Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.54 KB | None | 0 0
  1. // Default ET Bot Profile
  2.  
  3. // FieldOfView is the angle(in degrees) that the bot can 'see' in front of them.
  4. this.FieldOfView = 90.0;
  5.  
  6. // ReactionTime is the time delay(in seconds) from when a bot first see's a target, to when
  7. // the bot will begin to react and target them.
  8. this.ReactionTime = 1.0;
  9.  
  10. // MemorySpan is how long it takes(in seconds) for a bot to consider his memory of someone or something
  11. // 'out of date' and not considered for targeting and such
  12. this.MemorySpan = 2.0;
  13.  
  14. // AimPersistance is how long the bot will aim in the direction of a target after the target has gone out of view.
  15. // This is useful for keeping the bot aiming toward the target in the event of brief obstructions of their view.
  16. this.AimPersistance = 2.0;
  17.  
  18. // MaxViewDistance is the maximum distance(in game units) the bot is capable of seeing something.
  19. // This could be tweaked lower for maps with fog or for a closer to human view distance
  20. // Typically this value is best set in the map script in the OnBotJoin callback.
  21. this.MaxViewDistance = 4000.0;
  22.  
  23. // These 3 values are aim properties. Care must be taken when tweaking aim properties, since
  24. // improper values can produce aim oscillations and hurt the bots combat abilities.
  25. this.MaxTurnSpeed = 720.0; // degree's / second
  26. this.AimStiffness = 75.0;
  27. this.AimDamping = 10.0;
  28.  
  29. // optionally set a fixed skill level for this bot
  30. // this will ensure that any global difficulty changes will not effect it
  31. // default difficulty levels are between 1 and 6 with 1 being the easiest
  32. // this.ProfileSkill = 3;
  33.  
  34. // optionally set a moveskill for the bot. this will effect how they react when in combat (i.e. strafing and crouching)
  35. // setting this will over-ride and value set in goal_combatmovement
  36. // 0 - off, 1 - easy, 2 - medium, 3 - hard, 4 - random
  37. // this.moveskill = 3;
  38.  
  39. //////////////////////////////////////////////////////////////////////////
  40. // Utility Callbacks
  41. this.SelectTeam = function()
  42. {
  43.     return null;
  44. };
  45.  
  46. this.SelectClass = function()
  47. {
  48.     return null;
  49. };
  50.  
  51. if(PrimaryWeaponChoices==null)
  52. {
  53.     global PrimaryWeaponChoices = {};
  54.  
  55.     PrimaryWeaponChoices.ETmain_Weapons = {};
  56.     PrimaryWeaponChoices.ETmain_Weapons[CLASS.SOLDIER] =
  57.     {
  58.         WEAPON.PANZERFAUST,
  59.         WEAPON.MOBILE_MG42,
  60.         WEAPON.FLAMETHROWER,
  61.         WEAPON.MORTAR,
  62.     };
  63.  
  64.     PrimaryWeaponChoices.Jaymod_Weapons = {};
  65.     PrimaryWeaponChoices.Jaymod_WeaponsAxis[CLASS.SOLDIER] =
  66.     {
  67.         WEAPON.MP40,
  68.     };
  69.    
  70.     PrimaryWeaponChoices.Jaymod_WeaponsAllies[CLASS.SOLDIER] =
  71.     {
  72.         WEAPON.THOMPSON,
  73.     }; 
  74.  
  75.     PrimaryWeaponChoices.NQ_WeaponsAxis = {};
  76.     PrimaryWeaponChoices.NQ_WeaponsAxis[CLASS.SOLDIER] =
  77.     {
  78.         WEAPON.PANZERFAUST,
  79.         WEAPON.MOBILE_MG42,
  80.         WEAPON.FLAMETHROWER,
  81.         WEAPON.MORTAR, // mortar2 is the same id now
  82.     };
  83.  
  84.     PrimaryWeaponChoices.NQ_WeaponsAllies = {};
  85.     PrimaryWeaponChoices.NQ_WeaponsAllies[CLASS.SOLDIER] =
  86.     {
  87.         WEAPON.BAZOOKA,
  88.         WEAPON.MOBILE_MG42, // browning is the same id now
  89.         WEAPON.FLAMETHROWER,
  90.         WEAPON.MORTAR,
  91.     };
  92.  
  93.     // if allowed, add venom to the list
  94.     if ( GetModName() == "noquarter" && (GetCvar("jp_insanity") & 256) ) {
  95.         PrimaryWeaponChoices.NQ_WeaponsAllies[CLASS.SOLDIER][ tableCount(PrimaryWeaponChoices.NQ_WeaponsAllies[CLASS.SOLDIER]) ] = WEAPON.VENOM;
  96.         PrimaryWeaponChoices.NQ_WeaponsAxis[CLASS.SOLDIER][ tableCount(PrimaryWeaponChoices.NQ_WeaponsAxis[CLASS.SOLDIER]) ] = WEAPON.VENOM;
  97.     }
  98. }
  99.  
  100. //////////////////////////////////////////////////////////////////////////
  101.  
  102. global ClassPrimaryWeaponChoice = function(bot, excludeweapons)
  103. {
  104.     myteam = bot.GetTeam();
  105.     myclass = bot.GetClass();
  106.  
  107.     weaponChoice = 0;
  108.     ModName = GetModName();
  109.  
  110.     switch(ModName)
  111.     {
  112.         case "noquarter":
  113.         {
  114.             if ( myteam == TEAM.ALLIES ) {
  115.                 wpns = PrimaryWeaponChoices.NQ_WeaponsAllies[myclass];
  116.             }
  117.             else {
  118.                 wpns = PrimaryWeaponChoices.NQ_WeaponsAxis[myclass];
  119.             }
  120.         }
  121.         case "jaymod":
  122.         {
  123.             if ( myteam == TEAM.ALLIES ) {
  124.                 wpns = PrimaryWeaponChoices.Jaymod_WeaponsAllies[myclass];
  125.             }
  126.             else {
  127.                 wpns = PrimaryWeaponChoices.Jaymod_WeaponsAxis[myclass];
  128.             }
  129.         }
  130.         default: // etmain
  131.         {
  132.             wpns = PrimaryWeaponChoices.ETmain_Weapons[myclass];
  133.         }
  134.     }
  135.  
  136.     if ( wpns )
  137.     {
  138.         // loop until we get an acceptable weapon
  139.         while(1)
  140.         {
  141.             weaponChoice = wpns[ RandInt( 0, tableCount(wpns)-1 ) ];
  142.             if(!excludeweapons || !excludeweapons[weaponChoice]) {
  143.                 break;
  144.             }
  145.             yield();
  146.         }
  147.     }
  148.  
  149.     return ToInt(weaponChoice);
  150. };
  151.  
  152. global ClassSecondaryWeaponChoice = function(bot, excludeweapons)
  153. {
  154.     return null;
  155. };
  156.  
  157. this.SelectWeapons = function()
  158. {
  159.     myteam = this.GetTeam();
  160.     myclass = this.GetClass();
  161.  
  162.     weaponSelection = {};
  163.     weaponSelection.Primary = ClassPrimaryWeaponChoice(this);
  164.     weaponSelection.Secondary = ClassSecondaryWeaponChoice(this);
  165.  
  166.     if ( weaponSelection.Primary )
  167.         { this.ChangePrimaryWeapon( weaponSelection.Primary ); }
  168.  
  169.     if ( weaponSelection.Secondary )
  170.         { this.ChangeSecondaryWeapon( weaponSelection.Secondary ); }
  171. };
  172.  
  173. //////////////////////////////////////////////////////////////////////////
  174. global saySkills = function()
  175. {
  176.     this.mySkills = table();
  177.     if(this.GetSkills(this.mySkills))
  178.     {
  179.         this.Say("Battle Sense: ", this.mySkills[SKILL.BATTLE_SENSE]);
  180.         this.Say("Engineering: ", this.mySkills[SKILL.ENGINEERING]);
  181.         this.Say("First Aid: ", this.mySkills[SKILL.FIRST_AID]);
  182.         this.Say("Signals: ", this.mySkills[SKILL.SIGNALS]);
  183.         this.Say("Lght Wpns: ", this.mySkills[SKILL.LIGHT_WEAPONS]);
  184.         this.Say("Hvy Wpns: ", this.mySkills[SKILL.HEAVY_WEAPONS]);
  185.         this.Say("Cov Ops: ", this.mySkills[SKILL.COVERTOPS]);
  186.     }
  187.     else
  188.     {
  189.         this.Say("Don't know my skills!");
  190.     }
  191. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement