Announcement

Collapse
No announcement yet.

How can you change the position of a Karma Actor using UScript?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can you change the position of a Karma Actor using UScript?

    I searched the forums but did not find a answer....

    I want to be able to:

    1) move a karma actor (kactor) to point B when it hits point A. (point A could be an actor or a volume).

    2) Be able to stop a karma actor immediately if it reaches a certain point. (again, could be an actor or a volume).

    The SetLocation function does not work for moving KActors. Well, more specifically, it DOES work, however the Karma Physics code simply moves it back to the original location as the Kactor keeps moving! I assume that is becuase the Karma parameters override normal actor location and velocity parameters. Does anyone have any ideas?

    [edit] Oh yeah, I am working in UT2004[/edit]

    #2
    Since you say that the KActor goes back to the original location because it was still moving, why don't you stop the Actor's movement, then position it, then resume their previous velocity?

    Just a suggestion

    Comment


      #3
      That is the problem.... HOW do you stop a karma actor? Karma actors ignore changes to the normal actor Velocity and Location, probably because the Karma engine simulation is overriding them...

      Comment


        #4
        After exhaustive research ( and trial and error ) I figured it out.
        To stop a karma actor, use the following code:
        Code:
        Thing.SetPhysics( PHYS_None );
        Thing.SetPhysics( PHYS_Karma );
        To change the location:
        Code:
        Thing.SetPhysics( PHYS_None );
        Thing.SetLocation(L);
        Thing.SetPhysics( PHYS_Karma );
        Since most karma actors probably won't have a PlayTeleportEffect function that actually does anything, if you want to spawn a teleporter effect you can use this code:
        Code:
        local Actor B;
        B = Spawn(class'XEffects.TransEffect',,,Thing.Location + Thing.CollisionHeight * vect(0,0,0.75));
        You can call this once before the SetLocation, and once after.

        Comment

        Working...
        X