271
edits
(Altered Alarm and added Combat part 1) |
(Another section about combat behavior) |
||
Line 42: | Line 42: | ||
'''Unexpected Collision''' movement happens when A.I. runs on its own towards some destination and suddenly hits an obstacle. Ideally that should never happen as pathfinding grid should prevent it, but still...Anyway, when collision happens, the game decides what to do according to actually selected | '''Unexpected Collision''' movement happens when A.I. runs on its own towards some destination and suddenly hits an obstacle. Ideally that should never happen as pathfinding grid should prevent it, but still...Anyway, when collision happens, the game decides what to do according to actually selected way how to move a character: | ||
:*Pathfinding - the game makes A.I. do a few steps back, rotate a bit and lets the A.I. continue its journey. There is limit of how many unexpected collisions can A.I. undergo before it gives up its destination as unreachable. | :*Pathfinding - the game makes A.I. do a few steps back, rotate a bit and lets the A.I. continue its journey. There is limit of how many unexpected collisions can A.I. undergo before it gives up its destination as unreachable. | ||
:*???Vector??? - according to the angle between A.I.'s facing and obstacle the game decides either to let the character slide along the obstacle or to stop the character completely until direction of the A.I.'s vector of movement changes. | :*???Vector??? - according to the angle between A.I.'s facing and obstacle the game decides either to let the character slide along the obstacle or to stop the character completely until direction of the A.I.'s vector of movement changes. | ||
Line 267: | Line 267: | ||
:*Long - enemy is approaching the A.I. character and starts from the Long Range. | :*Long - enemy is approaching the A.I. character and starts from the Long Range. | ||
:*Medium Retreat - enemy is retreating from Short Range into Medium Range. | :*Medium Retreat - enemy is retreating from Short Range into Medium Range. | ||
:*Long Retreat - enemy is retreating from Medium Range into | :*Long Retreat - enemy is retreating from Medium Range into Long Range. | ||
:Well of course nothing is perfect and in Oni there is a bit of an issue with proper switching between combat ranges, so Long and Medium ranges are used only once at the beginning of enemy approach. Only Short, Medium Retreat and Long Retreat ranges are used on regular basis in a combat. Even when enemy runs into Long Retreat and goes back to to medium range, engine does not switch A.I. behavior range to Medium, but (contrary to its name) to Medium Retreat. | :Well of course nothing is perfect and in Oni there is a bit of an issue with proper switching between combat ranges, so Long and Medium ranges are used only once at the beginning of enemy approach. Only Short, Medium Retreat and Long Retreat ranges are used on regular basis in a combat. Even when enemy runs into Long Retreat and goes back to to medium range, engine does not switch A.I. behavior range to Medium, but (contrary to its name) to Medium Retreat. | ||
Line 275: | Line 275: | ||
:*None (None) - simply nothing | :*None (None) - simply nothing | ||
:*Stare (Stare) - A.I. character stands and stares, does not even rotate to face enemy | :*Stare (Stare) - A.I. character stands and stares, does not even rotate to face enemy | ||
:*Hold and fire (HoldAndFire) - A.I. character stands still and fires a weapon. If this character does not have a weapon, then he switches to melee. | :*Hold and fire (HoldAndFire) - A.I. character stands still and fires a weapon. If this character does not have a weapon, then she/he switches to melee. | ||
:*Firing charge (FiringCharge) - A.I. character runs towards the enemy and fires a weapon. If this character does not have a weapon, then he switches to melee. | :*Firing charge (FiringCharge) - A.I. character runs towards the enemy and fires a weapon. If this character does not have a weapon, then she/he switches to melee. | ||
:*Melee (Melee) - A.I. character always uses melee, even when he holds loaded weapon. | :*Melee (Melee) - A.I. character always uses melee, even when she/he holds a loaded weapon. | ||
:*Barabbas shoot (BarabasShoot) - A.I. character stands still and fires a weapon with hardcoded three seconds pause between shots. If this character does not have a weapon, then he switches to melee. If this character meets certain conditions, she/he can start health regeneration. More detailed info about regeneration mechanics [[Barabus's regeneration| can be read HERE.]] | :*Barabbas shoot (BarabasShoot) - A.I. character stands still and fires a weapon with hardcoded three seconds pause between shots. If this character does not have a weapon, then he switches to melee. If this character meets certain conditions, she/he can start health regeneration. More detailed info about regeneration mechanics [[Barabus's regeneration| can be read HERE.]] | ||
:*Barabbas advance (BarabasAdvance) - A.I. character runs towards the enemy and fires a weapon with '''secondary fire mode''' (as if player pressed right button). If this character does not have a weapon, then he switches to melee. If this character meets certain conditions, she/he can start health regeneration. More detailed info about regeneration mechanics [[Barabus's regeneration| can be read HERE.]] | :*Barabbas advance (BarabasAdvance) - A.I. character runs towards the enemy and fires a weapon with '''secondary fire mode''' (as if player pressed right button). If this character does not have a weapon, then she/he switches to melee. If this character meets certain conditions, she/he can start health regeneration. More detailed info about regeneration mechanics [[Barabus's regeneration| can be read HERE.]] | ||
:*Barabbas melee (BarabasMelee) - A.I. character uses melee, even with loaded weapon in hand. If this character meets certain conditions, she/he can start health regeneration. More detailed info about regeneration mechanics [[Barabus's regeneration| can be read HERE.]] | :*Barabbas melee (BarabasMelee) - A.I. character uses melee, even with loaded weapon in hand. If this character meets certain conditions, she/he can start health regeneration. More detailed info about regeneration mechanics [[Barabus's regeneration| can be read HERE.]] | ||
:*Superninja fireball (SuperNinjaFireball) - Mukade's long range behavior. With this behavior A.I. cannot shoot weapons and cannot use melee, simply runs towards the enemy. However, if weapon is held, character can use melee (probably something from weapon melee override). A.I. character is occasionally teleported into the back of the enemy (AnimType 222 - Teleport In) if distance to enemy is greater than 100. It seems like it should work regularly once distance to enemy exceeds 100, but in reality something screws this teleport mechanics ^_^. Anyway, to add more to this behavior A.I. executes two special TRAM animations: | :*Superninja fireball (SuperNinjaFireball) - Mukade's long range behavior. With this behavior A.I. cannot shoot weapons and cannot use melee, simply runs towards the enemy. However, if weapon is held, character can use melee (probably something from weapon melee override). A.I. character is occasionally teleported into the back of the enemy (AnimType 222 - Teleport In) if distance to enemy is greater than 100. It seems like it should work regularly once distance to enemy exceeds 100, but in reality something screws this teleport mechanics ^_^. Anyway, to add more to this behavior A.I. executes two special TRAM animations: | ||
Line 286: | Line 286: | ||
::'''IMPORTANT''' There is an annoying problem with this behavior. When it is called, it checks character's position height-wise from the origin of the game world (coordinates 0,0,0) and if the height is below 550, this character is automatically moved to height 550 (which in almost all cases means death by falling). | ::'''IMPORTANT''' There is an annoying problem with this behavior. When it is called, it checks character's position height-wise from the origin of the game world (coordinates 0,0,0) and if the height is below 550, this character is automatically moved to height 550 (which in almost all cases means death by falling). | ||
:*Superninja advance (SuperNinjaAdvance) - Mukade's medium range behavior. With this behavior A.I. cannot shoot weapons and cannot use melee, simply runs towards the enemy. However, if weapon is held, character can use melee (probably something from weapon melee override). This behavior gives ability to use AnimType 225 - Ninja Invisible which grants 10 seconds invisibility. In order to be able to use this ability, A.I. has to be at least 50 (or 40?) units far from its enemy. Cooldown for this special technique is 20 seconds. Again, annoying '''over 550 height check''' is present. | :*Superninja advance (SuperNinjaAdvance) - Mukade's medium range behavior. With this behavior A.I. cannot shoot weapons and cannot use melee, simply runs towards the enemy. However, if weapon is held, character can use melee (probably something from weapon melee override). This behavior gives ability to use AnimType 225 - Ninja Invisible which grants 10 seconds invisibility. In order to be able to use this ability, A.I. has to be at least 50 (or 40?) units far from its enemy. Cooldown for this special technique is 20 seconds. Again, annoying '''over 550 height check''' is present. | ||
:*Superninja melee (SuperNinjaMelee) - Mukade's short range behavior. With this behavior A.I. cannot shoot weapons but can use melee. This behavior gives ability to use AnimType 225 - Ninja Invisible which grants 10 seconds invisibility. In order to be able to use this ability, A.I. has to be at least 50 (or 40?) units far from its enemy. Cooldown for this special technique is 20 seconds. This behavior also grants ability to teleport away from enemy to certain distance (around 100 units) if | :*Superninja melee (SuperNinjaMelee) - Mukade's short range behavior. With this behavior A.I. cannot shoot weapons but can use melee. This behavior gives ability to use AnimType 225 - Ninja Invisible which grants 10 seconds invisibility. In order to be able to use this ability, A.I. has to be at least 50 (or 40?) units far from its enemy. Cooldown for this special technique is 20 seconds. This behavior also grants ability to teleport away from enemy to certain distance (around 100 units) if any one of these conditions is met: | ||
:**About 35 points of damage dealt to this character in a short time (exact amount of damage and exact timing not known). | :**About 35 points of damage dealt to this character in a short time (exact amount of damage and exact timing not known). | ||
:**This character get thrown by any throw. | :**This character get thrown by any throw. | ||
::Again, annoying '''over 550 height check''' is present. | ::Again, annoying '''over 550 height check''' is present. | ||
:*Run for alarm (RunForAlarm) - see section [[Tricks behind Oni A.I.#Alarm behavior - "She's everywhere!"|Alarm behavior]]. | :*Run for alarm (RunForAlarm) - see section [[Tricks behind Oni A.I.#Alarm behavior - "She's everywhere!"|Alarm behavior]]. | ||
:*Mutant Muro melee (MutantMuroMelee) - A.I. character is only allowed to melee, will not fire weapons. This behavior casts chenille (overpower effect) on the user. Of course in order to see visible effect character has to have | :*Mutant Muro melee (MutantMuroMelee) - A.I. character is only allowed to melee, will not fire weapons. This behavior casts chenille (overpower effect) on the user. Of course in order to see visible effect character has to have set <HasDaodanPowers> to 1 in [[ONCC]]. This chenille mode does not grant damage overpower effect, melee attacks deal their usual damage. If ONCC has set both <HasDaodanPowers> and <HasSuperShield> to 1, the chenille mode called by this behavior grants super shield. | ||
::Chenille mode lasts forever if it is not terminated either via BSL or by A.I. character performing a [[TRAM]] which has a DisableShield flag. After 10 seconds interval, chenille is turned back on. | ::Chenille mode lasts forever if it is not terminated either via BSL or by A.I. character performing a [[TRAM]] which has a DisableShield flag. After 10 seconds interval, chenille is turned back on. Another specialty of this behavior is automatic backwards evasion move when about 35 points of damage or a throw are applied on the A.I. character. Chenille mode is turned off if this A.I. character switches to some other combat behavior because the enemy moved to some other combat range. | ||
:*Mutant Muro thunderbolt (MuroThunderbolt) - A.I. character goes into AnimState 69 (Thunderbolt) and loops special TRAM animation of AnimType 231 (Muro_Thunderbolt | :*Mutant Muro thunderbolt (MuroThunderbolt) - Upon initial contact A.I. chracter turns on chenille mode and runs towards enemy. If chenille mode is turned off, then until definite awareness of the enemy is lost this behavior will not cast chenille mode again. This behavior also allows the A.I. character to use special long range attack - chracter turns off chenille, goes into AnimState 69 (Thunderbolt) and loops special TRAM animation of AnimState 69 (Thunderbolt) and AnimType 231 (Muro_Thunderbolt). That lasts for 10 seconds. Then A.I. makes 5 seconds pause during which it runs towards enemy. If after those 5 seconds A.I. character is still executing Mutant Muro thunderbolt behavior, A.I. character starts again looping the TRAM animation which has AnimType 231 and AnimState 69. | ||
::This behavior's special (looping TRAM animation) lasts even when enemy enters some other combat range with the exception of Short range. If enemy enters Short range while the looped | ::This behavior's special (looping TRAM animation) lasts even when enemy enters some other combat range with the exception of Short range. If enemy enters Short range while the looped animation is running, the loop is forced to stop and A.I. character starts using Short range behavior. | ||
Line 304: | Line 304: | ||
:*Barabbas Shoot and Barabbas Melee behaviors have access to heal ability which can be a great asset for introducing mutants or stronger enemy units. However, remember that Barabbas Shoot limits rate of fire to one shot per three seconds. | :*Barabbas Shoot and Barabbas Melee behaviors have access to heal ability which can be a great asset for introducing mutants or stronger enemy units. However, remember that Barabbas Shoot limits rate of fire to one shot per three seconds. | ||
:*Barabbas Advance is the only behavior which allows A.I. to fire a weapon with secondary fire mode. However the behavior is quite glitched (A.I. character often looks away and fires stray shots). Still, with proper gun and proper setup it can be useable for boss fights. | :*Barabbas Advance is the only behavior which allows A.I. to fire a weapon with secondary fire mode. However the behavior is quite glitched (A.I. character often looks away and fires stray shots). Still, with proper gun and proper setup it can be useable for boss fights. | ||
:*Superninja's behaviors sound excellent for cunning enemy units, however annoying check for character's minimal allowed height from world origin and subsequent forced repositions severely impact these behaviors' usefulness. Despite the height limit, with deliberately designed level which is uplifted enough on purpose the behavior will not cause random A.I. character repositioning. Then it can be used to its fullest. | :*Superninja's behaviors sound excellent for cunning enemy units, however annoying check for character's minimal allowed height from world origin and subsequent forced repositions severely impact these behaviors' usefulness. Despite the height limit, with deliberately designed level which is uplifted enough on purpose, the behavior will not cause random A.I. character repositioning. Then it can be used to its fullest. | ||
::One other important thing about these behaviors - if A.I. character does not have required [[TRAM]]s in her/his [[TRAC]], the A.I. character can get stuck if she/he uses these behaviors. | ::One other important thing about these behaviors - if A.I. character does not have required [[TRAM]]s in her/his [[TRAC]], the A.I. character can get stuck if she/he uses these behaviors. | ||
:*If there is no console with ALARM CONOSLE flag within Alarm sarch distance, then behavior "Run For Alarm" will make A.I. enemy just stand and stare. Set this behavior with caution and consider using a workaround where medium and short combat ranges have very close diameters with Run For Alarm being MediumRetreat behavior, so Run For Alarm behavior is executed only for a brief amount of time as A.I. practically immediately switches to LongRetreat. However even one frame is enough because if alarm is found, A.I. character is requested to perform alarm run which can override combat (see section [[Tricks behind Oni A.I.#Alarm behavior - "She's everywhere!"|Alarm behavior]] for more info). | :*If there is no console with ALARM CONOSLE flag within Alarm sarch distance, then behavior "Run For Alarm" will make A.I. enemy just stand and stare. Set this behavior with caution and consider using a workaround where medium and short combat ranges have very close diameters with Run For Alarm being MediumRetreat behavior, so Run For Alarm behavior is executed only for a brief amount of time as A.I. practically immediately switches to LongRetreat. However even one frame is enough because if alarm is found, A.I. character is requested to perform alarm run which can override combat (see section [[Tricks behind Oni A.I.#Alarm behavior - "She's everywhere!"|Alarm behavior]] for more info). | ||
:*MutantMuro melee can be used to create tricky foes which have to be eliminated from distance because if player comes up close, these enemies will turn on their (super)shield and won't put it away ( | :*MutantMuro melee can be used to create tricky foes which have to be eliminated from distance because if player comes up close, these enemies will turn on their (super)shield and won't put it away (no TRAM with DisableShield flag). That means player has to put some distance between him and these A.I. characters in order to make them disable the shield. | ||
:*MutantMuro thunderbolt should NEVER be assigned to Short range behavior as that will negatively affect its special attack. Set it as LongRetreat or MediumRetreat. This kind of behavior (with proper [[TRAM]]s) can be used to create foes who will | :*MutantMuro thunderbolt should NEVER be assigned to Short range behavior as that will negatively affect its special attack. Set it as LongRetreat or MediumRetreat. This kind of behavior (with proper [[TRAM]]s) can be used to create foes who will perform special long range attack if player tries to keep a distance. This ranged attack does not have to be the same as Muro's tractor thunderbolt. For quick example, A.I. character can be made to fire a sort of aggressive plasma beam. | ||
==Combat behavior part 2 : "Guns or not, my fists are hot."== | ==Combat behavior part 2 : "Guns or not, my fists are hot."== | ||
Combat ranges and various A.I. combat behavior was discussed in previous section. Even with combat ranges, there are still other parts of combat to be taken care of - picking up weapons from the ground, melee overrides of weapons, behavior if character is unarmed and of course, firing weapons or using hand to hand combat. Files inspected in this section will be [[CMBT]] profiles and [[ONCC]] files. | |||
'''"Melee override" ([[CMBT]] profile)''' - similar to [[BSL]] command '''chr_dontaim''', this behavior bids the A.I. character to use hand to hand animation varient (see [[TRAM]]) and to switch from whatsoever other behavior to melee combat. This field was probably added to deal with conflicts when multiple A.I. behaviors are applied on character. Possible values are (xml strings in brackets): | |||
:*None (None) - no override is used. | |||
:*If Punched (IfPunched) - melee override applied when A.I. character is melee attacked by its enemy. | |||
:*Cancelled - unfinished stuff, does nothing. Remains only the question what it was meant to be... | |||
:*Short (ShortRange) - Melee override is applied when enemy is within Short range. | |||
:*Medium (MediumRange) - Melee override is applied when enemy is within Medium or Short range. | |||
:*Always melee (AlwaysMelee) - Melee override is applied withing all combat ranges | |||
:This override can affect: | |||
:*Alarm running - It is even required if alarm run is called via "If no gun" alarm run behavior, otherwise glitches will appear. | |||
:*Retreating behavior - When "If no gun" is set as "Retreat", unarmed A.I. character will try to run away from its enemy. However, if enemy meets Melee override parameter (for example get into Short range while Melee overrride is set to ShortRange), then this A.I. stops running away and starts attacking the enemy. | |||
:*Weapon firing - If distance between A.I. character and its enemy is smaller than minimal shooting distance, A.I. tries to run away from its enemy (still facing the enemy) till distance between characters is greater than minimal shooting distance. However, this backpedal behavior can be overriden by "Melee override" if all conditions are met - A.I. character then starts using melee (even with loaded weapon in hand) for at least 10 seconds (hardcoded timer) After ten seconds A.I. tries to restore its previous behavior. If enemy is still too close, Melee override is immediately applied again. | |||
:*Weapon pickup - if A.I. is trying to pick up a weapon and enemy crosses the range specified in MeleeOverride, then weapon pickup behavior is overridden by melee. | |||
:*Maybe some other aspects of A.I. behavior? | |||
'''"If no gun" behavior ([[CMBT]] profile)''' - this parameter tells A.I. character what kind of action A.I. should do if it is unarmed or has empty weapon and no spare clips. Possibilites are (xml strings in brackets): | |||
:*Melee (Melee) - A.I. character attacks enemy with hand to hand combat | |||
:*Retreat (Retreat) - A.I. character runs away from its enemy (a bit glitchy, but works) | |||
:*Run For Alarm (RunForAlarm) - see section [[Tricks behind Oni A.I.#Alarm behavior - "She's everywhere!"|Alarm behavior]]. Remainder: this alarm calling behavior requires Melee override set as ShortRange, MediumRange or AlwaysMelee, otherwise alarm behavior gets glitched and A.I. character gets stuck. If no alarm console is found within Alarm search distance, A.I. character resorts to melee. | |||
[[File:GoForGun.JPG|thumb|right|alt=Picture showing A.I. moving to a weapon.|A.I. character moving to a weapon.]] | |||
'''Weapon pickup behavior ([[ONCC]] file)''' - when in combat mode, unarmed A.I. character can be told to move to a loaded weapon and pick it up or to switch held empty gun for a loaded gun which is lying on the floor. Overall, A.I. characters only register pickable weapons which are lying around them up to a distance of 60 units (hardcoded). Weapons which are lying further than 60 units from the A.I. character are ignored. In [[ONCC]] file these parameters can be set to alter gun pickup behavior (xml tags in brackets ): | |||
:*Chance for pickup (GoForGunChance) - percentual chance of A.I. being told to go and pick up a weapon. It seems that the weapon closest to the A.I. character is always chosen to be picked up. | |||
:*Running pickup (RunPickupChance) - percentual chance of A.I. picking the weapon by performing an evasion move (melee dodge move). | |||
'''Getting up after being knocked down ([[ONCC]] file)''' - if A.I. character is knocked to the ground, it stays on the ground for a while (simulation of concussion) then gets up. In [[ONCC]] file there are two parameters regarding getups (xml tags in brackets): | |||
:*Knockdown minimal number of frames (DazedMinFrames) - minimal number of frames for which A.I. character stays on the ground. | |||
:*Knockdown maximal number of frames (DazedmaxFrames) - maximal number of frames for which A.I. character stays on the ground. | |||
:If knockdowned A.I. character gets hit by melee, it gets up immediately after the hit. Being hit by weapons does not make A.I. character instantly get up. Standard getups are simple ones (as if knockdowned player hit some direction key). If A.I. character is in melee combat mode, its MELE profile has getup attacks listed and enemy is within the required range, chance is this A.I. character will use getup attacks or instead of simple getups. | |||
'''Making sure enemy is dead ([[ONCC]] file)''' - yes, even this is a part of Oni combat Artificial Intelligence. | |||
:When enemy is defeated in hand to hand fighting, A.I. character stands for a while and "checks" if enemy is dead. During this interval A.I. character can utter a short victory speech if corresponding sound slot in [[ONCC]] is filled and percentual chance roll is successful. Also during "check body" time interval A.I. character can perform a taunt animation if percentual roll is successful. Here are listed all related fields from [[ONCC]] file (xml tags in brackets): | |||
:*Investigate body (InvestigateBodyDelay) - time interval for which A.I. character stands next to its defeated enemy and stares at him. | |||
:*Dead taunt chance (DeadTauntChance) - percentual chance of performing taunt animation. | |||
:*Check body sound probability (CheckBodyProbability) - Percentual chance of playing victory speech. | |||
:*Check body sound (CheckBodySound) - link to Oni Ambient sound file ([[OBD:OSBD/OSAm]]). | |||
:If the enemy is defeated by weapon, then A.I. character keeps shooting this dead enemy for some extra time to "make sure" the enemy is dead, then comes close to investigate the body. No taunts, no win phrases. Parameters of this behavior are: | |||
:*Dead make sure (DeadMakeSureDelay) - time interval for which A.I. character keeps shooting the dead enemy | |||
:*Investigate body (InvestigateBodyDelay) - it is the same as the one listed above. | |||
Modding hints - behaviors enlisted in this section can be combined to achieve quite impressive results. | |||
:*Unfortuantely, Oni does not provide (code-wise) any A.I. behavior which deals with dynamic holstering and unholstering of possessed weapons, so melee overrides are the only way how make armed A.I. character somehow defend itself when enemy gets too close. Nevertheless, [[BSL]] provides function to make character holster or unholster a weapon - '''chr_forceholster'''. In order to make a character holster the held weapon, this character has to be using pistol or rifle animation variant (see [[TRAM]]). Since A.I. characters can use walk_noaim and run_noaim movmement modes (which disable weapon variant i.e. aiming with weapon), the weapon variant should be explicitly coerced via BSL function '''chr_dontaim'''. Unholster is easier, character just must be playing some overlay-comaptible animation at the moment when chr_forceholster is executed. That mean standing/running/crouching/walking/jumping is OK and function will succeed, but attack animations or animations of getting hit are not OK and function will fail. | |||
::*IMPORTANT NOTE: The A.I. character must be "active" all the time in order to perform BSL animation checks ('''chr_wait_'''''animation/animtype/animstate'' checks). Remember that Oni was made back in years 2000/2001, so various tricks were used to save memory and enhance performance. One of these feints is making invisible characters (behind wall, behind closed doors etc) go into INACTIVE mode, which means they are only stored in a RAM memory as a structure, but no physics, no checks for collisions and no drawing functions are applied on them in order to save system resources (BTW yes, that means inactive characters can walk in air and pass through walls). On the contrary when character is ACTIVE, it is fully operational, physics working, collisions being checked and character being ready in graphics memory to be drawn anytime. To make sure character stays active means either applying individually "'''chr_lock_active''' ''ai_name''", or (since now is year 2011 ^_^) simply applying "'''chr_all_active=1'''" to make all characters be ready to be drawn anytime. | |||
::Here is a simple example of a BSL scripted holster behavior. Character is given a gun, then weapon is holstered. When this A.I. character notices enemy and plays startle animation, then unholster is called. [http://www.youtube.com/watch?v=2WNMh8u5wBI THIS YouTube video] shows the script in action. | |||
#Setup of A.I. - gets spawned, forced to be always active, weapon gets holstered. | |||
ai2_spawn A_t48 | |||
chr_giveweapon A_t48 w1_tap | |||
chr_lock_active A_t48 | |||
sleep 1 | |||
chr_dontaim A_t48 0 | |||
chr_forceholster A_t48 1 | |||
sleep 1 | |||
#Surprise behavior - unholster weapon when A.I. character is startled | |||
chr_wait_animtype (A_t48, Startle_Forward, Startle_Back, Startle_Left, Startle_Right) | |||
chr_forceholster A_t48 0 | |||
#Aftermath - A.I. is usually walking only if it is not in combat mode, so let's use it as a trigger that weapon can be holstered. | |||
chr_wait_animtype (A_t48, Walk, Walk_Backwards) | |||
chr_dontaim A_t48 0 | |||
chr_forceholster A_t48 1 | |||
:* |
edits