Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → limiting conditions...once per level, that is
limiting conditions...once per level, that is
2000-12-20, 3:50 PM #1
I want an cog to run an event only once in a level. I tried using the method of:

if x = 0
//as in the event never took place
{
do stuff...
x = 1
return;
}

Now that didn't work...any other suggestions?
2000-12-20, 3:54 PM #2
Instead of x = 1 try x = x + 1

------------------
All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither,
Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
2000-12-21, 11:18 AM #3
When you're checking if statements, you need to use 2 equal signs (==), not one(=). Change that and and it should work. Make sure X is specified in the symbols - probably as an int.

-Jipe
2000-12-21, 12:03 PM #4
Also, doesn't the x = 0 in the if statement have to be in brackets?

------------------
All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither,
Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
2000-12-21, 3:31 PM #5
Nope, you're both wrong. It's:

if(active != 0) Return;
active = 1;
//Do stuff
return;
end

So there you go...it works, it's tested.
2000-12-21, 4:01 PM #6
Um, no, I'm not wrong. When you check if statements with equal signs, you need to have 2.. yes, your last method works.

-Jipe

↑ Up to the top!