Pre-Scripted Regions

From MyGamingTalk
Revision as of 11:55, 14 July 2021 by Palota (talk | contribs) (→‎DisableBotPush)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Omni-Bot_Map_Scripting Pre-Scripted Regions


In 0.8 there are several pre-scripted region triggers. They are defined in file et/scripts/et_regiontriggers.gm. Therefore you don't need to define every trigger in "global Map". You just add one line to "OnMapLoad". The only exception to this is the "VehicleTrigger", see Vehicle Trigger Regions from more details.


OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.DisableBotPush); //trigger without a name
RegionTrigger.Create(AABB(0,0,0,1,1,1), "DisableBotPush", "Ladder_Around_CP"); //trigger with a name

(0,0,0,1,1,1) are just example coordinates which should be replaced with actual AABB coordinates as explained in the Trigger regions page.

DisableBotPush

This will disable bots from pushing within the trigger area. It also disables combat movement. Useful at leaders or narrow bridges where bots can fall down.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.DisableBotPush);

DisableCombatMovement

This will disable the bots combat movement within the trigger area. Useful in areas where moving from side to side can result in the bot getting killed.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.DisableCombatMovement);

BreakableDistance

This turns on the bots ability to shoot breakable objects within the trigger area. Useful if a map contains many breakable objects but you only require bots to break objects in a certain area. The parameter MinBreakableDist should be same as bot.TargetBreakableDist in OnBotJoin.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.BreakableDistance);
RegionTrigger.BreakableDistance.MaxBreakableDist = 200; //TargetBreakableDist when a bot enters the region
RegionTrigger.BreakableDistance.MinBreakableDist= 0;   //TargetBreakableDist when a bot exits the region

KillTrigger

Any bot that enters the trigger area will self kill. The main purpose of this is for when bots end up in an area that they are unable to escape from.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.KillTrigger);

IntrusionWarning

When an attacking player (human or bot) enters this region, a defending bot will use a voicechat warning. You must set Map.DefendingTeam.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.IntrusionWarning);

IntrusionWarningEngObj

When an attacking Engineer (human or bot) enters this region, a defending bot will use a voicechat warning. You must set Map.DefendingTeam.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.IntrusionWarningEngObj);

AllClear

When defending bot enters this region and can't see any enemy, he will use a voicechat. You must set Map.DefendingTeam.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.AllClear);

VehicleTrigger

This is used to detect when a vehicle enters the AABB Trigger area. This will send a message to the console (needs "/bot debugtrigger" on to see) saying the vehicle name "at location", this can then be used as a standard trigger. This is more detailed on the Vehicle Trigger Regions page.

OnTriggerRegion(AABB(0,0,0,1,1,1), RegionTrigger.VehicleTrigger);