Help with random object move to location script
Tuebits
Member Posts: 6
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);
}
#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);
}
0
Comments
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.