mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
MORE
This commit is contained in:
parent
ad47246bfa
commit
4174c2bcc5
@ -2,11 +2,17 @@
|
|||||||
#include maps\mp\_utility;
|
#include maps\mp\_utility;
|
||||||
#include maps\mp\gametypes\_hud_util;
|
#include maps\mp\gametypes\_hud_util;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
is_host()
|
is_host()
|
||||||
{
|
{
|
||||||
return (isDefined(self.pers["bot_host"]) && self.pers["bot_host"]);
|
return (isDefined(self.pers["bot_host"]) && self.pers["bot_host"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
doHostCheck()
|
doHostCheck()
|
||||||
{
|
{
|
||||||
self.pers["bot_host"] = false;
|
self.pers["bot_host"] = false;
|
||||||
@ -52,16 +58,25 @@ botAdsAmount()
|
|||||||
return (1 / (self.bot.ads_highest - self.bot.ads_lowest)) * self.bot.ads_tightness + (1 + (self.bot.ads_highest / (self.bot.ads_lowest - self.bot.ads_highest)));
|
return (1 / (self.bot.ads_highest - self.bot.ads_lowest)) * self.bot.ads_tightness + (1 + (self.bot.ads_highest / (self.bot.ads_lowest - self.bot.ads_highest)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
BotPressADS(time)
|
BotPressADS(time)
|
||||||
{
|
{
|
||||||
self maps\mp\bots\_bot_internal::pressAds(time);
|
self maps\mp\bots\_bot_internal::pressAds(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
BotPressAttack(time)
|
BotPressAttack(time)
|
||||||
{
|
{
|
||||||
self maps\mp\bots\_bot_internal::pressFire(time);
|
self maps\mp\bots\_bot_internal::pressFire(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
BotStopMoving(what)
|
BotStopMoving(what)
|
||||||
{
|
{
|
||||||
self.bot.stop_move = what;
|
self.bot.stop_move = what;
|
||||||
@ -70,6 +85,9 @@ BotStopMoving(what)
|
|||||||
self notify("kill_goal");
|
self notify("kill_goal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
getValidTube()
|
getValidTube()
|
||||||
{
|
{
|
||||||
weaps = self getweaponslistall();
|
weaps = self getweaponslistall();
|
||||||
@ -117,6 +135,9 @@ getValidGrenade()
|
|||||||
return random(possibles);
|
return random(possibles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
botChangeWeapon(weapon)// intrestingly, this allows the bots to use pullout and pulldown anims and etc, but bugs out when the bot is frozen while midburst of a firerate limited weapon (m16, only shot one shot, or two shots, even though its a 3 round burst) (never switches until unfrozen)
|
botChangeWeapon(weapon)// intrestingly, this allows the bots to use pullout and pulldown anims and etc, but bugs out when the bot is frozen while midburst of a firerate limited weapon (m16, only shot one shot, or two shots, even though its a 3 round burst) (never switches until unfrozen)
|
||||||
{
|
{
|
||||||
self endon("death");
|
self endon("death");
|
||||||
@ -159,16 +180,25 @@ botChangeWeapon(weapon)// intrestingly, this allows the bots to use pullout and
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
throwBotGrenade(gname, gtime)
|
throwBotGrenade(gname, gtime)
|
||||||
{
|
{
|
||||||
return self maps\mp\bots\_bot_internal::botThrowGrenade(gname, gtime);
|
return self maps\mp\bots\_bot_internal::botThrowGrenade(gname, gtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
botIsClimbing()
|
botIsClimbing()
|
||||||
{
|
{
|
||||||
return self.bot.climbing;
|
return self.bot.climbing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
BotGetTargetRandom()
|
BotGetTargetRandom()
|
||||||
{
|
{
|
||||||
if (!isDefined(self.bot.target))
|
if (!isDefined(self.bot.target))
|
||||||
@ -258,6 +288,9 @@ SetScriptGoal(goal, dist)
|
|||||||
self notify("new_goal");
|
self notify("new_goal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
GetScriptGoal()
|
GetScriptGoal()
|
||||||
{
|
{
|
||||||
return self.bot.script_goal;
|
return self.bot.script_goal;
|
||||||
@ -271,37 +304,58 @@ ClearScriptGoal()
|
|||||||
self SetScriptGoal(undefined, 0);
|
self SetScriptGoal(undefined, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
HasBotJavelinLocation()
|
HasBotJavelinLocation()
|
||||||
{
|
{
|
||||||
return isDefined(self.bot.jav_loc);
|
return isDefined(self.bot.jav_loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
SetScriptAimPos(pos)
|
SetScriptAimPos(pos)
|
||||||
{
|
{
|
||||||
self.bot.script_aimpos = pos;
|
self.bot.script_aimpos = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
ClearScriptAimPos()
|
ClearScriptAimPos()
|
||||||
{
|
{
|
||||||
self SetScriptAimPos(undefined);
|
self SetScriptAimPos(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
GetScriptAimPos()
|
GetScriptAimPos()
|
||||||
{
|
{
|
||||||
return self.bot.script_aimpos;
|
return self.bot.script_aimpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
HasScriptAimPos()
|
HasScriptAimPos()
|
||||||
{
|
{
|
||||||
return isDefined(self GetScriptAimPos());
|
return isDefined(self GetScriptAimPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
SetBotJavelinLocation(loc)
|
SetBotJavelinLocation(loc)
|
||||||
{
|
{
|
||||||
self.bot.jav_loc = loc;
|
self.bot.jav_loc = loc;
|
||||||
self notify("new_enemy");
|
self notify("new_enemy");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
ClearBotJavelinLocation()
|
ClearBotJavelinLocation()
|
||||||
{
|
{
|
||||||
self SetBotJavelinLocation(undefined);
|
self SetBotJavelinLocation(undefined);
|
||||||
@ -351,21 +405,33 @@ HasThreat()
|
|||||||
return (isDefined(self GetThreat()));
|
return (isDefined(self GetThreat()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
IsBotKnifing()
|
IsBotKnifing()
|
||||||
{
|
{
|
||||||
return self.bot.knifing;
|
return self.bot.knifing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
getBotVelocity()
|
getBotVelocity()
|
||||||
{
|
{
|
||||||
return self.bot.velocity;
|
return self.bot.velocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
isWeaponPrimary(weap)
|
isWeaponPrimary(weap)
|
||||||
{
|
{
|
||||||
return (maps\mp\gametypes\_weapons::isPrimaryWeapon(weap) || maps\mp\gametypes\_weapons::isAltModeWeapon(weap));
|
return (maps\mp\gametypes\_weapons::isPrimaryWeapon(weap) || maps\mp\gametypes\_weapons::isAltModeWeapon(weap));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
entIsVehicle(ent)
|
entIsVehicle(ent)
|
||||||
{
|
{
|
||||||
return (ent.classname == "script_vehicle" || ent.model == "vehicle_uav_static_mp" || ent.model == "vehicle_ac130_coop");
|
return (ent.classname == "script_vehicle" || ent.model == "vehicle_uav_static_mp" || ent.model == "vehicle_ac130_coop");
|
||||||
@ -384,31 +450,49 @@ WeaponIsFullAuto(weap)
|
|||||||
return !isDefined(level.bots_nonfullautoguns[weaptoks[0]]);
|
return !isDefined(level.bots_nonfullautoguns[weaptoks[0]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
IsDefusing()
|
IsDefusing()
|
||||||
{
|
{
|
||||||
return (isDefined(self.isDefusing) && self.isDefusing);
|
return (isDefined(self.isDefusing) && self.isDefusing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
isPlanting()
|
isPlanting()
|
||||||
{
|
{
|
||||||
return (isDefined(self.isPlanting) && self.isPlanting);
|
return (isDefined(self.isPlanting) && self.isPlanting);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
inLastStand()
|
inLastStand()
|
||||||
{
|
{
|
||||||
return (isDefined(self.lastStand) && self.lastStand);
|
return (isDefined(self.lastStand) && self.lastStand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
inFinalStand()
|
inFinalStand()
|
||||||
{
|
{
|
||||||
return (isDefined(self.inFinalStand) && self.inFinalStand);
|
return (isDefined(self.inFinalStand) && self.inFinalStand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
isFlagCarrier()
|
isFlagCarrier()
|
||||||
{
|
{
|
||||||
return (isDefined(self.carryFlag) && self.carryFlag);
|
return (isDefined(self.carryFlag) && self.carryFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
isWeaponDroppable(weap)
|
isWeaponDroppable(weap)
|
||||||
{
|
{
|
||||||
return (maps\mp\gametypes\_weapons::mayDropWeapon(weap));
|
return (maps\mp\gametypes\_weapons::mayDropWeapon(weap));
|
||||||
@ -430,6 +514,9 @@ isArtShocked()
|
|||||||
return (isDefined(self.beingArtilleryShellshocked) && self.beingArtilleryShellshocked);
|
return (isDefined(self.beingArtilleryShellshocked) && self.beingArtilleryShellshocked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
getEyeHeight()
|
getEyeHeight()
|
||||||
{
|
{
|
||||||
myEye = self getEye();
|
myEye = self getEye();
|
||||||
@ -437,6 +524,9 @@ getEyeHeight()
|
|||||||
return myEye[2] - self.origin[2];
|
return myEye[2] - self.origin[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
notifyAfterDelay(delay, not)
|
notifyAfterDelay(delay, not)
|
||||||
{
|
{
|
||||||
wait delay;
|
wait delay;
|
||||||
@ -491,6 +581,9 @@ getConeDot(to, from, dir)
|
|||||||
return vectordot(dirToTarget, forward);
|
return vectordot(dirToTarget, forward);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
DistanceSquared2D(to, from)
|
DistanceSquared2D(to, from)
|
||||||
{
|
{
|
||||||
to = (to[0], to[1], 0);
|
to = (to[0], to[1], 0);
|
||||||
@ -529,6 +622,9 @@ RoundUp( floatVal )
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
float(num)
|
float(num)
|
||||||
{
|
{
|
||||||
setdvar("temp_dvar_bot_util", num);
|
setdvar("temp_dvar_bot_util", num);
|
||||||
@ -536,6 +632,9 @@ float(num)
|
|||||||
return GetDvarFloat("temp_dvar_bot_util");
|
return GetDvarFloat("temp_dvar_bot_util");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
tokenizeLine(line, tok)
|
tokenizeLine(line, tok)
|
||||||
{
|
{
|
||||||
tokens = [];
|
tokens = [];
|
||||||
@ -559,11 +658,17 @@ tokenizeLine(line, tok)
|
|||||||
return tokens;
|
return tokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
isStrStart( string1, subStr )
|
isStrStart( string1, subStr )
|
||||||
{
|
{
|
||||||
return ( getSubStr( string1, 0, subStr.size ) == subStr );
|
return ( getSubStr( string1, 0, subStr.size ) == subStr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
parseTokensIntoWaypoint(tokens)
|
parseTokensIntoWaypoint(tokens)
|
||||||
{
|
{
|
||||||
waypoint = spawnStruct();
|
waypoint = spawnStruct();
|
||||||
@ -599,6 +704,9 @@ parseTokensIntoWaypoint(tokens)
|
|||||||
return waypoint;
|
return waypoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
// https://github.com/leiizko/cod4x_lua_plugin/blob/master/LuaScripts/Rotu-R/waypoints.gsc
|
// https://github.com/leiizko/cod4x_lua_plugin/blob/master/LuaScripts/Rotu-R/waypoints.gsc
|
||||||
wpsFromCSV(mapname)
|
wpsFromCSV(mapname)
|
||||||
{
|
{
|
||||||
@ -897,6 +1005,9 @@ load_waypoints()
|
|||||||
level.waypointsJav[level.waypointsJav.size] = level.waypoints[i];
|
level.waypointsJav[level.waypointsJav.size] = level.waypoints[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
getMapName(mapname)
|
getMapName(mapname)
|
||||||
{
|
{
|
||||||
switch(mapname)
|
switch(mapname)
|
||||||
@ -1794,6 +1905,9 @@ random_normal_distribution( mean, std_deviation, lower_bound, upper_bound )
|
|||||||
return( number );
|
return( number );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
onUsePlantObjectFix( player )
|
onUsePlantObjectFix( player )
|
||||||
{
|
{
|
||||||
// planted the bomb
|
// planted the bomb
|
||||||
@ -1831,6 +1945,9 @@ onUsePlantObjectFix( player )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
bombPlantedFix( destroyedObj, player )
|
bombPlantedFix( destroyedObj, player )
|
||||||
{
|
{
|
||||||
maps\mp\gametypes\_gamelogic::pauseTimer();
|
maps\mp\gametypes\_gamelogic::pauseTimer();
|
||||||
@ -1946,6 +2063,9 @@ bombPlantedFix( destroyedObj, player )
|
|||||||
maps\mp\gametypes\sd::sd_endGame( game["attackers"], game["strings"]["target_destroyed"] );
|
maps\mp\gametypes\sd::sd_endGame( game["attackers"], game["strings"]["target_destroyed"] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
botGiveLoadout( team, class, allowCopycat )
|
botGiveLoadout( team, class, allowCopycat )
|
||||||
{
|
{
|
||||||
self takeAllWeapons();
|
self takeAllWeapons();
|
||||||
@ -2177,6 +2297,9 @@ botGiveLoadout( team, class, allowCopycat )
|
|||||||
self notify( "bot_giveLoadout", allowCopycat );
|
self notify( "bot_giveLoadout", allowCopycat );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
botGetPerkUpgrade( perkName )
|
botGetPerkUpgrade( perkName )
|
||||||
{
|
{
|
||||||
perkUpgrade = tablelookup( "mp/perktable.csv", 1, perkName, 8 );
|
perkUpgrade = tablelookup( "mp/perktable.csv", 1, perkName, 8 );
|
||||||
@ -2190,6 +2313,9 @@ botGetPerkUpgrade( perkName )
|
|||||||
return ( perkUpgrade );
|
return ( perkUpgrade );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
botLoadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 )
|
botLoadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 )
|
||||||
{
|
{
|
||||||
loadoutEquipment = maps\mp\perks\_perks::validatePerk( 1, loadoutEquipment );
|
loadoutEquipment = maps\mp\perks\_perks::validatePerk( 1, loadoutEquipment );
|
||||||
@ -2224,6 +2350,9 @@ botLoadoutAllPerks( loadoutEquipment, loadoutPerk1, loadoutPerk2, loadoutPerk3 )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
botPlayerModelForWeapon( weapon, secondary )
|
botPlayerModelForWeapon( weapon, secondary )
|
||||||
{
|
{
|
||||||
team = self.team;
|
team = self.team;
|
||||||
@ -2268,6 +2397,9 @@ botPlayerModelForWeapon( weapon, secondary )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
claymoreDetonationBotFix()
|
claymoreDetonationBotFix()
|
||||||
{
|
{
|
||||||
self endon( "death" );
|
self endon( "death" );
|
||||||
|
@ -4,6 +4,7 @@ unreleased gamemodes
|
|||||||
|
|
||||||
_other:
|
_other:
|
||||||
dvars, loadout, behaviour, menu
|
dvars, loadout, behaviour, menu
|
||||||
|
extendable menu, fun menu
|
||||||
code comments
|
code comments
|
||||||
documentation and tutorials
|
documentation and tutorials
|
||||||
modules (iw4x (http), iw4m1)
|
modules (iw4x (http), iw4m1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user