MOHAA GAME Module Classes(1)
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.
calcgrenadetoss2( Vector target_position, Float speed )
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
kickdir
Gets the direction the AI wants to kick
killed( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
event which is sent to an entity once it as been killed
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
last_enemy_visible_time
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)
pain( Entity attacker, Float damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
used to inflict pain to an entity
painhandler
Sets the current script that will handle pain events
painhandler
Gets the current script that will handle pain events
pathdist
returns total distance along current path to the path goal
patrolpath( String value )
Sets the name of the patrol path for the actor (must have type set to patrol for effect)
patrolpath( String value )
Sets the name of the patrol path for the actor (must have type set to patrol for effect)
patrolpath
Gets the name of the patrol path for the actor (must have type set to patrol for effect)
physics_off
turn physics off.
physics_on
turn physics on.
playsound( String soundName, [ Integer channel ], [ Float volume ], [ Float min_distance ], [ Float pitch ] )
play a sound coming from this entity.
default channel, CHAN_BODY.
pointat( Entity entity )
The actor will point at this entity.
position
The Position the Actor wants to be and should animate towards
position
The Position the Actor wants to be and should animate towards
ReadyToFire
Returns if ready to fire
reload_mg42
Reload the mg42 - only used by machinegunner
remove
Removes this listener the next time events are processed.
resetleash
resets the AI's leash to their current position
runanimrate
Get the rate at which the run animation plays back
runanimrate( Float multiplier )
Set the rate at which the run animation plays back
runanimrate( Float multiplier )
Set the rate at which the run animation plays back
runto( String dest )
Specify the location to run to.
say( String animation )
The name of a dialog animation to play
saydone
Even used by sound-only special case of say to trigger waittill saydone
setactionanim( String base_anim, Float lower_limit, Float upper_limit )
Set the base action animation and range that they cover
setaimmotionanim( String anim_crouch, String anim_stand )
Set aim motion animation (handler scripts only)
setaimtarget( Entity entity, Integer bMakeEnemy )
Sets the primary weapon's aim target. if you pass a 1 for p2, the target will become the current enemy...
setanim( String anim, Integer slot, Float weight, String flagged )
Set animation slot
setanimlength( Float time )
Set the maximum time an animation will play
setmotionanim( String anim )
Set motion animation (handler scripts only)
setreloadcover
do this command to let the ai know it needs to reload; used to reload while going to cover
setsay( String animation )
The name of a dialog animation to play - used by animation script only
setupperanim( String anim )
Set the upper body animation - used by animation script only
share_enemy
internal code use only - shares an AI's enemy with his squad mates.
share_grenade
internal code use only - shares an AI's grenade with his squad mates.
sight( Float max_sight_range )
Sets the vision distance of the actor.
sight
Gets the vision distance of the actor.
sight( Float max_sight_range )
Sets the vision distance of the actor.
silent( Integer silent )
set to 0 to prevent this guy from saying stuff besides pain and death sounds.
silent
gets whether or not this guy is allowed to say stuff besides pain and death sounds
silent( Integer silent )
set to 0 to prevent this guy from saying stuff besides pain and death sounds.
sound_awareness
gets the awareness of sounds in 0-100 percent chance of hearing a sound withinhalf of the sound's radius' fades to zero outside sound's radius
sound_awareness( Float awareness_percent )
sets the awareness of sounds in 0-100 percent chance of hearing a sound withinhalf of the sound's radius' fades to zero outside sound's radius
sound_awareness( Float awareness_percent )
sets the awareness of sounds in 0-100 percent chance of hearing a sound withinhalf of the sound's radius' fades to zero outside sound's radius
stopped
sent when entity has stopped bouncing for MOVETYPE_TOSS.
suppresschance
sets the percent chance of doing suppressing fire when appropriate (0-100)
suppresschance
sets the percent chance of doing suppressing fire when appropriate (0-100)
suppresschance
sets the percent chance of doing suppressing fire when appropriate (0-100)
tether( Entity entity )
the entity to which the AI's leash should be tethered
thinkstate
current ai think state; can be void, idle, pain, killed, attack, curious, disguise, or grenade.
turndoneerror
The error amount that turndone will occur for the turnto command.
turndoneerror( Float error )
The error amount that turndone will occur for the turnto command.
turndoneerror( Float error )
The error amount that turndone will occur for the turnto command.
turnspeed( Float speed )
The turn speed of the actor.
turnspeed
The turn speed of the actor.
turnspeed( Float speed )
The turn speed of the actor.
turnto( Entity entity )
The actor will turn to this entity.
turret
Gets the turret of the actor.
turret( String turret )
Sets the turret of the actor.
turret( String turret )
Sets the turret of the actor.
type_attack
Gets the attack type of the actor.
type_attack( String value )
Sets the attack type of the actor.
type_attack( String value )
Sets the attack type of the actor.
type_disguise( String value )
Sets the disguise type of the actor.
type_disguise
Gets the disguise type of the actor.
type_disguise( String value )
Sets the disguise type of the actor.
type_grenade( String value )
Sets the grenade type of the actor.
type_grenade
Gets the grenade type of the actor.
type_grenade( String value )
Sets the grenade type of the actor.
type_idle( String value )
Sets the idle type of the actor.
type_idle
Gets the idle type of the actor.
type_idle( String value )
Sets the idle type of the actor.
unholster( Integer if )
Unholster weapon
upperanim( String anim )
Set the upper body animation
use( String name, [ Integer weapon_hand ] )
Use the specified weapon or item in the hand choosen (optional).
voicetype
Gets the voice type
voicetype
Set voicetype to magic letter postfix
voicetype
Set voicetype to magic letter postfix
waittrigger( Boolean bool )
If true, patrol guys and running men wait until triggered to move
waittrigger( Boolean bool )
If true, patrol guys and running men wait until triggered to move
waittrigger
If true, patrol guys and running men wait until triggered to move
walkto( String dest )
Specify the location to walk to.
weapon( String weapon_modelname )
Sets the weapon.
weapon( String weapon_modelname )
Gives the sentient the weapon specified.
weapon
Gets the weapon.
weapon_internal( String s )
internal use
weapongroup
Specifies weapon animation set to use in anim scripts
weapontype
The Weapon Type of the Actor
Ammo → Class
AmmoEntity → Item → Trigger → Animate → Entity → SimpleEntity → Listener → Class
ammoentity_postspawn
Ammo Entity Post Spawn
Animate (animate) → Entity → SimpleEntity → Listener → Class
anim( String animName )
Exec anim commands on server or client.
isloopinganim( String anim_name )
returns 1 if the anim is a looping anim, or 0 otherwise
pauseanims( Integer pause )
Pause (or unpause) animations
playerspawn( String model_name, [ Float range ], [ Vector vector_offset ], [ Float inFOV ], [ Float speed ] )
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
testmojo( String model_name, Vector vector_offset )
INTERNAL EVENT
AnimationEvent → Event → Class
Armor → Item → Trigger → Animate → Entity → SimpleEntity → Listener → Class
BarrelObject (func_barrel) → Entity → SimpleEntity → Listener → Class
barreltype( String type )
Sets the barrel's type
damage( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
general damage event used by all entities
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
killed( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
event which is sent to an entity once it as been killed
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
Body → Animate → Entity → SimpleEntity → Listener → Class
Camera (func_camera) → Entity → SimpleEntity → Listener → Class
auto_active( Boolean newActiveState )
Whether or not the auto camera is active.
auto_maxfov( Float maxFOV )
Sets the maximum FOV that should be used when automatically calculating FOV.
auto_radius( Float newRadius )
Sets the radius of the automatic camera.
auto_starttime( Float newTime )
Sets how long it takes for the camera to be switched to.
auto_state( String state1, [ String state2 ], [ String state3 ], [ String state4 ], [ String state5 ], [ String state6 ] )
Sets the states the player needs to be in for this camera to activate.
auto_stoptime( Float newTime )
Sets how long it takes for the camera switch back to the player.
camera_think
Called each frame to allow the camera to adjust its position.
continue
Continue the camera movement.
cut
switch camera states immediately, do not transition
doActivate( Entity activatingEntity )
General trigger event for all entities
fadetime( Float fadetime )
Sets the fade time for camera transitioning.
follow( Entity targetEnt, [ Entity targetWatchEnt ] )
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
orbit( Entity targetEnt, [ Entity targetWatchEnt ] )
Makes the camera orbit around an entity and optionally watch an entity.
orbit_height( Float height )
Sets the orbit camera's height.
pause
Pause the camera.
showquakes( Integer 0 )
Sets the camera to show or not show earthquake effects.
speed( Float speed )
Sets the camera speed.
start
Start camera moving.
stop
Stop the camera movement.
turnto( Vector angle )
Makes the camera look in the specified direction.
watch( Entity watchEnt, [ Float fadeTime ] )
Makes the camera watch an entity.
if fadeTime is specified, camera will fade over that time
watchnode( [ Float fadeTime ] )
Makes the camera watch based on what is stored
in the camera nodes.
if fadeTime is specified, camera will fade over that time
watchpath( [ Float fadeTime ] )
Makes the camera look along the path of travel.
if fadeTime is specified, camera will fade over that time
watchstring( String string, [ Float fadeTime ] )
Makes the camera watch based on a string.
if fadeTime is specified, camera will fade over that time
CameraManager → Listener → Class
add
Add a new point to the camera path where the player is standing.
cancelFor( String name )
Cancel for current path node event of type name
delete
Delete the current path node.
hide
Hides the paths.
load( String filename )
Loads a camera path.
loop( [ Entity path ] )
Loop the current path or the specified one.
moveplayer
Move the player to the current path node position.
new
Starts a new path.
next
Go to the next path node.
nextpath
Go to the next path.
nowatch
Set the current path node to watch nothing.
play( [ Entity path ] )
Play the current path or the specified one once.
prev
Go to the previous path node.
prevpath
Go to the previous path.
renamepath( String newName )
Rename the path to the new name.
replace
Replace the current path node position/angle with the player's.
save( String filename )
Saves the camera path.
savemap( String filename )
Saves the camera path to a map file.
setfadetime( Float newFadeTime )
Set the fadetime of the current path node.
setfov( String newFOV )
Set the fov at the current path node.
setpath( Entity path )
Sets the new path.
setspeed( Float speed )
Set the speed of the camera at the current path node.
settarget( String target )
Set the trigger target.
settargetname( String targetname )
Set the targetname.
show( [ Entity path ] )
Shows the specified path.
stop
Stop the camera playing path.
updateinput
Updates the current node with user interface values.
waitTill( String name )
Wait until current path node event of type name
watch( String watch )
Set the current path node to watch something.
CarryableTurret → InventoryItem → Weapon → Item → Trigger → Animate → Entity → SimpleEntity → Listener → Class
dropturret
Makes the carryable turret have itself dropped
item_pickup( Entity item )
Pickup the specified item.
placeturret
Try to place the carryable turret
turrettik
Tiki of the turret to place
Class
ConsoleEvent → Event → Class
CrateObject (func_crate) → Entity → SimpleEntity → Listener → Class
damage( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
general damage event used by all entities
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
debristype( Integer type )
Sets the debris type of the crate
killed( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
event which is sent to an entity once it as been killed
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
DamageModel (DamageModel) → Animate → Entity → SimpleEntity → Listener → Class
damage( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
general damage event used by all entities
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
killed( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
event which is sent to an entity once it as been killed
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
killthread( String thread )
Set the thread to execute when this model is killed
killtrace( Vector offset, Vector direction, Float radius, Float distance )
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
orientedbbox( Vector mins, Vector maxs, Float yawoffset )
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
doUse( Entity activatingEntity )
sent to entity when it is used by another entity
killed( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
event which is sent to an entity once it as been killed
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
linkdoor
Link doors together.
lock
Lock the door.
open( Entity other )
Opens the door.
sound_close_end( String sound_close )
Sets the sound to use when the door closes.
sound_close_start( String sound_close )
Sets the sound to use when the door closes.
sound_locked( String sound_locked )
Sets the sound to use when the door is locked.
sound_message( String sound_message )
Sets the sound to use when the door displays a message.
sound_open_end( String sound_open_end )
Sets the sound to use when the door stops to opens.
sound_open_start( String sound_open_start )
Sets the sound to use when the door starts to opens.
time( Float traveltime )
Sets the time it takes for the door to open an close.
toggledoor( Entity other )
Toggles the state of the door (open/close).
triggereffect( Entity triggering_entity )
Send event to owner of trigger.
trysolid
Trys to make the door solid.
tryToOpen( Entity other )
Tries to open the door.
unlock
Unlock the door.
wait( Float wait )
Sets the amount of time to wait before automatically shutting.
DrivableVehicle → Vehicle → VehicleBase → Animate → Entity → SimpleEntity → Listener → Class
doBlocked( Entity obstacle )
sent to entity when blocked.
doTouch( Entity touchingEntity )
sent to entity when touched.
killed( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
event which is sent to an entity once it as been killed
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
DynItem → Item → Trigger → Animate → Entity → SimpleEntity → Listener → Class
damage( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
general damage event used by all entities
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
kill
console based command to kill yourself if stuck.
EffectEntity (effectentity) → Animate → Entity → SimpleEntity → Listener → Class
Emitter (func_emitter) → Entity → SimpleEntity → Listener → Class
doTouch( Entity touchingEntity )
sent to entity when touched.
emitter( String name )
Emitter to use
idle
Animates the puff daddy.
Entity → SimpleEntity → Listener → Class
ai_event( [ String type ], [ Float radius ] )
Let the AI know that this entity made a sound,
type is a string specifying what type of sound it is.
radius determines how far the sound reaches.
alpha( Float newAlpha )
Set the alpha of the entity to alpha.
alwaysdraw
Sets this entity to always draw
attach( Entity parent, String tagname, [ Integer use_angles ] )
attach this entity to the parent's legs tag called tagname
attachedmodelanim( String tagname, String anim_name, Float crossblend_time, String model_name )
Tells models (or specified model) attached to specified tag to play
specified animation. Crossbkend time doesn't work yet.
attachmodel( String modelname, String tagname, [ Float scale ], [ String targetname ], [ Boolean detach_at_death ], [ Float removetime ], [ Float fadeintime ], [ Float fadeoutdelay ], [ Float fadetime ], [ Vector offset ] )
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
avelocity
gets the angular velocity for this entity.
bind( Entity parent )
bind this entity to the specified entity.
brushmodel
get the brush modelName.
cansee( Entity entity, [ Float fov ], [ Float vision_distance ] )
returns 1 if the entities can see eachother, 0 if not; blocked by any entities between them
canseenoents( Entity entity, [ Float fov ], [ Float vision_distance ] )
returns 1 if the entities can see eachother, 0 if not; ignores any entities between them
censor
used to ban certain contact when in parentmode
classname
The entity's classname
classname( String nameOfClass )
Determines what class to use for this entity,
this is pre-processed from the BSP at the start
of the level.
connect_paths
Connects all navigation paths which intersect with the specified entity's volume
damage( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )
general damage event used by all entities
Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot
damage_type( String meansofdeathstring )
Set the type of damage that this entity can take
deathsinkeachframe
Makes the entity sink into the ground and then get removed (this gets called each frame).
deathsinkstart
Makes the entity sink into the ground and then get removed (this starts it).
delete
Removes this listener immediately.
detach
detach this entity from its parent.
detachallchildren
Detach all the children from the entity.
disconnect_paths
Disconnects all navigation paths which intersect with the specified entity's volume
dm( String command, [ String parms ] )
Makes a command be executed only in multiplayer
dmrealism( String command, [ String parms ] )
Makes a command be executed only in miltiplayer realism mode
droptofloor( [ Float maxRange ] )
drops the entity to the ground, if maxRange is not specified 8192 is used.
effects( [ String parameter1 ], [ String parameter2 ], [ String parameter3 ], [ String parameter4 ], [ String parameter5 ], [ String parameter6 ] )
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
entnum
The entity's entity number
explosionattack( String explosionModel, [ String tagName ] )
Spawn an explosion optionally from a specific tag
fade( [ Float fadetime<0.00...max_float> ], [ Float target_alpha<0.00...1.00> ] )
Fade the entity's alpha, reducing it by 0.03
every FRAMETIME, until it has faded out, does not remove the entity
fadein( [ Float fadetime<0.00...max_float> ], [ Float target_alpha<0.00...1.00> ] )
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.
fadeout( [ Float fadetime<0.00...max_float> ], [ Float alpha<0.00...1.00> ] )
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.
flags( [ String parameter1 ], [ String parameter2 ], [ String parameter3 ], [ String parameter4 ], [ String parameter5 ], [ String parameter6 ] )
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.
0 评论
Recommended Comments
没有要显示的评论。
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new account登录
Already have an account? Sign in here.
现在登录