Animations and Timing

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
Markman
Posts: 21
Joined: Sat Jan 14, 2006 2:28 pm

Animations and Timing

Post by Markman »

At the moment i have a problem with Animations and Rotations in conjunction with stuff that need to be executet on a regular time basis.

I have a pawn, that should carry and start an "explosion" (in fact it's rather a light) regularly, like the flashing indicator on a car.

But every time i do a Rotation or a Animation, the effect runs "out of rhythm".

Is there any scripting style, so that you can let the animations finish, without interrupting the rest ?
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

i honestly never got too deep into pawn scripting, so ill dodge the actual question, but i have an idea: if you cannot do this, you might simply make a second pawn which has the explosion, with the entityname and bonename fields filled in appropriately to attach it to the first entity, and in the attached entity simply have the flash script.
User avatar
Markman
Posts: 21
Joined: Sat Jan 14, 2006 2:28 pm

Post by Markman »

That would be a Solution !

But I still have no clue what is going on in Low Level Orders, i mean the return 0; / return; / Return(); stuff...
I always read that the Orders would continue to loop (when they are not sealed with a return 0;) even if the Interpreter was sent to/ and executes another Order.
But I could not use / get that to work until now...

So i hope that there would be a possibility to let the Animations and Rotation finish, while the Interpreter jumps to another Order and do that in the main Pawn Script.
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

i dont know, but as for the return stuff, if it works the same way it does in c++, it returns a variable, for instance, you could have an order named HasWeapon() that returns 1 if the enemy has a weapon and 0 if the enemy does not, then you could say in another function

if(HasWeapon() == 1)
{
NewOrder("Fire");
}

just as an example. there are probably errors, ive never tried to use return in rf scripting. i really need to use rf more...

to my knowledge orders do not continue to loop, thats why theres the restartorder() function, for instance:

Idle[ ()
{
PlayAnimation("Idle", true, "");
RestartOrder();
} ]

would constantly play that pawns idle animation.

sorry im not as knowledgeable about pawns as i should be, i just never got really deep into scripting them...
User avatar
Markman
Posts: 21
Joined: Sat Jan 14, 2006 2:28 pm

Post by Markman »

It really looks like I always used a unessecessary ammount of return0;

It seems to be really only for sending back (returning) a value - and NOT make a jump back (returning) to the point where it came from.

Maybe from C64 times I must always think of GOSUB / RETURN...
User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR »

ah. forgot to add to the post, again, if it works the same way it does in c++, return can exit an order prematurely.

i've put off getting deeply into simkin for too long...
Post Reply