ACS built-in functions: Difference between revisions
(→Things) |
|||
(29 intermediate revisions by the same user not shown) | |||
Line 24: | Line 24: | ||
===Sectors=== | ===Sectors=== | ||
{|class="wikitable sortable | |||
! Name | |||
! Description | |||
|- | |||
||[[ChangeCeiling]]||Changes the ceiling texture. | |||
|- | |||
||[[ChangeFloor]]||Changes the floor texture. | |||
|- | |||
||[[GetSectorCeilingZ]]||Gets the ceiling height. | |||
|- | |||
||[[GetSectorFloorZ]]||Gets the floor height. | |||
|- | |||
||[[GetSectorLightLevel]]||Gets the light level. | |||
|- | |||
||[[SectorDamage]]||Damages things in sector. | |||
|- | |||
||[[SetSectorDamage]]||Modifies the damaging floor status. | |||
|- | |||
||[[TagWait]]||Waits for sectors to stop movement. | |||
|} | |||
===Things=== | ===Things=== | ||
*[[ActivatorTID]] | *[[ActivatorTID]] | ||
*[[ChangeActorAngle]] | |||
*[[ChangeActorPitch]] | |||
*[[CheckActorCeilingTexture]] | *[[CheckActorCeilingTexture]] | ||
*[[CheckActorClass]] | *[[CheckActorClass]] | ||
*[[CheckActorFloorTexture]] | |||
*[[CheckActorProperty]] | *[[CheckActorProperty]] | ||
*bool [[CheckFlag]](int tid, str flag) | *bool [[CheckFlag]](int tid, str flag) | ||
Line 42: | Line 58: | ||
*bool CheckSight(int source, int dest, int flags) | *bool CheckSight(int source, int dest, int flags) | ||
:Returns true if there's a line of sight between at least one thing tagged as source and one thing tagged as dest. Currently flags is reserved and must be 0. | :Returns true if there's a line of sight between at least one thing tagged as source and one thing tagged as dest. Currently flags is reserved and must be 0. | ||
*int [[ClassifyActor]](int tid) | *int [[ClassifyActor]](int tid) | ||
:Checks the kind of thing tagged tid. It returns a set of flags, possibly combined: | :Checks the kind of thing tagged tid. It returns a set of flags, possibly combined: | ||
Line 54: | Line 69: | ||
:*ACTOR_NONE (0): no thing found with this TID | :*ACTOR_NONE (0): no thing found with this TID | ||
:*ACTOR_WORLD (1): TID is 0 but activator isn't a thing | :*ACTOR_WORLD (1): TID is 0 but activator isn't a thing | ||
*[[GetActorAngle]] | |||
*[[GetActorCeilingZ]] | |||
*[[GetActorFloorZ]] | |||
*[[GetActorLightLevel]] | |||
*[[GetActorPitch]] | |||
*[[GetActorProperty]] | *[[GetActorProperty]] | ||
*[[GetActorVelX]] | *[[GetActorVelX]] | ||
*[[GetActorVelY]] | *[[GetActorVelY]] | ||
*[[GetActorVelZ]] | *[[GetActorVelZ]] | ||
*[[ | *[[GetActorX]] | ||
*[[GetActorY]] | |||
*[[GetActorZ]] | |||
*[[IsTIDUsed]] | *[[IsTIDUsed]] | ||
*[[SetActivator]] | *[[SetActivator]] | ||
*[[SetActivatorToTarget]] | *[[SetActivatorToTarget]] | ||
Line 87: | Line 105: | ||
*void Thing_Projectile2 (int tid, int type, int angle, int speed, int vspeed, int gravity, int newtid) | *void Thing_Projectile2 (int tid, int type, int angle, int speed, int vspeed, int gravity, int newtid) | ||
*int UniqueTID ([int tid[, int limit]]) | *int UniqueTID ([int tid[, int limit]]) | ||
===Player=== | |||
*[[CheckInventory]] | |||
*[[CheckWeapon]] | |||
*[[GetWeapon]] | |||
*[[GetSigilPieces]] | |||
*[[PlayerArmorPoints]] | |||
*[[PlayerCount]] | |||
*[[PlayerFrags]] | |||
*[[PlayerHealth]] | |||
*[[PlayerNumber]] | |||
*[[SetWeapon]] | |||
*[[TakeInventory]] | |||
===Linedefs and sidedefs=== | ===Linedefs and sidedefs=== | ||
Line 107: | Line 138: | ||
|- | |- | ||
|| || [[ReplaceTextures]] || nothing || str old_texture_name, str new_texture_name[, int flags] || | || || [[ReplaceTextures]] || nothing || str old_texture_name, str new_texture_name[, int flags] || | ||
|- | |||
|| || [[SetLineBlocking]] || || || | |||
|- | |- | ||
||internal|| [[SetLineMonsterBlocking]] || || || Makes a linedef block or not block monsters. | ||internal|| [[SetLineMonsterBlocking]] || || || Makes a linedef block or not block monsters. | ||
Line 128: | Line 161: | ||
===Console=== | ===Console=== | ||
*int GetCVar (str cvar) | *int [[GetCVar]] (str cvar) | ||
*string GetCVarString (str cvar) | *string [[GetCVarString]] (str cvar) | ||
*int GetPlayerInput (int player, int input) | *int GetPlayerInput (int player, int input) | ||
===Polyobjects=== | ===Polyobjects=== | ||
*[[GetPolyobjX]] | *[[GetPolyobjX]] | ||
*[[GetPolyobjY]] | *[[GetPolyobjY]] | ||
*[[PolyWait]] | |||
===Quake=== | ===Quake=== | ||
Line 140: | Line 175: | ||
===Math=== | ===Math=== | ||
*[[Cos]] | *[[Cos]] | ||
*fixed [[FixedSqrt]] (fixed number) | |||
*int [[Random]] (int min, int max) | *int [[Random]] (int min, int max) | ||
*int [[Sqrt]] (int number) | *int [[Sqrt]] (int number) | ||
* | *[[Sin]] | ||
*[[VectorAngle]] | *[[VectorAngle]] | ||
*int [[VectorLength]] (int x, int y) | *int [[VectorLength]] (int x, int y) | ||
Line 152: | Line 188: | ||
===Level state=== | ===Level state=== | ||
*[[GameSkill]] | |||
*[[GameType]] | |||
*[[GetLevelInfo]] | |||
*[[SetAirControl]] | *[[SetAirControl]] | ||
*[[SetAirFriction]] | *[[SetAirFriction]] | ||
*[[SetGravity]] | |||
*[[SinglePlayer]] | |||
*[[Timer]] | |||
==See also== | ==See also== |
Latest revision as of 11:16, 2 January 2022
These are predefined ACS functions with no parameterized linedef special equivalents, accessible only through ACS scripts.
NOTE: most of these functions are meant to be compatible with those from ZDoom. For any ones not yet documented on this wiki, you can check the ZDoom wiki. A few of them may be incompletely implemented in Eternity. Don't hesitate to update the wiki in case of any mistakes.
Special TID info[edit]
For functions affecting things, some TIDs (thing tags) carry special meaning. TID 0 means the activator, and TIDs -1 ... -4 mean each of the four players in the game -- this is an Eternity extension
Data type info[edit]
You may see specifiers such as void, str, int and others in ACS function signatures. They act as a guide on what kinds of values are expected, but in ACS there really are only two types: str and int (and str internally is merely a string ID number). Most importantly:
- void means that a function should be used as a procedure (command) without returning anything,
- fixed means you can use the decimal point notation: 1.0 is equivalent to 65536, 1.5 to 98304 etc. In ACS, such values are still of int type, but whether you use the decimal point or not is quite relevant. A value such as 128.0 is not the same as 128: it's actually equal to 8388608 (no decimal point).
Function list[edit]
Sound and music[edit]
- ActivatorSound
- AmbientSound
- LocalAmbientSound
- PlayActorSound
- PlaySound
- SectorSound
- SetMusic
- LocalSetMusic
- SoundSequence
- SoundSequenceOnActor
- StopSound
- ThingSound
Sectors[edit]
Name | Description |
---|---|
ChangeCeiling | Changes the ceiling texture. |
ChangeFloor | Changes the floor texture. |
GetSectorCeilingZ | Gets the ceiling height. |
GetSectorFloorZ | Gets the floor height. |
GetSectorLightLevel | Gets the light level. |
SectorDamage | Damages things in sector. |
SetSectorDamage | Modifies the damaging floor status. |
TagWait | Waits for sectors to stop movement. |
Things[edit]
- ActivatorTID
- ChangeActorAngle
- ChangeActorPitch
- CheckActorCeilingTexture
- CheckActorClass
- CheckActorFloorTexture
- CheckActorProperty
- bool CheckFlag(int tid, str flag)
- Returns true if the first thing with the given tid has the given flag enabled.
- CheckProximity
- bool CheckSight(int source, int dest, int flags)
- Returns true if there's a line of sight between at least one thing tagged as source and one thing tagged as dest. Currently flags is reserved and must be 0.
- int ClassifyActor(int tid)
- Checks the kind of thing tagged tid. It returns a set of flags, possibly combined:
- ACTOR_PLAYER (2): it's player-controlled
- ACTOR_VOODOODOLL (8): it's a duplicate player start, not controlled by the player but still linked to it. Used in Boom maps for advanced mapping tricks
- ACTOR_MONSTER (16): it's a monster (has COUNTKILL or KILLABLE thing type flag set)
- ACTOR_MISSILE (128): it's a projectile in flight (has MISSILE thing type flag set)
- ACTOR_GENERIC (256): neither a monster, nor a projectile
- ACTOR_ALIVE (32): has positive health
- ACTOR_DEAD (64): has health <= 0
- ACTOR_NONE (0): no thing found with this TID
- ACTOR_WORLD (1): TID is 0 but activator isn't a thing
- GetActorAngle
- GetActorCeilingZ
- GetActorFloorZ
- GetActorLightLevel
- GetActorPitch
- GetActorProperty
- GetActorVelX
- GetActorVelY
- GetActorVelZ
- GetActorX
- GetActorY
- GetActorZ
- IsTIDUsed
- SetActivator
- SetActivatorToTarget
- void SetActorAngle (int tid, fixed angle)
- SetActorVelocity
- void SetActorPitch (int tid, int pitch)
- SetActorPosition
- void SetThingSpecial (int tid, int special [, int arg0 [, int arg1 [, int arg2 [, int arg3 [, int arg4]]]]])
- int SetActorState(int tid, str statename[, bool exact]);
- SetActorProperty
- int Spawn (str classname, fixed x, fixed y, fixed z [, int tid [, int angle]])
- int SpawnForced (str classname, fixed x, fixed y, fixed z [, int tid [, int angle]])
- SpawnProjectile
- SpawnSpot
- int SpawnSpotFacing (str classname, int spottid [, int tid])
- SpawnSpotFacingForced
- SpawnSpotForced
- int ThingCount (int type, int tid)
- int ThingCountName (str classname, int tid)
- int ThingCountSector (int type, int tid, int tag)
- int ThingCountNameSector (str classname, int tid, int tag)
- int Thing_Damage2 (int tid, int amount, str type);
- void Thing_Projectile2 (int tid, int type, int angle, int speed, int vspeed, int gravity, int newtid)
- int UniqueTID ([int tid[, int limit]])
Player[edit]
- CheckInventory
- CheckWeapon
- GetWeapon
- GetSigilPieces
- PlayerArmorPoints
- PlayerCount
- PlayerFrags
- PlayerHealth
- PlayerNumber
- SetWeapon
- TakeInventory
Linedefs and sidedefs[edit]
zspecial.acs index | Name | Return type | Parameters | Description |
---|---|---|---|---|
internal | ClearLineSpecial | nothing | nothing | Clears the trigger linedef's special. |
GetLineRowOffset | ||||
GetLineX | ||||
GetLineY | ||||
LineSide | ||||
ReplaceTextures | nothing | str old_texture_name, str new_texture_name[, int flags] | ||
SetLineBlocking | ||||
internal | SetLineMonsterBlocking | Makes a linedef block or not block monsters. | ||
SetLineSpecial | ||||
SetLineTexture | nothing | int line_id, int line_side, int sidedef_texture, str texture_name |
Sky[edit]
Scripts[edit]
- bool ACS_NamedExecuteAlways(str script, int map, int arg1, int arg2, int arg3)
- Executes a named script, starting a new instance if one already exists. Returns true if successfully started.
- bool ACS_NamedExecute(str script, int map, int arg1, int arg2, int arg3)
- Executes a named script. Returns true if successfully started.
- int ACS_NamedExecuteWithResult (string script, int s_arg1, int s_arg2, int s_arg3, int s_arg4)
- bool ACS_NamedSuspend (string script, int map)
- bool ACS_NamedTerminate (string script, int map)
Console[edit]
- int GetCVar (str cvar)
- string GetCVarString (str cvar)
- int GetPlayerInput (int player, int input)
Polyobjects[edit]
Quake[edit]
Math[edit]
- Cos
- fixed FixedSqrt (fixed number)
- int Random (int min, int max)
- int Sqrt (int number)
- Sin
- VectorAngle
- int VectorLength (int x, int y)
Strings[edit]
- str StrLeft (str string, int length)
- str StrMid (str string, int start, int length)
- str StrRight (str string, int length)