PlayMovingEffectXYZ( srcloc, dstloc, effect, speed, loop, explode)
instead of:
PlayMovingEffectXYZ( srcx, srcy, srcz, dstx, dsty, dstz, effect, speed, loop, explode, realm )
Quiet a bit neater, eh? Also if we add little bit of polymorphism-like support, you could use UObjects as the first two parameters as well.
To start with, here's a few simple functions.
Code: Select all
/*
GetCoords
Takes objects location and sets it in a struct.
Returns: struct with x, y, z, and realm.
*/
function GetCoords( object )
return struct{"x" := object.x, "y" := object.y, "z" := object.z, "realm" := object.realm };
endfunction
/*
NewCoords
Easy way to create Coordinate Struct
Returns: coordinate struct
*/
function NewCoords( x, y, z := 0, realm := _DEFAULT_REALM )
return struct{"x" := x, "y" := y, "z" := z, "realm" := realm};
endfunction
/*
SameCoords
To check if two set of coordinates match.
For example, can be used to check if mobile has moved.
Returns:
1 if same
0 if different
*/
function SameCoords( first, second )
return (
first.x == second.x &&
first.y == second.y &&
first.z == second.z &&
first.realm == second.realm
);
endfunction