ET 071 MG42 AimAdjustments
From Omni-bot Wiki
| ET 0.71 Scripts | goal_mgmount |
Description: This script contains functionality to make the bots less deadly when mounting mg42's
Download: Goal_mgmount.gm
Installation: Rename Goal_mgmount.gm so that the G is lowercase (goal_mgmount.gm) and place the file in ~/omni-bot/et/scripts/goals
// This script contains functionality to make the bots less deadly when mounting mg42's // These parameters are required this.Name = "MountMG"; // The name of the goal. this.Parent = "LowLevel"; // The name of the parent. This setting determines where in the state tree the goal will reside in. this.LimitToEntityFlag( ENTFLAG.MOUNTED, ENTFLAG.MNT_MG42); this.Initialize = function() { //store the bots properties this.MaxView = this.Bot.MaxViewDistance; this.FOV = this.Bot.FieldOfView; this.Reaction = this.Bot.ReactionTime; this.Persistance = this.Bot.AimPersistance; this.Tolerance = this.Bot.AimTolerance; this.TurnSpeed = this.Bot.MaxTurnSpeed; this.Stiffness = this.Bot.AimStiffness; this.Damping = this.Bot.AimDamping; print( this.Name, "initialized" ); }; this.Exit = function() { //print ( this.Bot.Name, " is no longer mounted " ); //no longer mounted, so set back to original this.Bot.MaxViewDistance = this.MaxView; this.Bot.FieldOfView = this.FOV; this.Bot.ReactionTime = this.Reaction; this.Bot.AimPersistance = this.Persistance; this.Bot.AimTolerance = this.Tolerance; this.Bot.MaxTurnSpeed = this.TurnSpeed; this.Bot.AimStiffness = this.Stiffness; this.Bot.AimDamping = this.Damping; }; this.GetPriority = function() { //print( this.Bot.Name, " is mounted" ); //the bot is mounted, so let's adjust some properties to make it less deadly this.Bot.MaxViewDistance = this.MaxView; this.Bot.FieldOfView *= 0.5; this.Bot.ReactionTime *= 2; this.Bot.AimPersistance *= 0.2; this.Bot.AimTolerance *= 3; this.Bot.MaxTurnSpeed *= 0.33; this.Bot.AimStiffness = 25.0; this.Bot.AimDamping = 5.0; //set a priority so it will exit later this.Priority = 0.15; //once set, block until exit since we don't want to set these every frame block(0); };