Classes:Object
Jump to navigation
Jump to search
Note: This feature is for ZScript only. |
Object is the very front-most class which all other classes inherit from, either directly or through other inheriting classes.
Fields
Variables
- native bool bDestroyed
- If true, this object has been destroyed, either by the engine or using the Destroy method. Existing references to it will become null soon. New references to it (such as the statement Object b = a; when a.bDestroyed is true) cannot be created; attempting to do so will create a null reference instead.
Constants
- const TICRATE = 35
- The number of tics in a second. In the future this may potentially become a variable, so using TICRATE rather than 35 is preferable throughout ZScript.
Methods
Non-static
- void Destroy()
- Removes the calling class instance from the level.
- virtualscope void OnDestroy()
- Virtual callback for triggering custom special behavior when an object is destroyed.
Static
- static int G_SkillName()
- Returns the name of the currently selected skill. i.e "I'm Too Young To Die"
- static int G_SkillPropertyInt(int p)
- Returns the flags that the currently selected skill has, such as if it Fast monsters.
- static double G_SkillPropertyFloat(int p)
- Returns the decimal properties of the current skill level, such as how much the health of hostile monsters is multiplied by.
- static vector3, int G_PickDeathmatchStart() (deprecated)
- static vector3, int G_PickPlayerStart(int pnum, int flags =0) (deprecated)
- static int GameType()
- Used in conjunction with the gameinfo. prefix to return what game the code is running in.
- static void S_Sound(Sound sound_id, int channel, float volume = 1, float attenuation = ATTN_NORM) (deprecated)
- static void S_StartSound(Sound sound_id, int channel, int flags = 0, float volume = 1, float attenuation = ATTN_NORM)
- Start playing a sound from the object. This should be used over S_Sound(), since it supports passing sound flags.
- static void S_StartSoundAt(Vector3 pos, Sound sound_id, int channel, int flags = 0, float volume = 1, float attenuation = ATTN_NORM) (development version a1460e8 only)
- Functions exactly like S_StartSound, except that it plays the sound at the specified position, instead of attaching it to the calling object.
- static void S_PauseSound(bool notmusic, bool notsfx)
- Pauses all audio playing. notmusic can be used to keep map music playing, and notsfx can be used to keep all other game sounds playing.
- static void S_ResumeSound(bool notsfx)
- Resumes all audio playback. notsfx can be used to make the function keep general sound effects (As opposed to music) stopped.
- static bool S_ChangeMusic(String music_name, int order = 0, bool looping = true, bool force = false)
- Change the music currently playing in the map.
- static float S_GetLength(Sound sound_id)
- Gets the length of the sound file specified by sound_id and returns it in seconds.
- static void MarkSound(Sound snd)
- Marks the specified sound for precaching. (Verification needed)
- static void C_MidPrint(string fontname, string textlabel, bool bold = false)
- static uint BAM(double angle)
- static void SetMusicVolume(float volume)
- Sets the volume of the music on the map.
- static Object GetNetworkEntity(uint id)
- Gets the networked entity to whom id is assigned to. (Verification needed) (Need more info)
- static void EnableNetworking(bool enable)
- Enables or disables networking on the object. Cannot be used to change the networking status of actors. (Verification needed) (Need more info)
- static uint GetNetworkID()
- Returns the objects' network ID.
- static uint MSTime()
- (Need more info)
- static double MSTimeF()
- (Need more info)
- static void ThrowAbortException(string fmt)
- Causes the game to have a VM abort, fmt can be used to also print a custom message for the abort.
- static Function<void> FindFunction(Class<Object> cls, Name fn)
- static native Name ValidateNameIndex(int index) (development version bfd9b6f only)
- Return the Name type stored at the specified index internally.
- static class<Object> FindClass(Name cls, class<Object> baseType = null) (development version 236c9b4 only)
- Returns the specified class name passed to cls, if it exists. baseType allows for limiting the search to only classes descended from the specified parent class (Verification needed).
Intrinsic functions
This is the list of intrinsics shared by all objects. A list of the math specific intrinsics can be found at DECORATE expressions
- clearscope bool IsAbstract()
- Returns if this class is abstract.
- clearscope Object GetParentClass()
- Gets the class this object inherits from.
- clearscope Name GetClassName()
- Returns the name of the class.
- clearscope Class<Object> GetClass()
- clearscope Object New(Class<Object> type)
- Creates a new instance of the specified class and returns a pointer to it. This is the function used to create new instances of generic objects and thinkers. However, special creation functions are needed for certain classes such as actors and visual thinkers.