Meteor 2 Scripting Functions
Waypoint
bool bindToWaypoint(int objectID, int waypointID)
Make an object follow a waypoint.
bindToWaypoint(0, 3);
The object will continue to follow the waypoint, even if stuck. To make the object stop following the waypoint if it gets stuck, use bindToWaypointSoft.
bool bindToWaypointSoft(int objectID, int waypointID)
Make an object follow a waypoint. The object will stop following the waypoint if it gets stuck.
bindToWaypointSoft(0, 3);
int createWaypoint(vector2 pos, int prevWaypointID)
Create a waypoint.
int newWaypointID = createWaypoint(vector2(100,100), -1);
int prevID = -1;
prevID = createWaypoint(vector2(100,100), -1);
prevID = createWaypoint(vector2(200,100), prevID);
prevID = createWaypoint(vector2(300,100), prevID);
The prevWaypointID parameter is the previous connected waypoint ID, set this -1 to no connect to a previous waypoint.
Return value (newWaypointID) will be -1 if the waypoint could not be created.
Enable netIDs display (netids console command) or general debug (gbug console command) to view waypoints in game.
bool deleteWaypoint(int waypointID)
Delete a waypoint.
deleteWaypoint(1);
Objects currently on the waypoint will be either sent to the next waypoint or unbound depending on whether a next waypoint existed.
int getNextWaypointID(int waypointID)
Get a waypoint's next waypoint ID.
print(getNextWaypointID(1));
void setNextWaypointID(int waypointID, int nextWaypointID)
Set a waypoint's next waypoint ID.
setNextWaypointID(1, 2);
vector2 getWaypointPos(int waypointID)
Get a waypoint's position.
print(getWaypointPos(1));
Do not use this function to check if a waypoint exists (use waypointExists).
void setWaypointPos(int waypointID, vector2 pos)
Set a waypoint's position.
int waypointID = 1;
print(getWaypointPos(waypointID));
setWaypointPos(waypointID, vector2(200,200));
print(getWaypointPos(waypointID));
Do not use this function to check if a waypoint exists (use waypointExists).
bool waypointExists(int waypointID)
Determine if a waypoint exists.
int waypointID = 1;
if(waypointExists(waypointID))
print("Waypoint " + waypointID + " exists");
else
print("Waypoint " + waypointID + " does not exist");
Index
Generated on the 23 November 2024 at 08:20:45 (UK Time)