Jump to content

Photo

Multiple damage prevention boots


  • Please log in to reply
12 replies to this topic

#1 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 18 February 2009 - 08:40 AM

Okay, here we go... I think this is my first script request. I'm hoping this is a simple one.

So, I'd like to have multiple items that act like the "Boots" item, but in different areas. Essentially, each of the three items will completely prevent a different kind of environmental damage (meaning damage from combos). They won't use up magic/rupees/whatever.

Would this be a simple task? I imagine there's more than one way to go about it. If I didn't have the benefit of scripts, I'd make one of the three items the actual "Boots" item, and the other two would be dummy items; opening the treasure chest for each of them would trigger a screen state carryover chain reaction that would remove the damage combos from the appropriate screens. Obviously, that would be a lot of work. icon_razz.gif

Please let me know whether you think this request is doable.



#2 Joe123

Joe123

    Retired

  • Members

Posted 18 February 2009 - 09:21 AM

Hrm...

Would it be acceptable to have this kind of a set-up:
  • The items for your new boots are just 'dummys' (they don't actually do anything themselves
  • In the rooms where you want those items to take effect, you apply an ffc script
  • The script checks if you have the correct boots item when you first enter the screen, then if you do replaces the damage combos with a blank combotype
?

It'd require you to put the graphics of the damage combos on layer 1/2, as if I actually remove the damage combotype (rather than replacing the combo), it'll remove it on all instances of that combo in the game.

#3 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 18 February 2009 - 04:54 PM

QUOTE(Joe123 @ Feb 18 2009, 06:21 AM) View Post
Hrm...

Would it be acceptable to have this kind of a set-up:
  • The items for your new boots are just 'dummys' (they don't actually do anything themselves
  • In the rooms where you want those items to take effect, you apply an ffc script
  • The script checks if you have the correct boots item when you first enter the screen, then if you do replaces the damage combos with a blank combotype
?

It'd require you to put the graphics of the damage combos on layer 1/2, as if I actually remove the damage combotype (rather than replacing the combo), it'll remove it on all instances of that combo in the game.

Yeah, that'd be acceptable. icon_smile.gif Loading a script for each screen would be a lot easier than creating a long chain of screen state carryovers, to be sure. I have some questions, though:

1. Would this method work equally well for combos that cycle in and out of the damage combo type? (Most of my environmental damage is gradual.)
2. Would the dummy items still appear on the subscreen? (I'm pretty sure the answer is yes in 910, but just checking)
3. So I'd need to keep either layer 1 or 2 relatively free so the damage combos can be relocated there via the script? Is that right?
4. I see this is a FFC script. Would I have to create any actual FFCs, or just load the script and let 'er rip? (Not that I wouldn't be willing to...it'd just take longer)

Thanks for offering, Joe. icon_smile.gif (I assume you're offering, given the context)

.

#4 Joe123

Joe123

    Retired

  • Members

Posted 19 February 2009 - 05:31 AM

Mm, and with 'Paste Special->Freeform Combos', it's even easier nowadays.
  1. No, but if I change the script to run every frame rather than just when you enter the screen that'll be fine.
  2. Oh, yes they would.
  3. Not quite no. What you'd need to do is put all of your actual damage combos on layer 0, then put the graphics for those combos on layer 1 or 2. The script removes the combo on layer 0, so it appears as though your combos are still there and are no longer dealing damage, but really only the graphics remain and the damage-dealing combotypes have been taken away.
  4. Oh no, all you'd have to do is make an ffc. Give it a blank, non-zero combo. Apply the script, and put the item ID of the boots as D0 on the arguments tab.
Yeah, I am offering don't worry =P
It should only take a couple of minutes really, much less hassle than when I get 'MaKe Me TeH CoOlEsT cUsT0m B0ss evarrrrzzz' from various people

EDIT:
CODE
ffc script NewBoots{
    void run(int itm){
        if(!Link->Item[itm]) Quit();
        Waitframes(2);
        while(true){
            for(int i;i<176;i++) if(DamageCombo(i)) Screen->ComboD[i] = 0;
        Waitframe();
        }
    }
    bool DamageCombo(int i){
        int Damage[7] = {31,32,33,34,120,121,122};
        for(int j;j<7;j++) if(Screen->ComboT[i] == Damage[j]) return true;
    }
}


Well, I'm hoping this should work you you want it. I haven't actually compiled it yet though.
If it doesn't work, let me know and I'll test it myself.

At the moment, it removes all damage combos from the screen. If there are any you want protected, I could add that aswell.

#5 lucas92

lucas92

    Defender

  • Members

Posted 19 February 2009 - 04:22 PM

Nice use of array in that bool function. icon_biggrin.gif

EDIT- But why don't you make it as a global script instead so we wouldn't have to put a ffc script on each screen? :S

Edited by lucas92, 19 February 2009 - 04:24 PM.


#6 Joe123

Joe123

    Retired

  • Members

Posted 19 February 2009 - 04:52 PM

Well, for a couple of reasons.

This way allows for the use of different boots in different situations, which could be achieved with the global script, but it'd be more awkward.
FFC scripts are also a little easier on the usage to global scripts for the less script-savvy.

...and another reason which I've subsequently forgotten, but nevermind =P


I'm glad you like my array. This was one of my favourites too I'm sure.

#7 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 20 February 2009 - 04:22 PM

1. Okay, great.
2. Also great. Actually, I had an idea: if I give Link a ring item (one that doesn't reduce damage) in place of the dummy item, and disable it on all DMaps except for the ones where that tunic is needed, then I won't have to mess with palette cycling at all. However, that brings up another question which I'll ask in a minute.
3. So I just carpet the damage combo graphics on layer 1 and damage combos themselves on layer 0. That's no problem; I assign layer 1 on most screens. icon_smile.gif
4. Also doable. Single blank FFCs are easy. Now I just have to learn how to implement the scripts.


Anyway, as I said above, I'm currently learning how to implement scripts via this article. I was trying to set up your Bombchu script first, but perhaps this tunic script would be an easier way to start off. I just had a couple of questions before I give it a try.

First of all, you know how we were talking about your old Fort Knights tunic script in the other topic? It got me thinking that perhaps it would be more fun if the tunics were actually selectable. Now, this might be a lot more work for you, so I wanted your opinion on whether it'd be worth the bother.

Just in case you're curious, the three tunics would do these three things: blue (Zora Tunic) would prevent damage from freezing cold water, red (Goron Tunic) would prevent damage from heat (not walking on lava, just heat), and purple (Sheikah Tunic) would prevent damage from poison. They'd be used on Snowpeak, in the Fire Temple, and in the swamp, respectively.

Secondly, it's becoming clear that at some point I'm going to need a script to give the player two items at once when they pick up the first item. I imagine this will take all of 30 seconds to script, though. Could you manage something like that?

Lastly, I'm going to try my best to set up this script on my own, but I was having troubles with the last one. Do you think I could chat with you on IM or IRC sometime if I can't quite get it working? I know I should learn to handle this sort of stuff since I'm thinking of getting a computer science degree, but I'm still just a neophyte at this point. icon_razz.gif

#8 Joe123

Joe123

    Retired

  • Members

Posted 21 February 2009 - 07:15 AM

1. Mm, the script up there ^ does run every frame.
3. Yeah, that's right.
4. They are indeed. Setting up an ffc script isn't difficult; don't worry.


QUOTE
Anyway, as I said above, I'm currently learning how to implement scripts via this article. I was trying to set up your Bombchu script first, but perhaps this tunic script would be an easier way to start off. I just had a couple of questions before I give it a try.

Ah yeah, that should be really useful. Shame that ScaryBinary guy dissapeared.
The bombchu guide's reasonably comprehensive, but if you've never compiled a script before you'd be throwing yourself in at the deep end really. I think I wrote that one as a sort of 'good knowledge of ZQuest but not of ZScript' type guide so you should be ok with it, but it'd probably be best to try some others first.

QUOTE
First of all, you know how we were talking about your old Fort Knights tunic script in the other topic? It got me thinking that perhaps it would be more fun if the tunics were actually selectable. Now, this might be a lot more work for you, so I wanted your opinion on whether it'd be worth the bother.

Just in case you're curious, the three tunics would do these three things: blue (Zora Tunic) would prevent damage from freezing cold water, red (Goron Tunic) would prevent damage from heat (not walking on lava, just heat), and purple (Sheikah Tunic) would prevent damage from poison. They'd be used on Snowpeak, in the Fire Temple, and in the swamp, respectively.

So you want a different script now?
It wouldn't be too hard to set them up as ones you have to equip I shouldn't think.

QUOTE
Secondly, it's becoming clear that at some point I'm going to need a script to give the player two items at once when they pick up the first item. I imagine this will take all of 30 seconds to script, though. Could you manage something like that?

I did write it in one of those other threads, but here it is again:
CODE
item script ExtraItem{
    void run(int itm){
        Link->Item[itm] = true;
    }
}


QUOTE
Lastly, I'm going to try my best to set up this script on my own, but I was having troubles with the last one. Do you think I could chat with you on IM or IRC sometime if I can't quite get it working? I know I should learn to handle this sort of stuff since I'm thinking of getting a computer science degree, but I'm still just a neophyte at this point. icon_razz.gif

Sure yeah. I'm joe_blob4@hotmail.com on MSN Messenger, but if you don't use that I'm happy to come on IRC some time.

#9 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 22 February 2009 - 03:05 AM

QUOTE(Joe123 @ Feb 21 2009, 04:15 AM) View Post
Ah yeah, that should be really useful. Shame that ScaryBinary guy dissapeared.
The bombchu guide's reasonably comprehensive, but if you've never compiled a script before you'd be throwing yourself in at the deep end really. I think I wrote that one as a sort of 'good knowledge of ZQuest but not of ZScript' type guide so you should be ok with it, but it'd probably be best to try some others first.

I agree... I need something useful that's easy to implement to use for a practice run. Do you have any suggestions for something that's already out there? A signpost script perhaps? I have a feeling there are finished scripts posted on the forums that never made their way to the database.

QUOTE(Joe123 @ Feb 21 2009, 04:15 AM) View Post
So you want a different script now?

Umm... yeah, I know, I'm being like the kid who comes in and asks for a cracker for a snack and then later finds out there's fresh-baked cookies. icon_rolleyes.gif Another way of putting it: I'm trying to be easy to please, but after hearing that you already wrote a similar script that's even cooler I became tempted to ask for it.

QUOTE(Joe123 @ Feb 21 2009, 04:15 AM) View Post
It wouldn't be too hard to set them up as ones you have to equip I shouldn't think.
I did write it in one of those other threads, but here it is again:
CODE
item script ExtraItem{
    void run(int itm){
        Link->Item[itm] = true;
    }
}

Sure yeah. I'm joe_blob4@hotmail.com on MSN Messenger, but if you don't use that I'm happy to come on IRC some time.

Looks great... perhaps that'd be the best one to practice with, even though it's very specific. I'll see if I can get it running without difficulty. How do I specify which additional item to give?

I used to be able to access MSN Messenger through Trillian, but then MSN decided they hated Trillian and made their network incompatible with my version. icon_razz.gif I haven't bothered to try to remedy it because I only had one active contact on it and I haven't talked to him for months.

Let me know if you're free to IRC, though. I am moderately flexible this week.

.

#10 Joe123

Joe123

    Retired

  • Members

Posted 22 February 2009 - 06:06 AM

QUOTE(Radien @ Feb 22 2009, 08:05 AM) View Post
I agree... I need something useful that's easy to implement to use for a practice run. Do you have any suggestions for something that's already out there? A signpost script perhaps? I have a feeling there are finished scripts posted on the forums that never made their way to the database.

Mm, there are quite a few.
AGN's database has plenty as well though.
That one I just showed you is an example of an item script, so yes - maybe the singpost one if you want an ffc script aswell:
CODE
ffc script Signpost{
    void run(int m, int brk){
        while(true){
            while(Link->X < this->X-8 || Link->X > this->X+24 || Link->Y < this->Y || Link->Y > this->Y+24 || Link->Dir != DIR_UP || !Link->InputA || Link->Z != 0) Waitframe();
            Link->InputA = false;
            Screen->Message(m);
            do Waitframe();
            while(Link->InputA)
        }
    }
}

That's my take on Pkmnfrk's script.
Another nice, simple one would be the item pick-up message script:
CODE
item script Message{
    void run(int m){
        Screen->Message(m);
    }
}


QUOTE(Radien @ Feb 22 2009, 08:05 AM) View Post
Umm... yeah, I know, I'm being like the kid who comes in and asks for a cracker for a snack and then later finds out there's fresh-baked cookies. icon_rolleyes.gif Another way of putting it: I'm trying to be easy to please, but after hearing that you already wrote a similar script that's even cooler I became tempted to ask for it.

That's fine. The script I posted here took me about 2 minutes to write, I've taken much more time writing scripts for others in the past.
QUOTE(Radien @ Feb 22 2009, 08:05 AM) View Post
Looks great... perhaps that'd be the best one to practice with, even though it's very specific. I'll see if I can get it running without difficulty. How do I specify which additional item to give?

This script uses something called an 'argument', which is like a user input - allowing you to use it for more than one situation.
To set the argument, you go to the 'Arguments' tab for the item you're applying the script to, and put the item ID number in the 'D0' box.
When people tell you what inputs a script uses, they'll often say 'D0 is this, D1 is this' etc., which refers to the arguments screen.

QUOTE(Radien @ Feb 22 2009, 08:05 AM) View Post
I used to be able to access MSN Messenger through Trillian, but then MSN decided they hated Trillian and made their network incompatible with my version. icon_razz.gif I haven't bothered to try to remedy it because I only had one active contact on it and I haven't talked to him for months.

Let me know if you're free to IRC, though. I am moderately flexible this week.

Ah ok. Well I have more free time then perhaps I really should do, so if you let me know when's good for you I'll try and make some time then.

#11 Radien

Radien

    Courage

  • Members
  • Real Name:Steve
  • Location:Oregon

Posted 23 February 2009 - 03:34 AM

I got my first script installed! icon_smile.gif I imported your "ladders" script, and it worked on the first try. (Technically the second, but the first doesn't count because I was stupid and accidentally loaded it into a FFC slot.) Since that one's a global, I figure next I should try to import one FFC script and one item script... your signpost script and dual-item scripts should do nicely.

I'm still debating whether to use scripts to call messages. It would certainly simplify things, not having to create dummy screens just for dialog and the like... but then there's the issue of having no message frames. Oh well... that's a problem for another day.



QUOTE(Joe123 @ Feb 22 2009, 03:06 AM) View Post
This script uses something called an 'argument', which is like a user input - allowing you to use it for more than one situation.
To set the argument, you go to the 'Arguments' tab for the item you're applying the script to, and put the item ID number in the 'D0' box.
When people tell you what inputs a script uses, they'll often say 'D0 is this, D1 is this' etc., which refers to the arguments screen.

Awesome. That's one more question answered. icon_smile.gif

QUOTE(Joe123 @ Feb 22 2009, 03:06 AM) View Post
Ah ok. Well I have more free time then perhaps I really should do, so if you let me know when's good for you I'll try and make some time then.

Okay, sure. Coordination mostly has to do with accounting for time zones at this point. If you're in Britain, that means GMT, and I'm -8:00 GMT...so the best plan is probably for me to get on in the afternoon, at which point it will be evening (after 8pm) over there.

What time do you prefer? 9pm GMT perhaps? If so maybe we can chat tomorrow (Tuesday).

#12 Joe123

Joe123

    Retired

  • Members

Posted 23 February 2009 - 07:08 AM

QUOTE(Radien @ Feb 23 2009, 08:34 AM) View Post
I got my first script installed! icon_smile.gif I imported your "ladders" script, and it worked on the first try. (Technically the second, but the first doesn't count because I was stupid and accidentally loaded it into a FFC slot.) Since that one's a global, I figure next I should try to import one FFC script and one item script... your signpost script and dual-item scripts should do nicely.

Sounds like a good plan of action.
What you'll have to watch for though is when you want to use more than one global script - that requires (very minimal) programming knowledge, but I'm happy to set it up for you.

QUOTE(Radien @ Feb 23 2009, 08:34 AM) View Post
I'm still debating whether to use scripts to call messages. It would certainly simplify things, not having to create dummy screens just for dialog and the like... but then there's the issue of having no message frames. Oh well... that's a problem for another day.

Mm. You can now have transparency on message frames though, so if you did use the message frame tool you could have non-square frames.
I might be able to see about adding in translucenly. Not sure whether I'd be capable to or not yet, but it's certainly something worth thinking about.

QUOTE(Radien @ Feb 23 2009, 08:34 AM) View Post
What time do you prefer? 9pm GMT perhaps? If so maybe we can chat tomorrow (Tuesday).

Yeah, that sounds fine =)

#13 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 03 March 2009 - 07:03 PM

I have a more flexible "extra item" script that I made long ago. I used it to make the bow, arrow, and quiver into one package.

CODE
//D0-D6:items to give (negative for null)
//D7:optional string (negative for null)
item script dummyGive {

    void run(int item1, int item2, int item3, int item4, int item5, int item6, int item7, int strNo) {

        if(item1 >= 0)
            Link->Item[item1] = true;
        if(item2 >= 0)
            Link->Item[item2] = true;
        if(item3 >= 0)
            Link->Item[item3] = true;
        if(item4 >= 0)
            Link->Item[item4] = true;
        if(item5 >= 0)
            Link->Item[item5] = true;
        if(item6 >= 0)
            Link->Item[item6] = true;
        if(item7 >= 0)
            Link->Item[item7] = true;
        if(strNo >= 0)
            Screen->Message(strNo);

    }
}



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users