PDA

View Full Version : 2 block triggers in one room



lupinealchemist
12-12-2007, 11:34 PM
The room has 4 push blocks, and I already made 4 block triggers
to trigger a secret. If someone can show me how to make 4 extra block triggers triggering something different, I might be able to fill in the locations.

I'm trying to make a puzzle similar to the two switches in Lttp. One triggers the door and the other triggers a trap.

pkmnfrk
12-13-2007, 12:37 AM
Well, this isn't really a scripting question, but the only way to do this is with a script, so fine.

What you're looking for is a script like this:


import "std.zh"

ffc script otherblocktrigger {
void run() {
while(true) {
if( //fill in x, y and block combo (and add/remove lines as necessary)
Screen->ComboD[ComboAt(x,y)] == block combo &&
Screen->ComboD[ComboAt(x,y)] == block combo &&
Screen->ComboD[ComboAt(x,y)] == block combo &&
Screen->ComboD[ComboAt(x,y)] == block combo
) {
//'trigger' the secret
Screen->ComboD[ComboAt(x,y)] = secret combo;
Screen->ComboD[ComboAt(x,y)] = secret combo;
Screen->ComboD[ComboAt(x,y)] = secret combo;
Screen->ComboD[ComboAt(x,y)] = secret combo;
//any other special effects? Put 'em here.


Quit(); //no more.
}
Waitframe();
}
}
}

You need to fill in exactly what you want to do, but it should be fairly self-explanitory.

lupinealchemist
12-18-2007, 12:44 AM
Where can I find "std.zh"?

Russ
12-18-2007, 01:41 AM
Where can I find "std.zh"?
First of all, what version are youi using?

lupinealchemist
12-18-2007, 02:05 PM
First of all, what version are youi using?

679b.

pkmnfrk
12-18-2007, 07:08 PM
std.zh is located in your zelda classic folder. Unless you want to read it (which is very informative, especially the list of constants), though, you don't need to worry about it.

Just, 'import "std.zh"' must be included at the top of every script file.

lupinealchemist
12-21-2007, 10:44 PM
I did what you said and now it looks like this:
import "std.zh"

ffc script otherblocktrigger {
void run() {
while(true) {
if(
Screen->ComboD[ComboAt(80, 64)] == 66 &&
Screen->ComboD[ComboAt(128, 48)] == 66 &&
Screen->ComboD[ComboAt(144, 96)] == 66 &&
Screen->ComboD[ComboAt(96, 112)] == 66
) {
Screen->ComboD[ComboAt(112, 80)] = 19;



Quit();
}
Waitframe();
}
}
}

(I don't know how to paste the tabs/spaces properly)

Is this in ASM or Zscript? I try to import it in ASM but it doesn't understand ("std.zh"), (,). Can someone show me how to properly import to either ASM or Zscript?

Russ
12-21-2007, 11:32 PM
It is Zscript. First, save it in word as a .z file (when you save it just add .z to the end of thename. In Zquest, Tools-Scripts-Compli Zscript. Import-Load the .z file-compile. It is a freeform combo script, so put it into a freeform combo slot. On the screen, create a freeform combo and assign the script.

lupinealchemist
12-22-2007, 02:44 AM
Now I have to learn how to assign FFCs.
Anyway, thanks for the ".z" tip.

Russ
12-22-2007, 02:48 AM
Now I have to learn how to assign FFCs.
Anyway, thanks for the ".z" tip.
On the screen, go to Data-Freeform combos. Select one and press edit. Assign a blank combo to it by clicking in the box and seting it to a black transparent combo. Then in the box that says scripts, select the script you want to assign to the freeform combo.

lupinealchemist
12-22-2007, 03:02 AM
On the screen, go to Data-Freeform combos. Select one and press edit. Assign a blank combo to it by clicking in the box and seting it to a black transparent combo. Then in the box that says scripts, select the script you want to assign to the freeform combo.

Crap! I already posted this question on "Quest Editor Help".

lupinealchemist
12-23-2007, 09:57 PM
After trial and error I was able to make the script work, all I need is to make the warp work.

It helped me a lot when I figured out ComboD means combo data. Also I was wondering if ComboF would work but I don't think I could trigger it that way, besides it would take more space than if I did it your way.