Editing ACS built-in functions

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
These are predefined ACS functions with no [[parameterized linedef specials|parameterized linedef special]] equivalents, accessible only through ACS scripts.
These ACS functions are imported from ZDoom.
 
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==
==Special TID info==
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
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 in an Eternity extension
==Data type info==
==Sound and music==
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 ActivatorSound(str sound, int volume)
*''void'' means that a function should be used as a procedure (command) without returning anything,
:Starts a sound from script's activator, at the given volume. If there's no activating thing, the sound will be ambient.
*''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).
*void AmbientSound(str sound, int volume)
==Function list==
:Starts an ambient sound.
===Sound and music===
*void LocalAmbientSound(str sound, str volume)
*[[ActivatorSound]]
:Starts an ambient sound that can only be heard by the activator, normally a player.
*[[AmbientSound]]
*void PlaySound (int tid, str sound [, int channel [, fixed volume [, bool looping [, fixed attenuation]]]])
*[[LocalAmbientSound]]
*void PlayActorSound (int tid, int sound, int channel, fixed volume, bool looping, fixed attenuation)
*[[PlayActorSound]]
*void SectorSound(str sound, int volume);
*[[PlaySound]]
*void SetMusic (str song [, int order [, int unused]])
*[[SectorSound]]
*void LocalSetMusic (str song [, int order [, int unused]])
*[[SetMusic]]
*void SoundSequence (str sndseq);
*[[LocalSetMusic]]
*void SoundSequenceOnActor (int tid, str sndseq);
*[[SoundSequence]]
*void StopSound (int tid, int channel);
*[[SoundSequenceOnActor]]
*void ThingSound (int tid, str sound, int volume);
*[[StopSound]]
*[[ThingSound]]
 
===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===
==Sectors==
*[[ActivatorTID]]
*void ChangeCeiling(int tag, str flatname)
*[[ChangeActorAngle]]
:Changes the ceiling texture of tagged sectors to flatname.
*[[ChangeActorPitch]]
*void ChangeFloor(int tag, str flatname)
*[[CheckActorCeilingTexture]]
:Changes the floor texture of tagged sectors to flatname.
*[[CheckActorClass]]
*fixed GetSectorCeilingZ (int tag, int x, int y)
*[[CheckActorFloorTexture]]
:Gets sector ceiling height. Currently x and y are reserved for the time Eternity gets working slope physics.
*[[CheckActorProperty]]
*fixed GetSectorFloorZ (int tag, int x, int y)
*bool [[CheckFlag]](int tid, str flag)
:Gets sector floor height. Currently x and y are reserved for the time Eternity gets working slope physics.
:Returns true if the first thing with the given tid has the given flag enabled.
*int GetSectorLightLevel (int tag)
*[[CheckProximity]]
==Things==
*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)
*bool CheckFlag(int tid, str flag)
:Returns true if the first thing with the given tid has the given flag enabled.
*bool CheckActorClass(int tid, str class)
:Returns true if the first thing with the given tid is of the given class.
*[[CheckActorProperty]]
*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:
:*ACTOR_PLAYER (2): it's player-controlled
:*ACTOR_PLAYER (2): it's player-controlled
Line 69: Line 48:
:*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]]
*bool IsTIDUsed (int tid)
*[[GetActorVelY]]
*void SectorDamage (int tag, int amount, str type, str protection_item, int flags)
*[[GetActorVelZ]]
*int SetActivator (int tid[, pointer_selector])
*[[GetActorX]]
*bool SetActivatorToTarget (int tid)
*[[GetActorY]]
*[[GetActorZ]]
*[[IsTIDUsed]]
*[[SetActivator]]
*[[SetActivatorToTarget]]
*void SetActorAngle (int tid, fixed angle)
*void SetActorAngle (int tid, fixed angle)
*[[SetActorVelocity]]
*bool SetActorVelocity (int tid, fixed velx, fixed vely, fixed velz, bool add, bool setbob)
*void SetActorPitch (int tid, int pitch)
*void SetActorPitch (int tid, int pitch)
*[[SetActorPosition]]
*bool SetActorPosition (int tid, fixed x, fixed y, fixed z, bool fog)
*void SetThingSpecial (int tid, int special [, int arg0 [, int arg1 [, int arg2 [, int arg3 [, int arg4]]]]])
*void SetThingSpecial (int tid, int special [, int arg0 [, int arg1 [, int arg2 [, int arg3 [, int arg4]]]]])
*int SetActorState(int tid, str statename[, bool exact]);
*int SetActorState(int tid, str statename[, bool exact]);
Line 93: Line 62:
*int Spawn (str classname, fixed x, fixed y, fixed z [, int tid [, int angle]])
*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]])
*int SpawnForced (str classname, fixed x, fixed y, fixed z [, int tid [, int angle]])
*[[SpawnProjectile]]
*void SpawnProjectile (int tid, string type, int angle, int speed, int vspeed, int gravity, int newtid);
*[[SpawnSpot]]
*int SpawnSpot (str classname, int spottid [, int tid [, int angle]])
*int SpawnSpotForced (str classname, int spottid [, int tid [, int angle]])
*int SpawnSpotFacing (str classname, int spottid [, int tid])
*int SpawnSpotFacing (str classname, int spottid [, int tid])
*[[SpawnSpotFacingForced]]
*int SpawnSpotFacingForced (str classname, int spottid [, int tid])
*[[SpawnSpotForced]]
*int ThingCount (int type, int tid)
*int ThingCount (int type, int tid)
*int ThingCountName (str classname, int tid)
*int ThingCountName (str classname, int tid)
Line 106: Line 75:
*int UniqueTID ([int tid[, int limit]])
*int UniqueTID ([int tid[, int limit]])


===Player===
==Linedefs and sidedefs==
*[[CheckInventory]]
*[[GetLineX]]
*[[CheckWeapon]]
*[[GetLineY]]
*[[GetWeapon]]
*[[LineSide]]
*[[GetSigilPieces]]
*void ReplaceTextures (str oldtexturename, str newtexturename [, int flags])
*[[PlayerArmorPoints]]
*void SetLineSpecial (int lineid, int special [, int arg0 [, int arg1 [, int arg2 [, int arg3 [, int arg4]]]]])
*[[PlayerCount]]
*void SetLineTexture(int lineid, int line_side, int sidedef_texture, str texturename);
*[[PlayerFrags]]
*[[PlayerHealth]]
*[[PlayerNumber]]
*[[SetWeapon]]
*[[TakeInventory]]


===Linedefs and sidedefs===
==Sky==
{|class="wikitable sortable"
*void SetSkyScrollSpeed (int sky, fixed skyspeed);
! 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===
==Scripts==
*[[SetSkyScrollSpeed]]
 
===Scripts===
*bool ACS_NamedExecuteAlways(str script, int map, int arg1, int arg2, int arg3)
*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.
:*Executes a named script, starting a new instance if one already exists. Returns true if successfully started.
Line 160: Line 95:
*bool ACS_NamedTerminate (string script, int map)
*bool ACS_NamedTerminate (string script, int map)


===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==
*fixed GetPolyobjX (int po)
*fixed GetPolyobjY (int po)
==Quake==
*void Radius_Quake2 (int tid, int intensity, int duration, int damrad, int tremrad, str sound)
==Math==
*int Random (int min, int max)
*int Sqrt (int number)
*fixed FixedSqrt (fixed number)
*int VectorLength (int x, int y)


===Polyobjects===
==Strings==
*[[GetPolyobjX]]
*[[GetPolyobjY]]
*[[PolyWait]]
 
===Quake===
*[[Radius_Quake2]]
 
===Math===
*[[Cos]]
*fixed [[FixedSqrt]] (fixed number)
*int [[Random]] (int min, int max)
*int [[Sqrt]] (int number)
*[[Sin]]
*[[VectorAngle]]
*int [[VectorLength]] (int x, int y)
 
===Strings===
*str StrLeft (str string, int length)
*str StrLeft (str string, int length)
*str StrMid (str string, int start, int length)
*str StrMid (str string, int start, int length)
*str StrRight (str string, int length)
*str StrRight (str string, int length)
===Level state===
*[[GameSkill]]
*[[GameType]]
*[[GetLevelInfo]]
*[[SetAirControl]]
*[[SetAirFriction]]
*[[SetGravity]]
*[[SinglePlayer]]
*[[Timer]]
==See also==
*[[Parameterized linedef specials]]
[[Category:ACS]]
[[Category:Editing reference]]
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)