if (Screen->ComboD[901])int ComboX(176), int ComboY(48) {
it's catching the int in this line (well, every line like this, but really the first one is where it is tripping up right now).
should be something like
if (Screen->ComboD[901]==something){
do something with ComboX(176) and ComboY(48)
}
else if{...
}
obviously the ==something should actually be the thing you want to know if Screen->ComboD[901] is equal to. if it is then it'll run what's inside the curly braces. if not, it'll move onto the next else.
i'm not exactly sure what you're trying to do, so i wasn't sure what to put in the curly braces.
also, you want it to be else if, not just else. else means, if the preceeding IFs aren't true then do this instead. else if, means if the first IF isn't true, then check if this IF is true, if not then go onto the next (or possibly the else)
oh, and if you paste your code on here into the code tags it is easier to read
edit: ok, just looking through your code again trying to figure out what you're trying to do.
some other issues...
Screen->ComboD[x], the x should equal between 0 and 175. If you open ZQuest and hover over the various screen positions you can get the pos#. What is 901 supposed to be referencing?
editedit: rereading your first posts in the thread, starting to get an idea of what you're trying to do.
import "std.zh"
const int CRYSTAL_COMBO = 0; // This should be the combo# of the first crystal colour
// combos should be in order, first combo is the first colour
// setup combos with strike next flags
// D0 = the pos# of the first crystal
// D1 = the colour of the first crystal to trigger secret
// D2 = the pos# of the second crystal
// D3 = the colour of the second crystal to trigger secret
// pos# is determined by hovering mouse cursor over the crystal in Zquest until the popup box shows
// colour (canadian eh?), this depends on how many colours there are, starts at 0.
ffc script CrystalSwitchDemo {
void run(int crystalPos1, int crystalColour1, int crystalPos2, int crystalColour2) {
while(true) {
// This If statement is checking the Combo# at each position
// if the combo# is equal to the combo# of the correct colour then it triggers secrets
// both crystals have to be correct for it to work.
if( (Screen->ComboD[crystalPos1]==CRYSTAL_COMBO+crystalColour1)&&
(Screen->ComboD[crystalPos2]==CRYSTAL_COMBO+crystalColour2) ){
// trigger secret
Screen->TriggerSecrets();
Screen->State[ST_SECRET]=true; // Change to false if you don't want the secret permanent
}
Waitframe();
}
}
}
tested, works. read through the comments to understand what is going on. feel free to ask why if you don't get it.
it could be expanded to include more crystals per screen. this was just two. could go as high as 4. if you wanted more than that, we'd have to differ to someone smarter than me.
Edited by justin, 03 December 2014 - 09:58 PM.