Hiya!
Have you ever stuck upon problems with scripting moving objects with PHYS_Flying? Under certain conditions they seem to neglect subsequent function calls e.g. I order my flying pawn to set new destination and strafe the enemy every, let say, two seconds. Pawn executes one call and then flies straight all the time ignoring new directions. Are there any restrictions on what flying pawn can do in terms of movement? I know for sure it's not jumping to parent class' functions and getting lost in the loop. Any ideas?
Movement Functions - problem
5 posts •
Page 1 of 1
- jammer64
- Skaarj Scout
- Posts: 45
- Joined: 05 Jan 2010, 02:38
Subject: Movement Functions - problem
Post Posted: 25 Dec 2012, 22:05
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject: Re: Movement Functions - problem
Post Posted: 26 Dec 2012, 05:29
Is it doing something in a state like sleep() or TurnToward()? Latent functions will "freeze" the pawn mid-motion until the state is complete, which I've seen several times with Gasbag variants that fire huge sprays of projectiles. If they start firing while moving, they won't stop moving until they stop shooting (i.e. the state ends).
- jammer64
- Skaarj Scout
- Posts: 45
- Joined: 05 Jan 2010, 02:38
Subject: Re: Movement Functions - problem
Post Posted: 27 Dec 2012, 01:31
Yep, it usually happens if my pawn spawns projectiles and i use sleep inside state. As I suspected, I should take closer look at this area. Many thanks, m8
- Buff Skeleton
- >:E
- Posts: 4173
- Joined: 15 Dec 2007, 00:46
Subject: Re: Movement Functions - problem
Post Posted: 27 Dec 2012, 02:48
If you find any good workarounds other than doing movement checks during the state with a bunch of very short sleep() calls, please let us know!
- jammer64
- Skaarj Scout
- Posts: 45
- Joined: 05 Jan 2010, 02:38
Subject: Re: Movement Functions - problem
Post Posted: 03 Jan 2013, 01:31
Well, I was so foolish, thinking that MoveTo/StrafeTo are working in the background with the state code, despite knowing the general definition of 'latent function' As I intended to make states animation driven (in terms of timing), I've come up with:
'Przewodnik' means 'guide' in Polish and it's my custom scout actor calculating route for pawn. I won't hesitate to share a little code in some time Of course I haven't finished custom model and animation yet, so i rely on original ones and choice of animation is purely working one.
Code: Select all
state ReachingTarget
{
...
event AnimEnd()
{
StopWaiting();
GotoState('Decisions');
}
Begin:
PlayAnim('RunSM', 1.2);
Loop:
if(CanSee(Enemy))
{
StrafeTo(Przewodnik.Location, Enemy.Location);
TurnTo(Enemy.Location);
}
else
{
MoveTo(Przewodnik.Location);
TurnTo(Przewodnik.Location);
}
Goto('Loop');
}
'Przewodnik' means 'guide' in Polish and it's my custom scout actor calculating route for pawn. I won't hesitate to share a little code in some time Of course I haven't finished custom model and animation yet, so i rely on original ones and choice of animation is purely working one.
5 posts •
Page 1 of 1
Who is online
Users browsing this forum: No registered users and 54 guests