Makes the script slave follow the specified path. The allowable arguments are ignoreangles,
ignorevelocity, normalangles, loop, and a number specifying the start time.
MOHAA GAME Module Classes(程序代码注释)
Game Module Classes
Actor, Animate, Entity, ScriptSlave, ScriptThread, Sentient, Trigger, World
Actor (Actor) → SimpleActor → Sentient → Animate → Entity → SimpleEntity → Listener → Class
accuracy( Float value )
Set percent to hit
accuracy( Float value )
Set percent to hit
accuracy
Set percent to hit
ai_off
Turns the AI off for this actor.
ai_on
Turns the AI on for this actor.
aimat( String target )
Specify the target to aim at.
alarmnode( String value )
Sets the name of the alarm node for the actor (must have type set to alarm for effect)
alarmnode( String value )
Sets the name of the alarm node for the actor (must have type set to alarm for effect)
alarmnode
Gets the name of the alarm node for the actor (must have type set to alarm for effect)
alarmthread
Gets the name of the alarm thread for the actor (must have type set to alarm for effect)
alarmthread( String value )
Sets the name of the alarm thread for the actor (must have type set to alarm for effect)
alarmthread( String value )
Sets the name of the alarm thread for the actor (must have type set to alarm for effect)
ammo_grenade
Returns how many grenades an AI has
ammo_grenade( Integer grenade_count )
Gives the AI some grenades
ammo_grenade( Integer grenade_count )
Gives the AI some grenades
anim( String name )
Play animation.
anim_attached( String name )
Play attached animation.
anim_noclip( String name )
Play noclip animation.
anim_scripted( String name )
Play scripted animation.
animfinal
Whether the animation was succesfully finished
animloop( String name )
Loop animation.
animname
Gets the animname.
animname
Sets the animname.
animscript( String name )
Play the animation script
animscript_attached( String name )
Play a noclip animation even when attached
animscript_noclip( String name )
Play the noclip animation script
animscript_scripted( String name )
Play the scripted animation script
attachgrenade
Used only by grenade return animations to tell the code when to attach the grenade to the actor
attackhandler
Gets the current script that will handle attack events
attackhandler
Sets the current script that will handle attack events
attackplayer
Force Actor to attack the player
avoidplayer( Integer allowavoid )
set to 0 if this AI shouldn't automatically get out of the way, non-zero if he should.
avoidplayer( Integer allowavoid )
set to 0 if this AI shouldn't automatically get out of the way, non-zero if he should.
avoidplayer
is 0 if this AI won't automatically get out of the way, non-zero if he will
balconyheight( Float height )
minimum height a balcony guy must fall to do special balcony death
balconyheight( Float height )
minimum height a balcony guy must fall to do special balcony death
balconyheight
minimum height a balcony guy must fall to do special balcony death
bedead
Forces the actor to be instantly and totally dead; no death animation is played
blendtime
Set the crossblend time to something other than the default, in seconds
blendtime
Get the crossblend time
breakspecial
tell ai to break special attack
calcgrenadetoss( Vector target_position )
Called to calculate a grenade toss. Must be called before a grenade throwing animation.
Returns the name of the script to call with animscript if the toss can succeed, or if the toss won't work.
Should be called infrequently, and never during the middle of a grenade toss.
Called to calculate a grenade toss. Must be called before a grenade throwing animation.
Returns the name of the script to call with animscript if the toss can succeed, or if the toss won't work.
Should be called infrequently, and never during the middle of a grenade toss.
The speed parameter is optional. Pass a speed if you just want to override and throw no matter what...
canmoveto( Vector position )
returns a boolean if the AI can move to a point; for use in anim scripts
canshoot( Vector shootOrigin )
Determines if it would be possible to shoot the sentient's enemy from the given position.
canshootenemyfrom( Vector shootOrigin )
Determines if it would be possible to shoot the sentient's enemy from the given position.
crawlto( String dest )
Specify the location to crawl to.
crouchto( String dest )
Specify the location to crouch to.
damagepuff( Vector position, Vector direction )
Spawns a puff of 'blood' smoke at the speficied location in the specified direction.
deathembalm
preps the dead actor for turning nonsolid gradually over time
deathhandler
Sets the current script that will handle death events
deathhandler
Gets the current script that will handle death events
deathsinkstart
Makes the entity sink into the ground and then get removed (this starts it).
defaultnonvislevel
updates the default value for 'nonvislevel'
delete
Removes this listener immediately.
detachgrenade
Used only by grenade return animations to tell the code when to throw the grenade
disguise_accept_thread( String value )
Sets the name of the thread for the actor to start when accepting papers
disguise_accept_thread( String value )
Sets the name of the thread for the actor to start when accepting papers
disguise_accept_thread
Gets the name of the thread for the actor to start when accepting papers
disguise_level
Gets the disguise level of the actor. May be 1 or 2
disguise_level( Integer value )
Sets the disguise level of the actor. May be 1 or 2
disguise_level( Integer value )
Sets the disguise level of the actor. May be 1 or 2
disguise_period( Float period_in_seconds )
Sets the time between the end of one disguise behavior and start of the next
disguise_period
Gets the time between the end of one disguise behavior and start of the next
disguise_period( Float period_in_seconds )
Sets the time between the end of one disguise behavior and start of the next
disguise_range( Float range_in_units )
Sets the maximum distance for disguise behavior to get triggered
disguise_range( Float range_in_units )
Sets the maximum distance for disguise behavior to get triggered
disguise_range
Gets the maximum distance for disguise behavior to get triggered
distancetoenemy
Get the distance from the Actor to its enemy
doActivate( Entity activatingEntity )
General trigger event for all entities
dumb
Make Actor dumb.
emotion
The method of setting the facial expression of the Actor
enableEnemy
sets enableEnemy variable
enablePain
sets enablePain variable
endactionanim( )
End any aiming/action animation which is currently playing
enemy
Get the actor's current enemy
enemy_visible_change_time
Get the last time whether or not the enemy is visible changed, in seconds
enemysharerange( Float range )
sets the range outside which the AI will not receive notification that a teammate has a new enemy
enemysharerange
gets the range outside which the AI will not receive notification that a teammate has a new enemy
enemysharerange( Float range )
sets the range outside which the AI will not receive notification that a teammate has a new enemy
enemyswitchdisable
Disable enemy switching...
enemyswitchenable
Enable enemy switching...
entitystart
Initialize a Actor.
eyeslookat( Entity entity )
The actor will look at this entity.
fallheight( Float height )
Set the fallheight
fallheight
Set the fallheight
favoriteenemy( Entity ai_or_player )
Gets this AI's favorite enemy
favoriteenemy( Entity ai_or_player )
Gets this AI's favorite enemy
favoriteenemy
Gets this AI's favorite enemy
findenemy
Finds the best enemy to target
fire_grenade
Used only by grenade throw animations to tell the code when to throw a grenade
fixedleash( Float multiplier )
if non-zero, the leash will never auto-reset; if zero, the leash may auto-reset
fixedleash
if non-zero, the leash will never auto-reset; if zero, the leash may auto-reset
fixedleash( Float multiplier )
if non-zero, the leash will never auto-reset; if zero, the leash may auto-reset
fov( Float angle )
The fov angle of the actor
fov
The fov angle of the actor
fov( Float angle )
The fov angle of the actor
GetRunAnim
Internal usage
GetWalkAnim
Internal usage
gren_awareness( Float awareness_percent )
sets the awareness of grenades in 0-100 percent chance of responding to a grenadewhen the AI sees it (applied once every 0.4 seconds)
gren_awareness
gets the awareness of grenades in 0-100 percent chance of responding to a grenadewhen the AI sees it (applied once every 0.4 seconds)
gren_awareness( Float awareness_percent )
sets the awareness of grenades in 0-100 percent chance of responding to a grenadewhen the AI sees it (applied once every 0.4 seconds)
gun
gets the gun to being used
gun( String s )
specifies the gun to use
gun( String s )
specifies the gun to use
hascompletelookahead
returns true if there are no corners to turn on the rest of the AI's current path
headmodel
gets the head model
headmodel( String headmodel )
sets the head model
headskin
gets the head skin
headskin( String headskin )
sets the head skin
hearing( Float radius )
The hearing radius of the actor
hearing( Float radius )
The hearing radius of the actor
hearing( Float radius )
The hearing radius of the actor
holster( Integer if )
Holster weapon
idlesay( String animation )
The name of an idle dialog animation to play
ignorebadplaces( Integer ignore )
sets whether or not this AI guy will ignore bad places (0 = not suicidal)
ignorebadplaces
gets whether or not this AI guy will ignore bad places (0 = not suicidal)
ignorebadplaces( Integer ignore )
sets whether or not this AI guy will ignore bad places (0 = not suicidal)
immediateremove
Removes this listener immediately.
inreload
returns non-zero if the AI is in a reload
inreload( Integer reloading )
set to non-zero to indicate the AI is in a reload
interrupt_point
hint from animation scripts to AI code that now is a good time to switch animations
interval
Gets the distance AI tries to keep between squadmates while moving.
interval( Float distance )
Sets the distance AI tries to keep between squadmates while moving.
interval( Float distance )
Sets the distance AI tries to keep between squadmates while moving.
intervaldir
the direction the AI would like to move to maintain its interval
is_enemy_visible
0 if the enemy is not currently visible, 1 if he is
Get the last time the enemy was visible, in seconds
leash( Float distance )
Sets the maximum distance the AI will wander from its leash home
leash( Float distance )
Sets the maximum distance the AI will wander from its leash home
leash
Gets the maximum distance the AI will wander from its leash home
lookaroundangle
gets the angle in degrees left or right of center that the AI will look around while patrolling
lookaroundangle( Float angle )
gets the angle in degrees left or right of center that the AI will look around while patrolling
lookaroundangle( Float angle )
gets the angle in degrees left or right of center that the AI will look around while patrolling
lookat( Entity entity )
The actor will look at this entity.
maxdist( Float distance )
Sets the maximum distance the AI tries to allow between itself and the player
maxdist( Float distance )
Sets the maximum distance the AI tries to allow between itself and the player
maxdist
Gets the maximum distance the AI tries to keep between itself and the player
mindist
Gets the minimum distance the AI tries to keep between itself and the player
mindist( Float distance )
Sets the minimum distance the AI tries to keep between itself and the player
mindist( Float distance )
Sets the minimum distance the AI tries to keep between itself and the player
mood
gets the AI mood: 'bored', 'nervous', 'curious', or 'alert'.
mood( String new_mood )
sets the AI mood... must be 'bored', 'nervous', 'curious', or 'alert'.
movedir
Returns a unit vector pointing in the current direction of motion, or zero if not moving.This still has meaning if velocity is zero but the AI is starting to move on a path.
movedoneradius( Float radius )
Set the waittill movedone radius, default 0 means don't use manual radius
movedoneradius( Float radius )
Set the waittill movedone radius, default 0 means don't use manual radius
moveto( String anim, String dest )
Specify the location to move to, with animation anim.
mumble( Integer can_mumble )
Set to 1 if this guy is allowed to mumble, or 0 if he is not
mumble( Integer can_mumble )
Set to 1 if this guy is allowed to mumble, or 0 if he is not
mumble
Returns 1 if this guy is allowed to mumble, or 0 if he is not
no_idle
Specifies if the actor will not go into idle after playing an animation
no_idle
Gets if the actor will not go into idle after playing an animation
nolongpain( Integer allow )
Set to 1 if long pain is not allowed, or 0 if long pain is allowed.
nolongpain( Integer allow )
Set to 1 if long pain is not allowed, or 0 if long pain is allowed.
nolongpain
Returns 1 if long pain is not allowed, or 0 if long pain is allowed.
nonvislevel
visibility level in range 0-1 below which an enemy is treated as non-visible
nonvislevel
visibility level in range 0-1 below which an enemy is treated as non-visible
nonvislevel
visibility level in range 0-1 below which an enemy is treated as non-visible
nosurprise( Integer nosurprise )
set to 0 to allow this guy to play a surprised animation when first encountering an enemy.
nosurprise
gets whether or not this guy is allowed to play a surprised animation when first encountering an enemy.
nosurprise( Integer nosurprise )
set to 0 to allow this guy to play a surprised animation when first encountering an enemy.
noticescale( Float multiplier )
Set the max multiplier in time to notice an enemy (default 100, half as big notices twice as fast)
noticescale
Get the max multiplier in time to notice an enemy (default 100, half as big notices twice as fast)
noticescale( Float multiplier )
Set the max multiplier in time to notice an enemy (default 100, half as big notices twice as fast)
spawn something near the player, either within the player's view or behind him
model - name of model to spawn
range - how close does this need to be to the player to actually get spawned, default 480 (30 foot radius).
vector_offset - oriented vector offset of where to spawn the item, default (0 0 0)
inFOV -
1 - Only spawn when this position is within the FOV of the player
-1 - Only spawn when this position is outside the FOV of the player
0 - (default) don't care, always spawn
speed - how fast the effect should travel, in other words, how long before the effect gets spawned.
delay is calculated based on the distance between object and player divided by the speed
0 - no delay
960 - (default) 60 feet per second. If the object is 60 feet from the player, the player effect will spawn one second later.
setcontrollerangles( Integer num, Vector angles )
Sets the control angles for the specified bone.
setsynctime( Float synctime )
Set sync time for entity.
setyawfrombone( String bone_name )
Set the yaw of the model based on the current animation time
Makes the camera follow an entity and optionally watch an entity.
follow_distance( Float distance )
Sets the camera follow distance.
follow_yaw( Float yaw )
Sets the yaw offset of the camera following an entity.
follow_yaw_absolute
Makes the follow camera yaw absolute.
follow_yaw_relative
Makes the follow camera yaw relative (not absolute).
fov( Float fov, [ Float fadeTime ] )
Sets the camera's field of view (fov).
if fadeTime is specified, camera will fade over that time
if fov is less than 3, than an auto_fov will be assumed
the value of fov will be the ratio used for keeping a watch
entity in the view at the right scale
lookat( Entity ent )
Makes the camera look at an entity.
moveto( Entity ent )
Move the camera's position to that of the specified entities.
movetopos( Vector position )
Move the camera's position to the specified position.
nextcamera( String nextCamera )
Sets the next camera to use.
nowatch( [ Float fadeTime ] )
Stop watching an entity or looking along a path.
Camera is now static as far as orientation.
if fadeTime is specified, camera will fade over that time
kills all objects along the trace
offset - initial offset from origin
direction - angular offset orientation for trace
radius - thickness of trace
distance - how far to trace
spawn an oriented bounding box with the given dimensions and an angular offset
mins - min dimensions of box
maxs - max dimensions of box
yawoffset - angular offset orientation of box
Decal → Entity → SimpleEntity → Listener → Class
DM_Manager → Listener → Class
doroundtransition
delayed function call to (possibly) determine round winner and restart next round
finishroundtransition
delayed function call to do the actual restart for the next round
DM_Team → Listener → Class
Door (NormalDoor) → ScriptSlave → Mover → Trigger → Animate → Entity → SimpleEntity → Listener → Class
alwaysaway
Makes the door always open away from the person opening it.
angle( Float newAngle )
set the angles of the entity using just one value.
Sets the yaw of the entity or an up and down
direction if newAngle is [0-359] or -1 or -2
close
Closes the door.
dmg( Integer damage )
Sets the amount of damage the door will do to entities that get stuck in it.
doActivate( Entity activatingEntity )
General trigger event for all entities
doBlocked( Entity obstacle )
sent to entity when blocked.
door_triggerfield( Entity other )
Is called when a doors trigger field is touched.
doorclosed
Called when the door finishes closing.
dooropened
Called when the door finishes opening.
doortype( String door_type )
Sets the defaults for this door
Door Defaults: wood(default)
metal
attach a entity with modelname to this entity to tag called tagname.
scale - scale of attached entities
targetname - targetname for attached entities
detach_at_death - when entity dies, should this model be detached.
removetime - when the entity should be removed, if not specified, never.
fadeintime - time to fade the model in over.
fadeoutdelay - time to wait until we fade the attached model out
fadeoutspeed - time the model fades out over
offset - vector offset for the model from the specified tag
Change the current entity effects flags.
Valid flags are as follows:
+ sets a flag, - clears a flag
antisbjuice - anti sucknblow juiceeveryframe - process commands every time entity is rendered
Fade the entity's alpha and scale in, increasing it by 0.03
every FRAMETIME, until it has faded completely in to 1.0.
If fadetime or target_alpha are defined, they will override
the default values.
Fade the entity's alpha and scale out, reducing it by 0.03
every FRAMETIME, until it has faded out. If fadetime or
target_alpha are defined, they will override the defaults.
Once the entity has been completely faded, the entity is removed.
Change the current entity flags.
Valid flags are as follows:
+ sets a flag, - clears a flag
blood - should it bleed
explode - should it explode when dead
die_gibs - should it spawn gibs when dead
god - makes the entity invincible
forceactivate
Forces an entity to activate outside of the player's PVS
getcontrollerangles( Integer num )
Gets the control angles for the specified bone.
GetLocalYawFromVector
Turn a worldspace vector into a local space yaw
getmaxs
Get the maxs of the bounding box of the entity to maxs.