Scripting waypoints flags

From MyGamingTalk
Jump to navigation Jump to search
Omni-Bot_Map_Scripting Scripting Waypoints flags


During the process of running a map things can change such as doors no longer been axis only.


The following flags can be added/removed via script


  • axis
  • allies
  • closed

There are a few other flags that can be added removed but these are the only ones that you are likely to need to change in the game


The waypoint must be named in the map "/bot waypoint_setname name" so the script knows which waypoint to add/remove the flag


The command to use in the script is "Wp.SetWaypointFlag".


        Wp.SetWaypointFlag( "waypoint_name", "flag", true/false );


This command initially must be added to the "global OnMapLoad" section so the status of the flag is known at the start of the map. The flag must then be added to any "function( trigger )'s" that causes the need to add/remove the flag.


Below is an example of the script to remove a axis only flag to allow both teams to use.

 
global Map =

{
	Main_Entrance_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Wp.SetWaypointFlag( "door1", "axis", false );

		Util.MapDebugPrint( "Main_Entrance_Destroyed" );
	},
};

global OnMapLoad = function()

{
        OnTrigger( "Allies have destroyed the main entrance", Map.Main_Entrance_Destroyed );

        Wp.SetWaypointFlag( "door1", "axis", true );

};


Note: Using this to remove a closed flag is not needed on blockable section of a map unless the blockwall flag does not work like in the Caen map.