PDA

View Full Version : 1 or more triforce triggers secret combos?



Hot Water Music
06-10-2007, 12:08 AM
For my quest, I got this KFC place that when you have a triforce, it appears, because I want the effect that the place moved to a different location over time.

Dan Furst
06-13-2007, 12:43 PM
On the screens where the building moves from and to, place the trigger enemy, and make an ffc with


if((Game->LItems[1] & LI_TRIFORCE) == LI_TRIFORCE)

Then, inside the if statement, you could set the trigger enemy's HP to 0 with


npc trigger = Screen->LoadNPC(1);
trigger->HP = 0;

That will activate the secret combos (Enemies->Secret), which are your building on the screen it moves to, and grass/rock where it moves from.

Hot Water Music
06-16-2007, 12:09 PM
LI_TRIFORCE is undeclared.

Can you set up how exactly how it should be?

_L_
06-16-2007, 11:55 PM
You need this line of code at the start:


import "std.zh"

Hot Water Music
06-17-2007, 12:53 PM
I realized that but it's still not working

Dan Furst
06-18-2007, 10:11 AM
Post the script you're trying to compile and I'll take a look at it. Also, what build are you using?

Hot Water Music
06-18-2007, 04:12 PM
latest n greatest




import "std.zh"
ffc script secrets {
void run(){
if((Game->LItems[1] & LI_TRIFORCE) > 0){
npc trigger = Screen->LoadNPC(1);
trigger->HP = 0;
}
}
}

Dan Furst
06-19-2007, 11:57 AM
I got it to work. Example quest can be found here (http://filer.case.edu/dpf4/treemove.qst).

The only setback is that the secret combos trigger after the screen is fully loaded. If there is a way around that, well, I'd like to know.

Edit: I see that if you check Permanent Enemies->Secrets in the Screen Data, then the only time you see it change is the first time. After that it scrolls nicely.

Hot Water Music
06-19-2007, 03:50 PM
Thank you.

I'm honestly not sure how to set up this type of scripting.

Dan Furst
06-19-2007, 04:27 PM
I'll just be very thorough.

In the example quest file, go to Tools -> Scripts -> Compile ZScript. Then export it to 'script.z'. Then open your quest file. Tools -> Scripts -> Compile ZScript -> Import. Select the z file you just exported. Compile, press any key. Then, click on the name of the script on the right, click on any open slot on the right (probably #1), and press the "<<" button, then ok. It should say scripts have been successfully loaded into script slots.

Now go to the first screen that you want to change. Put secret flag #16 over the combos you want to "be removed" and select the secret combo to look like ground. You can of course use flags 16-31 if you like. Now, put a trigger enemy as the only enemy on the screen, and check Enemies->Secret, Permanent Enemies->Secret, and No Secret Sound in the Screen Flags. Now, go to Data -> Freeform Combos. Edit combo #1 (or any number, actually). Give it a fully transparent combo. Select script #1 (or whichever slot you loaded the script into). Click OK, Done.

Now repeat the previos paragraph on the screen which the building/object moves to. Use secret combos to make the building appear.

Make sure that the level number of the dmap of the dungeon you are getting the triforce piece in is 1. That should do it. If you want to use the script to check for other levels' triforce pieces, you'd need to change the argument inside of Game->LItems[] from 1 to whatever.

(If you wanted to do it right, you would change run() to run(int n) and use Game->LItems[n]. Then, when you make the freeform combos on the screens, you would go to the third tab labeled "Arguments" and put the level number you want the screen to change after in D0.)

Hot Water Music
06-21-2007, 01:37 PM
Yeah I know how to import it thanks.