This commit is contained in:
2023-04-13 17:30:38 +02:00
commit 013c6f3b4d
921 changed files with 337975 additions and 0 deletions

24
shared/ai/aivsaimelee.gsh Normal file
View File

@ -0,0 +1,24 @@

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
///////////////////////////////////////////////////////////////////////////////
//
// Clientfields
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// FX
//
///////////////////////////////////////////////////////////////////////////////

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,243 @@
#using scripts\shared\ai\archetype_human;
#using scripts\shared\ai\systems\ai_interface;
#namespace HumanInterface;
function RegisterHumanInterfaceAttributes()
{
/*
* Name: can_be_meleed
* Summary: Controls whether other AI will choose to melee the human.
* Initial Value: true
* Attribute true: Normal behavior, humans will be meleed when close to their enemy.
* Attribute false: Forces other AI to shoot the AI instead of melee them at
* close distances.
* Example: entity ai::set_behavior_attribute( "can_be_meleed", true );
*/
ai::RegisterMatchedInterface(
"human",
"can_be_meleed",
true,
array( true, false ) );
/*
* Name: can_melee
* Summary: Controls whether the human AI is able to melee their enemies.
* Initial Value: true
* Attribute true: Normal behavior, will melee when close to their enemy.
* Attribute false: Forced to shoot even when they are within melee distance.
* Example: entity ai::set_behavior_attribute( "can_melee", true );
*/
ai::RegisterMatchedInterface(
"human",
"can_melee",
true,
array( true, false ) );
/*
* Name: can_initiateaivsaimelee
* Summary: Controls whether the human AI are able to initiate synced melee with their enemies.
* Initial Value: true
* Attribute true: Normal behavior, will do synced melee when appropriate conditions are met.
* Attribute false: Will never initiate synced melee even if it is possible.
* Example: entity ai::set_behavior_attribute( "can_initiateaivsaimelee", true );
*/
ai::RegisterMatchedInterface(
"human",
"can_initiateaivsaimelee",
true,
array( true, false ) );
/*
* Name: coverIdleOnly
* Summary: Forces humans to only choose the idle behavior when at cover.
* Initial Value: false
* Attribute true : Forces a human to only idle at cover.
* Attribute false : Disables forcing idle.
* Example: entity ai::set_behavior_attribute( "coverIdleOnly", true );
*/
ai::RegisterMatchedInterface(
"human",
"coverIdleOnly",
false,
array( true, false ) );
/*
* Name: cqb
* Summary: Controls whether humans will use their close quarter battle
* animation set. CQB animations are tailored for indoor combat distances.
* NOTE: This is only supported for male human characters.
* Initial Value: false
* Attribute true : Forces a human to use cqb animations.
* Attribute false : Uses the normal animation set.
* Example: entity ai::set_behavior_attribute( "cqb", true );
*/
ai::RegisterMatchedInterface(
"human",
"cqb",
false,
array( true, false ),
&HumanSoldierServerUtils::cqbAttributeCallback );
/*
* Name: forceTacticalWalk
* Summary: Controls whether humans will forcefully tactical walk while moving.
* Initial Value: false
* Attribute true : Forces a human to tactical walk when moving.
* Attribute false : Disables forcing tactical walk.
* Example: entity ai::set_behavior_attribute( "forceTacticalWalk", true );
*/
ai::RegisterMatchedInterface(
"human",
"forceTacticalWalk",
false,
array( true, false ),
&HumanSoldierServerUtils::forceTacticalWalkCallback );
/*
* Name: move_mode
* Summary: Controls how humans choose to move to their goal position.
* Initial Value normal
* Attribute normal: Adheres to normal movement and combat.
* Attribute rambo: Runs to goal position, allowed to shoot at enemies, but doesn't stop and
* fight enemies.
* Example: entity ai::set_behavior_attribute( "move_mode", "rambo" );
*/
ai::RegisterMatchedInterface(
"human",
"move_mode",
"normal",
array( "normal", "rambo" ),
&HumanSoldierServerUtils::moveModeAttributeCallback );
/*
* Name: useAnimationOverride
* Summary: Controls whether humans will use their specific animation set
* This set is meant to be used for level specific animation override
* NOTE: This is only supported for male human characters.
* NOTE: Talk to Sumeet before using this attribute.
* Initial Value: false
* Attribute true : Forces a human to use specific animation set.
* Attribute false : Uses the normal animation set.
* Example: entity ai::set_behavior_attribute( "useAnimationOverride", true );
*/
ai::RegisterMatchedInterface(
"human",
"useAnimationOverride",
false,
array( true, false ),
&HumanSoldierServerUtils::UseAnimationOverrideCallback );
/*
* Name: sprint
* Summary: Controls whether humans will forcefully sprint while moving,
* this prevents shooting while moving.
* Initial Value: false
* Attribute true : Forces a human to sprint when moving.
* Attribute false : Disables forcing sprint.
* Example: entity ai::set_behavior_attribute( "sprint", true );
*/
ai::RegisterMatchedInterface(
"human",
"sprint",
false,
array( true, false ) );
/*
* Name: patrol
* Summary: Controls whether humans will use their patrol walking
* animation set. Patrol walks are meant for non-combat situations.
* NOTE: This is only supported for male human characters.
* Initial Value: false
* Attribute true : Non combat movement uses patrol walk animations.
* Attribute false : Non combat movement uses default animations.
* Example: entity ai::set_behavior_attribute( "patrol", true );
*/
ai::RegisterMatchedInterface(
"human",
"patrol",
false,
array( true, false ) );
/*
* Name: disablearrivals
* Summary: Controls whether humans will use their arrival transitions while moving
* NOTE: This is only supported for male human characters.
* Initial Value: false
* Attribute true : when set to true, AI's will not use arrival transitions.
* Attribute false : AI will use arrival transitions.
* Example: entity ai::set_behavior_attribute( "disablearrivals", true );
*/
ai::RegisterMatchedInterface(
"human",
"disablearrivals",
false,
array( true, false ) );
/*
* Name: disablesprint
* Summary: Controls whether humans will use their sprint locomotion.
* Initial Value: false
* Attribute true : when set to true, AI's will not use sprint locomotion.
* Attribute false : AI will use sprint locomotion when applicable.
* Example: entity ai::set_behavior_attribute( "disablesprint", true );
*/
ai::RegisterMatchedInterface(
"human",
"disablesprint",
false,
array( true, false ) );
/*
* Name: stealth
* Summary: Controls whether humans will use stealth behavior or not.
* Initial Value: false
* Attribute true : Using stealth behavior.
* Attribute false : Not using stealth behavior (default).
* Example: entity ai::set_behavior_attribute( "stealth", true );
*/
ai::RegisterMatchedInterface(
"human",
"stealth",
false,
array( true, false ) );
/*
* Name: vignette_mode
* Summary: Overrides the actor's default settings to handle controlled scripted
* situations. Normal AI in combat should not be placed in a vignette mode.
* Vignette modes change low level attributes on an AI, such as being able
* to push players, ignore avoidance with obstacles, and change steering behaviors.
* Initial Value: off
* Attribute off : Returns the AI to normal settings.
* Attribute slow : Configures the actor to handle slow paced vignettes prioritizing
* smooth movement while attempting to avoid other obstacles.
* Attribute fast : Configures the actor to handle fast paced vignettes prioritizing
* movement, with expectations that other AI will attempt to avoid them.
* Example: entity ai::set_behavior_attribute( "vignette", "slow" );
*/
ai::RegisterMatchedInterface(
"human",
"vignette_mode",
"off",
array( "off", "slow", "fast" ),
&HumanSoldierServerUtils::VignetteModeCallback );
/*
* Name: useGrenades
* Summary: Controls whether humans will use their a grenades.
* NOTE: This is only supported for human archetypes.
* Initial Value: true
* Attribute true : when set to true, AI's will throw grenades at enemies.
* Attribute false : AI will not throw grendades at enemies.
* Example: entity ai::set_behavior_attribute( "useGrenades", false );
*/
ai::RegisterMatchedInterface(
"human",
"useGrenades",
true,
array( true, false ) );
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
// Number of bullets it will take to make the AI stagger when their riotshield is shot
// Amount of time that must pass before the flinch count is reset

View File

@ -0,0 +1,124 @@
#using scripts\shared\ai\archetype_human_riotshield;
#using scripts\shared\ai\systems\ai_interface;
#namespace HumanRiotshieldInterface;
function RegisterHumanRiotshieldInterfaceAttributes()
{
/*
* Name: can_be_meleed
* Summary: Controls whether other AI will choose to melee the human.
* Initial Value: true
* Attribute true: Normal behavior, humans will be meleed when close to their enemy.
* Attribute false: Forces other AI to shoot the AI instead of melee them at
* close distances.
* Example: entity ai::set_behavior_attribute( "can_be_meleed", true );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"can_be_meleed",
true,
array( true, false ) );
/*
* Name: can_melee
* Summary: Controls whether the human AI is able to melee their enemies.
* Initial Value: true
* Attribute true: Normal behavior, will melee when close to their enemy.
* Attribute false: Forced to shoot even when they are within melee distance.
* Example: entity ai::set_behavior_attribute( "can_melee", true );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"can_melee",
true,
array( true, false ) );
/*
* Name: can_initiateaivsaimelee
* Summary: Controls whether the human AI are able to initiate synced melee with their enemies.
* Initial Value: true
* Attribute true: Normal behavior, will do synced melee when appropriate conditions are met.
* Attribute false: Will never initiate synced melee even if it is possible.
* Example: entity ai::set_behavior_attribute( "can_initiateaivsaimelee", true );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"can_initiateaivsaimelee",
true,
array( true, false ) );
/*
* Name: coverIdleOnly
* Summary: Forces humans to only choose the idle behavior when at cover.
* Initial Value: false
* Attribute true : Forces a human to only idle at cover.
* Attribute false : Disables forcing idle.
* Example: entity ai::set_behavior_attribute( "coverIdleOnly", true );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"coverIdleOnly",
false,
array( true, false ) );
/*
* Name: phalanx
* Summary: Controls whether the riotshield is in a phalanx formation or not.
* This value should be left to the phalanx system to manipulate.
* Initial Value: false
* Attribute true: Riotshield is in a phalanx formation.
* Attribute false: Riotshield is not in a phalanx formation.
* Example: entity ai::set_behavior_attribute( "phalanx", true );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"phalanx",
false,
array( true, false ) );
/*
* Name: phalanx_force_stance
* Summary: Forces a riotshield in a phalanx formation to a specific stance when stationary.
* This value should be left to the phalanx system to manipulate.
* Initial Value: normal
* Attribute normal: Uses the default stance.
* Attribute stand: Forces the riotshield to stand.
* Attribute crouch: Forces the riotshield to crouch.
* Example: entity ai::set_behavior_attribute( "phalanx_force_stance", "stand" );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"phalanx_force_stance",
"normal",
array( "normal", "stand", "crouch" ) );
/*
* Name: sprint
* Summary: Controls whether humans will forcefully sprint while moving,
* this prevents shooting while moving.
* Initial Value: false
* Attribute true : Forces a human to sprint when moving.
* Attribute false : Disables forcing sprint.
* Example: entity ai::set_behavior_attribute( "sprint", true );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"sprint",
false,
array( true, false ) );
/*
* Name: attack_mode
* Summary: Controls how human riot shields attack their enemies.
* Initial Value: normal
* Attribute normal: Adheres to normal combat.
* Attribute unarmed: Can't shoot at enemies, try to melee enemies within goal.
* Example: entity ai::set_behavior_attribute( "attack_mode", "unarmed" );"
*/
ai::RegisterMatchedInterface(
"human_riotshield",
"attack_mode",
"normal",
array( "normal", "unarmed" ) );
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,81 @@
#using scripts\shared\ai\archetype_human_rpg;
#using scripts\shared\ai\systems\ai_interface;
#namespace HumanRpgInterface;
function RegisterHumanRpgInterfaceAttributes()
{
/*
* Name: can_be_meleed
* Summary: Controls whether other AI will choose to melee the human.
* Initial Value: true
* Attribute true: Normal behavior, humans will be meleed when close to their enemy.
* Attribute false: Forces other AI to shoot the AI instead of melee them at
* close distances.
* Example: entity ai::set_behavior_attribute( "can_be_meleed", true );"
*/
ai::RegisterMatchedInterface(
"human_rpg",
"can_be_meleed",
true,
array( true, false ) );
/*
* Name: can_melee
* Summary: Controls whether the human AI is able to melee their enemies.
* Initial Value: true
* Attribute true: Normal behavior, will melee when close to their enemy.
* Attribute false: Forced to shoot even when they are within melee distance.
* Example: entity ai::set_behavior_attribute( "can_melee", true );"
*/
ai::RegisterMatchedInterface(
"human_rpg",
"can_melee",
true,
array( true, false ) );
/*
* Name: coverIdleOnly
* Summary: Forces humans to only choose the idle behavior when at cover.
* Initial Value: false
* Attribute true : Forces a human to only idle at cover.
* Attribute false : Disables forcing idle.
* Example: entity ai::set_behavior_attribute( "coverIdleOnly", true );"
*/
ai::RegisterMatchedInterface(
"human_rpg",
"coverIdleOnly",
false,
array( true, false ) );
/*
* Name: sprint
* Summary: Controls whether humans will forcefully sprint while moving,
* this prevents shooting while moving.
* Initial Value: false
* Attribute true : Forces a human to sprint when moving.
* Attribute false : Disables forcing sprint.
* Example: entity ai::set_behavior_attribute( "sprint", true );"
*/
ai::RegisterMatchedInterface(
"human_rpg",
"sprint",
false,
array( true, false ) );
/*
* Name: patrol
* Summary: Controls whether humans will use their patrol walking
* animation set. Patrol walks are meant for non-combat situations.
* NOTE: This is only supported for male human characters.
* Initial Value: false
* Attribute true : Non combat movement uses patrol walk animations.
* Attribute false : Non combat movement uses default animations.
* Example: entity ai::set_behavior_attribute( "patrol", true );"
*/
ai::RegisterMatchedInterface(
"human_rpg",
"patrol",
false,
array( true, false ) );
}

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,49 @@
#using scripts\shared\ai\zombie;
#using scripts\shared\ai\systems\ai_interface;
#namespace MannequinInterface;
function RegisterMannequinInterfaceAttributes()
{
/*
* Name: can_juke
* Summary: Controls whether the zombie can juke.
* Initial Value: true
* Attribute true: Normal behavior, zombie will occasionally juke left or right.
* Attribute false: Disables zombie's ability to juke.
* Example: entity ai::set_behavior_attribute( "can_juke", true );"
*/
ai::RegisterMatchedInterface(
"mannequin",
"can_juke",
false,
array( true, false ) );
/*
* Name: suicidal_behavior
* Summary: Controls whether the zombie is going to act as suicidal.
* Initial Value: false
* Attribute true: Will enable the suicidal behavior.
* Attribute false: Disables suicidal behavior.
* Example: entity ai::set_behavior_attribute( "suicidal_behavior", true );"
*/
ai::RegisterMatchedInterface(
"mannequin",
"suicidal_behavior",
false,
array( true, false ) );
/*
* Name: spark_behavior
* Summary: Controls whether the zombie is going to act as spark zombie.
* Initial Value: false
* Attribute true: Will enable the spark behavior.
* Attribute false: Disables spark behavior.
* Example: entity ai::set_behavior_attribute( "spark_behavior", true );"
*/
ai::RegisterMatchedInterface(
"mannequin",
"spark_behavior",
false,
array( true, false ) );
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,214 @@
///////////////////////////////////////////////////////////////////////////////
//
// Tweakables
//
///////////////////////////////////////////////////////////////////////////////
// Chance that a destructible piece will gib off when the robot is
// killed, regardless of hitlocation, this applies to all pieces. (0, 1)
// Maximum number of destructible pieces that will randomly gib off
// when the robot is killed.
// Percentage of health before robot arms and head can be gibbed off.
// Valid float range (0, 1)
// Chance the robot's head will gib off when killed with a headshot.
// Valid float range (0, 1)
// Chance the robot's head will gib off when damaged with an explosion.
// Valid float range (0, 1)
// Chance the robot's head will gib off when dealth a fatal blow.
// Percentage of health before the robots leg can be gibbed off. (0, 1)
// Chance the robot's legs will gib off when killed with a leg shot.
// Valid float range (0, 1)
// Chance the robot's legs will gib off randomly when killed (0, 1)
// Chance the robot's legs will gib off when killed with an explosion.
// Valid float range (0, 1)
// Chance the robot's limb will gib off when killed with an explosion. (0, 1)
// Chance the robot's limb will gib off when killed with a limb shot. (0, 10
// Chance the robot will choose a cover position over an exposed position.
// Minimum amount of time in seconds robots will step out of cover for.
// Maximum amount of time in seconds robots will step out of cover for.
// Damage modifier when robots are shot in the head.
// Damage modifier when robots are shot in the back.
// Time in milliseconds robots will remain exposed after being shot when popping out of cover.
// Robot must be within this distance to their enemy to cause them to juke.
// Robot must be within this distance to their enemy to preemptive juke
// Robot must be within this distance to their attacker to become a crawler.
// Robots must be at least this distance away from their enemy to become a rusher.
// Robots within this distance may turn into rushers, if their fellow robot dies.
// Robots' whose enemy is further than this distance will not be considered for rushing.
// Robots will walk to positions even within sprint range if the path is shorter than this.
// Robots will start to super sprint outside this distance to their target.
// Amount of time robots will stay inactive after being damaged by an emp.
///////////////////////////////////////////////////////////////////////////////
//
// Robot Grunt Defines
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Clientfields
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// FX
//
///////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,397 @@
#using scripts\shared\ai\archetype_robot;
#using scripts\shared\ai\systems\ai_interface;
#namespace RobotInterface;
function RegisterRobotInterfaceAttributes()
{
/*
* Name: can_be_meleed
* Summary: Controls whether other AI will choose to melee the robot.
* Initial Value: true
* Attribute true: Normal behavior, robots will be meleed when close to their enemy.
* Attribute false: Forces other AI to shoot the robot instead of melee them at
* close distances.
* Example: entity ai::set_behavior_attribute( "can_be_meleed", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"can_be_meleed",
true,
array( true, false ) );
/*
* Name: can_become_crawler
* Summary: Controls whether the robot can become a crawler robot. This does not prevent a
* robot from having their legs gibbed upon death.
* Initial Value: true
* Attribute true: Normal behavior, robot can become a crawler.
* Attribute false: Robots will not become a crawler.
* Example: entity ai::set_behavior_attribute( "can_become_crawler", false );"
*/
ai::RegisterMatchedInterface(
"robot",
"can_become_crawler",
true,
array( true, false ) );
/*
* Name: can_become_rusher
* Summary: Controls whether the robot can become a rusher, even when told to become a rusher.
* Initial Value: true
* Attribute true: Normal behavior, robot can become a rusher.
* Attribute false: Robots will not become a rusher, even when told to become a rusher.
* Example: entity ai::set_behavior_attribute( "can_become_rusher", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"can_become_rusher",
true,
array( true, false ) );
/*
* Name: can_gib
* Summary: Controls whether the robot can gib at all. This should not be turned off in normal gameplay and is needed for cybercom.
* Initial Value: true
* Attribute true: Normal behavior, robot can gib.
* Attribute false: Robots will not gib, unless gibbing is explicitly called on them.
* Example: entity ai::set_behavior_attribute( "can_gib", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"can_gib",
true,
array( true, false ) );
/*
* Name: can_melee
* Summary: Controls whether the robot is able to melee their enemies. This only pertains
* to normal shooting robots.
* Initial Value: true
* Attribute true: Normal behavior, robot will melee when close to their enemy.
* Attribute false: Forces a robot to shoot even when they are within melee distance.
* Example: entity ai::set_behavior_attribute( "can_melee", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"can_melee",
true,
array( true, false ) );
/*
* Name: can_initiateaivsaimelee
* Summary: Controls whether the robot AI are able to initiate synced melee with their enemies.
* Initial Value: true
* Attribute true: Normal behavior, will do synced melee when appropriate conditions are met.
* Attribute false: Will never initiate synced melee even if it is possible.
* Example: entity ai::set_behavior_attribute( "can_initiateaivsaimelee", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"can_initiateaivsaimelee",
true,
array( true, false ) );
/*
* Name: disablesprint
* Summary: Controls whether humans will use their sprint locomotion.
* Initial Value: false
* Attribute true : when set to true, AI's will not use sprint locomotion.
* Attribute false : AI will use sprint locomotion when applicable.
* Example: entity ai::set_behavior_attribute( "disablesprint", true );
*/
ai::RegisterMatchedInterface(
"robot",
"disablesprint",
false,
array( true, false ) );
/*
* Name: escort_position
* Summary: If the robot is in the escort move_mode, this position is used to determine where
* the robot should stay close to.
* Initial Value: undefined
* Attribute: Vector position.
* Example: entity ai::set_behavior_attribute( "escort_position", player.origin );"
*/
ai::RegisterVectorInterface(
"robot",
"escort_position" );
/*
* Name: force_cover
* Summary: Controls whether robots will forcefully go to cover positions instead
* of a mixture of cover and exposed positions.
* Initial Value: false
* Attribute true: Forces a robot to move to cover positions.
* Attribute false: Disables forcing cover positions.
* Example: entity ai::set_behavior_attribute( "force_cover", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"force_cover",
false,
array( true, false ) );
/*
* Name: force_crawler
* Summary: Converts a robot into a crawler, either by gibbing their legs immediately
* or making their legs disappear.
* Initial Value: normal
* Attribute normal: A normal walking robot, crawlers cannot be turned back into normal
* robots.
* Attribute gib_legs: Immediately gibs the legs of a robot creating a crawler.
* Attribute remove_legs: Makes the legs of the robot disappear, useful for spawning.
* Example: entity ai::set_behavior_attribute( "force_crawler", "remove_legs" );"
*/
ai::RegisterMatchedInterface(
"robot",
"force_crawler",
"normal",
array( "normal", "gib_legs", "remove_legs" ),
&RobotSoldierServerUtils::robotForceCrawler );
/*
* Name: move_mode
* Summary: Controls how robots choose to move to their goal position.
* Initial Value normal
* Attribute escort: Forces a robot to move toward their designated escort_position.
* Attribute guard: Randomly chooses positions to move to within the current goal radius.
* Attribute normal: Adheres to normal movement and combat.
* Attribute marching: Walks using a slow forward moving march. Marching robots can only
* shoot targets that are facing in front of them.
* Attribute rambo: Runs to goal position, allowed to shoot at enemies, but doesn't stop and
* fight enemies.
* Attribute rusher: Moves toward the player instead of staying at cover or in the open.
* Attribute squadmember: Indicates that the robot belongs to a squad.
* Example: entity ai::set_behavior_attribute( "move_mode", "rambo" );"
*/
ai::RegisterMatchedInterface(
"robot",
"move_mode",
"normal",
array( "escort", "guard", "normal", "marching", "rambo", "rusher", "squadmember" ),
&RobotSoldierServerUtils::robotMoveModeAttributeCallback );
/*
* Name: phalanx
* Summary: Controls whether the robot is in a phalanx formation or not.
* This value should be left to the robot_phalanx system to manipulate.
* Initial Value: false
* Attribute true: Robot is in a phalanx formation.
* Attribute false: Robot is not in a phalanx formation.
* Example: entity ai::set_behavior_attribute( "phalanx", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"phalanx",
false,
array( true, false ) );
/*
* Name: phalanx_force_stance
* Summary: Forces a robot in a phalanx formation to a specific stance when stationary.
* This value should be left to the robot_phalanx system to manipulate.
* Initial Value: normal
* Attribute normal: Uses the default stance.
* Attribute stand: Forces the robot to stand.
* Attribute crouch: Forces the robot to crouch.
* Example: entity ai::set_behavior_attribute( "phalanx_force_stance", "stand" );"
*/
ai::RegisterMatchedInterface(
"robot",
"phalanx_force_stance",
"normal",
array( "normal", "stand", "crouch" ) );
/*
* Name: robot_lights
* Summary: Enables or disable the lights attached to the robot.
* Initial Value: ROBOT_LIGHTS_ON
* Attribute ROBOT_LIGHTS_ON: Enable lights.
* Attribute ROBOT_LIGHTS_FLICKER: Enable flickering lights.
* Attribute ROBOT_LIGHTS_OFF: Disable lights.
* Attribute ROBOT_LIGHTS_DEATH: Play death fx.
* * Attribute ROBOT_LIGHTS_OFF: Enable hacked lights.
* Example: entity ai::set_behavior_attribute( "robot_lights", ROBOT_LIGHTS_ON );"
*/
ai::RegisterMatchedInterface(
"robot",
"robot_lights",
0,
array( 0, 1, 2, 3, 4 ),
&RobotSoldierServerUtils::robotLights );
/*
* Name: robot_mini_raps
* Summary: Equips a robot with a mini raps they can deploy like a grenade.
* Initial Value: false
* Attribute true: Gives a mini raps to the robot.
* Attribute false: Takes away the mini raps from the robot.
* Example: entity ai::set_behavior_attribute( "robot_mini_raps", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"robot_mini_raps",
false,
array( true, false ),
&RobotSoldierServerUtils::robotEquipMiniRaps );
/*
* Name: rogue_allow_predestruct
* Summary: If true, allows robots forced into level_2 or level_3 to spawn with destructible pieces missing.
* Initial Value: true
* Attribute true: Spawns rogue controlled robot predestructed.
* Attribute false: Spawn rogue controlled robot without predestructing.
* Example: entity ai::set_behavior_attribute( "rogue_allow_predestruct", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"rogue_allow_predestruct",
true,
array( true, false ) );
/*
* Name: rogue_allow_pregib
* Summary: If true, allows robots forced into level_2 or level_3 to spawn with limbs missing.
* Initial Value: true
* Attribute true: Spawns rogue controlled robot pregibbed.
* Attribute false: Spawn rogue controlled robot without pregibbing.
* Example: entity ai::set_behavior_attribute( "rogue_allow_pregib", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"rogue_allow_pregib",
true,
array( true, false ) );
/*
* Name: rogue_control
* Summary: Controls whether or not a robot is rogue controlled. Note that
* setting a level lower than the current level has no effect and will be disregarded.
* Initial Value: level_0
* Attribute level_0: A normal robot, not rogue controlled.
* Attribute level_1: Swaps the robot to team three but still lets them shoot like a normal robot.
* Attribute forced_level_1: Immediately moves to level_1 without playing an animation.
* Attribute level_2: Swaps the robot to team three and makes them melee only.
* Attribute forced_level_2: Immediately moves to level_2 without playing an animation.
* Attribute level_3: Swaps the robot to team three, makes them melee only, and they explode when
* within reach of their enemy.
* Attribute forced_level_3: Immediately moves to level_3 without playing an animation.
* Example: entity ai::set_behavior_attribute( "rogue_control", "forced_level_1" );
*/
ai::RegisterMatchedInterface(
"robot",
"rogue_control",
"level_0",
array( "level_0", "level_1", "forced_level_1", "level_2", "forced_level_2", "level_3", "forced_level_3" ),
&RobotSoldierServerUtils::rogueControlAttributeCallback );
/*
* Name: rogue_control_force_goal
* Summary: Forces a rogue controlled robot that is in level_2 or level_3 to move to a position
* if the robot is currently unable to path to the player. Once the robot can path to the
* player, this value will be ignored and reset to undefined.
* Initial Value: undefined
* Example: entity ai::set_behavior_attribute( "rogue_control_force_goal", (10, 100, 0) );
*/
ai::RegisterVectorInterface(
"robot",
"rogue_control_force_goal",
undefined,
&RobotSoldierServerUtils::rogueControlForceGoalAttributeCallback );
/*
* Name: rogue_control_speed
* Summary: Controls how fast a rogue controlled robot moves at.
* Initial Value: sprint
* Attribute walk: Slow speed walk.
* Attribute run: Medium speed walk.
* Attribute sprint: Fast sprint.
* Example: entity ai::set_behavior_attribute( "rogue_control_speed", "walk" );"
*/
ai::RegisterMatchedInterface(
"robot",
"rogue_control_speed",
"sprint",
array( "walk", "run", "sprint" ),
&RobotSoldierServerUtils::rogueControlSpeedAttributeCallback );
/*
* Name: rogue_force_explosion
* Summary: Causes a level 3 robot to forcefully explode regardless of range to
* their enemy.
* Initial Value: false
* Attribute true: Forces a level 3robot to explode.
* Attribute false: Level 3 robot will only explode within range of their enemy.
* Example: entity ai::set_behavior_attribute( "rogue_force_explosion", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"rogue_force_explosion",
false,
array( true, false ) );
/*
* Name: shutdown
* Summary: When set to true the robot will shutdown, as if they were hit
* by an emp.
* Initial Value: false
* Attribute true: Forces a robot to shutdown.
* Attribute false: Returns the robot to normal.
* Example: entity ai::set_behavior_attribute( "shutdown", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"shutdown",
false,
array( true, false ) );
/*
* Name: sprint
* Summary: Controls whether robots will forcefully sprint while moving,
* this prevents shooting while moving.
* Initial Value: false
* Attribute true: Forces a robot to sprint when moving.
* Attribute false: Disables forcing sprint.
* Example: entity ai::set_behavior_attribute( "sprint", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"sprint",
false,
array( true, false ) );
/*
* Name: supports_super_sprint
* Summary: Allows the robot to use super sprint.
* NOTE: This is an MP only feature of robots and should not be used in other modes.
* Initial Value: false
* Attribute true: Allows the robot to super sprint.
* Attribute false: Disables the use of super sprint.
* Example: entity ai::set_behavior_attribute( "supports_super_sprint", true );"
*/
ai::RegisterMatchedInterface(
"robot",
"supports_super_sprint",
false,
array( true, false ) );
/*
* Name: traversals
* Summary: Controls how robots handle traversals, either through animations
* or procedurally calculating a trajectory.
* Initial Value: normal
* Attribute normal: Animated traverals, only normal AI traverals and custom traverals.
* Attribute procedural: Procedurally created trajectory, supports nearly any possible traveral.
* Example: entity ai::set_behavior_attribute( "traversals", "normal" );"
*/
ai::RegisterMatchedInterface(
"robot",
"traversals",
"normal",
array( "normal", "procedural" ),
&RobotSoldierServerUtils::robotTraversalAttributeCallback );
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
#using_animtree( "generic" );
function autoexec init()
{
// make sure these animations get registered on the client side
dummyVar = %faces;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,227 @@
///////////////////////////////////////////////////////////////////////////////
//
// THRASHER TUNABLES
//
///////////////////////////////////////////////////////////////////////////////
// Initial thrasher health, NOT USED IN ZOMBIES
// Total health is based on level.zombie_health multiplied by this multiplier, increases per round
// Initial pustule health, NOT USED IN ZOMBIES
// Total pustule health is based on level.zombie_health multiplied by this multiplier, increases per round
// Initial head health
// Additional health added when enraged
// Amount of rage added when hit in a particular location
// Amount of rage added per second
// Additional rage added on top "THRASHER_RAGE_AUTO" per second multiplied by current level
// Amount of rage added when performing behavior
// Amount of rage before pushing the thrasher into berserk mode
// How often a thrasher can consume a zombie
// How many times a thrasher can consume a zombie
// How often a thrasher can teleport to close the distance in milliseconds
// How close a thrasher can teleport to another thrasher's position
// How far a thrasher will consider a downed player to consume
// How long stuns lasts in milliseconds
// How much normal damage before the thrasher is stunned
// How long the thrasher stays invulnerable after becoming enraged
// Distance from enemy before the thrasher will teleport
// How long the thrasher's spore inflate FX will play for.
// How long the spore cloud released from a popped pustule lasts
// How far away from the center of a spore cloud zombies can be affected
// Maximum number of zombies a single spore cloud can convert to thrashers
// Maximum number of zombies that can be converted per round into thrashers
// Chance a single zombie will be converted into a thrasher (0, 1)
// How often all zombies within a spore cloud will be tested to turn into a thrasher
// How long a player must be in laststand before being able to be eatten
// How long of a time must pass before a new thrasher can consume a player that was just freed from a thrasher.
///////////////////////////////////////////////////////////////////////////////
//
// THRASHER DEFINES
//
///////////////////////////////////////////////////////////////////////////////
// Melee
// Consume
// Consume Zombie
// Navmesh
// Spores
// Thrasher First Person Mouth
// 2 bits per player
// Berserk Mode
// Spikes
// FX
// Head Damage
// Teleport

View File

@ -0,0 +1,42 @@
#using scripts\shared\ai\archetype_thrasher;
#using scripts\shared\ai\systems\ai_interface;
#namespace ThrasherInterface;
function RegisterThrasherInterfaceAttributes()
{
/*
* Name: stunned
* Summary: Controls whether the thrasher AI is stunned.
* Initial Value: false
* Attribute true: Thrasher is stunned.
* Attribute false: Normal thrasher behaviors.
* Example: entity ai::set_behavior_attribute( "thrasher", true );"
*/
ai::RegisterMatchedInterface(
"thrasher",
"stunned",
false,
array( true, false ) );
ai::RegisterMatchedInterface(
"thrasher",
"move_mode",
"normal",
array( "normal", "friendly" ),
&ThrasherServerUtils::thrasherMoveModeAttributeCallback );
/*
* Name: use_attackable
* Summary: Controls whether the thrasher destroys attackable objects.
* Initial Value: false
* Attribute true: Will enable the attackable behavior.
* Attribute false: Disables attackable behavior.
* Example: entity ai::set_behavior_attribute( "use_attackable", true );"
*/
ai::RegisterMatchedInterface(
"thrasher",
"use_attackable",
false,
array( true, false ) );
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,84 @@
#using scripts\shared\ai\warlord;
#using scripts\shared\ai\systems\ai_interface;
#namespace WarlordInterface;
function RegisterWarlordInterfaceAttributes()
{
/*
* Name: can_be_meleed
* Summary: Controls whether other AI will choose to melee the warlord.
* Initial Value: true
* Attribute true: Normal behavior, warlord will be meleed when close to their enemy.
* Attribute false: Forces other AI to shoot the warlord instead of melee it at close distances.
* Example: entity ai::set_behavior_attribute( "can_be_meleed", true );"
*/
ai::RegisterMatchedInterface(
"warlord",
"can_be_meleed",
false,
array( true, false ) );
}
/*
* Name: AddPreferedPoint
* Summary: Adds a prefered go to location that the warlord will be inclined to go to every now and then.
* The warlord will choose the location only if it is inside the goal bounadries.
* Multiple points can be added.
* Mandatory Arg - self : warlord entity
* Mandatory Arg - position : prefered position.
* Optional Arg - min_duration/max_duration Range in milliseconds where the warlord should hold that position if he chooses it
* Optional Arg - position name
* Example: entity AddPreferedPoint(interesting_node.origin, 10000, 15000);
*/
function AddPreferedPoint(position, min_duration, max_duration, name)
{
WarlordServerUtils::AddPreferedPoint(self, position, min_duration, max_duration, name);
}
/*
* Name: DeletePreferedPoint
* Summary: Deletes a specific preferred point.
* Mandatory Arg - self : warlord entity.
* Mandatory Arg - name : Name of the prefered point passed by AddPreferedPoint function.
* Return Arg : True is found a point and deleted it. False if it didn't find any points.
* Example: entity DeletePreferedPoint( "TruckPreferedPoint1" );
*/
function DeletePreferedPoint( name )
{
WarlordServerUtils::DeletePreferedPoint(self, name);
}
/*
* Name: ClearAllPreferedPoints
* Summary: Clears all Warlord prefered nodes.
* Mandatory Arg - self : warlord entity
* Example: entity ClearAllPreferedPoints();
*/
function ClearAllPreferedPoints()
{
WarlordServerUtils::ClearAllPreferedPoints(self);
}
/*
* Name: ClearPreferedPointsOutsideGoal
* Summary: Clears all Warlord prefered nodes which are outside the current Goal
* Mandatory Arg - self : warlord entity
* Example: entity ClearAllPreferedPoints();
*/
function ClearPreferedPointsOutsideGoal()
{
WarlordServerUtils::ClearPreferedPointsOutsideGoal(self);
}
/*
* Name: SetWarlordAggressiveMode
* Summary: Instruct the Warlord to be more careful about choosing position that can target the LastSeenEnemy and to make him prefer close encounters. Recommended for indoor areas.
* Recommended to not be set if the fighting are is outdoor.
* Mandatory Arg - self : warlord entity
* Example: entity SetWarlordAggressiveMode(true);
*/
function SetWarlordAggressiveMode( b_aggressive_mode )
{
WarlordServerUtils::SetWarlordAggressiveMode(self);
}

View File

@ -0,0 +1,47 @@
#using scripts\shared\ai\behavior_zombie_dog;
#using scripts\shared\ai\systems\ai_interface;
#namespace ZombieDogInterface;
function RegisterZombieDogInterfaceAttributes()
{
/*
* Name: gravity
* Summary: Enables or disables low gravity animations for the zombie dog.
* Initial Value: normal
* Attribute normal: Normal animations.
* Attribute low: Low gravity animations.
* Example: entity ai::set_behavior_attribute( "gravity", "low" );
*/
ai::RegisterMatchedInterface(
"zombie_dog",
"gravity",
"normal",
array( "low", "normal" ),
&ZombieDogBehavior::zombieDogGravity );
/*
* Name: min_run_dist
* Summary: The minimum distance at which a zombie dog will decide to start running towards its target.
* Initial Value: 500
* Example: entity ai::set_behavior_attribute( "min_run_dist", 500 );
*/
ai::RegisterMatchedInterface(
"zombie_dog",
"min_run_dist",
500 );
/*
* Name: sprint
* Summary: If this is set to true, the zombie dog will sprint towards its target even without LOS.
* Initial Value: false
* Example: entity ai::set_behavior_attribute( "sprint", true );
*/
ai::RegisterMatchedInterface(
"zombie_dog",
"sprint",
false,
array( true, false ) );
}

View File

@ -0,0 +1,63 @@
#using scripts\shared\ai\zombie;
#using scripts\shared\ai\systems\ai_interface;
#namespace ZombieInterface;
function RegisterZombieInterfaceAttributes()
{
/*
* Name: can_juke
* Summary: Controls whether the zombie can juke.
* Initial Value: true
* Attribute true: Normal behavior, zombie will occasionally juke left or right.
* Attribute false: Disables zombie's ability to juke.
* Example: entity ai::set_behavior_attribute( "can_juke", true );"
*/
ai::RegisterMatchedInterface(
"zombie",
"can_juke",
false,
array( true, false ) );
/*
* Name: suicidal_behavior
* Summary: Controls whether the zombie is going to act as suicidal.
* Initial Value: false
* Attribute true: Will enable the suicidal behavior.
* Attribute false: Disables suicidal behavior.
* Example: entity ai::set_behavior_attribute( "suicidal_behavior", true );"
*/
ai::RegisterMatchedInterface(
"zombie",
"suicidal_behavior",
false,
array( true, false ) );
/*
* Name: spark_behavior
* Summary: Controls whether the zombie is going to act as spark zombie.
* Initial Value: false
* Attribute true: Will enable the spark behavior.
* Attribute false: Disables spark behavior.
* Example: entity ai::set_behavior_attribute( "spark_behavior", true );"
*/
ai::RegisterMatchedInterface(
"zombie",
"spark_behavior",
false,
array( true, false ) );
/*
* Name: use_attackable
* Summary: Controls whether the zombie destroys attackable objects.
* Initial Value: false
* Attribute true: Will enable the attackable behavior.
* Attribute false: Disables attackable behavior.
* Example: entity ai::set_behavior_attribute( "use_attackable", true );"
*/
ai::RegisterMatchedInterface(
"zombie",
"use_attackable",
false,
array( true, false ) );
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

550
shared/ai/margwa.csc Normal file

File diff suppressed because one or more lines are too long

1589
shared/ai/margwa.gsc Normal file

File diff suppressed because one or more lines are too long

202
shared/ai/margwa.gsh Normal file
View File

@ -0,0 +1,202 @@
///////////////////////////////////////////////////////////////////////////////
//
// Margwa Defines
//
///////////////////////////////////////////////////////////////////////////////
// bones used for precision damage
// Mouth timing
// Melee ranges
// Smash attack
// Riotshield
// Mavnesh
// FX
///////////////////////////////////////////////////////////////////////////////
//
// Clientfields
//
///////////////////////////////////////////////////////////////////////////////

288
shared/ai/mechz.csc Normal file

File diff suppressed because one or more lines are too long

1711
shared/ai/mechz.gsc Normal file

File diff suppressed because one or more lines are too long

162
shared/ai/mechz.gsh Normal file
View File

@ -0,0 +1,162 @@
///////////////////////////////////////////////////////////////////////////////
//
// Mechz Defines
//
///////////////////////////////////////////////////////////////////////////////
// Melee ranges
// Mavnesh
// Models
// Tags
// FX
// Face anims
// Grenade
// Flamethrower
// Aiming
// Damage
// Detachable Part Health
// Berserk
// Stun
// React

566
shared/ai/phalanx.gsc Normal file

File diff suppressed because one or more lines are too long

138
shared/ai/phalanx.gsh Normal file
View File

@ -0,0 +1,138 @@
///////////////////////////////////////////////////////////////////////////////
//
// Formations
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Phalanx Tiers
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Formation Positions
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Phalanx Defines
//
///////////////////////////////////////////////////////////////////////////////

538
shared/ai/robot_phalanx.gsc Normal file

File diff suppressed because one or more lines are too long

122
shared/ai/robot_phalanx.gsh Normal file
View File

@ -0,0 +1,122 @@
///////////////////////////////////////////////////////////////////////////////
//
// Formations
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Phalanx Tiers
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Formation Positions
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Phalanx Defines
//
///////////////////////////////////////////////////////////////////////////////

71
shared/ai/skeleton.csc Normal file

File diff suppressed because one or more lines are too long

635
shared/ai/skeleton.gsc Normal file

File diff suppressed because one or more lines are too long

30
shared/ai/skeleton.gsh Normal file
View File

@ -0,0 +1,30 @@
// Melee ranges and timers
// Vision ranges
// used for getting points on the navmesh
///////////////////////////////////////////////////////////////////////////////
//
// Clientfields
//
///////////////////////////////////////////////////////////////////////////////

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,250 @@
function autoexec main()
{
/#
level.__ai_debugInterface = GetDvarInt( "ai_debugInterface" );
#/
}
function private _CheckValue( archetype, attributeName, value )
{
/#
attribute = level.__ai_interface[ archetype ][ attributeName ];
switch ( attribute[ "type" ] )
{
case "_interface_match":
possibleValues = attribute[ "values" ];
assert( !IsArray( possibleValues ) || IsInArray( possibleValues, value ),
"AI: \"" + value + "\" is not one of the allowed values for attribute \"" +
attributeName + "\"." );
break;
case "_interface_numeric":
maxValue = attribute[ "max_value" ];
minValue = attribute[ "min_value" ];
assert( IsInt( value ) || IsFloat( value ), "AI: Attribute \"" + attributeName +
"\" requires a numeric value and \"" + value + "\" does not qualify." );
assert( ( !IsDefined( maxValue ) && !IsDefined( minValue ) ) ||
( value <= maxValue && value >= minValue ),
"AI: \"" + value + "\" is outside the allowed range of (" + minValue + "," +
maxValue + ")." );
break;
case "_interface_vector":
if ( IsDefined( value ) )
assert( IsVec( value ), "AI: Attribute \"" + attributeName +
"\" requires a vector value and \"" + value + "\" does not qualify." );
break;
default:
assert( "AI: Unknown attribute type of \"" + attribute[ "type" ] +
"\" for attribute \"" + attributeName + "\"." );
break;
}
#/
}
function private _CheckPrerequisites( entity, attribute )
{
/#
assert( IsEntity( entity ), "AI: Must pass an entity to access an attribute." );
assert( IsActor( entity ) || IsVehicle( entity ), "AI: Must pass an actor or vehicle to access an attribute." );
assert( IsString( attribute ), "AI: Must pass in a valid attribute name." );
// In depth debugging, only necessary to debug if an AI or the AI Interface system has been setup properly.
if ( IsDefined( level.__ai_debugInterface ) && level.__ai_debugInterface > 0 )
{
assert( IsArray( entity.__interface ),
"AI: Entity(" + entity.archetype + ") must create an interface before accessing an " +
"attribute, see \"ai::CreateInterfaceForEntity\"." );
assert( IsArray( level.__ai_interface ),
"AI: No attributes have been registered with the AI interface system yet." );
assert( IsArray( level.__ai_interface[ entity.archetype ] ),
"AI: No attributes for archetype \"" + entity.archetype + "\" have been registered." );
assert( IsArray( level.__ai_interface[ entity.archetype ][ attribute ] ),
"AI: Attribute \"" + attribute + "\" has not been registered for archetype \"" +
entity.archetype + "\" yet." );
assert( IsString( level.__ai_interface[ entity.archetype ][ attribute ][ "type" ] ),
"AI: Attribute type is undefined for \"" + attribute + "\"." );
}
#/
}
function private _CheckRegistrationPrerequisites( archetype, attribute, callbackFunction )
{
/#
assert( IsString( archetype ), "AI: \"archetype\" value is mandatory for registration." );
assert( IsString( attribute ), "AI: \"attribute\" value is mandatory for registration." );
assert( !IsDefined( callbackFunction ) || IsFunctionPtr( callbackFunction ),
"AI: \"callbackFunction\" is optional but must be a function pointer if specified." );
#/
}
function private _InitializeLevelInterface( archetype )
{
if ( !IsDefined( level.__ai_interface ) )
{
level.__ai_interface = [];
}
if ( !IsDefined( level.__ai_interface[ archetype ] ) )
{
level.__ai_interface[ archetype ] = [];
}
}
#namespace ai;
function CreateInterfaceForEntity( entity )
{
if ( !IsDefined( entity.__interface ) )
{
entity.__interface = [];
}
}
function GetAiAttribute( entity, attribute )
{
/#
ai_interface::_CheckPrerequisites( entity, attribute );
#/
if ( !IsDefined( entity.__interface[ attribute ] ) )
{
return level.__ai_interface[ entity.archetype ][ attribute ][ "default_value" ];
}
return entity.__interface[ attribute ];
}
function HasAiAttribute( entity, attribute )
{
return
IsDefined( entity ) &&
IsDefined( attribute ) &&
IsDefined( entity.archetype ) &&
IsDefined( level.__ai_interface ) &&
IsDefined( level.__ai_interface[ entity.archetype ] ) &&
IsDefined( level.__ai_interface[ entity.archetype ][ attribute ] );
}
function RegisterMatchedInterface( archetype, attribute, defaultValue, possibleValues, callbackFunction )
{
/#
ai_interface::_CheckRegistrationPrerequisites( archetype, attribute, callbackFunction );
assert( !IsDefined( possibleValues ) || IsArray( possibleValues ),
"AI: \"possibleValues\" is optional but must be an array if specified." );
#/
ai_interface::_InitializeLevelInterface( archetype );
/#
assert( !IsDefined( level.__ai_interface[ archetype ][ attribute ] ),
"AI: \"" + attribute + "\" is already registered for archetype \"" + archetype + "\"" );
#/
level.__ai_interface[ archetype ][ attribute ] = [];
level.__ai_interface[ archetype ][ attribute ][ "callback" ] = callbackFunction;
level.__ai_interface[ archetype ][ attribute ][ "default_value" ] = defaultValue;
level.__ai_interface[ archetype ][ attribute ][ "type" ] = "_interface_match";
level.__ai_interface[ archetype ][ attribute ][ "values" ] = possibleValues;
/#
ai_interface::_CheckValue( archetype, attribute, defaultValue );
#/
}
function RegisterNumericInterface( archetype, attribute, defaultValue, minimum, maximum, callbackFunction )
{
/#
ai_interface::_CheckRegistrationPrerequisites( archetype, attribute, callbackFunction );
assert( !IsDefined( minimum ) || IsInt( minimum ) || IsFloat( minimum ),
"AI: \"minimum\" is optional but must be a numeric if specified." );
assert( !IsDefined( maximum ) || IsInt( maximum ) || IsFloat( maximum ),
"AI: \"maximum\" is optional but must be a numeric if specified." );
assert( ( !IsDefined( minimum ) && !IsDefined( maximum ) ) ||
( IsDefined( minimum ) && IsDefined( maximum ) ),
"AI: Either both a minimum and maximum must be defined or both undefined, not mixed.");
assert( ( !IsDefined( minimum ) && !IsDefined( maximum ) ) ||
( minimum <= maximum ),
"AI: Attribute \"" + attribute + "\" cannot specify a minimum greater than " +
"the attribute's maximum");
#/
ai_interface::_InitializeLevelInterface( archetype );
/#
assert( !IsDefined( level.__ai_interface[ archetype ][ attribute ] ),
"AI: \"" + attribute + "\" is already registered for archetype \"" + archetype + "\"" );
#/
level.__ai_interface[ archetype ][ attribute ] = [];
level.__ai_interface[ archetype ][ attribute ][ "callback" ] = callbackFunction;
level.__ai_interface[ archetype ][ attribute ][ "default_value" ] = defaultValue;
level.__ai_interface[ archetype ][ attribute ][ "max_value" ] = maximum;
level.__ai_interface[ archetype ][ attribute ][ "min_value" ] = minimum;
level.__ai_interface[ archetype ][ attribute ][ "type" ] = "_interface_numeric";
/#
ai_interface::_CheckValue( archetype, attribute, defaultValue );
#/
}
function RegisterVectorInterface( archetype, attribute, defaultValue, callbackFunction )
{
/#
ai_interface::_CheckRegistrationPrerequisites( archetype, attribute, callbackFunction );
#/
ai_interface::_InitializeLevelInterface( archetype );
/#
assert( !IsDefined( level.__ai_interface[ archetype ][ attribute ] ),
"AI: \"" + attribute + "\" is already registered for archetype \"" + archetype + "\"" );
#/
level.__ai_interface[ archetype ][ attribute ] = [];
level.__ai_interface[ archetype ][ attribute ][ "callback" ] = callbackFunction;
level.__ai_interface[ archetype ][ attribute ][ "default_value" ] = defaultValue;
level.__ai_interface[ archetype ][ attribute ][ "type" ] = "_interface_vector";
/#
ai_interface::_CheckValue( archetype, attribute, defaultValue );
#/
}
function SetAiAttribute( entity, attribute, value )
{
/#
ai_interface::_CheckPrerequisites( entity, attribute );
ai_interface::_CheckValue( entity.archetype, attribute, value );
#/
oldValue = entity.__interface[ attribute ];
if ( !IsDefined( oldValue ) )
{
oldValue = level.__ai_interface[ entity.archetype ][ attribute ][ "default_value" ];
}
entity.__interface[ attribute ] = value;
callback = level.__ai_interface[ entity.archetype ][ attribute ][ "callback" ];
if ( IsFunctionPtr( callback ) )
{
[[callback]]( entity, attribute, oldValue, value );
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
#namespace AnimationSelectorTable;
function RegisterAnimationSelectorTableEvaluator( functionName, functionPtr )
{
if ( !IsDefined( level._astevaluatorscriptfunctions ) )
{
level._astevaluatorscriptfunctions = [];
}
functionName = ToLower( functionName );
Assert( IsDefined( functionName ) && IsDefined( functionPtr ) );
Assert( !IsDefined( level._astevaluatorscriptfunctions[functionName] ) );
level._astevaluatorscriptfunctions[functionName] = functionPtr;
}

View File

@ -0,0 +1,90 @@
// ASM RUNNING STATUS FLAGS ------------------------------------------------------//
// TODO - Find a better way to not need to have this hardcoded state name.
// ASM NOTETRACK HANDLER DEFINES -----------------------------------------------//
// ASM AIM/SHOOT NODE DEFINES -------------------------------------------------//
// ASM MOCOMP ATTRIBUTES -----------------------------------------------------//
// NOTERACKS HANDLED BY ASM ---------------------------------------------------//
// AI_ANIM_MODE, DEFINED SAME AS CODE -----------------------------------------//

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
// EMPTY ANIMSCRIPT AS WE DO NOT NEED AI TO RUN ANYTHING HERE
function main()
{
}
function end_script()
{
// This callback will be called when AI will change states from AIS_BEHAVE to AIS_SCRIPTED
// i.e when it will go from behavior state to animscripted state
if( IsDefined( self.___ArchetypeOnAnimscriptedCallback ) )
[[self.___ArchetypeOnAnimscriptedCallback]]( self );
}

View File

@ -0,0 +1,98 @@
// at 96 units distance, AI will prefer to walk instead of running to it.
// standing offset at covernodes based on the AI pose
// yaws used to check if the AI can see the enemy
// offsets used to check if the AI can see the enemy
// in sec, if AI has not seen enemy for 4 sec, then he will be considered hidden
// maximum time for idle action at cover, ir-respective of the animation length
// grenade throw ranges
// grenade throw modifiers
// Lower bound of time before a person of the same team can throw another grenade
// Upper bound of time before a person of the same team can throw another grenade
// Lower bound of time before a person that finished a scripted animation can throw a grenade
// Upper bound of time before a person that finished a scripted animation can throw a grenade
// Lower bound of time before being able to throw another grenade
// Upper bound of time before being able to throw another grenade
// New grenade throws must land atleast this far from any previous throw, within the GRENADE_THROW_TIME window.
// Don't throw a grenade if you are on team allies and it will land this close to a player (may want to change to any ally)
// Don't throw a grenade if there is a player in laststand this close to the target.
// Melee ranges and timers
// allowed 10 units to account for charge blend
// charge distance is the minimum distance required to even attempt melee
// Arrival
// Distance at which enmey is considered to be nearby
// Cover modes
//Sprint values
//delay between two sprints
//upto one more second delay between sprint
//additional compensation factor
//value between 0 and 100, probability of sprinting
// Cover shoot times
// *********** SUMEET TODO - Merge seeking and exposed reacquiring behavior together. ***********
// Reacquire/ Cover/Locomotion Seek

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
// These enums must match with StateMachineStatus in behavior_state_machine_db.h
// HACK - just to match status codes with the behavior tree, ease of use!
// HACK - just to match status codes with the behavior tree, ease of use!

View File

@ -0,0 +1,17 @@
// return status for BehaviorTreeNodes tick functions - BHTN_STATUS, order is important, BHTN_RUNNING needs to be highest

View File

@ -0,0 +1,71 @@
#namespace BehaviorTreeNetwork;
// ------------- BehaviorTreeScript ----------- //
function RegisterBehaviorTreeScriptAPIInternal( functionName, functionPtr )
{
if ( !IsDefined( level._BehaviorTreeScriptFunctions ) )
{
level._BehaviorTreeScriptFunctions = [];
}
// SUMEET TODO - remove the need of ToLower and have the functionNames defined in .gsh
functionName = ToLower( functionName );
Assert( IsDefined( functionName ) && IsDefined( functionPtr ), "BT - (RegisterBehaviorTreeScriptAPI) No functionPtr defined or no functionName defined for BehaviorTreeScript." );
Assert( !IsDefined( level._BehaviorTreeScriptFunctions[functionName] ), "BT - (RegisterBehaviorTreeScriptAPI) functionName is already defined for BehaviorTreeScript." );
level._BehaviorTreeScriptFunctions[functionName] = functionPtr;
}
// ------------- BehaviorTreeAction ----------- //
function RegisterBehaviorTreeActionInternal( actionName, startFuncPtr, updateFuncPtr, terminateFuncPtr )
{
if ( !IsDefined( level._BehaviorTreeActions ) )
{
level._BehaviorTreeActions = [];
}
actionName = ToLower( actionName );
Assert( IsString( actionName ), "BT - actionName for RegisterBehaviorTreeActionInternal is not a string." );
Assert( !IsDefined(level._BehaviorTreeActions[actionName]), "BT - (RegisterBehaviorTreeActionInternal) actionName " + actionName + " is already registered." );
level._BehaviorTreeActions[actionName] = array();
// BHTN_ACTION_START
if( IsDefined( startFuncPtr ) )
{
Assert( IsFunctionPtr( startFuncPtr ), "BT - BehaviorTreeAction startFuncPtr must be of type functionPtr." );
level._BehaviorTreeActions[actionName]["bhtn_action_start"] = startFuncPtr;
}
// BHTN_ACTION_UPDATE
if( IsDefined( updateFuncPtr ) )
{
Assert( IsFunctionPtr( updateFuncPtr ), "BT - BehaviorTreeAction updateFuncPtr must be of type functionPtr." );
level._BehaviorTreeActions[actionName]["bhtn_action_update"] = updateFuncPtr;
}
// BHTN_ACTION_TERMINATE
if( IsDefined( terminateFuncPtr ) )
{
Assert( IsFunctionPtr( terminateFuncPtr ), "BT - BehaviorTreeAction terminateFuncPtr must be of type functionPtr." );
level._BehaviorTreeActions[actionName]["bhtn_action_terminate"] = terminateFuncPtr;
}
}
// ------------- utility----------- //
#namespace BehaviorTreeNetworkUtility;
function RegisterBehaviorTreeScriptAPI( functionName, functionPtr )
{
BehaviorTreeNetwork::RegisterBehaviorTreeScriptAPIInternal( functionName, functionPtr );
}
function RegisterBehaviorTreeAction( actionName, startFuncPtr, updateFuncPtr, terminateFuncPtr )
{
BehaviorTreeNetwork::RegisterBehaviorTreeActionInternal( actionName, startFuncPtr, updateFuncPtr, terminateFuncPtr );
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,424 @@
// -------------------------------------------- BLACKBOARD ATTRIBUTES --------------------------//
// Attribute names, keep it lowercase. "_" before the attribute name indicates that its being used by both AST and BT.
// Desired values should have DESIRED and "_desired_" in their definition. There should be a associated BB attribute existing already
// Eg. ATTRIBUTE and DESIRED_ATTRIBUTE and "_attribute" and "_desired_attribute". Try to keep them together please. :)
// Robots
//Zombies
//contains all the possible knockdown animations
//only has the quick to the ground knockdown animations
// will be set to YES if AI will look good if he reacts with flanking
// -------------------------------------------- BLACKBOARD DEFINES --------------------//
// -------------------------------------------- AIM RELATED --------------------------//
// -------------------------------------------- STANCES -------------------------------//
// -------------------------------------------- WEAPONS -------------------------------//
// -------------------------------------------- DAMAGE -------------------------------//
// -------------------------------------------- TACTICAL WALK -------------------------//
// -------------------------------------------- CORNER PREDICTION ----------------------//
// -------------------------------------------- ARRIVAL -------------------------------//
// -------------------------------------------- LOCMOTION PAIN ------------------------//
// -------------------------------------------- DAMAGE DIRECTION ------------------------//
// -------------------------------------------- SPECIAL DEATH ------------------------//
// -------------------------------------------- AWARENESS ------------------------//
// -------------------------------- STAIRS ------------------------//
// skip4 Not implemented yet
// -------------------------------------------- HITLOCS ------------------------//
// same as hitLocation_t enum in q_shared.h

414
shared/ai/systems/debug.gsc Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,24 @@
// 20 possible states and 1 toggle bit to determine if spawning gib models should happen on the client.
// The toggle bit is used to predamage characters when they are spawned in, without creating gib models.
// (20 + 1) states
// Pieces numbers start at 1, and stop at DESTRUCT_MAX_PIECES

421
shared/ai/systems/face.gsc Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@

792
shared/ai/systems/gib.csc Normal file

File diff suppressed because one or more lines are too long

663
shared/ai/systems/gib.gsc Normal file

File diff suppressed because one or more lines are too long

57
shared/ai/systems/gib.gsh Normal file
View File

@ -0,0 +1,57 @@
// Server side only
// Server side only
// Server side only
// 7 Damage states and 1 toggle bit to determine if gib models should be spawned on the client.
// Less than GIB_TORSO_RIGHT_ARM_FLAG
// Client/Server scriptbundle

414
shared/ai/systems/init.gsc Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

28
shared/ai/utility.gsh Normal file
View File

@ -0,0 +1,28 @@
// node spawnflag macros
// node type macros
// node stances macros
// Yaw and Pitch utility macros

177
shared/ai/warlord.csc Normal file

File diff suppressed because one or more lines are too long

1769
shared/ai/warlord.gsc Normal file

File diff suppressed because one or more lines are too long

204
shared/ai/warlord.gsh Normal file
View File

@ -0,0 +1,204 @@
///////////////////////////////////////////////////////////////////////////////
//
// Tweakables
//
///////////////////////////////////////////////////////////////////////////////
// Millisecond cooldown time before the warlord can juke again.
// Anything less than 2000 is less than the juke animation playback length.
// Health pool the warlord uses when in the tug-of-war recharge state.
// The initial health added to the warlord's health pool when entering the recharge state.
// NOTE - This is truncated to WARLORD_RECHARGE_HEALTH_MAX and should be positive.
// The amount of health to give the warlord per second when recharging.
// Health percentage of the warlord to play the medium damage FX.
// Health percentage of the warlord to play the heavy damage FX.
// The starting health of the warlord's shield.
// The percent of health the shield has to be to turn orange.
// The percent of health the shield has to be to turn red.
// Maximum distance from the player the warlord will try to charge melee them.
// How often the warlord will attempt to charge melee.
// in seconds
///////////////////////////////////////////////////////////////////////////////
//
// Warlord Defines
//
///////////////////////////////////////////////////////////////////////////////
/#
#/
///////////////////////////////////////////////////////////////////////////////
//
// Clientfields
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Warlord Spawn Types
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// FX
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//
// Sounds
//
///////////////////////////////////////////////////////////////////////////////

128
shared/ai/zombie.csc Normal file
View File

@ -0,0 +1,128 @@
#using scripts\shared\clientfield_shared;
#using scripts\shared\ai\systems\gib;
#using scripts\shared\ai_shared;
#precache( "client_fx", "zombie/fx_val_chest_burst");
#precache( "client_fx", "fire/fx_fire_ai_human_arm_left_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_arm_right_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_arm_left_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_arm_right_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_torso_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_hip_left_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_hip_right_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_leg_left_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_leg_right_loop_optim");
#precache( "client_fx", "fire/fx_fire_ai_human_head_loop_optim");
function autoexec precache()
{
}
function autoexec main()
{
level._effect["zombie_special_day_effect"] = "zombie/fx_val_chest_burst";
ai::add_archetype_spawn_function( "zombie", &ZombieClientUtils::zombie_override_burn_fx );
clientfield::register(
"actor",
"zombie",
1,
1,
"int",
&ZombieClientUtils::zombieHandler,
!true,
!true);
clientfield::register(
"actor",
"zombie_special_day",
6001,
1,
"counter",
&ZombieClientUtils::zombieSpecialDayEffectsHandler,
!true,
!true);
}
#namespace ZombieClientUtils;
function zombieHandler( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
{
entity = self;
if ( IsDefined( entity.archetype ) && entity.archetype != "zombie" )
{
return;
}
if ( !IsDefined( entity.initializedGibCallbacks ) || !entity.initializedGibCallbacks )
{
entity.initializedGibCallbacks = true;
GibClientUtils::AddGibCallback( localClientNum, entity, 8, &_gibCallback );
GibClientUtils::AddGibCallback( localClientNum, entity, 16, &_gibCallback );
GibClientUtils::AddGibCallback( localClientNum, entity, 32, &_gibCallback );
GibClientUtils::AddGibCallback( localClientNum, entity, 128, &_gibCallback );
GibClientUtils::AddGibCallback( localClientNum, entity, 256, &_gibCallback );
}
}
function private _gibCallback( localClientNum, entity, gibFlag )
{
switch (gibFlag)
{
case 8:
playsound(0, "zmb_zombie_head_gib", self.origin + (0,0,60));
break;
case 16:
case 32:
case 128:
case 256:
playsound(0, "zmb_death_gibs", self.origin + (0,0,30));
break;
}
}
function zombieSpecialDayEffectsHandler( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
{
entity = self;
if ( IsDefined( entity.archetype ) && entity.archetype != "zombie" )
{
return;
}
origin = entity GetTagOrigin( "j_spine4" );
fx = PlayFX( localClientNum, level._effect["zombie_special_day_effect"], origin );
SetFXIgnorePause( localClientNum, fx, true );
}
function zombie_override_burn_fx( localClientNum )
{
if( SessionModeIsZombiesGame() )
{
if( !isdefined( self._effect ))
{
self._effect = [];
}
level._effect["fire_zombie_j_elbow_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop_optim"; // hand and forearm fires
level._effect["fire_zombie_j_elbow_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop_optim";
level._effect["fire_zombie_j_shoulder_le_loop"] = "fire/fx_fire_ai_human_arm_left_loop_optim"; // upper arm fires
level._effect["fire_zombie_j_shoulder_ri_loop"] = "fire/fx_fire_ai_human_arm_right_loop_optim";
level._effect["fire_zombie_j_spine4_loop"] = "fire/fx_fire_ai_human_torso_loop_optim"; // upper torso fires
level._effect["fire_zombie_j_hip_le_loop"] = "fire/fx_fire_ai_human_hip_left_loop_optim"; // thigh fires
level._effect["fire_zombie_j_hip_ri_loop"] = "fire/fx_fire_ai_human_hip_right_loop_optim";
level._effect["fire_zombie_j_knee_le_loop"] = "fire/fx_fire_ai_human_leg_left_loop_optim"; // shin fires
level._effect["fire_zombie_j_knee_ri_loop"] = "fire/fx_fire_ai_human_leg_right_loop_optim";
level._effect["fire_zombie_j_head_loop"] = "fire/fx_fire_ai_human_head_loop_optim"; // head fire
}
}

1603
shared/ai/zombie.gsc Normal file

File diff suppressed because one or more lines are too long

62
shared/ai/zombie.gsh Normal file
View File

@ -0,0 +1,62 @@
// Melee ranges and timers
// Vision ranges
// used for getting points on the navmesh
// Crawler blocking
// Juking
// Stumbling
// Pain
// Suicide
// Movement checking
///////////////////////////////////////////////////////////////////////////////
//
// Clientfields
//
///////////////////////////////////////////////////////////////////////////////

121
shared/ai/zombie_death.csc Normal file

File diff suppressed because one or more lines are too long

299
shared/ai/zombie_death.gsc Normal file

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More