Did you know? Every one of these messages is hand-typed live, just for you.

Movement Functions - problem

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

jammer64
Skaarj Scout Skaarj Scout
Posts: 45
Joined: 05 Jan 2010, 02:38

Subject: Movement Functions - problem

Post Posted: 25 Dec 2012, 22:05

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?

User avatar Buff Skeleton
>:E >: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).
Image

jammer64
Skaarj Scout 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 ;)

User avatar Buff Skeleton
>:E >: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!
Image

jammer64
Skaarj Scout 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:

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.


Who is online

Users browsing this forum: No registered users and 47 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited