Jump to content

Photo

Updated Pegasus Boots Script


  • Please log in to reply
68 replies to this topic

#1 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 02:12 AM

I'm working in the latest build of Zelda Classic 2.5 and the old Pegasus Boots scripts I have found on the forums aren't working properly. So far, I've only got one of them to compile and it doesn't do anything other than make a sound. It could be that I've done something wrong in the setup process, but since the example quest referred to in the old script database no longer seems to exist; I can't take a look at it and try to figure out what I'm doing wrong. The original topic which gave me the idea of trying to implement them is here. 

 

http://www.purezc.ne...showtopic=38916

 

The first attempt to incorporate it revealed that some of the commands have now been included in std_functions.zh, so I eliminated them. I combined my global scripts and created the item, assigned the scripts to slots; and then to the item's action script slot and tried it out in game and nothing really happened except for making a sound. There was another set of code, which came with a downloadable example quest and when I try to compile it I start getting all sorts of errors. I can't find the link to that example quest, so I'll just post the code as it stands. 

Spoiler

 

I'm working off of the PureTileset Version 2.5 uploaded by Nick and that means after the global script file (which is what's listed above) I've got this code.

Spoiler

 

The error I'm currently getting on this version of the code is that it could not match type signature isSolid(float, float) and I think that this is because this function has been changed somehow. (I've seen references to that fact elsewhere.) Unfortunately, I don't know how they've been altered or whether or not there are other bugs somewhere in the code. All other code you might see in my post other than that related to the Pegasus Boots is working, so that has to be where the problem lies. Thanks in advance to anybody who can help.



#2 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 03:06 AM

It's Screen->isSolid(x, y) now. You can just put "Screen->" in front of all the isSolid functions and they should work.



#3 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 04:00 AM

Well I was going to upload screenshots of my current setup for the item so I could get help now that a new bug has mysteriously appeared but I don't know how to take them in the item and subscreen editors.

 

Thanks to the previous post by Lejes I was able to get it to compile. Only now it doesn't appear in my subscreen. It is set as Custom Itemclass 3, an equipment item with Pickup Script as ItemMessage and action script as PegasusBoots. On the subscreen it is set as position 13 with the relevant position numbers of the nearby items set in the up, left, down and right slots. But when I acquire it in the game, the item doesn't appear on the subscreen. I tried having it initially equipped, giving Link all the items at once, then placing each of the intermediary items on separate screens and having him collect them all one at a time. All of my other items are working, but this one acts as if it doesn't exist.


Edited by ywkls, 13 December 2014 - 04:01 AM.


#4 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 04:26 AM

Did you set the right subscreen for the DMap? It might also be this line:

if(Link->Item[124]) Link->Item[124]=false;

This takes item 124 (Custom Item 02 by default) away from Link. I've never used this script before, and giving it a brief look I'm honestly not sure what purpose this line serves.


Edited by Lejes, 13 December 2014 - 04:27 AM.


#5 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 10:35 AM

Okay, removing that mysterious line of code Lejes referred to makes it where I can now get the item and it shows up in my subscreen and I can equip it. But now it is still doing the same thing as the other Pegasus Boots code, just making a sound. For testing purposes, I've left all of the settings on the constants used by this as they originally were, thinking that the item would work automatically once you had it set up correctly. Currently, the only difference I can see in how the two scripts work is that on the second, it only plays the sound whenever you press the button but does nothing if you hold the button down whereas the first will play the sound in both cases. I've tried pressing the button it's assigned to and in a certain direction, along with holding it down and pressing in a certain direction and neither seems to do anything other than play a sound in either script. To test whether leaving the constants alone was affecting things, I set the value of the constant T_DUST to 1 and tried it again. Since tile one exists, now I can see it animating under Link when I press the button, but that's all. Based on what I've learned so far, the problem seems to be somewhere in the code that controls your movement while using the item. One thing that puzzles me is this line.

if(DashCounter > 10)

In several places the game seems to be set up to find the value of this variable but the instruction to change its value from 0 to anything else is placed almost at the end of the code. (In fact, there are only three right braces and three lines of code after it.) In my experience with other types of code, whatever is listed last is checked last, which would mean that the value of DashCounter might not increase properly. While it is doing so every frame, which means you only have to hold down the button for about a sixth of a second, I'm not entirely sure that the current positioning of the command near the end is proper.

 

Of course, I could be wrong in my conclusions; which is why I'm posting the results of my efforts to get this to work so somebody more knowledgeable can provide some insight.



#6 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 11:42 AM

I found the problem. Add this just after the PegasusBoots function in your global:

 

StoreHP = Link->HP;

 

Without that, StoreHP will be stuck at 0, so the script always thinks you've just taken damage, so it sets the dashing state to false.



#7 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 01:52 PM

Yeah, now it does work... but Link doesn't move very fast. Any way to alter that? I'd like for Link to move about twice as fast as normal. (I don't know how fast that is, but I'm guessing about one combo per second without the item and two per second with it. By the way, the first script had a line like the one you mentioned but the second one didn't so I didn't add one.) Once everything is done, I'd like to submit it to the database so that a current copy of the script without parts that are outdated or don't work is available to anybody who wants to use an item like this. Thank you for your help, Lejes!


Edited by ywkls, 13 December 2014 - 01:58 PM.


#8 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 02:14 PM

Spoiler

 

Link moves twice as fast while dashing now. It might break solidity checks somewhere, I didn't really test it that much. The knockback when hitting something is also a little weird, but there's no fixing that without completely rewriting the knockback section of the script.



#9 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 02:49 PM

Okay, Link now moves at a faster speed but there's still something weird going on. While the Pegasus Boots are in use, the number 100 appears on the left side of the screen. The way it looks is similar to what happens when you use the command Screen->DrawInteger. This is my new global script. Everything works, except for drawing the number 100.

Spoiler

 

I've never set up a Screen->Draw Integer command before, but I did notice that the number 100 is listed in the arguments it has but I don't know whether to remove it, change it to something else or change some other part of the code.. Also, the current code calls for ComboX(80 and ComboY(80). Should I change these to the combo numbers used for the dash animation, the tile numbers or something else? Or should I leave it the way it is? Thanks in advance.


Edited by ywkls, 13 December 2014 - 02:50 PM.


#10 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 03:06 PM

Just remove all instances of DrawInteger. I was only using them for debugging.



#11 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 08:22 PM

And just like that, the problems have gone away. Since this version seems to be free of bugs (unless there's something related to walkability as mentioned earlier) and I've seen a lot of requests for a similar item and none of the other code in the forums appears to be up to date; I'd like to post it to the database; with full credit going to Lejes for ironing out all of the problems. (I'd also have to thank whoever originally posted the code, but I haven't been able to find the page where I downloaded the example quest where I got it from. I think it was MoscowModder, posting some of the code written by Zepinho; but while I'm sure about the latter I can't remember whether it was the former or not.) Hopefully whoever you are knows that you did this, because I'm sure that there are others who'd like to use it. In any case, here's how to set it up.

 

First, add the code to your existing file. Place this before your global script.

Spoiler

 

Next, this goes in the global script's while loop before Waitdraw();

PegasusBoots();
StoreHP = Link->HP;

After Waitdraw(); place this.

if (PegasusDash)
{
// I don't know if these braces are necessary or if you can use a semicolon after the above command. I just left them in because the code works as it is.			
}

Finally, there is the code that runs the item which does not go inside the global script.

Spoiler

 

Once the code it added, set up SFX, dash animation, item appearance and combos how you want them. Pegasus Boots is a custom item class with the Action script slot set to the item script PegasusBoots. Make sure it is equipable and properly placed on you subscreen where it can be selected. (And set that subscreen current item to that same Custom Item class as the Pegasus Boots. Important if you have more than one custom item class.) That should be all that is necessary. But if I'm wrong, I'm not the one to ask since I had to have a lot of help before I got things this far.


Edited by ywkls, 13 December 2014 - 08:24 PM.


#12 Lejes

Lejes

    Seeker of Runes

  • Members
  • Location:Flying High Above Monsteropolis

Posted 13 December 2014 - 08:51 PM

That setup sounds about right.

if (PegasusDash)
{
// I don't know if these braces are necessary or if you can use a semicolon after the above command. I just left them in because the code works as it is.			
}

This segment can be removed entirely, though. It was only used for the DrawInteger function, and with that gone, this if statement has no reason to be there.



#13 ywkls

ywkls

    Master

  • Members

Posted 13 December 2014 - 09:21 PM

That setup sounds about right.

if (PegasusDash)
{
// I don't know if these braces are necessary or if you can use a semicolon after the above command. I just left them in because the code works as it is.			
}

This segment can be removed entirely, though. It was only used for the DrawInteger function, and with that gone, this if statement has no reason to be there.

 

Hmm... I thought including it was necessary since it is in the code posted in the old script database but the item works fine whether that line is in there or not. And since that was the only thing I added after requesting a way to increase speed and now it seems to have done so, maybe I just thought it seemed slow when I was using it before. Anyways, thanks again for your work clearing up this mystery!



#14 Deedee

Deedee

    Bug Frog Dragon Girl

  • Moderators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 29 December 2014 - 10:31 PM

Can this be submitted to the database if it hasn't been already? (The 2x speed one)



#15 Mero

Mero

    Touch Fluffy Tail

  • Banned
  • Real Name:Tamamo No Mae
  • Location:Rainbow Factory

Posted 30 December 2014 - 09:26 AM

Contact Zephino he has a working Pegasus Boots script actually.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users