Problem detecting (lack of) enemies.
Ran into something odd when trying to put together some fixes for Scarab - it appears to be the cause of the problems with books on level 3 of the TOA and with getting a bottle of water in the oasis area. Using this :-
if (get_sprite_with_this_brain(9, ¤t_sprite) != 0)
{
return;
}
Caused the script to end when no brain 9 sprites were on screen. Trying to work around it, I found that this :-
int &stuff = get_sprite_with_this_brain(9, ¤t_sprite);
if (&stuff != 0)
return;
Works fine. Just so long as I've got it working I'm happy, but can anyone give me any ideas as to what's wrong with the first one?
if (get_sprite_with_this_brain(9, ¤t_sprite) != 0)
{
return;
}
Caused the script to end when no brain 9 sprites were on screen. Trying to work around it, I found that this :-
int &stuff = get_sprite_with_this_brain(9, ¤t_sprite);
if (&stuff != 0)
return;
Works fine. Just so long as I've got it working I'm happy, but can anyone give me any ideas as to what's wrong with the first one?
You see, DinkC it's not like C, or Pascal, or other languages, where you can put several commands on the same line.
For example, I think
&variable +=1; &variable *=5;
will not work, unless you put them on different lines.
I guess you have a similar problem.
For example, I think
&variable +=1; &variable *=5;
will not work, unless you put them on different lines.
I guess you have a similar problem.
Excusez-moi, lad, but I don't think you read his question correctly as well as his script.
DinkC is very picky on what functions can be placed in conditional statements. I'm not exactly sure what the criteria is, though.
July 14th 2005, 05:05 PM

Arik


Yeah, that's the conclusion I came to. I just thought this was weird because so many DinkC scripts rely on using this function in conditional statements when determining whether to release a screenlock. It'll teach me to make assumptions, I guess.
Cypry WAS right... There's 2 times () in that line, and I don't think Dink can handle it.