Jump to content

Photo

Metroid-Style Space Jump


  • Please log in to reply
9 replies to this topic

#1 ywkls

ywkls

    Master

  • Members

Posted 23 November 2014 - 10:17 PM

I'm working with Zelda Classic version 2.5 and I think it's the latest release date. I've got an entirely sideview gravity based quest, which has been uploaded to the database- the Super Metroid (Clone) and I've been progressively improving it. I've added the global script for jumping with the L button posted by Moosh in the topic 'L to Jump' created by AlphaFrost in June 2014 and this has made the experience of jumping in the game seem much more authentic to me. There is another script in that topic, posted by ZoraRpg but it has hit a snag in implementation. The stdextra.zh (or .z) I downloaded from the script database doesn't seem to load properly. I've got std.z library, string.z, ffcscript.z, and a host of others from the tileset Pure Tileset 2.5 uploaded by Nick and have created a custom file to upload all of them at once, but the process stops when it gets to stdextra.z. Even altering my copy of the jump code so it doesn't include imports of files I'm importing elsewhere doesn't seem to work. I'm working off of the tileset Metroid Prime Tiles uploaded by toaofGamecue. This is on a Level 0 Overworld Map. If I could get the code which ZoraRPG posted to work, it might do what I want; create the ability to jump in midair like Super Metroid for the SNES. When I was looking over Moosh's code, it seems like it could be modified fairly easily to include multiple items which would affect how high you can jump. Theoretically, you could make an item which would modify the height of your jump to the maximum distance upward you'd ever have to jump. But if it is possible to instead jump in midair, that would be preferable. I'd post this in that topic but it hasn't had any replies since July 2014 so I don't know if anybody is monitoring it.  Thanks in advance for any help I receive!

 



#2 ywkls

ywkls

    Master

  • Members

Posted 23 November 2014 - 10:40 PM

Acting on advice found in other forums, I'm uploading the code I'm currently using to jump as originally posted by Moosh with the term I_HIGHJUMP changed to the item number I have assigned to that item and the value of the JUMP_HEIGHT_NORMAL and JUMP_HEIGHT_HIGH altered to the amount I want for them to be. The base item number for the Roc's Feather equivalent is 91.

 
Spoiler

 


Edited by ywkls, 23 November 2014 - 10:58 PM.


#3 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 24 November 2014 - 09:27 AM

I'd say a double jump would be more useful for most quests. But the space jump would be great for Metroid quests. Keep up the good work.

#4 Old-Skool

Old-Skool

    Hero of Time

  • Members
  • Location:Missouri

Posted 24 November 2014 - 07:39 PM

Someone actually created exactly this for me, I think it was Freya. It is specifically designed for sideview metroid quests too. The heck of it is though, I can't really pick it apart from my buffer to tell where or what it is :x   Although, this was also designed for a quest which diverts a dedicated A button specifically to jumping, so I don't know how well it would work with just the rocs feather.



#5 ywkls

ywkls

    Master

  • Members

Posted 07 December 2014 - 04:53 PM

I found the code King Aquamentus said was in his buffer on another topic posted in October. http://www.purezc.ne...ic=64847&page=2

 

While I can't code myself (yet) I can read code. So I'm going to attempt to see if I can figure out which part would do what I want and modify it to my needs. I'll be sure to post the results if I can get it to work. And if what I need isn't in there, I'd like to request a copy of the current code King Aquamentus is using to see what I can make out of that.

 

Edit: Well that seems to be mostly the code for the inverted stomp boots. I'm guessing that what I'm looking for is in one of those files listed down at the bottom either "hardjumpupgrade.z" or "6_ItemPickupMessage.z" (probably the former). So I guess I going to have to keep waiting and hope somebody has a suggestion to make or I'll have to leave this feature as I have it currently set up. (Which, since it uses the Flippers; doesn't work very well at all.)

 

 


Edited by ywkls, 07 December 2014 - 06:14 PM.


#6 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 03:04 AM

So close, and yet so far... I found a script which I thought would work and to a certain degree it does. But not quite like I would hope. Let me explain. The script in question is found here. 

 

http://www.purezc.ne...=64529&hl= item

 

From reading the topic and the description of the setup, I thought; what If I used this effect instead? So I added it to my scripts, placed everything into my file; compiled and loaded everything into slots successfully and then started experimenting with implementation. One thing I learned is that the combos marked with the indicated flag have to be walkable and the FFC is used to make it work. When I jump from the screen below into area now filled with the new sideview water, I can move left and right. And that's it. I don't drop back down nor can I ascend. I've looked through the code again and I haven't found whatever it is that I'm missing. The worst thing about this is that I feel like I'm really close to a solution; but yet nowhere near one. And furthermore, if I do get it to work; I may need yet another script to have two types of flippers so I can have one that only works on the sideview water and another that only functions on regular water.



#7 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 04:12 AM

I'm not really sure what your problem could be, so here's the demo quest I used to test this script.

 

http://www.mediafire...9v/swimming.qst

 

You can compare it to how you implemented it in your quest and see if there are any discrepancies.

 

As for flippers, since this isn't real water at all, it would need a new flipper check. That wouldn't be hard to make, though.



#8 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 11:20 AM

After trying out the example quest, I'm no longer sure that this code will do what I'm looking for. In the example, although Link has the Roc's Feather, he only seems to be able to descend. (I'm guessing about that, since the code is set up to make Link invisible and draw an FFC over his position and changing his starting position to outside the fake water doesn't seem to make a difference.) What I'd like is a way where I can move about in walkable water in Sideview Gravity the same way that you do in topdown screens. Or a way to make an item that allows you to jump in midair. As for differences in my implementation, the only way I can think of that I had it different was that I had the combo's inherent flag set up as script 5. I changed it to a flag assigned at the screen level, but the result seems to be the same. My character just floats along the bottommost level of whatever fake walkable water is on screen, even if the combos on the screen directly below are also filled with fake water. I can move left or right, but I can't jump out or go down. I thought that the trouble might be because I wasn't currently using string.zh or ghost.zh so I added references to them to my script file. But after compiling it, the bug of your character simply treating the fake water as though it was a solid barrier and floating across without being able to jump out, ascend or descend still exists.

 

Here's a screenshot of my results.

Eh807bp.png

 

The stuff that looks like green rain is a stand-in for my fake water whilst the strange yellow and pink blob is the ffc being drawn over my position. I start the character out on the left, on regular ground and when I fall in the area that is flagged, I can float across its surface to the far side but I don't drop to the area below which consists of two walls with nothing but fake water between them nor can I use the jump item to get back out. This could be because I currently have it set up to work with L, but since the example quest also seemed to disregard any attempts to press the button for the Roc's Feather, I'm not certain about that. 



#9 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 12:28 PM

I'm not really sure what your problem could be. Are the fake water blocks solid? A combo type other than "none"? Regardless, that script was meant to simulate swimming, so it won't be great for jumping. Try this instead.

import "std.zh"

const int JUMP_HEIGHT_NORMAL = 4; //This is the jump height when you don't have the high jump item. It uses feather jump height instead of script jump height for compatibility purposes.
const int JUMP_HEIGHT_HIGH = 8; //This is the jump height when you have the high jump item.
const int I_HIGHJUMP = 123; //This is the item used for the high jump boots. Just having the item will make you jump higher with the script. Uses Roc's Feather by default.
const int I_SPACE_JUMP = 124;
const int SPACE_JUMP_LOWER_BOUND = 20; // How many frames Link has to fall before Space Jump can be used.
const int SPACE_JUMP_UPPER_BOUND = 50; // How many frames Link can fall before Space Jump use is barred.
const int SF_NOJUMP = 0000100b; //This is the Misc screen flag used by the script to find screens where jumping is disabled. It uses General Use 1 (Scripts) by default.

int StoredY;
int SpaceJumpFalling;

//This is the jump function. Put this in the while loop of your global script.
void JumpWithL(){
    int JumpHeight = JUMP_HEIGHT_NORMAL;
    if(Link->Item[I_HIGHJUMP])JumpHeight = JUMP_HEIGHT_HIGH;
    if(IsSideview()){ //For sideview screens
        if(Link->PressL&&OnSidePlatform(Link->X, Link->Y, Link->HitXOffset, Link->HitYOffset, Link->HitHeight)&&Link->Action<=2&&!(Screen->Flags[SF_MISC]&SF_NOJUMP)){
            Link->Jump = (JumpHeight+2)*0.8;
            Game->PlaySound(SFX_JUMP);
        }
		else if (Link->PressL&&Link->Item[I_SPACE_JUMP]&&SpaceJumpFalling>=SPACE_JUMP_LOWER_BOUND&&SpaceJumpFalling<SPACE_JUMP_UPPER_BOUND&&Link->Action<=2&&!(Screen->Flags[SF_MISC]&SF_NOJUMP)){
			Link->Jump = (JumpHeight+2)*0.8;
            Game->PlaySound(SFX_JUMP);
		}
		if (Link->Y > StoredY)
		{
			SpaceJumpFalling++;
		}
		else
		{
			SpaceJumpFalling = 0;
		}
		
		StoredY = Link->Y;
    }
    else{ //For top-down screens
        if(Link->PressL&&Link->Z==0&&Link->Action<=2&&!(Screen->Flags[SF_MISC]&SF_NOJUMP)){
            Link->Jump = (JumpHeight+2)*0.8;
            Game->PlaySound(SFX_JUMP);
        }
    }
    Link->InputL = false;
}

//Here's an example global script with only the jump function and waitframe.
global script LJump{
    void run(){
        while(true){
            JumpWithL();
            Waitframe();
        }
    }
}

I modified that jumping script Moosh made so it can space jump now. It behaves mostly like the space jump in Metroid, but you can still activate it by falling off a ledge.



#10 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 01:44 PM

Alright, it took a little modification; but I got it to working. Here is the result.

Spoiler

 

Now that it is complete, it works just like you'd think a Space Jump should. When you jump, you rise a certain height and start to fall; then if you press jump again before a certain amount of time has passed; you jump again. There might be a way to use Link Tile Modifiers to change your appearance while using this item; but for now I'm content with the results.

 

Edit: A note on implementation that I didn't even notice when I was testing the code. I had forgotten to change the item class of the Space Jump from Flippers to anything else and it still worked. Apparently, the code ignores whatever item class is built into the item and just tests to see whether you have it and are in the window for using it after having jumped. Now switched to Custom Item Class one and it still works without having to create an item script.


Edited by ywkls, 13 December 2014 - 07:54 PM.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users