This commit is contained in:
INeedBots 2020-09-23 00:50:26 -06:00
parent 4174c2bcc5
commit a36a6238e1
3 changed files with 246 additions and 0 deletions

View File

@ -229,6 +229,9 @@ fixGamemodes()
} }
} }
/*
*/
fixKoth() fixKoth()
{ {
level.radio = undefined; level.radio = undefined;
@ -256,6 +259,9 @@ fixKoth()
} }
} }
/*
*/
addNotifyOnAirdrops() addNotifyOnAirdrops()
{ {
for (;;) for (;;)
@ -279,6 +285,9 @@ addNotifyOnAirdrops()
} }
} }
/*
*/
doNotifyOnAirdrop() doNotifyOnAirdrop()
{ {
self endon( "death" ); self endon( "death" );
@ -304,6 +313,9 @@ onPlayerConnect()
} }
} }
/*
*/
watchScrabler() watchScrabler()
{ {
for (;;) for (;;)
@ -729,6 +741,9 @@ onGrenadeFire()
} }
} }
/*
*/
AddToFragList(who) AddToFragList(who)
{ {
grenade = spawnstruct(); grenade = spawnstruct();
@ -744,6 +759,9 @@ AddToFragList(who)
level.bots_fragList ListAdd(grenade); level.bots_fragList ListAdd(grenade);
} }
/*
*/
thinkFrag() thinkFrag()
{ {
while(isDefined(self.grenade)) while(isDefined(self.grenade))

View File

@ -1,5 +1,8 @@
#include maps\mp\bots\_bot_utility; #include maps\mp\bots\_bot_utility;
/*
*/
doVersionCheck() doVersionCheck()
{ {
remoteVersion = getRemoteVersion(); remoteVersion = getRemoteVersion();
@ -21,6 +24,9 @@ doVersionCheck()
return true; return true;
} }
/*
*/
getRemoteWaypoints(mapname) getRemoteWaypoints(mapname)
{ {
url = "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/" + mapname + "_wp.csv"; url = "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/" + mapname + "_wp.csv";
@ -42,6 +48,9 @@ getRemoteWaypoints(mapname)
} }
} }
/*
*/
getRemoteVersion() getRemoteVersion()
{ {
request = httpGet( "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/version.txt" ); request = httpGet( "https://raw.githubusercontent.com/ineedbots/iw4x_waypoints/master/version.txt" );
@ -54,6 +63,9 @@ getRemoteVersion()
return strtok(data, "\n")[0]; return strtok(data, "\n")[0];
} }
/*
*/
linesToWaypoints(res) linesToWaypoints(res)
{ {
waypoints = []; waypoints = [];
@ -74,6 +86,9 @@ linesToWaypoints(res)
return waypoints; return waypoints;
} }
/*
*/
getLinesFromUrl(url) getLinesFromUrl(url)
{ {
result = spawnStruct(); result = spawnStruct();

View File

@ -93,6 +93,9 @@ bot_get_rank()
return maps\mp\gametypes\_rank::getRankInfoMinXP( rank ); return maps\mp\gametypes\_rank::getRankInfoMinXP( rank );
} }
/*
*/
getCardTitles() getCardTitles()
{ {
cards = []; cards = [];
@ -113,6 +116,9 @@ getCardTitles()
return cards; return cards;
} }
/*
*/
getCardIcons() getCardIcons()
{ {
cards = []; cards = [];
@ -133,6 +139,9 @@ getCardIcons()
return cards; return cards;
} }
/*
*/
isValidAttachmentCombo(att1, att2) isValidAttachmentCombo(att1, att2)
{ {
colIndex = tableLookupRowNum( "mp/attachmentCombos.csv", 0, att1 ); colIndex = tableLookupRowNum( "mp/attachmentCombos.csv", 0, att1 );
@ -143,6 +152,9 @@ isValidAttachmentCombo(att1, att2)
return true; return true;
} }
/*
*/
getAttachmentsForGun(gun) getAttachmentsForGun(gun)
{ {
row = tableLookupRowNum( "mp/statStable.csv", 4, gun ); row = tableLookupRowNum( "mp/statStable.csv", 4, gun );
@ -164,6 +176,9 @@ getAttachmentsForGun(gun)
return attachments; return attachments;
} }
/*
*/
getPrimaries() getPrimaries()
{ {
primaries = []; primaries = [];
@ -183,6 +198,9 @@ getPrimaries()
return primaries; return primaries;
} }
/*
*/
getSecondaries() getSecondaries()
{ {
secondaries = []; secondaries = [];
@ -205,6 +223,9 @@ getSecondaries()
return secondaries; return secondaries;
} }
/*
*/
getCamos() getCamos()
{ {
camos = []; camos = [];
@ -222,6 +243,9 @@ getCamos()
return camos; return camos;
} }
/*
*/
getPerks(perktype) getPerks(perktype)
{ {
perks = []; perks = [];
@ -246,11 +270,17 @@ getPerks(perktype)
return perks; return perks;
} }
/*
*/
getKillsNeededForStreak(streak) getKillsNeededForStreak(streak)
{ {
return int(tableLookup("mp/killstreakTable.csv", 1, streak, 4)); return int(tableLookup("mp/killstreakTable.csv", 1, streak, 4));
} }
/*
*/
getKillstreaks() getKillstreaks()
{ {
killstreaks = []; killstreaks = [];
@ -275,6 +305,9 @@ getKillstreaks()
return killstreaks; return killstreaks;
} }
/*
*/
chooseRandomPerk(perkkind) chooseRandomPerk(perkkind)
{ {
perks = getPerks(perkkind); perks = getPerks(perkkind);
@ -307,6 +340,9 @@ chooseRandomPerk(perkkind)
} }
} }
/*
*/
chooseRandomCamo() chooseRandomCamo()
{ {
camos = getCamos(); camos = getCamos();
@ -322,6 +358,9 @@ chooseRandomCamo()
} }
} }
/*
*/
chooseRandomPrimary() chooseRandomPrimary()
{ {
primaries = getPrimaries(); primaries = getPrimaries();
@ -344,6 +383,9 @@ chooseRandomPrimary()
} }
} }
/*
*/
chooseRandomSecondary(perk1) chooseRandomSecondary(perk1)
{ {
if (perk1 == "specialty_onemanarmy") if (perk1 == "specialty_onemanarmy")
@ -372,6 +414,9 @@ chooseRandomSecondary(perk1)
} }
} }
/*
*/
chooseRandomAttachmentComboForGun(gun) chooseRandomAttachmentComboForGun(gun)
{ {
atts = getAttachmentsForGun(gun); atts = getAttachmentsForGun(gun);
@ -399,6 +444,9 @@ chooseRandomAttachmentComboForGun(gun)
} }
} }
/*
*/
chooseRandomTactical() chooseRandomTactical()
{ {
tacts = strTok("flash_grenade,smoke_grenade,concussion_grenade", ","); tacts = strTok("flash_grenade,smoke_grenade,concussion_grenade", ",");
@ -411,6 +459,9 @@ chooseRandomTactical()
} }
} }
/*
*/
setClasses() setClasses()
{ {
rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") ); rank = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData("experience") );
@ -450,6 +501,9 @@ setClasses()
} }
} }
/*
*/
isColidingKillstreak(killstreaks, killstreak) isColidingKillstreak(killstreaks, killstreak)
{ {
ksVal = getKillsNeededForStreak(killstreak); ksVal = getKillsNeededForStreak(killstreak);
@ -478,6 +532,9 @@ isColidingKillstreak(killstreaks, killstreak)
return false; return false;
} }
/*
*/
setKillstreaks() setKillstreaks()
{ {
rankId = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData( "experience" ) ) + 1; rankId = self maps\mp\gametypes\_rank::getRankForXp( self getPlayerData( "experience" ) ) + 1;
@ -662,6 +719,9 @@ bot_cry_for_help( attacker )
} }
} }
/*
*/
onKillcam() onKillcam()
{ {
level endon("game_ended"); level endon("game_ended");
@ -675,6 +735,9 @@ onKillcam()
} }
} }
/*
*/
doKillcamStuff() doKillcamStuff()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1008,6 +1071,9 @@ onSpawned()
} }
} }
/*
*/
onDeath() onDeath()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1020,6 +1086,9 @@ onDeath()
} }
} }
/*
*/
onGiveLoadout() onGiveLoadout()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1037,6 +1106,9 @@ onGiveLoadout()
} }
} }
/*
*/
bot_inc_bots(obj, unreach) bot_inc_bots(obj, unreach)
{ {
level endon("game_ended"); level endon("game_ended");
@ -1052,6 +1124,9 @@ bot_inc_bots(obj, unreach)
obj.bots--; obj.bots--;
} }
/*
*/
bots_watch_touch_obj(obj) bots_watch_touch_obj(obj)
{ {
self endon ("death"); self endon ("death");
@ -1078,6 +1153,9 @@ bots_watch_touch_obj(obj)
} }
} }
/*
*/
nearAnyOfWaypoints(dist, waypoints) nearAnyOfWaypoints(dist, waypoints)
{ {
dist *= dist; dist *= dist;
@ -1094,6 +1172,9 @@ nearAnyOfWaypoints(dist, waypoints)
return false; return false;
} }
/*
*/
getNearestWaypointOfWaypoints(waypoints) getNearestWaypointOfWaypoints(waypoints)
{ {
answer = undefined; answer = undefined;
@ -1110,6 +1191,9 @@ getNearestWaypointOfWaypoints(waypoints)
return answer; return answer;
} }
/*
*/
bot_escort_obj(obj, carrier) bot_escort_obj(obj, carrier)
{ {
self endon( "death" ); self endon( "death" );
@ -1132,6 +1216,9 @@ bot_escort_obj(obj, carrier)
self notify("goal"); self notify("goal");
} }
/*
*/
bot_get_obj(obj) bot_get_obj(obj)
{ {
self endon( "death" ); self endon( "death" );
@ -1170,6 +1257,9 @@ onBotSpawned()
} }
} }
/*
*/
start_bot_threads() start_bot_threads()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1208,6 +1298,9 @@ start_bot_threads()
self thread bot_cap(); self thread bot_cap();
} }
/*
*/
stop_go_target_on_death(tar) stop_go_target_on_death(tar)
{ {
self endon( "death" ); self endon( "death" );
@ -1221,6 +1314,9 @@ stop_go_target_on_death(tar)
self ClearScriptGoal(); self ClearScriptGoal();
} }
/*
*/
follow_target() follow_target()
{ {
self endon( "death" ); self endon( "death" );
@ -1298,6 +1394,9 @@ bot_think_camp()
} }
} }
/*
*/
killCampAfterTime(time) killCampAfterTime(time)
{ {
self endon("death"); self endon("death");
@ -1311,6 +1410,9 @@ killCampAfterTime(time)
self notify("kill_camp_bot"); self notify("kill_camp_bot");
} }
/*
*/
killCampAfterEntGone(ent) killCampAfterEntGone(ent)
{ {
self endon("death"); self endon("death");
@ -1331,6 +1433,9 @@ killCampAfterEntGone(ent)
self notify("kill_camp_bot"); self notify("kill_camp_bot");
} }
/*
*/
CampAtSpot(origin, anglePos) CampAtSpot(origin, anglePos)
{ {
self endon("kill_camp_bot"); self endon("kill_camp_bot");
@ -1397,6 +1502,9 @@ bot_think_follow()
} }
} }
/*
*/
watchForFollowNewGoal() watchForFollowNewGoal()
{ {
self endon("death"); self endon("death");
@ -1415,6 +1523,9 @@ watchForFollowNewGoal()
self notify("kill_follow_bot"); self notify("kill_follow_bot");
} }
/*
*/
killFollowAfterTime(time) killFollowAfterTime(time)
{ {
self endon("death"); self endon("death");
@ -1428,6 +1539,9 @@ killFollowAfterTime(time)
self notify("kill_follow_bot"); self notify("kill_follow_bot");
} }
/*
*/
followPlayer(who) followPlayer(who)
{ {
self endon("kill_follow_bot"); self endon("kill_follow_bot");
@ -1461,6 +1575,9 @@ followPlayer(who)
self notify("kill_follow_bot"); self notify("kill_follow_bot");
} }
/*
*/
bot_perk_think() bot_perk_think()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1587,6 +1704,9 @@ bot_perk_think()
} }
} }
/*
*/
bot_use_tube_think() bot_use_tube_think()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1717,6 +1837,9 @@ bot_use_tube_think()
} }
} }
/*
*/
fire_current_weapon() fire_current_weapon()
{ {
self endon("death"); self endon("death");
@ -1731,6 +1854,9 @@ fire_current_weapon()
} }
} }
/*
*/
bot_use_equipment_think() bot_use_equipment_think()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1847,6 +1973,9 @@ bot_use_equipment_think()
} }
} }
/*
*/
bot_use_grenade_think() bot_use_grenade_think()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1971,6 +2100,9 @@ bot_use_grenade_think()
} }
} }
/*
*/
bot_jav_loc_think() bot_jav_loc_think()
{ {
self endon("disconnect"); self endon("disconnect");
@ -2091,6 +2223,9 @@ bot_jav_loc_think()
} }
} }
/*
*/
bot_equipment_kill_think() bot_equipment_kill_think()
{ {
self endon( "death" ); self endon( "death" );
@ -2218,6 +2353,9 @@ bot_equipment_kill_think()
} }
} }
/*
*/
bot_equipment_attack(equ) bot_equipment_attack(equ)
{ {
wait_time = RandomIntRange( 7, 10 ); wait_time = RandomIntRange( 7, 10 );
@ -2233,6 +2371,9 @@ bot_equipment_attack(equ)
} }
} }
/*
*/
bot_listen_to_steps() bot_listen_to_steps()
{ {
self endon("disconnect"); self endon("disconnect");
@ -2332,6 +2473,9 @@ bot_listen_to_steps()
} }
} }
/*
*/
bot_uav_think() bot_uav_think()
{ {
self endon( "death" ); self endon( "death" );
@ -2403,6 +2547,9 @@ bot_uav_think()
} }
} }
/*
*/
bot_revenge_think() bot_revenge_think()
{ {
self endon( "death" ); self endon( "death" );
@ -2431,6 +2578,9 @@ bot_revenge_think()
} }
} }
/*
*/
turret_death_monitor(turret) turret_death_monitor(turret)
{ {
self endon ("death"); self endon ("death");
@ -2456,6 +2606,9 @@ turret_death_monitor(turret)
self notify("bad_path"); self notify("bad_path");
} }
/*
*/
bot_turret_attack( enemy ) bot_turret_attack( enemy )
{ {
wait_time = RandomIntRange( 7, 10 ); wait_time = RandomIntRange( 7, 10 );
@ -2478,6 +2631,9 @@ bot_turret_attack( enemy )
} }
} }
/*
*/
bot_turret_think() bot_turret_think()
{ {
self endon( "death" ); self endon( "death" );
@ -2571,6 +2727,9 @@ bot_turret_think()
} }
} }
/*
*/
bot_crate_think() bot_crate_think()
{ {
self endon( "death" ); self endon( "death" );
@ -2682,6 +2841,9 @@ bot_crate_think()
} }
} }
/*
*/
bot_weapon_think() bot_weapon_think()
{ {
self endon("death"); self endon("death");
@ -2782,6 +2944,9 @@ bot_weapon_think()
} }
} }
/*
*/
getRocketAmmo() getRocketAmmo()
{ {
answer = self getLockonAmmo(); answer = self getLockonAmmo();
@ -2795,6 +2960,9 @@ getRocketAmmo()
return answer; return answer;
} }
/*
*/
getLockonAmmo() getLockonAmmo()
{ {
answer = undefined; answer = undefined;
@ -2811,6 +2979,9 @@ getLockonAmmo()
return answer; return answer;
} }
/*
*/
bot_target_vehicle() bot_target_vehicle()
{ {
self endon("disconnect"); self endon("disconnect");
@ -2873,6 +3044,9 @@ bot_target_vehicle()
} }
} }
/*
*/
bot_attack_vehicle( target ) bot_attack_vehicle( target )
{ {
target endon("death"); target endon("death");
@ -2891,6 +3065,9 @@ bot_attack_vehicle( target )
} }
} }
/*
*/
getKillstreakTargetLocation() getKillstreakTargetLocation()
{ {
location = undefined; location = undefined;
@ -2927,6 +3104,9 @@ getKillstreakTargetLocation()
return location; return location;
} }
/*
*/
clear_remote_on_death(isac130) clear_remote_on_death(isac130)
{ {
self endon("disconnect"); self endon("disconnect");
@ -2940,6 +3120,9 @@ clear_remote_on_death(isac130)
self ClearUsingRemote(); self ClearUsingRemote();
} }
/*
*/
isAnyEnemyPlanes() isAnyEnemyPlanes()
{ {
for (i = 0; i < level.harriers.size; i++) for (i = 0; i < level.harriers.size; i++)
@ -2958,6 +3141,9 @@ isAnyEnemyPlanes()
return false; return false;
} }
/*
*/
bot_killstreak_think() bot_killstreak_think()
{ {
self endon("disconnect"); self endon("disconnect");
@ -3259,6 +3445,9 @@ bot_killstreak_think()
} }
} }
/*
*/
bot_dom_spawn_kill_think() bot_dom_spawn_kill_think()
{ {
self endon( "death" ); self endon( "death" );
@ -3312,6 +3501,9 @@ bot_dom_spawn_kill_think()
} }
} }
/*
*/
bot_dom_watch_flags(count, myTeam) bot_dom_watch_flags(count, myTeam)
{ {
self endon( "death" ); self endon( "death" );
@ -3331,6 +3523,9 @@ bot_dom_watch_flags(count, myTeam)
self notify("bad_path"); self notify("bad_path");
} }
/*
*/
bot_dom_def_think() bot_dom_def_think()
{ {
self endon( "death" ); self endon( "death" );
@ -3377,6 +3572,9 @@ bot_dom_def_think()
} }
} }
/*
*/
bot_dom_watch_for_flashing(flag, myTeam) bot_dom_watch_for_flashing(flag, myTeam)
{ {
self endon( "death" ); self endon( "death" );
@ -3399,6 +3597,9 @@ bot_dom_watch_for_flashing(flag, myTeam)
self notify("bad_path"); self notify("bad_path");
} }
/*
*/
bot_dom_cap_think() bot_dom_cap_think()
{ {
self endon( "death" ); self endon( "death" );
@ -3491,6 +3692,9 @@ bot_dom_cap_think()
} }
} }
/*
*/
bot_dom_go_cap_flag(flag, myteam) bot_dom_go_cap_flag(flag, myteam)
{ {
self endon( "death" ); self endon( "death" );
@ -3519,6 +3723,9 @@ bot_dom_go_cap_flag(flag, myteam)
self notify("goal"); self notify("goal");
} }
/*
*/
bot_hq() bot_hq()
{ {
self endon( "death" ); self endon( "death" );
@ -3694,6 +3901,9 @@ bot_hq_watch_flashing(obj, radio)
self notify("bad_path"); self notify("bad_path");
} }
/*
*/
bot_cap() bot_cap()
{ {
self endon( "death" ); self endon( "death" );
@ -3836,6 +4046,9 @@ bot_cap()
} }
} }
/*
*/
bot_cap_get_flag(flag) bot_cap_get_flag(flag)
{ {
origin = flag.curorigin; origin = flag.curorigin;