Skip to content

Help with random object move to location script

I have no idea what I am doing wrong with this script, I think it should work "ondamaged"

#include "x0_i0_position"
void main()
{
location lAttacker = GetLocation(OBJECT_SELF);
object oArea = GetArea(OBJECT_SELF);
float xDist =IntToFloat(d6(5));
float xAngle =IntToFloat(d8(50)-45);
object oSelf = OBJECT_SELF ;
location bLoc = GetLocation(oSelf);
vector bVec = GetPositionFromLocation(bLoc) ;
bVec = GetChangedPosition(bVec,xDist,xAngle);
bLoc = Location(oArea, bVec, xAngle);

ActionJumpToLocation (bLoc);

}

Comments

  • PhantasmaPhantasma Member Posts: 79
    edited October 2020
    ClearAllActions(TRUE) before the jump is what you need.

    However, ActionJumpToLocation will walk to the location if it's very close, so you may want to use ActionJumpToObject (create an invisible object to jump to) with the bWalkStraightLine set to FALSE - assuming that will work, I haven't tested it.
Sign In or Register to comment.