PDA

View Full Version : Ignoring States


RestInPieces
23rd Sep 2001, 12:09 PM
hi everybody, ive got a litte prob.
I want to code a weapon which freezes all enemies in a certain radius. These enemies will then go to a state called "frozen".
I want them to stay in this state, so i wanted to ignore all other states like this:

state Frozen
{
ignores Attacking,...// all the states i want ignored
}

But then the compiler said: Attacking is not a function.
Can't i ignores states? Is there any possibiliy to ignore states? Did i make a syntax mistatke?

usaar33
23rd Sep 2001, 02:42 PM
Ignore states?
What do you mean by that?

If you want to freeze them, just change their physics, set their accel to (0,0,0), disable tick, and freeze their animation.

Bytekeeper
23rd Sep 2001, 02:49 PM
You can't "ignore" states,
Just ignore or overwrite the functions which would leave your state...
Those are mainly events like Timer(), Tick(), Touch() etc.

RestInPieces
23rd Sep 2001, 04:20 PM
Well, actually, thats what i did, but i thought ignoring the states, meaning the ignored states cannont be called on the pawn who ist in the state frozen, would be a "cleaner" solution...
Well, at least no i know that it doesn't work, thanX

ca
24th Sep 2001, 02:32 AM
Ignore doesn't work with states, and it only works with certain (ai-related) functions. If you want a function to not be called just override it:

state Iced
{
function DoSomething()
{
}

function DoSomethingElse();
}

... etc

Bytekeeper
24th Sep 2001, 08:01 AM
It actually work with all functions :)
But ignores are not inherited: if you overwrite the state you kill the old ignores, therefore most code which is meant to be inherited doesn't use ignore but overwrite the old functions with empty new ones ( like ie. engine.weapon does )

@Restinpeaces:
You can use a "trick" to "ignore" other states. Everytime a state is about be be left, endstate() is called, so you just put a gotostate in your state.endstate function to redirect to your state again.

RestInPieces
24th Sep 2001, 09:02 AM
This is cool
Thanks !

ca
24th Sep 2001, 07:03 PM
No, ignore is broken - try ignoring Fire() in a weapon state and it'll call the global version instead of not calling the function. Steve has confirmed that this is broken behaviour...

RestInPieces
25th Sep 2001, 08:43 AM
Err,.... anyone can tell me how to freeze an anim? :(

Bytekeeper
25th Sep 2001, 10:44 AM
Yeap @ ca, I had some weird problems with my dying state for bots. At first it didn't ignore anything, then I copied the line out of bots, and even then some functions where called :( Which I then have overwritten. So I don't use ignore anymore if I can ;)

usaar33
27th Sep 2001, 03:39 AM
Originally posted by ca
No, ignore is broken - try ignoring Fire() in a weapon state and it'll call the global version instead of not calling the function. Steve has confirmed that this is broken behaviour...

wow, it always.... seemed... to work for me :)

RestInPieces
28th Sep 2001, 08:34 AM
Originally posted by RestInPieces
Err,.... anyone can tell me how to freeze an anim? :(

or can't anims be "frozen"?

trasko
28th Sep 2001, 10:22 AM
sorry i can't help -- i know this sounds sort of hard since bots are heavily AI driven. but, i'd imagine there is some way to interrupt all that to freeze the animation.

i'll keep my eye peeled.

trasko

RestInPieces
29th Sep 2001, 08:07 AM
YIPIIIIIIIIIIIIIIIIIIIEEEEE! found it out!
AnimRate=0;
thats all you have to do in order to freeze the anim :cool:
Thanks to everybody who helped me with my States/Anim problem!