Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

quick question

22 replies · 4,838 views · Started 23 March 2008

how would i say

if(x number of combos are a certain combo)

?

i checked the std.zh to see what was going on there... but i just cant figure out how to mess with combos in scripts.

Start with checking one combo then just add on to that. I believe you want to use ComboAt(). but you should be more specific.

Use it like this:

if(Screen->ComboT[ComboAt(x, y)] == ???){ // stuff

sorry for the double post... the edit button absolutely refuses to work for me.

anyway i got one more question.

does Screen-> ComboF[] trigger a flag? or just say its there?

You can check whether a combo has that flag, or give that flag to a combo.
Not tigger though.

Triggering flags isn't too straightforward.

You have to put a Trigger (Sens. Perm) combo underneath Link's feet.

this->Data = whateverthatcomboIDnumberis;
this->X = Link->X; this->Y = Link->Y;
Waitframes(3);
this->Data = 0;

//or

int combo = Screen->ComboT[ComboAt(Link->X,Link->Y)];
Screen->ComboT[ComboAt(Link->X,Link->Y)] = thatcomboIDnumber;
Waitframes(3);
Screen->ComboT[ComboAt(Link->X,Link->Y)] = combo;

Probably intended to be a translucent tile......does it even work like that? An ffc with a trigger type that is..

what i was gonna do was make it trigger just one flag. flag 16.

but this isnt turning out as easy as i hoped it would...

there should be a trigger function for things like this...

well... im trying to make a simpler version of the floor puzzle script.

here it is:
ffc script floor_puzzle{

void run(int n, int x, int y){

if(Screen->ComboT[ComboAt(x,y)] == n){

int combo = Screen->ComboT[ComboAt(Link->X,Link->Y)];
Screen->ComboT[ComboAt(Link->X,Link->Y)] = 658;
Waitframes(3);
Screen->ComboT[ComboAt(Link->X,Link->Y)] = combo;

}
Waitframe()
}

it compiles just fine. but when i try to test it, nothing happens.

it was supposed to be if (n) combo ID's matches this tile then trigger the flag.

Sorry, yeah, but what does it do. What kind of floor puzzle? Is it just a "push a block onto a marker" or something?

umm the one thats hard to describe lol.

that puzzle where you have to turn the floor tiles colors when you step on them and make them all the same to proceed?

Ohhhhhh.
*rereads script*
Now it makes sense.
Well, forget placing SensPerm triggers, just use Joe's script to place the new color. Then like Gleeok said check each combo for the type, and if it's the correct number activate.

so... what i have now will do essentially nothing?

because ive tried testing what i have and it doesent do anything and plus, the tiles keep changing while link is standing on them. i only want them to change once, when link steps on them, and only change again if link steps on them again.

i think i might have to abort this mission and use the one thats already made lol i dont think there is a simple way to do this.

and by the way i made a little something gleeok might enjoy.

ffc script death{
void run(m){
if(Link-> Item[m]){
link->HP=0;
}
Waitframe()
}
}

it brought me endless happiness lol D:0 is the item ID i believe. it was supposed to end my script test quest but thats not happening any time soon.

Amaster42 wrote:Well, forget placing SensPerm triggers, just use Joe's script to place the new color. Then like Gleeok said check each combo for the type, and if it's the correct number activate.

I wrote a script to place colours?

This was where?

Maybe a floor tile? I forget, can you set FFCs under Link?

this->Data = whateverthatcomboIDnumberis;
this->X = Link->X; this->Y = Link->Y;
Waitframes(3);
this->Data = 0;

See the second line?
Yah, that's what it does.


it compiles just fine. but when i try to test it, nothing happens.

That's because there's no while loops, so it just runs once and then stops.

It's also wrong, but it's better than that eyeball thing you were writing a few weeks ago at least.

What you want is something a little more like this:

ffc script floor_puzzle{
void run(int combotype, int n){
int i; int combocount;
int orig;
while(true){
combocount = 0;
for(i=0; i<176; i++){
if(Screen->ComboD[i] == combotype) combocount++;
}
if(combocount >= n){
orig = Screen->ComboT[ComboAt(Link->X,Link->Y)];
Screen->ComboT[ComboAt(Link->X,Link->Y)] = CT_STRIGFLAG;
Waitframes(3);
Screen->ComboT[ComboAt(Link->X,Link->Y)] = orig;
}
Waitframe();
}
}
}

I'll run you through it:

open script{
void run(declare integer combotype, declare integer n){
declare integer i; //for use in the for loop
declare integer combocount; //this counts how many of combo 'combotype' you have on the screen
declare integer orig; //same function as the 'combo' integer in the last script
start the while loop{ //so the script will run every frame
set the combocounter to 0; //so that the number of that combotype counted last frame doesn't carry over
start a for loop, that will check every combo on the screen{
if(the combo ID number at [i] (which is what the for loop increments, so we'll check every single combo this way) is equal to the combotype you want it to be) increment the combocounter; //which counts how many of that combo are on the screen
end for}
if(the combocount for this frame is equal to the number of that type of combo you want on the screen (integer n, D1){
run the trigger script;
end if}
Waitframe(); // so the while loop doesn't crash the system
end while}
end void run}
end script}

So how to use it:
Make all of your little panel things 'Step->Next' combos. When they turn to the next combo, they will cycle back to the first one after a certain number of frames.
Set 'D0' of the script to be the Combo ID number of the combo after your 'Step->Next' combo (so what they change into)
Set 'D1' to the number of those combos on your screen
Put Flag 16 across all of your panels, and set flag 16 in the secret combo editor to be what they change into (this is so that they all stay changed after you've stepped on them all)
Then you can use flags 17-32 to make something happen after all of them change.

Bear in mind, however, that this is now a different puzzle to the oracles puzzle.
This puzzle is 'make all of the floor tiles the same before they can cycle back', rather than 'step on all the floor tiles in a row'.

I wrote a script to place colours?

This was where?


Ii meant your first one you showed. Instead of placing a SensPem just place a different colored floor tile under Link's feet.

And that looks real neat. I just may have to steal it.

That script I wrote doesn't change the actual combo, it just changes it's attribute.

Go ahead, I don't like to keep anything I make private really.