Jump to content

Photo

Gaponga Swamp flower script?


  • Please log in to reply
3 replies to this topic

#1 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 05 January 2008 - 10:58 PM

*sigh* I know exactly what I want the script to do, but I don't know how to do it. icon_sweat.gif



Anyway, I finally figured out how I'm going to do the thing with BowWow and the Gopanga Swamp plants (From LA). I need a script to do it though. If Link has a certain item, and he is within... oh, say, 24 pixels of the ffc, it is replaced with a different ffc (D01), and a sfx plays (D02) (for the illusion of it being an enemy that was killed). One more thing, the ffc for the plant would have to be solid.



It doesn't sound like it should be too difficult to make, but I don't know... I don't know that much about ZScript. I only know the basics. icon_confused.gif Whoever canscript this for me will recieve so much credit; I've been trying to figure out what to do with BowWow for so long now...



#2 Joe123

Joe123

    Retired

  • Members

Posted 06 January 2008 - 09:14 AM

Right now, this works in a simmilar way to what you said, but it's not exactly the same, due to the fact that I don't understand binary, and so can't access the solidty function in ZScript.

CODE
ffc script gopongaswampplant{
    void run(int cmb, int sfx){
    if(cmb == 0){cmb = 1;}// if you change the '1' here to the number of the swamp plant, you won't have to set it every time, but you'll still be able to change it via D0 if you need to.
    if(sfx == 0){sfx = 1;}// same here, for the sfx number.
    int itm = 1; // and put the ID number of the item you want the script to check in place of the '1' here.
    Screen->ComboD[ComboAt(this->X,this->Y)] = cmb;    
        while(true){
            if((Abs(this->X+8-Link->X) < 32) && (Abs(this->Y+8-Link->Y) < 32) && Link->Item[itm]){
                Screen->ComboD[ComboAt(this->X, this->Y)] = cmb+1;
                Game->PlaySound(sfx);
                Quit();
            }
        Waitframe();
        }
    }
}


So, how the script works is:
You set the ffc where you'd like to have the swamp plant, but make it invisible.
The ffc then sets the combo underneath itself to the value that you tell it for the swamp plant (therefore, it'll be solid).
Then, when you get within 24 pixels of it, and Link has the given item, the combo at that position moves to the next one in the list, and the sound effect is played.

If you do what it says in the noted lines, all you'll have to do for each plant is to put the ffc where you want it to be, give it the script and give it a transparent, non-0 combo and then it'll do it all for you.

I've checked this one, made and example quest and everything, and it does definately work icon_wink.gif

Edited by Joe123, 06 January 2008 - 09:18 AM.


#3 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 07 January 2008 - 04:21 PM

Wow! Thankyou so much, Joe! icon_smile.gif This is a huge help to me!

#4 Joe123

Joe123

    Retired

  • Members

Posted 07 January 2008 - 05:25 PM

That's alright, glad to help icon_smile.gif


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users