https://wiki.thedarkmod.com/api.php?action=feedcontributions&user=Stgatilov&feedformat=atomThe DarkMod Wiki - User contributions [en]2024-03-28T15:41:38ZUser contributionsMediaWiki 1.39.5https://wiki.thedarkmod.com/index.php?title=What%27s_new_in_TDM_2.12&diff=31087What's new in TDM 2.122024-02-25T12:55:57Z<p>Stgatilov: Removed words in parentheses which were originally links.</p>
<hr />
<div><!-- keywords whats new --><br />
{{notreleasedyet|2.12}}<br />
See the [http://bugs.thedarkmod.com/roadmap_page.php roadmap] on our bugtracker.<br />
<!-- See the [https://bugs.thedarkmod.com/changelog_page.php?version_id=96 changelog] on our bugtracker. --><br />
<!-- {{released|2.12|XXXX-XX-XX}} --><br />
<br />
<br><br><br />
'''<font size="5">The Dark Mod 2.12 Performance Edition!</font>'''<br />
<br><br />
<br />
<font size="3"> <br />
<br><br />
A major focus for The Dark Mod 2.12 was to better handle light and shadow culling.<br />
<br>Mappers often have to carefully arrange visportals and adjust light radius values to ensure<br />
that invisible lights are not stealing performance from the scene.<br />
<br>Many times such optimization work looks nonsensical or requires mappers to rebuild their scene until<br />
they can make a sensible portal design.<br />
<br>The new culling optimizations make TDM far more resilient to maps with poor portal design and bad lighting practices.<br />
<br>With this new optimization in place, new mappers shouldn't need to reach out to veteran mappers for assistance with performance so often.<br />
<br><br />
<br>A special thanks must go out to community member '''Geeps'''! <br />
<br>Over the course of 2.12 development, this user has created Subtitles for nearly all AI barks <br />
<br>along with developing testing tools and procedures for this gargantuan task!<br />
<br>Geeps also provided substantial feedback for our GUI and Subtitle design process and edited font data to improve text quality overall<br />
<br><br />
<br>Joebarnin identified a 2.11 bug that prevented arrows from colliding with AI and objects at certain angles and sent us a patch to fix it.<br />
<br>Daft Mugi has taken on the task of improving movement, mantling, and frob operations to make them more seamless and closer to Thief 1/2 behavior<br />
<br>Dragofer has added native support for Turrets to TDM 2.12, in addition to many asset and code change submissions<br />
<br />
<br />
</font><br />
<br />
<br />
<br />
----<br />
<br><br><br />
<br />
== <br><br> <font size="4">'''Important CVARS''' ==<br />
<br />
=== <font size="4">PLAYER</font> ===<br />
<br><br />
tdm_holdfrob_* --- set of variables that affect the reworked frob controls.<br />
<br />
tdm_autosearch_bodies --- automatically take items attached to unconscious bodies on frob.<br />
<br />
pm_headbob_mod, pm_lean_* --- allows to reduce some player movements.<br />
<br />
{{clear}}<br />
<br />
=== <font size="4">HELPER</font> ===<br />
<br><br />
<br />
tdm_show_viewpos, screenshot_viewpos --- embedding viewpos into screenshot for better bug reports.<br />
<br />
tdm_open_doors, tdm_close_doors --- cheats to make mission testing faster. <br />
<br />
{{clear}}<br />
<br />
=== <font size="4">TROUBLESHOOTING</font> ===<br />
<br><br />
<br />
r_useLightPortalFlow, r_useLightPortalFlowCulling --- improved light-entity interaction culling. Most major effect on shadows. This cvar is responsible for causing light leaks with stencil shadows, please report all of them! (thread)<br />
<br />
r_useNewRenderPasses --- selects from several renderer backend code paths. This is similar to the old r_useNewBackend cvar which has been deleted.<br />
<br />
r_shadowMapSinglePass --- faster code path for filling shadow maps.<br />
<br />
r_useEntityScissors, r_animationBounds --- improved bounds estimates for rendered entities.<br />
<br />
r_postprocess_dither --- new dithering in tonemap postprocessing for less color banding.<br />
<br />
r_shadowMapAlphaTested --- experimental mode for alpha-tested surfaces with shadow maps, where transparent areas of texture don't cast shadows.<br />
<br />
s_realTimeDecoding --- selects code path for decoding sound samples.<br />
<br />
tdm_subtitles_* --- many cvars for subtitle improvements (location cue, duration extension, debug text).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Graphics''' ==<br />
<br />
* Optimized generation of light-entity interactions in rendering frontend. Also greatly optimized shadow processing, especially for moving lights. Unfortunately, many existing missions are not compatible with these changes, so you might see light leaking through walls (mainly with stencil shadows). Please report all such cases, we'll apply workaround on case by case basis.<br />
<br />
* The "old" and "new" rendering backends are finally merged into one. It is as nice to program as the new backend, and as old-fashioned and reliable as the old backend. Single-pass shadow maps enabled by default and now respect noselfshadow.<br />
<br />
* Materials with polygonoffset now interact with lights. So static decals can have bumpmap and specular lighting. Note however: dynamic decals still don't interact with lights.<br />
<br />
* Revised parallelSky lights and marked shadowing parallel lights as deprecated.<br />
<br />
* PNG image format now behaves equally to other supported formats. In particular, it is not required to explicitly specify its extension, and it can be referenced directly in GUI code.<br />
<br />
* Added functions min/max to material expressions, which can be useful for clamping.<br />
<br />
* Fixed minor culling bugs on animated entities and enabled entity scissors by default.<br />
<br />
* Reduced color banding for fog with some dithering at tonemapping stage.<br />
<br />
* Fixed and revised underwater "double vision" effect.<br />
<br />
* Finally our C++ code can compress and decompress all texture formats we use, meaning that we no longer depend on occasionally buggy/slow vendor implementations. <br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''AI''' ==<br />
<br />
* Added automatic turrets, to be combined with security cameras (Thread).<br />
* Fixed some issues with moor AI (6345).<br />
* Added canCloseDoors spawnarg on AI, which allows to block closing only (6460).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Mapping''' ==<br />
<br />
* Now light entities support noPortalFog spawnarg (6282).<br />
* Extended dmap diagnostics to info_portalSettings, improved editor descriptions (6224).<br />
* r_showportals 2 is easier to understand now<br />
* Added r_skipEntities cvar, similar to "filter entities" in DR.<br />
* Added editor spawnargs for volumetric light properties (6322).<br />
* Added "forceShadowBehindOpaque" hack to workaround shadow leaks in old missions (5172).<br />
* Can set spawnarg "douse 0" on damageDef to not extinguish lights from splash damage.<br />
* Added setFrobMaster script event.<br />
* Added script-based stim type, which triggers only when stimEmit script event is called.<br />
* Added on/off script events to func_emitter entity.<br />
* Added setSmoke script event to change particle decl for a func_smoke.<br />
* Added hasInvItem script event to check if player has some item.<br />
* Added launchGuided script event to start guided projectiles.<br />
* Added getInterceptTime script event for shooting projectile and running target.<br />
* Added "bounce_sound_min|max_velocity" spawnargs to control projectile bounce sounds.<br />
* Added "postbounce_*" spawnargs to change projectile properties after bounce.<br />
* Added mission.cfg as a temporary way for mission to override non-archived cvars (5453).<br />
<br />
{{clear}}<br />
<br />
== '''Coding''' ==<br />
<br />
* Upgraded libpng and rebuilt third-party packages.<br />
* Fixed some uninitialized values, float overflows and NaNs across the code.<br />
* Now several script addons can coexist and work independently (thread).<br />
* Default value of com_maxfps increased from 144 to 300.<br />
* Improved idEntityPtr, fixed some warnings.<br />
* Simplified flee script event, supported fleeing from non-actor entity and fleeFromPoint.<br />
* CFrobLock now supports script events: Lock, Unlock, ToggleLock, IsLocked, IsPickable (6329).<br />
* Added cvar to modify all head bobbing settings (6310).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Assets''' ==<br />
<br />
* Added automatic turrets, to be combined with security cameras (Thread).<br />
<br />
* Added more covered furniture models (6289).<br />
<br />
* Added wall models from Seeking Lady Leicester (6293).<br />
<br />
* New and fixed versions of atdm:lamp_electric_square_3_lit_unattached (6315).<br />
<br />
* Fixed UV map on Stove models (6312).<br />
<br />
* Added forest models from The Valley abandoned mission.<br />
<br />
* Improved Merry Chest prefabs (6459).<br />
<br />
* Improved normal map of long banners (6355).<br />
<br />
* Fixed overbright skins for nature bushes (6478).<br />
<br />
* Fixed Grandfather_clock_victorian_01 model (6383).<br />
<br />
* Tweaked fogging of health potion.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Gameplay''' ==<br />
<br />
* Frob controls have been reworked completely. Previously players were annoyed by having to do three presses to extinguish a light. Also, some player didn't even know that bodies could be shouldered and were limited with dragging bodies. Now simply clicking the frob button performs the action player needs most of the time, and pressing-and-holding the same button performs alternative actions like dragging bodies and extinguishing candles (thread).<br />
<br />
* Several aspects of mantling has been improved: overhead mantling has become faster, mantling over low obstacles is allowed while carrying an item or a body. Also it is possible to switch weapon while being on rope/ladder or mantling. Pressing crouch button on rope/ladder now starts slide-down immediately.<br />
<br />
* Some aspects of gameplay can be further simplified. Auto-search bodies is for players who don't want to waste time searching for keys and purses on guard bodies. Lockpicking "Auto" difficulty now indeed trivializes lockpicking (thread).<br />
<br />
* Leaning animation has been improved with lower head tilt (thread).<br />
<br />
* More settings to reduce camera bobbing/rolling/shaking, which is good for players who feel motion sickness from default camera animations.<br />
<br />
* Added vine arrows to the Training Mission (4352).<br />
<br />
* Optimized and fixed some issues with Tears of Saint Lucia<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''GUIs''' ==<br />
<br />
* '''Subtitles have been added to all AI barks ( Courtesy of Geeps with a few additions by Datiswous and MirceaKitsune )'''<br />
<br />
* Further improvements of subtitles: revised location and font to avoid overlapping with other GUI elements, added directional cue, better slot allocation. Each subtitle is now displayed for at least one second even if the sound is very short.<br />
<br />
* Supported -durationExtend for inline subtitles (6262).<br />
<br />
* Fixed text & background alignment in mission lists (6337)<br />
<br />
* Support fonts aspect ratio correction (6283).<br />
<br />
* Added 30 FPS option to max FPS selection in settings menu. <br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Sound''' ==<br />
<br />
* Fixed bug that stereo sample plays for 2x duration due to length confusion.<br />
* Fixed WAV sounds playing in main menu, all sounds are streaming now (6330)<br />
* Fixed wench AI sounds (6284).<br />
* Player footstep sounds have been rebalanced. Metal and water sounds were especially painful previously.<br />
* Removed pause from looping sound machinery/machines/m3_loop (6384).<br />
* Added EFX Reverb to the Training Mission<br />
<br />
{{clear}}<br />
<br />
{{whatsnew|sort=212}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31025New light leaks in 2.122024-02-24T21:25:30Z<p>Stgatilov: soc3_sacricide fixed</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
|<br />
-1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
-1044.74 -488.21 -74.51 0.1 89.2 0.0<br />
-1354.18 -806.16 76.39 11.0 -149.0 0.0<br />
-1077.75 240.02 -39.05 9.1 142.6 -0.0<br />
-216.02 -157.15 74.66 -8.8 -43.7 -0.0<br />
-86.51 380.53 87.05 -13.3 -65.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| svn rev 275: global workaround<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| -940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492510 other issue]<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31024New light leaks in 2.122024-02-24T21:16:48Z<p>Stgatilov: /* List of issues */</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
|<br />
-1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
-1044.74 -488.21 -74.51 0.1 89.2 0.0<br />
-1354.18 -806.16 76.39 11.0 -149.0 0.0<br />
-1077.75 240.02 -39.05 9.1 142.6 -0.0<br />
-216.02 -157.15 74.66 -8.8 -43.7 -0.0<br />
-86.51 380.53 87.05 -13.3 -65.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| -940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492510 other issue]<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31023New light leaks in 2.122024-02-24T21:16:30Z<p>Stgatilov: /* List of issues */</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
|<br />
-1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
-1044.74 -488.21 -74.51 0.1 89.2 0.0<br />
-1354.18 -806.16 76.39 11.0 -149.0 0.0<br />
-1077.75 240.02 -39.05 9.1 142.6 -0.0<br />
-216.02 -157.15 74.66 -8.8 -43.7 -0.0<br />
-86.51 380.53 87.05 -13.3 -65.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| -940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492510 other issue]<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31022New light leaks in 2.122024-02-24T21:16:17Z<p>Stgatilov: cos3: more locations</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
-1044.74 -488.21 -74.51 0.1 89.2 0.0<br />
-1354.18 -806.16 76.39 11.0 -149.0 0.0<br />
-1077.75 240.02 -39.05 9.1 142.6 -0.0<br />
-216.02 -157.15 74.66 -8.8 -43.7 -0.0<br />
-86.51 380.53 87.05 -13.3 -65.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| -940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492510 other issue]<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31021New light leaks in 2.122024-02-24T20:46:02Z<p>Stgatilov: /* List of issues */</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| -940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492510 other issue]<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31020New light leaks in 2.122024-02-24T20:18:00Z<p>Stgatilov: </p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| -940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| (not yet)<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31019New light leaks in 2.122024-02-24T20:13:58Z<p>Stgatilov: Fixed heartv2</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| svn rev 274: workaround on func_static_46<br />
<br />
|-<br />
| gatehouse1_3<br />
| 940.97 270.14 66.25 -3.97 146.34 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492373 1]<br />
| (not yet)<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31014New light leaks in 2.122024-02-11T12:26:29Z<p>Stgatilov: poets is fixed</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/page/3/#comment-492137 in beta212-06]<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| (not yet)<br />
<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=31013New light leaks in 2.122024-02-10T20:23:44Z<p>Stgatilov: ws2 fixed</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| svn rev 267: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|-<br />
| poets<br />
| 1768.4 76.97 60.25 4.17 156.92 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22294-beta-testing-212/&do=findComment&comment=492045 1]<br />
| (not yet)<br />
<br />
|-<br />
| heartv2<br />
| 1736.48 3691.68 -137.75 -5.4 101.1 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=492047 1]<br />
| (not yet)<br />
<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Profiling&diff=30993Profiling2024-01-29T19:47:36Z<p>Stgatilov: Added reference to timeline profiler, added Windows sampling profiler instructions, deleted non-universal TIMING_BUILD and M_TIMINGS (use Tracy instead).</p>
<hr />
<div>== Profiling ==<br />
<br />
To find code parts that are too slow, The Dark Mod can be run under a profiler.<br />
<br />
The two main types of profilers are:<br />
* Sampling profiler: use platform tools<br />
* Timeline profiler: see [[Tracy: timeline profiler]]<br />
<br />
<br />
== Sampling ==<br />
<br />
=== Windows ===<br />
<br />
Sampling profiler is integrated into Visual C++ today:<br />
<br />
* Run Release build of the game under debugger.<br />
* Go to menu <tt>Debug -> Windows -> Diagnostic Tools</tt>.<br />
* Switch to <tt>CPU Usage</tt> tab. <br />
* Enable <tt>Record CPU Profile</tt> to start profiling.<br />
* Break/pause execution to see profiling results since start. Preferably click on <tt>Open Details</tt>.<br />
<br />
<br />
=== Linux ===<br />
<br />
'''Note: This section is outdated!'''<br />
<br />
==== gprof ====<br />
<br />
gprof is part of the GNU tools just like gcc is, and is an application-level profiler.<br />
<br />
To compile the TDM source for profiling, you can use<br />
<br />
./linuxBuild BUILD=profile<br />
<br />
Then run TDM normally:<br />
<br />
cd .doom3/<br />
./thedarkmod.x86<br />
<br />
This will produce a file named "gmon.out", which can then after TDM exits, be analyzed with gprof:<br />
<br />
gprof<br />
<br />
For further information see the man page of <tt>gprof</tt>.<br />
<br />
==== oprofile ====<br />
<br />
Another method of profiling is by using '''oprofile'''. '''oprofile''' is a system-wide profiler, that can also profile the Linux kernel. It will by default profile everything that is running, so to avoid noise it is better to close as many applications (chat, Firefox etc) and shut down as many system services (f.i. Mysql, Postgres, Apache) as possible.<br />
<br />
===== Preparing oprofile =====<br />
<br />
* First, install the nec. packages:<br />
<br />
sudo aptitude install oprofile oprofile-gui<br />
<br />
The next step is not nec., so you could f.i. also profile a release build, however, the output will be less informative without symbols.<br />
<br />
* Then, recompile the TDM source with debug to get symbol names. <br />
<br />
./linuxBuild BUILD=debug<br />
<br />
Note: '''"debug"''', not "release" nor "profile"!<br />
<br />
There are two ways to use oprofile:<br />
<br />
===== Using tdm_profile.sh =====<br />
<br />
Instead of using tdm_launcher.linux, open a shell, change to the darkmod directory and run:<br />
<br />
sudo ./tdm_profile.sh fm_name<br />
<br />
where fm_name is a '''previously installed FM''', e.g. the directory it resides in, f.i:<br />
<br />
sudo ./tdm_profile.sh builders_influence<br />
<br />
It has not nec. to be the current installed FM, but it must have been installed already! <br />
<br />
After loading a game, running around a bit and exiting TDM again, you can find a report in the file '''tdm_profile_report.txt''' inside the darkmod directory.<br />
<br />
The disadvantage of this method is that you will also profile the mission load time, and for big missions that will easily swamp any work done during the mission run time unless you spent minutes there.<br />
<br />
''' Sample output:'''<br />
<br />
<pre><br />
CPU: AMD64 processors, speed 1800 MHz (estimated)<br />
Counted CPU_CLK_UNHALTED events (Cycles outside of halt state) with a unit mask of 0x00 (No unit mask) count 100000<br />
samples % image name app name symbol name<br />
2034319 38.8674 doom.x86 doom.x86 /home/te/games/doom3/doom.x86<br />
1303104 24.8969 libGLcore.so.185.18.36 doom.x86 /usr/lib32/libGLcore.so.185.18.36<br />
154842 2.9584 libmozjs.so firefox /usr/lib/xulrunner-1.9.1.9/libmozjs.so<br />
139323 2.6619 libasound_module_rate_speexrate.so doom.x86 /usr/lib32/alsa-lib/libasound_module_rate_speexrate.so<br />
124850 2.3854 gamex86.so doom.x86 CImage::LoadImage(CRenderPipe*)<br />
80195 1.5322 gamex86.so doom.x86 iReadLump<br />
66593 1.2723 libxul.so firefox /usr/lib/xulrunner-1.9.1.9/libxul.so<br />
62445 1.1931 gamex86.so doom.x86 idClip::ClipModelsTouchingBounds_r(clipSector_s const*, listParms_s&) const<br />
56680 1.0829 zero doom.x86 /dev/zero<br />
43315 0.8276 libc-2.10.1.so doom.x86 memcpy<br />
41921 0.8009 libGLcore.so.185.18.36 kwin /usr/lib/libGLcore.so.185.18.36<br />
38338 0.7325 firefox firefox /usr/lib/firefox-3.5.9/firefox<br />
35118 0.6710 [vdso] (tgid:2583 range:0x7fffe1fff000-0x7fffe2000000) kwin [vdso] (tgid:2583 range:0x7fffe1fff000-0x7fffe2000000)<br />
33020 0.6309 libc-2.10.1.so doom.x86 memset<br />
30151 0.5761 gamex86.so doom.x86 idGameLocal::AnalyzeRenderImage(CRenderPipe*, float*)<br />
27437 0.5242 no-vmlinux no-vmlinux /no-vmlinux<br />
26936 0.5146 libasound.so.2.0.0 doom.x86 /usr/lib32/libasound.so.2.0.0<br />
23572 0.4504 libQtCore.so.4.5.2 kwin /usr/lib/libQtCore.so.4.5.2<br />
23031 0.4400 Xorg Xorg /usr/bin/Xorg<br />
21347 0.4079 libQtGui.so.4.5.2 kdeinit4 /usr/lib/libQtGui.so.4.5.2<br />
20301 0.3879 oprofiled oprofiled /usr/bin/oprofiled<br />
19825 0.3788 gamex86.so doom.x86 idInterpreter::Execute()<br />
19785 0.3780 libGL.so.185.18.36 doom.x86 /usr/lib32/libGL.so.185.18.36<br />
19583 0.3742 gamex86.so doom.x86 idGameLocal::ProcessStimResponse(unsigned long)<br />
18508 0.3536 nvidia_drv.so Xorg /usr/lib/xorg/modules/drivers/nvidia_drv.so<br />
13580 0.2595 gamex86.so doom.x86 idGameLocal::RunFrame(usercmd_t const*)<br />
</pre><br />
<br />
===== Using opcontrol manually =====<br />
<br />
The '''opcontrol''' utility can be used to toggle the profiling on and off during runtime. Just start it, start TDM normally and after loading a mission, toggle back to a text-mode console with {{CTRL}}+{{ALT}}+{{F2}}, use:<br />
<br />
opcontrol --init<br />
opcontrol --start<br />
opcontrol --reset<br />
<br />
to start profiling, switch back to the desktop ({{CTRL}}+{{ALT}}+{{F7}}), then wait a bit, then turn profiling off again.<br />
<br />
opcontrol --dump<br />
opcontrol --stop<br />
opreport --symbols --demangle=smart >tdm_profile_report.txt<br />
<br />
''' Sample output:'''<br />
<br />
After ack:<br />
<br />
<pre><br />
samples % image name app name symbol name<br />
<br />
67453 2.4265 gamex86.so doom.x86 CImage::LoadImage(CRenderPipe*)<br />
42819 1.5403 gamex86.so doom.x86 iReadLump<br />
31089 1.1184 gamex86.so doom.x86 idClip::ClipModelsTouchingBounds_r(clipSector_s const*, listParms_s&) const<br />
16156 0.5812 gamex86.so doom.x86 idGameLocal::AnalyzeRenderImage(CRenderPipe*, float*)<br />
10535 0.3790 gamex86.so doom.x86 idInterpreter::Execute()<br />
10438 0.3755 gamex86.so doom.x86 idGameLocal::ProcessStimResponse(unsigned long)<br />
7241 0.2605 gamex86.so doom.x86 idMD5Anim::GetInterpolatedFrame(frameBlend_t&, idJointQuat*, int const*, int) const<br />
7134 0.2566 gamex86.so doom.x86 idGameLocal::RunFrame(usercmd_t const*)<br />
6680 0.2403 gamex86.so doom.x86 idMoveable::Think()<br />
5641 0.2029 gamex86.so doom.x86 idClipModel::Link_r(clipSector_s*)<br />
5133 0.1846 gamex86.so doom.x86 idAnimator::CreateFrame(int, bool)<br />
4836 0.1740 gamex86.so doom.x86 darkModLAS::updateLASState()<br />
4725 0.1700 gamex86.so doom.x86 idQuat::Slerp(idQuat const&, idQuat const&, float)<br />
4719 0.1698 gamex86.so doom.x86 idEntity::RunPhysics()<br />
4501 0.1619 gamex86.so doom.x86 __i686.get_pc_thunk.bx<br />
4365 0.1570 gamex86.so doom.x86 idSIMD_Generic::TransformJoints(idJointMat*, int const*, int, int)<br />
4265 0.1534 gamex86.so doom.x86 idEntity::Present()<br />
3844 0.1383 gamex86.so doom.x86 idStr::Icmp(char const*, char const*)<br />
3755 0.1351 gamex86.so doom.x86 idAF::ChangePose(idEntity*, int)<br />
3663 0.1318 gamex86.so doom.x86 idAnim::Name() const<br />
3540 0.1273 gamex86.so doom.x86 idQuat::ToMat3() const<br />
2953 0.1062 gamex86.so doom.x86 idInterpreter::CallEvent(function_t const*, int)<br />
2755 0.0991 gamex86.so doom.x86 idEntity::Think()<br />
2562 0.0922 gamex86.so doom.x86 idPhysics_RigidBody::SaveState()<br />
2440 0.0878 gamex86.so doom.x86 idDict::FindKey(char const*) const<br />
2429 0.0874 gamex86.so doom.x86 idIK_Walk::Evaluate()<br />
2302 0.0828 gamex86.so doom.x86 idAnimator::SetJointAxis(jointHandle_t, jointModTransform_t, idMat3 const&)<br />
</pre><br />
<br />
==== Tips ====<br />
<br />
Use [http://search.cpan.org/~petdance/ack/ ack] (or grep) on the tdm_profile_report.txt to filter out anything not mentioning gamex86.so, this reduces the clutter:<br />
<br />
ack gamex86.so tdm_profile_report.txt<br />
<br />
<br />
== g_frametime ==<br />
<br />
Set this [[CVAR]] to 1, and the code will emit how many milliseconds it took to do all the calculations for one frame, minus the render time. The output on the console will be something like this:<br />
<br />
game 28080: all:0.2 th:0.2 ev:0.0 28 ents<br />
<br />
The numbers are:<br />
<br />
* game: The current frame time (always increasing from map start)<br />
* all: The complete time to think + event handling<br />
* th: The thinking time (without event handling)<br />
* ev: The event handling time<br />
* ents: The number of entities that did thinking<br />
<br />
== g_timeentities ==<br />
<br />
When set to > 0, shows entities whose <tt>Think()</tt> functions exceeded the number of milliseconds specified. Set it for instance to 2, and all entities that think longer than 2ms will be shown on the console.<br />
<br />
== See also ==<br />
<br />
* [[Coding in the SDK]]<br />
<br />
{{coding}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Reporting_Problem&diff=30992Reporting Problem2024-01-29T19:14:44Z<p>Stgatilov: Added some new ways to get viewpos coordinates.</p>
<hr />
<div>If TDM does not work properly for you, the best thing to do would be to report the problem.<br />
<br />
You are welcome to post in Tech Support section of the [[The_Dark_Mod#Dark_Mod_Forums|forums]], even if you suspect the problem is with your machine or you want to get some help/clarifications.<br />
When there is clearly a problem with TDM itself, an issue is usually created in the [[The_Dark_Mod#Bugtracker|bugtracker]].<br />
But since the bugtracker is a rather technical place, it is more advised to report problems in the forum.<br />
Sooner or later someone will create the issue anyway if it is really needed.<br />
<br />
This article describes some general information typically requested from everyone who reports a problem.<br />
<br />
== Baseline ==<br />
<br />
This pieces of information are almost mandatory:<br />
<br />
# Contents of <tt>darkmod.cfg</tt>.<br />
# Contents of game console at some moment (known as "condump").<br />
# In case of graphical issue, a screenshot showing the problem is often needed.<br />
<br />
You can omit this information when writing a post on the forums: maybe your issue is trivial and someone will quickly explain what's wrong.<br />
If it is not obvious, then you will soon be asked for it anyway =)<br />
<br />
However, when creating an issue on the bugtracker, it is highly desirable to include all of these things, as well as the steps to reproduce.<br />
<br />
=== darkmod.cfg ===<br />
<br />
The file named <tt>darkmod.cfg</tt> should be located in the root directory of TDM installation.<br />
If in doubt, you can locate this directory by checking what executable is run when you start the game: it is in the same directory.<br />
Let's assume for the rest of the article that root directory is <tt>C:\games\thedarkmod</tt><br />
<br />
This file stores the values of all switches and tweaks that player can change.<br />
The game may work in completely different ways depending on these values, thus they are very important for reproducing the problem.<br />
<br />
When reporting the problem on forums, you can do one of:<br />
* Attach it to a forum post. In this case rename it to something like <tt>darkmod_cfg.txt</tt>, the forum forbids anything except txt files.<br />
* Copy/paste the full contents of the file into the post. In this case, please wrap it into "spoiler" tag, so that readers don't have to always scroll across the 5 pages of it.<br />
<br />
When reporting on bugtracker, just attach the <tt>darkmod.cfg</tt> file to the issue.<br />
<br />
=== condump ===<br />
<br />
The term "condump" means all the text written to the game console.<br />
You can usually open game console by pressing either Tilde(~) key or Ctrl+Alt+Tilde combo.<br />
<br />
There are two ways to save the contents of game console into a file:<br />
<br />
:'''1) condump.''' Open game console, type the following and hit Enter: <tt>condump unwrap my_nasty_issue</tt><br />
:Then find file named <tt>my_nasty_issue.txt</tt> in <tt>C:\games\thedarkmod</tt> (root TDM directory).<br />
:Note: execute the command soon after the issue manifests itself.<br />
<br />
:'''2) logfile.''' Open file <tt>darkmod.cfg</tt> in text editor.<br />
:Find or create new line containing: <tt>seta logFile "?"</tt><br />
:Instead of the question mark, set digit 2 if you experience a crash. Otherwise digit 1 is also OK.<br />
:Save the file, start TDM and reproduce the issue.<br />
:Now find the file named <tt>qconsole.log</tt> in the directory of the currently installed FM, for instance in <tt>C:\games\thedarkmod\fms\newjob</tt>.<br />
<br />
The first approach is better, but it is useless if TDM crashes or you cannot even get into game console.<br />
In any of these cases, use the second approach.<br />
<br />
When you have got the file, add it to your report just as you did with <tt>darkmod.cfg</tt>.<br />
<br />
=== Screenshot ===<br />
<br />
If something looks wrong for you, posting screenshot is a good thing to do.<br />
Otherwise, the guy who tries to reproduce your issue and fails will have hard time guessing if he sees the same picture as you.<br />
You can of course try to explain what you see with words, but it is vague and subjective.<br />
<br />
There are two ways to get a screenshot:<br />
# Press a key in-game (F12 by default). Then find the screenshot in <tt>C:\games\thedarkmod\screenshots</tt><br />
# Ensure that you run game in Windowed mode. Press Print-Screen key to copy screen to clipboard. Start Paint and paste (Ctrl+V) it there. Trim the TDM window in it and save.<br />
The first approach is preferred, but sometimes it fails to capture the glitch.<br />
<br />
When you want to share a picture on the forums, you can do one of:<br />
* Add it as attachment to your forum post.<br />
* Upload it to some free image hosting, and insert a link to it (click on Image icon) into the post. Surround the link/picture in spoiler tag (unless it is low-resolution) !<br />
<br />
When reporting on bugtracker, simply attach the file to the issue and mention it somewhere in the text.<br />
<br />
=== Coordinates ===<br />
<br />
Typically, a problem happens in-game on at least one of the released fan missions. In such case, please write the name of the FM and the world coordinates where the problem happens.<br />
<br />
In order to find world coordinates, execute <tt>getviewpos</tt> in the game console.<br />
The coordinates will be printed in response: the first three are the coordinates, and the last three are the viewing angles. Copy them all to your report.<br />
Since you cannot copy text directly from the game console, use [[Reporting Problem#condump|one of the methods described above to get a condump]].<br />
In fact, it is a good idea to run <tt>getviewpos</tt> just before creating a condump.<br />
By the way, you can execute <tt>setviewpos</tt> with these six arguments to teleport yourself to this specific location, e.g. to ensure that you have copied coords correctly.<br />
<br />
Alternatively, you can set <tt>tdm_show_viewpos 1</tt> to display current coordinates on screen, so that they can be captured in screenshot.<br />
Or you can call command <tt>screenshot_viewpos</tt> to make a special screenshot with coordinates visible on it.<br />
<br />
== Advanced ==<br />
<br />
Here are few more advanced tricks which may help debugging issues.<br />
<br />
=== Crashdump ===<br />
<br />
When TDM crashes, you can record a "memory dump" or "crash dump" of it.<br />
It often contains information invaluable for coders, but it is only useful for debugging crashes.<br />
<br />
The article [[Save a Memory Dump for debugging Crashes]] explains in detail how to record it.<br />
<br />
=== Video ===<br />
<br />
Some graphical issues are very obvious in dynamics, but when you take a still screenshot, it does not capture the tragedy well enough.<br />
<br />
In such case you can record a video of the problem.<br />
[https://obsproject.com/ Open Broadcast Software] is a free program which can easily record a high-quality and high-FPS game footage.<br />
The program is quite complicated, but the main thing you need is to add a "source": either "Game Capture", or "Window Capture", or "Screen Capture".<br />
<br />
When you have a video, you can either upload it to video hosting (like YouTube) and post a link, or upload it to cloud storage (like Google Drive) and post a shared link.<br />
If you copy/paste a link to YouTube video into a forum post, the forum will show embedded player automatically.<br />
<br />
=== Installation state ===<br />
<br />
Sometimes there is a chance that your TDM installation is corrupt.<br />
In such case it is great to give people a brief overview of it.<br><br />
Like generating a filelist of the gamefolder.<br><br />
<br><br />
To create a filelisting of the TDM gamefolder, in windows 10<br><br />
<br />
# Open file explorer, navigate to the tdm gamefolder. <br />
# click "file" (menu) > "open in powershell" and a blue window will appear.<br />
# Fill in the following command line in that window and hit the enter-key: dir /s > mytmdfolderandfiles.txt<br>This command generate a textfile in your gamefolder.<br />
# the content of this file mytmdfolderandfiles.txt you can give to people for research. <br />
After this, just run the TDM installer to download the original files.<br />
<br />
'''TODO''': write some simple way to get good textual representation of TDM installation directory.</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Console_Useful_Controls&diff=30991Console Useful Controls2024-01-29T19:10:19Z<p>Stgatilov: r_showSurfaceInfo added</p>
<hr />
<div>==Introduction==<br />
<br />
This is a list of common console commands and cvars that are of use to Dark Mod mappers and developers for testing etc. It is in order of key words and meaning. The console can be called by hitting "{{key|CTRL}}+{{key|ALT}}+{{key|~}}" ("{{key|CTRL}}+{{key|ALT}}+{{key|Key left of number 1}}" in general, e.g. "{{key|CTRL}}+{{key|ALT}}+{{key|^}}" on a German keyboard).<br />
<br />
This will open the console to cover the upper 50% of the screen. To cover more (80%), also hold down the {{key|SHIFT}} key.<br />
<br />
==Notes==<br />
<br />
* Where a cvar or command is followed by a 1 (parameter) it can be taken that it is enabled by 1 and disabled by 0 unless otherwise stated. '''N''' indicates a range of values.<br />
* The current value of a cvar can be shown by entering its name without a value.<br />
* Parameters can be toggled between values by preceding the control with 'toggle' and following it with eg, 1 0. Example : toggle r_showtris 3 0<br />
* Controls can be bound to keys to be used in-game, including the toggle command, eg, <tt>bind "v" "toggle r_showportals 1 0"</tt><br />
* Many controls can be included in the file '''Doomconfig.cfg''' in the darkmod folder so they are automatically effective.<br />
* Some controls are disabled on exit from a map; others are permanent until manually changed.<br />
<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|noclip<br />
|Player flies through everything.<br />
<br />
|-<br />
!align=left|notarget<br />
|AI will not know the player is there.<br />
<br />
|-<br />
!align=left|invisible<br />
|AI will not see the player, but can still hear him.<br />
<br />
|-<br />
!align=left|inaudible<br />
|AI will not hear the player, but can still see him.<br />
<br />
|-<br />
!align=left|god<br />
|Player cannot be harmed.<br />
<br />
|-<br />
!align=left|killmonsters<br />
|Removes all AI from a map.<br />
<br />
|-<br />
!align=left|tdm_open_doors<br />
|Opens all doors on map: even locked and unpickable ones!<br />
<br />
|-<br />
!align=left|tdm_close_doors<br />
|Closes all doors on map<br />
<br />
|-<br />
!align=left|tdm_show_loot<br />
|Shows loot items through walls for a short time.<br />
<br />
|-<br />
!align=left|tdm_show_keys<br />
|Shows keys through walls for a short time.<br />
<br />
|-<br />
!align=left|g_dragentity 1<br />
|Aim at entity and hold attack control then pull back.<br />
<br />
|-<br />
!align=left|pm_noclipspeed N<br />
|Changes the speed of player noclip movement.<br />
<br />
|-<br />
!align=left|g_fov N<br />
|N=angle of field of view, eg, '''<code>g_fov 30</code>''' = zoom in to restrict field of view to 30 degrees. Default = 90.<br />
<br />
|-<br />
!align=left|g_showEntityInfo 1<br />
|Show info about near entities (as box with classname).<br />
<br />
|-<br />
!align=left|com_showfps 1<br />
|Show fps to test performance.<br />
<br />
|-<br />
!align=left|com_numQuickSaves N<br />
|How many quicksaves to retain. Reducing the number won't delete any that you already have.<br />
<br />
|-<br />
!align=left|g_frametime 1<br />
|Timing info for each frame, see [[Profiling#g_frametime|Profiling]].<br />
<br />
|-<br />
!align=left|r_showPrimitives 1<br />
|Show info about number of [[drawcalls]] and tris/shadow tris rendered.<br />
<br />
|-<br />
!align=left|con_noprint 0<br />
|Prints console messages to the screen as an overlay.<br />
<br />
|-<br />
!align=left|r_showSurfaceInfo 1<br />
|Show info about closest rendered surface under crosshair: model name, index of surface in model, material name<br />
<br />
|-<br />
!align=left|r_showskel 1<br />
|Shows skeleton in-game with joint names.<br />
<br />
|-<br />
!align=left|g_showCollisionModels 1<br />
|Shows collision models. Use '''g_maxShowDistance N''' to increase the distance where they are shown to.<br />
<br />
|-<br />
!align=left|r_showtris N<br />
|(1) Shows triangles being rendered directly.<br>(2) Shows overdrawn tri's.<br>(3) Shows all tri's in scene, direct and indirect.<br />
<br />
|-<br />
!align=left|r_showportals N<br />
|(1) Shows all portals in scene (red=closed, green=open). If your portals don't show up they are most likely not sealing. Yellow indicates a portal that is effectively closed but which connects to a visleaf visible through another portal.<br />
(2) Also prints area numbers, mainly where player's eye is right now.<br />
<br />
|-<br />
!align=left|r_showlightcount 1<br />
|Using colours, shows the number of lights hitting a surface, black = 0, red = 1, blue = 2... etc.<br />
<br />
|-<br />
!align=left|seta tdm_showsprop 1<br />
|Shows the volume of sounds heard by AI. <br />
<br />
|-<br />
!align=left|tdm_ai_showbark 1<br />
|Gives the def name (not the soundshader) of barks used by AI.<br />
<br />
|-<br />
!align=left|tdm_ai_showalert 1<br />
|Shows the AI's current alert total and alert state.<br />
<br />
|-<br />
!align=left|tdm_ai_showdest 1<br />
|Shows the AI's current path destination.<br />
<br />
|-<br />
!align=left|bind "f1" "_impulse27" <br />
|Pressing F1 shows the AAS regions.<br />
<br />
|-<br />
!align=left|timescale 2<br />
|Double speed, good for testing pathing, 1 = normal speed, 2 = double, 0.5 = half speed. To have an effect, the "Uncapped FPS" setting must be Off.<br />
<br />
|-<br />
!align=left|g_timeModifier 2<br />
|Same as timescale 2 but somewhat different<br />
<br />
|-<br />
!align=left|g_stopTime 1<br />
|Stops gameplay time, but player can move normally.<br />
<br />
|-<br />
!align=left|teleport "entity name"<br />
|teleports the player to the named entity<br />
<br />
|-<br />
!align=left|teleportArea N<br />
|teleports the player into the area with number N<br />
<br />
|-<br />
!align=left|getviewpos<br />
|get player's position and orientation [[Reporting_Problem#Coordinates|coordinates]]<br />
<br />
|-<br />
!align=left|setviewpos X Y Z [P Y R]<br />
|teleports the player to the coordinates and optionally sets camera orientation.<br />
<br />
|}<br />
<br />
== Spawning entities ==<br />
<br />
Spawns entity in front of the player. Look up if entity gets spawned under the floor. <br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_blackjack<br />
|Spawns blackjack.<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_shortsword<br />
|Spawns a sword.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead<br />
|Spawns one arrow.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead inv_ammo_amount 50<br />
|Spawns 50 arrows (one entity with 50 ammo). Similar technique can be used for other ammo types.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_firearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_gasarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_mossarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_noisemaker<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_ropearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_waterarrow<br />
|<br />
<br />
|}<br />
<br />
With the TDM console you can press tab after typing something to autocomplete. For example <tt>spawn atdm:<tab></tt> will cycle through the various spawnables. You can also add additional spawnargs using the following syntax: <tt>spawn classname [key value] [key value] ...</tt>.<br />
<br />
== Diagnostic information ==<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|listEntities<br />
|lists all current entities followed by a count.<br />
<br />
|-<br />
!align=left|listEntities GLOB<br />
|lists all alive entities whose names match given glob/wildcard (e.g. use asterisks like <tt>*func_static*</tt> to search for substring).<br />
<br />
|-<br />
!align=left|countEntities<br />
|displays a count of entities by class. ''TDM 2.03+''<br />
<br />
|-<br />
!align=left|listCvars GLOB<br />
|lists all cvars matching the given glob/wildcard (no argument = lists everything).<br />
<br />
|-<br />
!align=left|listCmds GLOB<br />
|lists all console commands matching the given glob/wildcard (no argument = lists everything).<br />
<br />
|-<br />
!align=left|condump [unwrap] ''filename.txt''<br />
|Writes the text content of the console to text file ''filename.txt'' (you can use any file name). If optional keyword ''unwrap'' is used, full lines from the console will be stitched together with the following line. Useful when exporting long file paths from the console, that have been broken up by its width limit. ''TDM 2.03+''<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
[[Cvars in The Dark Mod]]<br />
<br />
{{editing}}<br />
<br />
[[Category:CVARS]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Console_Useful_Controls&diff=30990Console Useful Controls2024-01-29T19:02:22Z<p>Stgatilov: /* Diagnostic information */</p>
<hr />
<div>==Introduction==<br />
<br />
This is a list of common console commands and cvars that are of use to Dark Mod mappers and developers for testing etc. It is in order of key words and meaning. The console can be called by hitting "{{key|CTRL}}+{{key|ALT}}+{{key|~}}" ("{{key|CTRL}}+{{key|ALT}}+{{key|Key left of number 1}}" in general, e.g. "{{key|CTRL}}+{{key|ALT}}+{{key|^}}" on a German keyboard).<br />
<br />
This will open the console to cover the upper 50% of the screen. To cover more (80%), also hold down the {{key|SHIFT}} key.<br />
<br />
==Notes==<br />
<br />
* Where a cvar or command is followed by a 1 (parameter) it can be taken that it is enabled by 1 and disabled by 0 unless otherwise stated. '''N''' indicates a range of values.<br />
* The current value of a cvar can be shown by entering its name without a value.<br />
* Parameters can be toggled between values by preceding the control with 'toggle' and following it with eg, 1 0. Example : toggle r_showtris 3 0<br />
* Controls can be bound to keys to be used in-game, including the toggle command, eg, <tt>bind "v" "toggle r_showportals 1 0"</tt><br />
* Many controls can be included in the file '''Doomconfig.cfg''' in the darkmod folder so they are automatically effective.<br />
* Some controls are disabled on exit from a map; others are permanent until manually changed.<br />
<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|noclip<br />
|Player flies through everything.<br />
<br />
|-<br />
!align=left|notarget<br />
|AI will not know the player is there.<br />
<br />
|-<br />
!align=left|invisible<br />
|AI will not see the player, but can still hear him.<br />
<br />
|-<br />
!align=left|inaudible<br />
|AI will not hear the player, but can still see him.<br />
<br />
|-<br />
!align=left|god<br />
|Player cannot be harmed.<br />
<br />
|-<br />
!align=left|killmonsters<br />
|Removes all AI from a map.<br />
<br />
|-<br />
!align=left|tdm_open_doors<br />
|Opens all doors on map: even locked and unpickable ones!<br />
<br />
|-<br />
!align=left|tdm_close_doors<br />
|Closes all doors on map<br />
<br />
|-<br />
!align=left|tdm_show_loot<br />
|Shows loot items through walls for a short time.<br />
<br />
|-<br />
!align=left|tdm_show_keys<br />
|Shows keys through walls for a short time.<br />
<br />
|-<br />
!align=left|g_dragentity 1<br />
|Aim at entity and hold attack control then pull back.<br />
<br />
|-<br />
!align=left|pm_noclipspeed N<br />
|Changes the speed of player noclip movement.<br />
<br />
|-<br />
!align=left|g_fov N<br />
|N=angle of field of view, eg, '''<code>g_fov 30</code>''' = zoom in to restrict field of view to 30 degrees. Default = 90.<br />
<br />
|-<br />
!align=left|g_showEntityInfo 1<br />
|Show info about near entities (as box with classname).<br />
<br />
|-<br />
!align=left|com_showfps 1<br />
|Show fps to test performance.<br />
<br />
|-<br />
!align=left|com_numQuickSaves N<br />
|How many quicksaves to retain. Reducing the number won't delete any that you already have.<br />
<br />
|-<br />
!align=left|g_frametime 1<br />
|Timing info for each frame, see [[Profiling#g_frametime|Profiling]].<br />
<br />
|-<br />
!align=left|r_showPrimitives 1<br />
|Show info about number of [[drawcalls]] and tris/shadow tris rendered.<br />
<br />
|-<br />
!align=left|con_noprint 0<br />
|Prints console messages to the screen as an overlay.<br />
<br />
|-<br />
!align=left|r_showskel 1<br />
|Shows skeleton in-game with joint names.<br />
<br />
|-<br />
!align=left|g_showCollisionModels 1<br />
|Shows collision models. Use '''g_maxShowDistance N''' to increase the distance where they are shown to.<br />
<br />
|-<br />
!align=left|r_showtris N<br />
|(1) Shows triangles being rendered directly.<br>(2) Shows overdrawn tri's.<br>(3) Shows all tri's in scene, direct and indirect.<br />
<br />
|-<br />
!align=left|r_showportals N<br />
|(1) Shows all portals in scene (red=closed, green=open). If your portals don't show up they are most likely not sealing. Yellow indicates a portal that is effectively closed but which connects to a visleaf visible through another portal.<br />
(2) Also prints area numbers, mainly where player's eye is right now.<br />
<br />
|-<br />
!align=left|r_showlightcount 1<br />
|Using colours, shows the number of lights hitting a surface, black = 0, red = 1, blue = 2... etc.<br />
<br />
|-<br />
!align=left|seta tdm_showsprop 1<br />
|Shows the volume of sounds heard by AI. <br />
<br />
|-<br />
!align=left|tdm_ai_showbark 1<br />
|Gives the def name (not the soundshader) of barks used by AI.<br />
<br />
|-<br />
!align=left|tdm_ai_showalert 1<br />
|Shows the AI's current alert total and alert state.<br />
<br />
|-<br />
!align=left|tdm_ai_showdest 1<br />
|Shows the AI's current path destination.<br />
<br />
|-<br />
!align=left|bind "f1" "_impulse27" <br />
|Pressing F1 shows the AAS regions.<br />
<br />
|-<br />
!align=left|timescale 2<br />
|Double speed, good for testing pathing, 1 = normal speed, 2 = double, 0.5 = half speed. To have an effect, the "Uncapped FPS" setting must be Off.<br />
<br />
|-<br />
!align=left|g_timeModifier 2<br />
|Same as timescale 2 but somewhat different<br />
<br />
|-<br />
!align=left|g_stopTime 1<br />
|Stops gameplay time, but player can move normally.<br />
<br />
|-<br />
!align=left|teleport "entity name"<br />
|teleports the player to the named entity<br />
<br />
|-<br />
!align=left|teleportArea N<br />
|teleports the player into the area with number N<br />
<br />
|-<br />
!align=left|getviewpos<br />
|get player's position and orientation [[Reporting_Problem#Coordinates|coordinates]]<br />
<br />
|-<br />
!align=left|setviewpos X Y Z [P Y R]<br />
|teleports the player to the coordinates and optionally sets camera orientation.<br />
<br />
|}<br />
<br />
== Spawning entities ==<br />
<br />
Spawns entity in front of the player. Look up if entity gets spawned under the floor. <br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_blackjack<br />
|Spawns blackjack.<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_shortsword<br />
|Spawns a sword.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead<br />
|Spawns one arrow.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead inv_ammo_amount 50<br />
|Spawns 50 arrows (one entity with 50 ammo). Similar technique can be used for other ammo types.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_firearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_gasarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_mossarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_noisemaker<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_ropearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_waterarrow<br />
|<br />
<br />
|}<br />
<br />
With the TDM console you can press tab after typing something to autocomplete. For example <tt>spawn atdm:<tab></tt> will cycle through the various spawnables. You can also add additional spawnargs using the following syntax: <tt>spawn classname [key value] [key value] ...</tt>.<br />
<br />
== Diagnostic information ==<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|listEntities<br />
|lists all current entities followed by a count.<br />
<br />
|-<br />
!align=left|listEntities GLOB<br />
|lists all alive entities whose names match given glob/wildcard (e.g. use asterisks like <tt>*func_static*</tt> to search for substring).<br />
<br />
|-<br />
!align=left|countEntities<br />
|displays a count of entities by class. ''TDM 2.03+''<br />
<br />
|-<br />
!align=left|listCvars GLOB<br />
|lists all cvars matching the given glob/wildcard (no argument = lists everything).<br />
<br />
|-<br />
!align=left|listCmds GLOB<br />
|lists all console commands matching the given glob/wildcard (no argument = lists everything).<br />
<br />
|-<br />
!align=left|condump [unwrap] ''filename.txt''<br />
|Writes the text content of the console to text file ''filename.txt'' (you can use any file name). If optional keyword ''unwrap'' is used, full lines from the console will be stitched together with the following line. Useful when exporting long file paths from the console, that have been broken up by its width limit. ''TDM 2.03+''<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
[[Cvars in The Dark Mod]]<br />
<br />
{{editing}}<br />
<br />
[[Category:CVARS]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Console_Useful_Controls&diff=30989Console Useful Controls2024-01-29T19:01:45Z<p>Stgatilov: listCvars and listCmds are important: they allow finding other cvars/cmds =)</p>
<hr />
<div>==Introduction==<br />
<br />
This is a list of common console commands and cvars that are of use to Dark Mod mappers and developers for testing etc. It is in order of key words and meaning. The console can be called by hitting "{{key|CTRL}}+{{key|ALT}}+{{key|~}}" ("{{key|CTRL}}+{{key|ALT}}+{{key|Key left of number 1}}" in general, e.g. "{{key|CTRL}}+{{key|ALT}}+{{key|^}}" on a German keyboard).<br />
<br />
This will open the console to cover the upper 50% of the screen. To cover more (80%), also hold down the {{key|SHIFT}} key.<br />
<br />
==Notes==<br />
<br />
* Where a cvar or command is followed by a 1 (parameter) it can be taken that it is enabled by 1 and disabled by 0 unless otherwise stated. '''N''' indicates a range of values.<br />
* The current value of a cvar can be shown by entering its name without a value.<br />
* Parameters can be toggled between values by preceding the control with 'toggle' and following it with eg, 1 0. Example : toggle r_showtris 3 0<br />
* Controls can be bound to keys to be used in-game, including the toggle command, eg, <tt>bind "v" "toggle r_showportals 1 0"</tt><br />
* Many controls can be included in the file '''Doomconfig.cfg''' in the darkmod folder so they are automatically effective.<br />
* Some controls are disabled on exit from a map; others are permanent until manually changed.<br />
<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|noclip<br />
|Player flies through everything.<br />
<br />
|-<br />
!align=left|notarget<br />
|AI will not know the player is there.<br />
<br />
|-<br />
!align=left|invisible<br />
|AI will not see the player, but can still hear him.<br />
<br />
|-<br />
!align=left|inaudible<br />
|AI will not hear the player, but can still see him.<br />
<br />
|-<br />
!align=left|god<br />
|Player cannot be harmed.<br />
<br />
|-<br />
!align=left|killmonsters<br />
|Removes all AI from a map.<br />
<br />
|-<br />
!align=left|tdm_open_doors<br />
|Opens all doors on map: even locked and unpickable ones!<br />
<br />
|-<br />
!align=left|tdm_close_doors<br />
|Closes all doors on map<br />
<br />
|-<br />
!align=left|tdm_show_loot<br />
|Shows loot items through walls for a short time.<br />
<br />
|-<br />
!align=left|tdm_show_keys<br />
|Shows keys through walls for a short time.<br />
<br />
|-<br />
!align=left|g_dragentity 1<br />
|Aim at entity and hold attack control then pull back.<br />
<br />
|-<br />
!align=left|pm_noclipspeed N<br />
|Changes the speed of player noclip movement.<br />
<br />
|-<br />
!align=left|g_fov N<br />
|N=angle of field of view, eg, '''<code>g_fov 30</code>''' = zoom in to restrict field of view to 30 degrees. Default = 90.<br />
<br />
|-<br />
!align=left|g_showEntityInfo 1<br />
|Show info about near entities (as box with classname).<br />
<br />
|-<br />
!align=left|com_showfps 1<br />
|Show fps to test performance.<br />
<br />
|-<br />
!align=left|com_numQuickSaves N<br />
|How many quicksaves to retain. Reducing the number won't delete any that you already have.<br />
<br />
|-<br />
!align=left|g_frametime 1<br />
|Timing info for each frame, see [[Profiling#g_frametime|Profiling]].<br />
<br />
|-<br />
!align=left|r_showPrimitives 1<br />
|Show info about number of [[drawcalls]] and tris/shadow tris rendered.<br />
<br />
|-<br />
!align=left|con_noprint 0<br />
|Prints console messages to the screen as an overlay.<br />
<br />
|-<br />
!align=left|r_showskel 1<br />
|Shows skeleton in-game with joint names.<br />
<br />
|-<br />
!align=left|g_showCollisionModels 1<br />
|Shows collision models. Use '''g_maxShowDistance N''' to increase the distance where they are shown to.<br />
<br />
|-<br />
!align=left|r_showtris N<br />
|(1) Shows triangles being rendered directly.<br>(2) Shows overdrawn tri's.<br>(3) Shows all tri's in scene, direct and indirect.<br />
<br />
|-<br />
!align=left|r_showportals N<br />
|(1) Shows all portals in scene (red=closed, green=open). If your portals don't show up they are most likely not sealing. Yellow indicates a portal that is effectively closed but which connects to a visleaf visible through another portal.<br />
(2) Also prints area numbers, mainly where player's eye is right now.<br />
<br />
|-<br />
!align=left|r_showlightcount 1<br />
|Using colours, shows the number of lights hitting a surface, black = 0, red = 1, blue = 2... etc.<br />
<br />
|-<br />
!align=left|seta tdm_showsprop 1<br />
|Shows the volume of sounds heard by AI. <br />
<br />
|-<br />
!align=left|tdm_ai_showbark 1<br />
|Gives the def name (not the soundshader) of barks used by AI.<br />
<br />
|-<br />
!align=left|tdm_ai_showalert 1<br />
|Shows the AI's current alert total and alert state.<br />
<br />
|-<br />
!align=left|tdm_ai_showdest 1<br />
|Shows the AI's current path destination.<br />
<br />
|-<br />
!align=left|bind "f1" "_impulse27" <br />
|Pressing F1 shows the AAS regions.<br />
<br />
|-<br />
!align=left|timescale 2<br />
|Double speed, good for testing pathing, 1 = normal speed, 2 = double, 0.5 = half speed. To have an effect, the "Uncapped FPS" setting must be Off.<br />
<br />
|-<br />
!align=left|g_timeModifier 2<br />
|Same as timescale 2 but somewhat different<br />
<br />
|-<br />
!align=left|g_stopTime 1<br />
|Stops gameplay time, but player can move normally.<br />
<br />
|-<br />
!align=left|teleport "entity name"<br />
|teleports the player to the named entity<br />
<br />
|-<br />
!align=left|teleportArea N<br />
|teleports the player into the area with number N<br />
<br />
|-<br />
!align=left|getviewpos<br />
|get player's position and orientation [[Reporting_Problem#Coordinates|coordinates]]<br />
<br />
|-<br />
!align=left|setviewpos X Y Z [P Y R]<br />
|teleports the player to the coordinates and optionally sets camera orientation.<br />
<br />
|}<br />
<br />
== Spawning entities ==<br />
<br />
Spawns entity in front of the player. Look up if entity gets spawned under the floor. <br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_blackjack<br />
|Spawns blackjack.<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_shortsword<br />
|Spawns a sword.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead<br />
|Spawns one arrow.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead inv_ammo_amount 50<br />
|Spawns 50 arrows (one entity with 50 ammo). Similar technique can be used for other ammo types.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_firearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_gasarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_mossarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_noisemaker<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_ropearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_waterarrow<br />
|<br />
<br />
|}<br />
<br />
With the TDM console you can press tab after typing something to autocomplete. For example <tt>spawn atdm:<tab></tt> will cycle through the various spawnables. You can also add additional spawnargs using the following syntax: <tt>spawn classname [key value] [key value] ...</tt>.<br />
<br />
== Diagnostic information ==<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|listCvars GLOB<br />
|lists all cvars matching the given glob/wildcard (no argument = lists everything).<br />
<br />
|-<br />
!align=left|listCmds GLOB<br />
|lists all console commands matching the given glob/wildcard (no argument = lists everything).<br />
<br />
|-<br />
!align=left|listEntities<br />
|lists all current entities followed by a count.<br />
<br />
|-<br />
!align=left|listEntities GLOB<br />
|lists all alive entities whose names match given glob/wildcard (e.g. use asterisks like <tt>*func_static*</tt> to search for substring).<br />
<br />
|-<br />
!align=left|countEntities<br />
|displays a count of entities by class. ''TDM 2.03+''<br />
<br />
|-<br />
!align=left|condump [unwrap] ''filename.txt''<br />
|Writes the text content of the console to text file ''filename.txt'' (you can use any file name). If optional keyword ''unwrap'' is used, full lines from the console will be stitched together with the following line. Useful when exporting long file paths from the console, that have been broken up by its width limit. ''TDM 2.03+''<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
[[Cvars in The Dark Mod]]<br />
<br />
{{editing}}<br />
<br />
[[Category:CVARS]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Console_Useful_Controls&diff=30988Console Useful Controls2024-01-29T18:53:29Z<p>Stgatilov: listEntities accepts glob filter for entity name</p>
<hr />
<div>==Introduction==<br />
<br />
This is a list of common console commands and cvars that are of use to Dark Mod mappers and developers for testing etc. It is in order of key words and meaning. The console can be called by hitting "{{key|CTRL}}+{{key|ALT}}+{{key|~}}" ("{{key|CTRL}}+{{key|ALT}}+{{key|Key left of number 1}}" in general, e.g. "{{key|CTRL}}+{{key|ALT}}+{{key|^}}" on a German keyboard).<br />
<br />
This will open the console to cover the upper 50% of the screen. To cover more (80%), also hold down the {{key|SHIFT}} key.<br />
<br />
==Notes==<br />
<br />
* Where a cvar or command is followed by a 1 (parameter) it can be taken that it is enabled by 1 and disabled by 0 unless otherwise stated. '''N''' indicates a range of values.<br />
* The current value of a cvar can be shown by entering its name without a value.<br />
* Parameters can be toggled between values by preceding the control with 'toggle' and following it with eg, 1 0. Example : toggle r_showtris 3 0<br />
* Controls can be bound to keys to be used in-game, including the toggle command, eg, <tt>bind "v" "toggle r_showportals 1 0"</tt><br />
* Many controls can be included in the file '''Doomconfig.cfg''' in the darkmod folder so they are automatically effective.<br />
* Some controls are disabled on exit from a map; others are permanent until manually changed.<br />
<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|noclip<br />
|Player flies through everything.<br />
<br />
|-<br />
!align=left|notarget<br />
|AI will not know the player is there.<br />
<br />
|-<br />
!align=left|invisible<br />
|AI will not see the player, but can still hear him.<br />
<br />
|-<br />
!align=left|inaudible<br />
|AI will not hear the player, but can still see him.<br />
<br />
|-<br />
!align=left|god<br />
|Player cannot be harmed.<br />
<br />
|-<br />
!align=left|killmonsters<br />
|Removes all AI from a map.<br />
<br />
|-<br />
!align=left|tdm_open_doors<br />
|Opens all doors on map: even locked and unpickable ones!<br />
<br />
|-<br />
!align=left|tdm_close_doors<br />
|Closes all doors on map<br />
<br />
|-<br />
!align=left|tdm_show_loot<br />
|Shows loot items through walls for a short time.<br />
<br />
|-<br />
!align=left|tdm_show_keys<br />
|Shows keys through walls for a short time.<br />
<br />
|-<br />
!align=left|g_dragentity 1<br />
|Aim at entity and hold attack control then pull back.<br />
<br />
|-<br />
!align=left|pm_noclipspeed N<br />
|Changes the speed of player noclip movement.<br />
<br />
|-<br />
!align=left|g_fov N<br />
|N=angle of field of view, eg, '''<code>g_fov 30</code>''' = zoom in to restrict field of view to 30 degrees. Default = 90.<br />
<br />
|-<br />
!align=left|g_showEntityInfo 1<br />
|Show info about near entities (as box with classname).<br />
<br />
|-<br />
!align=left|com_showfps 1<br />
|Show fps to test performance.<br />
<br />
|-<br />
!align=left|com_numQuickSaves N<br />
|How many quicksaves to retain. Reducing the number won't delete any that you already have.<br />
<br />
|-<br />
!align=left|g_frametime 1<br />
|Timing info for each frame, see [[Profiling#g_frametime|Profiling]].<br />
<br />
|-<br />
!align=left|r_showPrimitives 1<br />
|Show info about number of [[drawcalls]] and tris/shadow tris rendered.<br />
<br />
|-<br />
!align=left|con_noprint 0<br />
|Prints console messages to the screen as an overlay.<br />
<br />
|-<br />
!align=left|r_showskel 1<br />
|Shows skeleton in-game with joint names.<br />
<br />
|-<br />
!align=left|g_showCollisionModels 1<br />
|Shows collision models. Use '''g_maxShowDistance N''' to increase the distance where they are shown to.<br />
<br />
|-<br />
!align=left|r_showtris N<br />
|(1) Shows triangles being rendered directly.<br>(2) Shows overdrawn tri's.<br>(3) Shows all tri's in scene, direct and indirect.<br />
<br />
|-<br />
!align=left|r_showportals N<br />
|(1) Shows all portals in scene (red=closed, green=open). If your portals don't show up they are most likely not sealing. Yellow indicates a portal that is effectively closed but which connects to a visleaf visible through another portal.<br />
(2) Also prints area numbers, mainly where player's eye is right now.<br />
<br />
|-<br />
!align=left|r_showlightcount 1<br />
|Using colours, shows the number of lights hitting a surface, black = 0, red = 1, blue = 2... etc.<br />
<br />
|-<br />
!align=left|seta tdm_showsprop 1<br />
|Shows the volume of sounds heard by AI. <br />
<br />
|-<br />
!align=left|tdm_ai_showbark 1<br />
|Gives the def name (not the soundshader) of barks used by AI.<br />
<br />
|-<br />
!align=left|tdm_ai_showalert 1<br />
|Shows the AI's current alert total and alert state.<br />
<br />
|-<br />
!align=left|tdm_ai_showdest 1<br />
|Shows the AI's current path destination.<br />
<br />
|-<br />
!align=left|bind "f1" "_impulse27" <br />
|Pressing F1 shows the AAS regions.<br />
<br />
|-<br />
!align=left|timescale 2<br />
|Double speed, good for testing pathing, 1 = normal speed, 2 = double, 0.5 = half speed. To have an effect, the "Uncapped FPS" setting must be Off.<br />
<br />
|-<br />
!align=left|g_timeModifier 2<br />
|Same as timescale 2 but somewhat different<br />
<br />
|-<br />
!align=left|g_stopTime 1<br />
|Stops gameplay time, but player can move normally.<br />
<br />
|-<br />
!align=left|teleport "entity name"<br />
|teleports the player to the named entity<br />
<br />
|-<br />
!align=left|teleportArea N<br />
|teleports the player into the area with number N<br />
<br />
|-<br />
!align=left|getviewpos<br />
|get player's position and orientation [[Reporting_Problem#Coordinates|coordinates]]<br />
<br />
|-<br />
!align=left|setviewpos X Y Z [P Y R]<br />
|teleports the player to the coordinates and optionally sets camera orientation.<br />
<br />
|}<br />
<br />
== Spawning entities ==<br />
<br />
Spawns entity in front of the player. Look up if entity gets spawned under the floor. <br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_blackjack<br />
|Spawns blackjack.<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_shortsword<br />
|Spawns a sword.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead<br />
|Spawns one arrow.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead inv_ammo_amount 50<br />
|Spawns 50 arrows (one entity with 50 ammo). Similar technique can be used for other ammo types.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_firearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_gasarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_mossarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_noisemaker<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_ropearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_waterarrow<br />
|<br />
<br />
|}<br />
<br />
With the TDM console you can press tab after typing something to autocomplete. For example <tt>spawn atdm:<tab></tt> will cycle through the various spawnables. You can also add additional spawnargs using the following syntax: <tt>spawn classname [key value] [key value] ...</tt>.<br />
<br />
== Diagnostic information ==<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|listEntities<br />
|lists all current entities followed by a count.<br />
<br />
|-<br />
!align=left|listEntities GLOB<br />
|lists all alive entities whose names match given glob/wildcard (e.g. use asterisks like <tt>*func_static*</tt> to search for substring).<br />
<br />
|-<br />
!align=left|countEntities<br />
|displays a count of entities by class. ''TDM 2.03+''<br />
<br />
|-<br />
!align=left|condump [unwrap] ''filename.txt''<br />
|Writes the text content of the console to text file ''filename.txt'' (you can use any file name). If optional keyword ''unwrap'' is used, full lines from the console will be stitched together with the following line. Useful when exporting long file paths from the console, that have been broken up by its width limit. ''TDM 2.03+''<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
[[Cvars in The Dark Mod]]<br />
<br />
{{editing}}<br />
<br />
[[Category:CVARS]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Console_Useful_Controls&diff=30987Console Useful Controls2024-01-29T17:43:34Z<p>Stgatilov: Added tdm_open/close_doors, r_showPortals 2, teleportArea, g_stopTime + minor fixes.</p>
<hr />
<div>==Introduction==<br />
<br />
This is a list of common console commands and cvars that are of use to Dark Mod mappers and developers for testing etc. It is in order of key words and meaning. The console can be called by hitting "{{key|CTRL}}+{{key|ALT}}+{{key|~}}" ("{{key|CTRL}}+{{key|ALT}}+{{key|Key left of number 1}}" in general, e.g. "{{key|CTRL}}+{{key|ALT}}+{{key|^}}" on a German keyboard).<br />
<br />
This will open the console to cover the upper 50% of the screen. To cover more (80%), also hold down the {{key|SHIFT}} key.<br />
<br />
==Notes==<br />
<br />
* Where a cvar or command is followed by a 1 (parameter) it can be taken that it is enabled by 1 and disabled by 0 unless otherwise stated. '''N''' indicates a range of values.<br />
* The current value of a cvar can be shown by entering its name without a value.<br />
* Parameters can be toggled between values by preceding the control with 'toggle' and following it with eg, 1 0. Example : toggle r_showtris 3 0<br />
* Controls can be bound to keys to be used in-game, including the toggle command, eg, <tt>bind "v" "toggle r_showportals 1 0"</tt><br />
* Many controls can be included in the file '''Doomconfig.cfg''' in the darkmod folder so they are automatically effective.<br />
* Some controls are disabled on exit from a map; others are permanent until manually changed.<br />
<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|noclip<br />
|Player flies through everything.<br />
<br />
|-<br />
!align=left|notarget<br />
|AI will not know the player is there.<br />
<br />
|-<br />
!align=left|invisible<br />
|AI will not see the player, but can still hear him.<br />
<br />
|-<br />
!align=left|inaudible<br />
|AI will not hear the player, but can still see him.<br />
<br />
|-<br />
!align=left|god<br />
|Player cannot be harmed.<br />
<br />
|-<br />
!align=left|killmonsters<br />
|Removes all AI from a map.<br />
<br />
|-<br />
!align=left|tdm_open_doors<br />
|Opens all doors on map: even locked and unpickable ones!<br />
<br />
|-<br />
!align=left|tdm_close_doors<br />
|Closes all doors on map<br />
<br />
|-<br />
!align=left|tdm_show_loot<br />
|Shows loot items through walls for a short time.<br />
<br />
|-<br />
!align=left|tdm_show_keys<br />
|Shows keys through walls for a short time.<br />
<br />
|-<br />
!align=left|g_dragentity 1<br />
|Aim at entity and hold attack control then pull back.<br />
<br />
|-<br />
!align=left|pm_noclipspeed N<br />
|Changes the speed of player noclip movement.<br />
<br />
|-<br />
!align=left|g_fov N<br />
|N=angle of field of view, eg, '''<code>g_fov 30</code>''' = zoom in to restrict field of view to 30 degrees. Default = 90.<br />
<br />
|-<br />
!align=left|g_showEntityInfo 1<br />
|Show info about near entities (as box with classname).<br />
<br />
|-<br />
!align=left|com_showfps 1<br />
|Show fps to test performance.<br />
<br />
|-<br />
!align=left|com_numQuickSaves N<br />
|How many quicksaves to retain. Reducing the number won't delete any that you already have.<br />
<br />
|-<br />
!align=left|g_frametime 1<br />
|Timing info for each frame, see [[Profiling#g_frametime|Profiling]].<br />
<br />
|-<br />
!align=left|r_showPrimitives 1<br />
|Show info about number of [[drawcalls]] and tris/shadow tris rendered.<br />
<br />
|-<br />
!align=left|con_noprint 0<br />
|Prints console messages to the screen as an overlay.<br />
<br />
|-<br />
!align=left|r_showskel 1<br />
|Shows skeleton in-game with joint names.<br />
<br />
|-<br />
!align=left|g_showCollisionModels 1<br />
|Shows collision models. Use '''g_maxShowDistance N''' to increase the distance where they are shown to.<br />
<br />
|-<br />
!align=left|r_showtris N<br />
|(1) Shows triangles being rendered directly.<br>(2) Shows overdrawn tri's.<br>(3) Shows all tri's in scene, direct and indirect.<br />
<br />
|-<br />
!align=left|r_showportals N<br />
|(1) Shows all portals in scene (red=closed, green=open). If your portals don't show up they are most likely not sealing. Yellow indicates a portal that is effectively closed but which connects to a visleaf visible through another portal.<br />
(2) Also prints area numbers, mainly where player's eye is right now.<br />
<br />
|-<br />
!align=left|r_showlightcount 1<br />
|Using colours, shows the number of lights hitting a surface, black = 0, red = 1, blue = 2... etc.<br />
<br />
|-<br />
!align=left|seta tdm_showsprop 1<br />
|Shows the volume of sounds heard by AI. <br />
<br />
|-<br />
!align=left|tdm_ai_showbark 1<br />
|Gives the def name (not the soundshader) of barks used by AI.<br />
<br />
|-<br />
!align=left|tdm_ai_showalert 1<br />
|Shows the AI's current alert total and alert state.<br />
<br />
|-<br />
!align=left|tdm_ai_showdest 1<br />
|Shows the AI's current path destination.<br />
<br />
|-<br />
!align=left|bind "f1" "_impulse27" <br />
|Pressing F1 shows the AAS regions.<br />
<br />
|-<br />
!align=left|timescale 2<br />
|Double speed, good for testing pathing, 1 = normal speed, 2 = double, 0.5 = half speed. To have an effect, the "Uncapped FPS" setting must be Off.<br />
<br />
|-<br />
!align=left|g_timeModifier 2<br />
|Same as timescale 2 but somewhat different<br />
<br />
|-<br />
!align=left|g_stopTime 1<br />
|Stops gameplay time, but player can move normally.<br />
<br />
|-<br />
!align=left|teleport "entity name"<br />
|teleports the player to the named entity<br />
<br />
|-<br />
!align=left|teleportArea N<br />
|teleports the player into the area with number N<br />
<br />
|-<br />
!align=left|getviewpos<br />
|get player's position and orientation [[Reporting_Problem#Coordinates|coordinates]]<br />
<br />
|-<br />
!align=left|setviewpos X Y Z [P Y R]<br />
|teleports the player to the coordinates and optionally sets camera orientation.<br />
<br />
|}<br />
<br />
== Spawning entities ==<br />
<br />
Spawns entity in front of the player. Look up if entity gets spawned under the floor. <br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_blackjack<br />
|Spawns blackjack.<br />
<br />
|-<br />
!align=left|spawn atdm:weapon_shortsword<br />
|Spawns a sword.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead<br />
|Spawns one arrow.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_broadhead inv_ammo_amount 50<br />
|Spawns 50 arrows (one entity with 50 ammo). Similar technique can be used for other ammo types.<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_firearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_gasarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_mossarrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_noisemaker<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_ropearrow<br />
|<br />
<br />
|-<br />
!align=left|spawn atdm:ammo_waterarrow<br />
|<br />
<br />
|}<br />
<br />
With the TDM console you can press tab after typing something to autocomplete. For example <tt>spawn atdm:<tab></tt> will cycle through the various spawnables. You can also add additional spawnargs using the following syntax: <tt>spawn classname [key value] [key value] ...</tt>.<br />
<br />
== Diagnostic information ==<br />
<br />
{|class="wikitable sortable" border=1 style="border-color: grey; border-collapse: collapse; font-size: 92%; margin-left: 1em" cellspacing=0 cellpadding=3<br />
<br />
|-<br />
!bgcolor=#ffdead|Command<br />
!bgcolor=#ffdead|Description<br />
<br />
|-<br />
!align=left|listEntities<br />
|lists all current entities followed by a count.<br />
<br />
|-<br />
!align=left|countEntities<br />
|displays a count of entities by class. ''TDM 2.03+''<br />
<br />
|-<br />
!align=left|condump [unwrap] ''filename.txt''<br />
|Writes the text content of the console to text file ''filename.txt'' (you can use any file name). If optional keyword ''unwrap'' is used, full lines from the console will be stitched together with the following line. Useful when exporting long file paths from the console, that have been broken up by its width limit. ''TDM 2.03+''<br />
<br />
|}<br />
<br />
==See Also==<br />
<br />
[[Cvars in The Dark Mod]]<br />
<br />
{{editing}}<br />
<br />
[[Category:CVARS]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Caulk&diff=30954Caulk2024-01-05T21:22:24Z<p>Stgatilov: Reviewed the section about applying caulk for the sake of performance</p>
<hr />
<div>== Introduction ==<br />
"Caulk" is an old word, in verb form meaning "to make a ship or building watertight by filling the seams between planks with oakum or other material driven snug". A ship not properly caulked could leak, slow down, and sink. Reputedly, this inspired id co-founder John Carmack to chose the name "caulk" for a substance to seal internal and external leaks. The original purposes of caulk in Doom were likely to help avoid game slow-downs, and to close off any accidental tiny leaks by plastering the whole outside with it. From [https://forums.thedarkmod.com/index.php?/topic/18030-the-origins-of-caulk/&tab=comments#comment-388327 The Origins of Caulk]<br />
<br />
In TDM, the noun "caulk" can be used in two senses:<br />
# as a texture (found in textures/common/caulk), that appears pink/magenta in DR, but is not drawn in-game. Like other textures, it can be applied to the faces of brushes (worldspawns), func_statics, and so on.<br />
# as a '''worldspawn brush''' with the caulk texture applied to one or typically all surfaces.<br />
<br />
== Caulk considered dangerous ==<br />
<br />
The very idea of caulk contradicts itself:<br />
* (rendering) It is not rendered and does not cast shadows, thus it does '''not''' block neither view nor light.<br />
* (area-portal graph) It is opaque and thus closes areas, meaning that it blocks both view and light.<br />
<br />
It means that when you apply caulk, you cannot expect fully defined behavior in game.<br />
The exact behavior depends on internal algorithms of the renderer, and may change between TDM versions due to engine improvements.<br />
<br />
For example, caulk brushes inside doorway models are known to [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ break the new light portal flow optimizations] [https://bugs.thedarkmod.com/view.php?id=5172#c16126 #5172]. This issue is caused by the fact that stencil shadows are only generated from backfaces.<br />
<br />
A related '''shadowcaulk material''' can fix this issue, because it casts shadows and thus blocks light rays in all regards.<br />
But the contradiction in whether it blocks view or not still remains.<br />
Perhaps it does not cause undefined behavior if the caulk geometry is fully surrounded by non-translucent geometry...<br />
<br />
Another example: if occlusion culling happens in the future, it will most likely use all the world geometry as occluders, but most likely will '''not''' use all the models.<br />
So if you cover a piece of the wall with caulk because it is invisible under a model, the objects behind this caulky hole will not be removed from rendering.<br />
<br />
== Main Use of Caulk - for Separating Vis Leafs ==<br />
It is the second meaning in which caulk is actually most useful: '''for defining and sealing, in conjunction with visportals, individual ''vis leaf'' areas of your map'''. This often takes the form of thin caulk-brush sheets sandwiched between non-brush opaque interior walls. Creating vis leafs is important to avoid unnecessary, performance-sucking rendering, and to provide more-plausible sound propagation. For more about this, see [[Visportals]] and [[Sound Propagation: Part 1]].<br />
<br />
Other transparent "no draw" textures on brushes do not have the sealing property that caulk has.<br />
<br />
== Another Important Use - Caulk Sky ==<br />
[[Image:Caulk sky with portal sky cube.png|200px|thumb|right|Figure 1a. Looking up at a caulk sky with portal sky cube in DR.]] While most any opaque worldspawn brush can be used to seal against the void (as discussed in [[Performance: Essential Must-Knows]] and other places), to specifically create a sky, the external, void-facing brushes have two choices for texture:<br />
* portal_sky (found in textures/smf/portal_sky)<br />
* caulk<br />
[[Image:Caulk sky in-game.jpg|200px|thumb|right|Figure 1b. Looking up at the same sky in-game.]]For a caulk sky, besides the caulk brushes themselves, you must have at least one surface anywhere in the rendered area with the portal_sky texture. For example, in Figure 1 (from a 2013 example by Obsttorte), this is done using an out-of-the-way portal_sky-textured cube brush. The engine will never render anything on the caulk brush surfaces themselves; they are merely views into the void, and the engine uses the portal_sky texture sample to "fill in" those views. Figure 1b shows the same "pit" scene, but in-game, at a different angle.<br />
<br />
There are two main reasons traditionally why caulk sky was useful in TDM.<br />
<br />
=== Non-Clipping of Objects that Extend Into the Void ===<br />
Consider a map object that pierces an external brush of your map. Assume that (in order to compile without leak) its origin is within the rendered volume, either naturally or by adjustment. If the external brush has portal_sky on its interior, the map object (prior to TDM 2.05) will be clipped there. Sometimes, that's not what you want.<br />
<br />
While caulk does not render, it does cut into other textures, but only if they are worldspawn. If you've converted them into func_statics, they will be rendered completely and not be cut off at the caulk surface. To ensure this happens, the func_static must reaching into the rendered area a bit. In Figure 1, the roof eaves at the pit lips are part of larger roof wedges that the player can see when jumping up. They are func_statics that extend into the void, but with origins in the pit's vis leaf. (If the game had multiple vis leafs from which to view the func_statics, they would appear unclipped from all.)<br />
<br />
To summarize, caulk is transparent, and in-effect shows the portal_sky through it, as well as any func_statics that pierce it into your vis leaf. That means you can cut a func_static house in half with a caulk brush, and still see both sides of it. Using portal_sky, this was not possible until recently. However, since TDM 2.05, the default behavior of portal_sky regarding clipping is now similar to caulk.<br />
<br />
For more, see [https://forums.thedarkmod.com/index.php?/topic/10003-so-what-are-you-working-on-right-now/page/178/&tab=comments#comment-311195 this forum post] and [http://bugs.thedarkmod.com/view.php?id=4635 this bug tracker entry about portal sky modes].<br />
<br />
=== Atmospheric Fog ===<br />
Dealing with fog effects is often tricky, particularly at the boundary of fog volume and sky. Portal_sky versus caulk sky can differ. Some starting points:<br />
* A ''Fog Light'' with spawnarg "noFogBoundary" lets fog paint on solid surfaces, while leaving empty space and caulk sky free of fog effects.<br />
* For more, see [[Light_Properties#Fog_Light | Fog Light]] and [https://forums.thedarkmod.com/index.php?/topic/15802-simulating-atmospheric-perspective Simulating Atmospheric Perspective].<br />
<br />
== Other, Secondary Uses of Caulk as a Texture ==<br />
=== As a DR Mapper Convenience ===<br />
[[Image:caulk_image3.png|200px|thumb|right|Figure 2. Benefits of caulking as a mapping tool.]] Some mappers like to caulk the exterior (void-facing) surfaces of their maps. While unnecessary for game play (since the engine ignores those surfaces automatically), it benefits editing. By using the DR Caulk filter, the mapper can easily switch off the exterior surfaces and see inside the map to get a better vantage point. Image 2 shows the view:<br />
* (''top'') if you don't caulk the exterior (and just leave it as a stone texture). It is difficult to get a good overhead view of the work. Unless you set up caulking (or one of the alternative methods), you have to either select and hide the exterior brushes or fly inside the map.<br />
* (''middle'') if you do caulk the exterior, when the caulk filter is not active.<br />
* (''bottom'') with the caulk filter activated, for a superior overhead view into the work.<br />
<br />
Alternative non-caulk methods to do this include:<br />
* using DR Layers. Move all the exterior brushes into their own Layer, and hide that layer.<br />
* with any brush used as a Portal Sky, keeping that texture on all faces, and adding a custom DR "Portal Sky" filter<br />
<br />
=== To Avoid Cost of Drawing Unseeable Polygons ===<br />
Caulk can be used to skip drawing of: [[Image:caulk_image.png|200px|thumb|right|Figure 3. Caulk applied to a func_static window.]]<br />
* back-surface polygons (tris) of a ''prop'' object, such as a door or window as in Figure 3. There, surfaces touching the wall are caulked, so are not drawn in game, saving tris. But GPU immediately drops all backfacing triangles anyway, so you won't notice any difference. Testing (detailed further below) shows that such caulking is not worth the effort.<br />
* worldspawn brush surfaces entirely covered by detail work like patches.[[Image:caulk_image2.png|200px|thumb|right|Figure 4. Caulk applied to a unseeable worldspawn brush surface.]] See Figure 4. The player can never see the caulked surface because it's hidden by the func_static vault. However, stencil shadows can might get broken in this case (see [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ thread]), and there is no noticeable performance difference anyway.<br />
<br />
=== Avoiding Z-Fighting ===<br />
As just seen with the vault in Figure 4, caulking helps in certain circumstances. The caulked worldspawn surface does not "sparkle" or z-fight through the highest point of the vault, where the vault patch and the worldspawn brush are at equal height.<br />
<br />
== Caulking of Hidden Surfaces to Improve Performance? - Discussion, Testing, and Analysis ==<br />
=== Introduction ===<br />
Every now and then, caulking arises in debates: is it useful and beneficial to performance to spend a lot of time object-caulking? And if so, how much caulk is required to get a solid impact on fps rate? <br />
<br />
As Figure 3 indicated, to save a few polygons (tris), one can apply caulk on surfaces the player can never see in any circumstances, like wall-facing surfaces of prop windows and doors. This reduces the number of tris, and thus could potentially improve performance in some cases. But what does testing reveal?<br />
<br />
=== Caulking That Cannot Affect Performance ===<br />
There is no ''performance'' advantage to using caulk on any of these surfaces:<br />
* worldspawn surfaces on the outside of the map in contact with the void<br />
* worldspawn surfaces that are flush against another surface, for instance the bottom of a brush aligned with the floor.<br />
<br />
Dmap compiler removes these surfaces automatically, so caulk texture is not needed.<br />
<br />
=== Testing and Estimating the Effect of Caulking on Performance ===<br />
Tests performed in 2010 by Sotha gave the following results.<br />
<br />
Caulking a medium complex scene with tens of windows and other objects (Knighton Manor start) did NOT have any effect on fps counts. Caulking did save roughly 1000 tris, but this is not sufficient to cause any fps improvement. Also it was noticed that memory usage decreased : 1000 saved tris saved 0.6MB of memory. This is about the size of one 1K x 1K diffuse texture, so the difference is absolutely negligible.<br />
<br />
Testing indicated that on a rather high-end computer (for 2010) an increase of 23000 tris, 75 draws and 2500 shdw reduced the fps count by two (stgatilov: relative to how many? was that additional geometry invisible?).<br />
If a window consists of 5 brushes and the wall facing surfaces are caulked, this saves 5 surfaces and thus 10 tris per window. This would mean that 2300 windows should be caulked to get an improvement of 2fps. Basically this shows that caulking does not have much impact on modern hardware. However, on an older piece of hardware the amount of caulking needed for performance effect is lower, but even in this case it should be remembered that 1000 tris is roughly 20% of a single AI character.<br />
<br />
=== Conclusion ===<br />
Applying caulk on brushes for the purpose of optimization is simply not worth it.<br />
And given that it can cause problems with TDM updates, better not do it.<br />
<br />
{{editing}}<br />
[[Category:Mapping Tutorials]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Caulk&diff=30953Caulk2024-01-05T17:17:52Z<p>Stgatilov: Added "caulk considered dangerous" section</p>
<hr />
<div>== Introduction ==<br />
"Caulk" is an old word, in verb form meaning "to make a ship or building watertight by filling the seams between planks with oakum or other material driven snug". A ship not properly caulked could leak, slow down, and sink. Reputedly, this inspired id co-founder John Carmack to chose the name "caulk" for a substance to seal internal and external leaks. The original purposes of caulk in Doom were likely to help avoid game slow-downs, and to close off any accidental tiny leaks by plastering the whole outside with it. From [https://forums.thedarkmod.com/index.php?/topic/18030-the-origins-of-caulk/&tab=comments#comment-388327 The Origins of Caulk]<br />
<br />
In TDM, the noun "caulk" can be used in two senses:<br />
# as a texture (found in textures/common/caulk), that appears pink/magenta in DR, but is not drawn in-game. Like other textures, it can be applied to the faces of brushes (worldspawns), func_statics, and so on.<br />
# as a '''worldspawn brush''' with the caulk texture applied to one or typically all surfaces.<br />
<br />
== Caulk considered dangerous ==<br />
<br />
The very idea of caulk contradicts itself:<br />
* (rendering) It is not rendered and does not cast shadows, thus it does '''not''' block neither view nor light.<br />
* (area-portal graph) It is opaque and thus closes areas, meaning that it blocks both view and light.<br />
<br />
It means that when you apply caulk, you cannot expect fully defined behavior in game.<br />
The exact behavior depends on internal algorithms of the renderer, and may change between TDM versions due to engine improvements.<br />
<br />
For example, caulk brushes inside doorway models are known to [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ break the new light portal flow optimizations] [https://bugs.thedarkmod.com/view.php?id=5172#c16126 #5172].<br />
One workaround is to disable the optimizations... which means you lose much more performance than you tried to gain by applying caulk!<br />
<br />
A related '''shadowcaulk material''' can also fix this issue, because it casts shadows and thus blocks light rays in all regards.<br />
But the contradiction in blocking view still remains.<br />
<br />
Another example: if occlusion culling happens in the future, it will most likely use all the world geometry as occluders, but most likely will '''not''' use all the models.<br />
So if you cover a piece of the wall with caulk because it is invisible under a model, the objects behind caulky hole will not be removed from rendering.<br />
<br />
== Main Use of Caulk - for Separating Vis Leafs ==<br />
It is the second meaning in which caulk is actually most useful: '''for defining and sealing, in conjunction with visportals, individual ''vis leaf'' areas of your map'''. This often takes the form of thin caulk-brush sheets sandwiched between non-brush opaque interior walls. Creating vis leafs is important to avoid unnecessary, performance-sucking rendering, and to provide more-plausible sound propagation. For more about this, see [[Visportals]] and [[Sound Propagation: Part 1]].<br />
<br />
Other transparent "no draw" textures on brushes do not have the sealing property that caulk has.<br />
<br />
== Another Important Use - Caulk Sky ==<br />
[[Image:Caulk sky with portal sky cube.png|200px|thumb|right|Figure 1a. Looking up at a caulk sky with portal sky cube in DR.]] While most any opaque worldspawn brush can be used to seal against the void (as discussed in [[Performance: Essential Must-Knows]] and other places), to specifically create a sky, the external, void-facing brushes have two choices for texture:<br />
* portal_sky (found in textures/smf/portal_sky)<br />
* caulk<br />
[[Image:Caulk sky in-game.jpg|200px|thumb|right|Figure 1b. Looking up at the same sky in-game.]]For a caulk sky, besides the caulk brushes themselves, you must have at least one surface anywhere in the rendered area with the portal_sky texture. For example, in Figure 1 (from a 2013 example by Obsttorte), this is done using an out-of-the-way portal_sky-textured cube brush. The engine will never render anything on the caulk brush surfaces themselves; they are merely views into the void, and the engine uses the portal_sky texture sample to "fill in" those views. Figure 1b shows the same "pit" scene, but in-game, at a different angle.<br />
<br />
There are two main reasons traditionally why caulk sky was useful in TDM.<br />
<br />
=== Non-Clipping of Objects that Extend Into the Void ===<br />
Consider a map object that pierces an external brush of your map. Assume that (in order to compile without leak) its origin is within the rendered volume, either naturally or by adjustment. If the external brush has portal_sky on its interior, the map object (prior to TDM 2.05) will be clipped there. Sometimes, that's not what you want.<br />
<br />
While caulk does not render, it does cut into other textures, but only if they are worldspawn. If you've converted them into func_statics, they will be rendered completely and not be cut off at the caulk surface. To ensure this happens, the func_static must reaching into the rendered area a bit. In Figure 1, the roof eaves at the pit lips are part of larger roof wedges that the player can see when jumping up. They are func_statics that extend into the void, but with origins in the pit's vis leaf. (If the game had multiple vis leafs from which to view the func_statics, they would appear unclipped from all.)<br />
<br />
To summarize, caulk is transparent, and in-effect shows the portal_sky through it, as well as any func_statics that pierce it into your vis leaf. That means you can cut a func_static house in half with a caulk brush, and still see both sides of it. Using portal_sky, this was not possible until recently. However, since TDM 2.05, the default behavior of portal_sky regarding clipping is now similar to caulk.<br />
<br />
For more, see [https://forums.thedarkmod.com/index.php?/topic/10003-so-what-are-you-working-on-right-now/page/178/&tab=comments#comment-311195 this forum post] and [http://bugs.thedarkmod.com/view.php?id=4635 this bug tracker entry about portal sky modes].<br />
<br />
=== Atmospheric Fog ===<br />
Dealing with fog effects is often tricky, particularly at the boundary of fog volume and sky. Portal_sky versus caulk sky can differ. Some starting points:<br />
* A ''Fog Light'' with spawnarg "noFogBoundary" lets fog paint on solid surfaces, while leaving empty space and caulk sky free of fog effects.<br />
* For more, see [[Light_Properties#Fog_Light | Fog Light]] and [https://forums.thedarkmod.com/index.php?/topic/15802-simulating-atmospheric-perspective Simulating Atmospheric Perspective].<br />
<br />
== Other, Secondary Uses of Caulk as a Texture ==<br />
=== As a DR Mapper Convenience ===<br />
[[Image:caulk_image3.png|200px|thumb|right|Figure 2. Benefits of caulking as a mapping tool.]] Some mappers like to caulk the exterior (void-facing) surfaces of their maps. While unnecessary for game play (since the engine ignores those surfaces automatically), it benefits editing. By using the DR Caulk filter, the mapper can easily switch off the exterior surfaces and see inside the map to get a better vantage point. Image 2 shows the view:<br />
* (''top'') if you don't caulk the exterior (and just leave it as a stone texture). It is difficult to get a good overhead view of the work. Unless you set up caulking (or one of the alternative methods), you have to either select and hide the exterior brushes or fly inside the map.<br />
* (''middle'') if you do caulk the exterior, when the caulk filter is not active.<br />
* (''bottom'') with the caulk filter activated, for a superior overhead view into the work.<br />
<br />
Alternative non-caulk methods to do this include:<br />
* using DR Layers. Move all the exterior brushes into their own Layer, and hide that layer.<br />
* with any brush used as a Portal Sky, keeping that texture on all faces, and adding a custom DR "Portal Sky" filter<br />
<br />
=== To Avoid Drawing Unseeable Polygons ===<br />
Caulk can be used to skip drawing of: [[Image:caulk_image.png|200px|thumb|right|Figure 3. Caulk applied to a func_static window.]]<br />
* back-surface polygons (tris) of a ''prop'' object, such as a door or window as in Figure 3. There, surfaces touching the wall are caulked, so are not drawn in game, saving tris. Testing (detailed further below) shows that such caulking is not worth the effort, unless you plan massive cloning of that prop object.<br />
* worldspawn brush surfaces entirely covered by detail work like patches.[[Image:caulk_image2.png|200px|thumb|right|Figure 4. Caulk applied to a unseeable worldspawn brush surface.]] See Figure 4. The player can never see the caulked surface because it's hidden by the func_static vault. This not only saves tris (which is not really important), but also removes the "sparkling" of the other texture at the highest point of the vault.<br />
<br />
=== Avoiding Z-Fighting ===<br />
As just seen with the vault in Figure 4, caulking helps in certain circumstances. To reiterate, the caulked worldspawn surface does not "sparkle" or z-fight through the highest point of the vault, where the vault patch and the worldspawn brush are at equal height.<br />
<br />
== Caulking of Hidden Surfaces to Improve Performance? - Discussion, Testing, and Analysis ==<br />
=== Introduction ===<br />
Every now and then, caulking arises in debates: is it useful and beneficial to performance to spend a lot of time object-caulking? And if so, how much caulk is required to get a solid impact on fps rate? <br />
<br />
As Figure 3 indicated, to save a few polygons (tris), one can apply caulk on surfaces the player can never see in any circumstances, like wall-facing surfaces of prop windows and doors. This reduces the number of tris, and thus could potentially improve performance in some cases. But what does testing reveal?<br />
<br />
=== Caulking That Cannot Affect Performance ===<br />
There is no ''performance'' advantage to using caulk on any of these surfaces:<br />
* worldspawn surfaces on the outside of the map in contact with the void<br />
* worldspawn surfaces that are flush against another surface, for instance the bottom of a brush aligned with the floor.<br />
<br />
The game engine removes these surfaces automatically, so caulk texture is not needed.<br />
<br />
=== Testing and Estimating the Effect of Caulking on Performance ===<br />
Tests performed in 2010 by Sotha gave the following results.<br />
<br />
Caulking a medium complex scene with tens of windows and other objects (Knighton Manor start) did NOT have any effect on fps counts. Caulking did save roughly 1000 tris, but this is not sufficient to cause any fps improvement. The main benefit of caulking was the decrease of memory usage: 1000 saved tris saved 0.6MB of memory.<br />
<br />
Testing indicated that on a rather high-end computer (for 2010) an increase of 23000 tris, 75 draws and 2500 shdw reduced the fps count by two. If a window consists of 5 brushes and the wall facing surfaces are caulked, this saves 5 surfaces and thus 10 tris per window. This would mean that 2300 windows should be caulked to get an improvement of 2fps. Basically this shows that caulking does not have much impact on modern hardware. However, on an older piece of hardware the amount of caulking needed for performance effect is lower, but even in this case it should be remembered that 1000 tris is roughly 20% of a single AI character.<br />
<br />
=== How Should Caulk be Used? Perhaps Before Massive Cloning ===<br />
Mappers may selectively integrate object-caulking in their ongoing work flow. Suppose the mapper builds a func_static window to be cloned and put everywhere. It is beneficial to use a few seconds to apply caulk on the source func_static and then get the caulking tris-saving effect on all the clones. This adds little work for the mapper, but, in a medium sized scene where the windows and other cloned (but caulked) objects are omnipresent, might easily save a few thousand tris.<br />
<br />
=== Conclusion ===<br />
Mappers should not generally take extra trouble to caulk their individual objects, since solid performance increases do not occur with the levels of tris so saved. However, thousands of tris can be saved by simple workflow consideration, when working with objects which are cloned in large numbers.<br />
<br />
{{editing}}<br />
[[Category:Mapping Tutorials]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=30950New light leaks in 2.122023-12-22T22:29:48Z<p>Stgatilov: </p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
|<br />
4385 420 -410 -30 -110 0 <br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0 <br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| (not yet)<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=30949New light leaks in 2.122023-12-22T22:28:44Z<p>Stgatilov: WS2 added</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| ws2_homeagain<br />
| 4385 420 -410 -30 -110 0<br />
4178.12 391.47 -94.56 -28.8 43.6 0.0<br />
4347.92 -271.22 57.53 -0.8 18.4 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=490582 1]<br />
| (not yet)<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=VMWare:_Virtual_machine_with_Linux&diff=30945VMWare: Virtual machine with Linux2023-12-16T22:09:14Z<p>Stgatilov: Added r_gpuBufferNonpersistentUpdateMode node.</p>
<hr />
<div>This guide is originally written for TDM 2.07.<br />
<br />
== Intro ==<br />
<br />
It is very convenient for a Windows-centric developer to have a Linux virtual machine in his arcenal.<br />
<br />
You can read how to set up VirtualBox VM in the article [[VirtualBox: Virtual machine with Linux for TDM]].<br />
This article is about setting up a VMware VM, which has some benefits over VirtualBox: better performance and OpenGL support.<br />
<br />
== Install VMware ==<br />
<br />
While Oracle's VirtualBox is open-source, the VMware product is proprietary in its full sense. As of year 2019, there is [https://www.vmware.com/products/workstation-player.html VMware Workstation Player], which is '''free for non-commercial use'''. You can download it on [https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player this page] (choose Windows version).<br />
<br />
Installation is trivial. Most likely, you do '''not''' need the "Enhanced Keyboard Driver".<br />
<br />
== Create VM ==<br />
<br />
Start VMware Workstation, click on "Create a New Virtual Machine".<br />
<br />
Point "Installer disc image file" to the ISO image of the Linux distro which you want to install (by default it would be [https://www.ubuntu.com/download/desktop Ubuntu LTS]). Click Next.<br />
<br />
Choose a name like "Ubuntu XX.YY x64", set user and password, click Next. Don't forget to set Location: a typical VM takes 5-10 GB. Leave Disk Capacity settings in defaults: do '''not''' use monolithic disk, because it would make some configuring much harder!<br />
<br />
As long as you choose reasonable settings and ISO, you should be eligible for "Easy Install", which means that you'll get Ubuntu installed for you automatically, along with open-vm-tools. Make sure you have '''internet access''' through the whole process, otherwise your installation will be incomplete.<br />
<br />
== Client Tools ==<br />
<br />
In order to use shared directories and shared clipboard, you need to install some sort of client tools. Unfortunately, this topic is quite messy in VMware world. First of all, there are two such tools available: ''VMware Tools'' is distributed with VMware Player, and ''open-vm-tools'' is intended to be distributed by Linux package manager. Second, default installations of the tools are often buggy and don't work.<br />
<br />
In my case, open-vm-tools 2:10.2.0-3~ubuntu0.16.04.1 was installed automatically by VMware Player 15.0.2 during Easy Install procedure and it did not work well. It mounted the shared folder properly when I added it, but after a full reboot the shared folder was absent. Installing the patches from [https://askubuntu.com/a/726906/918615 this answer] helped. Of course, you need to do "<tt>sudo apt-get install git</tt>" first.<br />
<br />
In order to create shared folder, open "Virtual Machine Settings" (in "Player" -> "Manage").<br />
Go to "Options" -> "Shared Folders", and set it to "Always enabled". Now "Add" your TDM root directory to make it accessible from within VM. Check that it is available at <tt>/mnt/hgfs/[name_of_share]</tt>. If it is not there, then I wish you good luck!<br />
<br />
== Configure VM ==<br />
<br />
When your VM is '''not''' running, right-click on VM and go to "Settings".<br />
<br />
Choose "Memory", and increase the amount of Memory available to 4096 MB.<br />
<br />
Choose "Processors", and increase "Number of processor cores" to make TDM build faster. I advise setting it to the number of physical cores you have (6 for me).<br />
<br />
Choose "Display", increase "Graphics memory" to 2 GB.<br />
<br />
Click OK to apply changes.<br />
<br />
== Clean backup ==<br />
<br />
I prefer having the clean VM backed up so that I could restart with a fresh and configured VM at any moment. VMware Player does not support cloning and snapshots, but you can find the directory with your VM data and simply copy the whole directory.<br />
<br />
== Build and run TDM ==<br />
<br />
Open terminal, change dir to the root source code directory in the shared folder, e.g.:<br />
<br />
cd /mnt/hgfs/thedarkmod/darkmod_src<br />
<br />
From here you can build TDM in the usual way, as described in the [[The Dark Mod - Compilation Guide#Linux]]. Of course, you have to install some packages before first build.<br />
<br />
In order to run TDM, go to assets root directory, e.g.:<br />
<br />
cd /mnt/hgfs/thedarkmod/darkmod<br />
<br />
Run TDM from there:<br />
<br />
./thedarkmod.x64<br />
<br />
For TDM 2.07, you also have to do "<tt>sudo apt-get install libopenal1</tt>" beforehand.<br />
<br />
Currently VMware seems to support OpenGL 3.0 in general and OpenGL 3.3 Core profile only.<br />
<br />
== Mouse look ==<br />
<br />
VMware breaks mouse cursor warping in the same way as VirtualBox does. Warping is critical for mouse-look in FPS games, including TDM. Without it, you won't be able even to navigate through menus.<br />
<br />
There are two ways to fix it in case of VMware Player:<br />
<br />
'''VMware-side solution'''. Make sure the VM is shutdown, open the <tt>.vmx</tt>-file of your VM and add the following magic lines to it:<br />
<br />
usb.generic.allowHID = "TRUE"<br />
mouse.vusb.useBasicMouse = "FALSE"<br />
mouse.vusb.enable = "TRUE"<br />
<br />
Strangely, this is already enough to fix the problem. If your mouse is crazy in TDM, press Ctrl+Alt and click back to VM, and mouse look should return to normal.<br />
<br />
Also with these lines, you can passthrough your mouse and keyboard exclusively to VM. In order to do that, click "Player" -> "Removable Devices", find your mouse/keyboard there and click "Connect". Make sure that you have spare USB mouse or keyboard connected to computer so that at least some control is left on the host side.<br />
<br />
'''TDM-side hack'''. Open game console and set "<tt>in_nowarp 1</tt>" there. <br />
After that you have a limited mouse-look. You cannot really play with it, but it is enough for clicking through menu and a bit of in-game testing. Use "turn left/right" keys as additional workaround.<br />
<br />
== The game runs very slow ==<br />
<br />
I have to set cvar "<tt>r_gpuBufferNonpersistentUpdateMode 1</tt>" locally to get normal performance (supposedly since TDM 2.09).<br />
With default value of this cvar, TDM rendering is very slow inside VM for some reason.<br />
Note that this cvar is internal and does not affect normal installations that much.<br />
<br />
[[Category: Coding]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=30944New light leaks in 2.122023-12-16T18:58:48Z<p>Stgatilov: </p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
<br />
=== Validation ===<br />
<br />
Before adding an issue here, please make sure to check the following steps:<br />
<br />
* Start game afresh, install mission, setviewpos and verify that light leak indeed happens. Perhaps you need to open some doors nearby.<br />
* Restart game afresh, set "r_useLightPortalFlow 1" and "r_useLightPortalFlowCulling 0", start mission. Check that light leak no longer happens.<br />
<br />
The light leak can be caused by this issue only if both points are true.<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=30943New light leaks in 2.122023-12-16T18:56:14Z<p>Stgatilov: Added cos3_sacricide</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
=== Description ===<br />
<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
<br />
|-<br />
| cos3_sacricide<br />
| -1283.53 -380.68 83.25 15.2 -38.6 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=489895 1]<br />
| (not yet)<br />
<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=New_light_leaks_in_2.12&diff=30942New light leaks in 2.122023-12-16T18:38:28Z<p>Stgatilov: Initial commit (ws1 only)</p>
<hr />
<div>There is major change in TDM 2.12 regarding how shadows are generated due to issue [https://bugs.thedarkmod.com/view.php?id=5172 #5172].<br />
As the result, some we might see some '''major light leaks''' in the old missions.<br />
<br />
=== Description ===<br />
<br />
As far as I know, the problem happens only with stencil shadows, because stencil shadows are cast from back faces only (shadow maps are generated by front faces too).<br />
The shape of such light leaks does '''not''' depend on the camera position.<br />
Usually the problem is caused by using caulk on brushes: light leaks through the caulk.<br />
<br />
<br />
'''New behavior''' (default in TDM 2.12 and after):<br />
* r_useLightPortalFlow = 2<br />
* r_useLightPortalFlowCulling = 1<br />
<br />
The shadows are computed differently for world areas and for models:<br />
# Any worldspawn brush within light volume always casts shadow. Even if it is behind walls and closed portals.<br />
# A model casts shadow only if light beams from the light origin might reach it through visportals. No shadows behind walls and closed portals!<br />
<br />
As an exception, some models switch from p.2 to p.1 and cast shadows everywhere.<br />
For instance, this happens in case of parallel lights, and when entities are explicitly marked with the workaround spawnarg "forceShadowBehindOpaque".<br />
<br />
<br />
'''Old behavior''' (default in TDM 2.11 and before):<br />
* r_useLightPortalFlow = 1<br />
* r_useLightPortalFlowCulling = 0<br />
<br />
The behavior here is different depending on the type of light:<br />
* '''Static''' lights use the new TDM 2.12 behavior, so models don't cast shadows behind walls.<br />
* '''Dynamic''' lights: everything within light volume casts shadows, regardless of whether it's area/brush or model.<br />
<br />
The light is static if it has not moved since game start.<br />
That's the case when engine uses precomputed shadow volumes for world geometry.<br />
<br />
=== Description ===<br />
<br />
<br />
<br />
=== List of issues ===<br />
<br />
{| class="wikitable"<br />
|-<br />
! Mission name !! getviewpos coordinates !! Links to forums !! Applied fixes<br />
|-<br />
| ws1_north<br />
| -1153.92 3523.22 -955.75 29.8 -145.6 0.0<br />
-664.04 2894.9 -635.75 10.2 9.9 0.0<br />
| [https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/ 1]<br />
[https://forums.thedarkmod.com/index.php?/topic/22241-new-shadow-leaks-in-212-dev-builds/&do=findComment&comment=488509 2]<br />
| svn rev 241: global workaround<br />
|}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference&diff=30941TDM Script Reference2023-12-16T14:11:58Z<p>Stgatilov: Updated due to 2.12 beta start.</p>
<hr />
<div>This page has been generated automatically by the tdm_gen_script_event_doc console command.<br />
<br />
Generated by The Dark Mod 2.12, code revision 10584, last update: 2023-12-16 15:10<br />
<br />
{{tdm-scripting-reference-intro}}<br />
<div class="toclimit-4"><br />
__TOC__<br />
</div><br />
= TDM Script Event Reference =<br />
<br />
== All Events ==<br />
=== Alphabetic List ===<br />
==== scriptEvent void '''accelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover accelerates.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''accelTime'''(float time); ====<br />
<br />
:Sets the acceleration time. Set this acceleration time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''accelTo'''(float speed, float time); ====<br />
<br />
:Initiates an acceleration to the given speed over the given time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''acos'''(float cosine); ====<br />
<br />
:Returns the angle in degrees with the given cosine.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
:Spawnclasses responding to this event: ''CTarget_AddObjectives'', ''CTarget_CallScriptFunction'', ''CTarget_ChangeEntityRelation'', ''CTarget_ChangeLockState'', ''CTarget_ChangeTarget'', ''CTarget_InterMissionTrigger'', ''CTarget_ItemRemove'', ''CTarget_SetEntityRelation'', ''CTarget_SetFrobable'', ''CTarget_SetObjectiveComponentState'', ''CTarget_SetObjectiveState'', ''CTarget_SetObjectiveVisibility'', ''CTarget_SetRelations'', ''CTarget_SetTeam'', ''CTarget_StartConversation'', ''idAFEntity_Generic'', ''idAFEntity_WithAttachedHead'', ''idAI'', ''idActivator'', ''idAnimated'', ''idBeam'', ''idBrittleFracture'', ''idCameraAnim'', ''idCameraView'', ''idCombatNode'', ''idDamagable'', ''idEarthQuake'', ''idEntityFx'', ''idExplodable'', ''idForceField'', ''idFuncAASObstacle'', ''idFuncAASPortal'', ''idFuncPortal'', ''idFuncSmoke'', ''idItem'', ''idLight'', ''idListener'', ''idMoveable'', ''idMover'', ''idMover_Binary'', ''idPhantomObjects'', ''idPlayerStart'', ''idPortalSky'', ''idRiser'', ''idRotater'', ''idShaking'', ''idSound'', ''idStaticEntity'', ''idTarget_CallObjectFunction'', ''idTarget_Damage'', ''idTarget_EnableLevelWeapons'', ''idTarget_EndLevel'', ''idTarget_FadeEntity'', ''idTarget_FadeSoundClass'', ''idTarget_Give'', ''idTarget_LightFadeIn'', ''idTarget_LightFadeOut'', ''idTarget_PostScriptEvent'', ''idTarget_Remove'', ''idTarget_RemoveWeapons'', ''idTarget_SessionCommand'', ''idTarget_SetFov'', ''idTarget_SetGlobalShaderTime'', ''idTarget_SetInfluence'', ''idTarget_SetKeyVal'', ''idTarget_SetModel'', ''idTarget_SetShaderParm'', ''idTarget_SetShaderTime'', ''idTarget_Show'', ''idTarget_WaitForButton'', ''idTrigger_Count'', ''idTrigger_EntityName'', ''idTrigger_Fade'', ''idTrigger_Hurt'', ''idTrigger_Multi'', ''idTrigger_Timer'', ''idTrigger_Touch'', ''idVacuumSeparatorEntity''<br />
==== scriptEvent void '''activateContacts'''(); ====<br />
<br />
:Activate objects sitting on this object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''activateTargets'''(entity activator); ====<br />
<br />
:Causes this entity to activate all it's targets. Similar to how a trigger activates entities.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addDescendant'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''addFrobPeer'''(entity peer); ====<br />
<br />
:Adds the passed entity as a frob peer.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addInvItem'''(entity inv_item); ====<br />
<br />
:Adds the given item to the inventory. Depending on the type the passed entity will be removed from the game (as for loot items) or hidden.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addItemToInv'''(entity target); ====<br />
<br />
:Adds the entity to the given entity's inventory. Depending on the type the entity will be removed from the game (as for loot items) or hidden. Example: $book->addItemToInv($player1);<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addTarget'''(entity target); ====<br />
<br />
:Add a target to this entity.<br />
::''target'': the entity to add as target<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addToClip'''(float amount); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''alert'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''alertAI'''(string type, float amount, entity actor); ====<br />
<br />
:internal<br />
::''type'': alert type<br />
::''amount'': alert amount<br />
::''actor'': actor causing alert<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowDamage'''(); ====<br />
<br />
:The AI can take damage again.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowDrop'''(float allow); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''allowHiddenMovement'''(float enable); ====<br />
<br />
:Normally, when hidden, monsters do not run physics. This enables physics when hidden.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowMovement'''(float allow); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''ammoAvailable'''(); ====<br />
<br />
:Number of shots left in inventory<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''ammoInClip'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent vector '''angToForward'''(vector angles); ====<br />
<br />
:Returns a forward vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''angToRight'''(vector angles); ====<br />
<br />
:Returns a right vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''angToUp'''(vector angles); ====<br />
<br />
:Returns an up vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''animDistance'''(float channel, string animName); ====<br />
<br />
:Returns the distance that the anim travels. If the entity has multiple anims with animName, the distance may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animDistance.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''animLength'''(float channel, string animName); ====<br />
<br />
:Returns the length of the anim in seconds. If the entity has multiple anims with animName, length may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animLength.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''animState'''(float channel, string stateFunction, float blendFrame); ====<br />
<br />
:Sets a new animation state script function for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''animTurn'''(float angle); ====<br />
<br />
:Enable/disable animation controlled turning.<br />
::''angle'': Pass in the maximum # of degrees the animation turns. Use an amount of 0 to disable.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''applyImpulse'''(entity source, float bodyid, vector point, vector impulse); ====<br />
<br />
:Applies an impulse to the entity. Example: entity.applyImpulse($player1, 0, entity.getOrigin(), '0 0 2');<br />
::''source'': Pass $null_entity or the entity that applies the impulse<br />
::''bodyid'': For articulated figures, ID of the body, 0 for the first (main) body. Otherwise use 0.<br />
::''point'': Point on the body where the impulse is applied to<br />
::''impulse'': Vector of the impulse<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''asin'''(float sine); ====<br />
<br />
:Returns the angle in degrees with the given sine.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''assert'''(float condition); ====<br />
<br />
:Breaks if the condition is zero. (Only works in debug builds.)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''attach'''(entity ent, string attName); ====<br />
<br />
:Attach an entity to the AI. Entity spawnArgs checked for attachments are: - "origin", "angles", and "joint". These must be set prior to calling attach.<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''attachToPos'''(entity ent, string position, string attName); ====<br />
<br />
:Attach an entity to the AI, using a named attachment position<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''attack'''(entity enemy, float ignoreCollisions); ====<br />
<br />
:Direct the turret to manually attack the specified entity. Use disableManualAttack() to disable.<br />
::''enemy'': enemy to attack<br />
::''ignoreCollisions'': whether to ignore obstacles in the way to the enemy when planning to attack<br />
<br />
:Spawnclasses responding to this event: ''idTurret''<br />
==== scriptEvent void '''attackBegin'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''attackEnd'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''attackMelee'''(string damageDef); ====<br />
<br />
:Returns true if the attack hit<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''attackMissile'''(string jointName); ====<br />
<br />
:returns projectile fired<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''attackPosition'''(vector targetPos, float ignoreCollisions); ====<br />
<br />
:Direct the turret to manually attack a position. Use disableManualAttack() to disable.<br />
::''targetPos'': position to attack<br />
::''ignoreCollisions'': whether to ignore obstacles in the way to the target position when planning to attack. Recommended true for this event.<br />
<br />
:Spawnclasses responding to this event: ''idTurret''<br />
==== scriptEvent void '''bark'''(string sound); ====<br />
<br />
:Let the AI bark a certain sound.<br />
::''sound'': sound name, e.g. 'snd_warn_response'<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idMoveable''<br />
==== scriptEvent float '''becomeRagdoll'''(); ====<br />
<br />
:enables the ragdoll if the entity has one<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''becomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''bind'''(entity master); ====<br />
<br />
:Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindPosition'''(entity master); ====<br />
<br />
:Fixes this entity's position (but not orientation) relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindToBody'''(entity master, float bodyID, float orientated); ====<br />
<br />
:Bind to AF body<br />
::''master'': entity to bind to<br />
::''bodyID'': AF body ID to bind to<br />
::''orientated'': binds the orientation as well as position, if set to 1<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindToJoint'''(entity master, string boneName, float rotateWithMaster); ====<br />
<br />
:Fixes this entity's position and orientation relative to a bone on another entity, such that when the master's bone moves, so does this entity.<br />
::''master'': the entity to bind to<br />
::''boneName'': the bone name<br />
::''rotateWithMaster'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bob'''(float speed, float phase, vector distance); ====<br />
<br />
:Initiates a translation back and forth along the given vector with the given speed and phase.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''burn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''callFunction'''(string functionName); ====<br />
<br />
:Calls a function on an entity's script object. See also callGlobalFunction().<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''callFunctionsByWildcard'''(string functionName); ====<br />
<br />
:Calls global functions with names matching the specified wildcard in separate threads (in lexicographical order). INTERNAL: don't use in mission scripting!<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''callGlobalFunction'''(string functionName, entity other); ====<br />
<br />
:calls a global function and passes the other entity along as the first argument calls the function in a new thread, so it continues executing in the current thread right away (unlike entity.callFunction( "blah"))<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''callGui'''(float handle, string namedEvent); ====<br />
<br />
:Calls a named event in a GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canBecomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canBeUsedBy'''(entity ent); ====<br />
<br />
:Returns true if the entity can be used by the argument entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canHitEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canHitEnemyFromAnim'''(string anim); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canHitEnemyFromJoint'''(string jointname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canPlant'''(vector traceStart, vector traceEnd, entity ignore, entity vine); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''canReachEnemy'''(); ====<br />
<br />
:Returns true if character can walk to enemy's position. For walking monsters, enemy should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canReachEntity'''(entity ent); ====<br />
<br />
:Returns true if character can walk to entity's position. For walking monsters, entity should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canReachPosition'''(vector pos); ====<br />
<br />
:Returns true if character can walk to specified position. For walking monsters, position should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idSecurityCamera''<br />
==== scriptEvent float '''canSeeEntity'''(entity target, float useLighting); ====<br />
<br />
:This is a general version of idAI::canSee, that can be used by all entities. It doesn't regard FOV, it just performs a trace to check whether the target is occluded by world geometry. Is probably useful for stim/response as well Pass useLighting = true to take the lighting of the target entity into account. Use "isEntityHidden" as a script event with a threshold. The constant threshold value for useLighting is defined within the SDK in game/entity.h.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canSeeExt'''(entity ent, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSee that can optionally choose to use field of vision and lighting calculations.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If b_useLighting is 0 the entity will be visible in complete darkness. If it is 1, the entity will only be visible if there is light shining on it, but the slightest light is enought. Use "isEntityHidden" as a script event with a threshold instead.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canSeePositionExt'''(vector position, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSeeExt that tests a location rather than an entity. Note that any actor at the position may make it not seeable from a distance.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If 0 the entity will be visible in complete darkness<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canWater'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''ceil'''(float x); ====<br />
<br />
:Returns the smallest integer that is greater than or equal to the given value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''changeEntityRelation'''(entity ent, float relationChange); ====<br />
<br />
:This changes the current relation to an entity by adding the new amount.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvIcon'''(string name, string category, string icon); ====<br />
<br />
:Sets the inventory icon of the given item in the given category to <icon>.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvItemCount'''(string name, string category, float amount); ====<br />
<br />
:Decreases the inventory item stack count by amount. The item is addressed using the name and category of the item. These are usually defined on the inventory item entity ("inv_name", "inv_category") Amount can be both negative and positive.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvLightgemModifier'''(string name, string category, float amount); ====<br />
<br />
:Sets the lightgem modifier value of the given item. Valid arguments are between 0 and 32 (which is the maximum lightgem value).<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''changeLootAmount'''(float type, float amount); ====<br />
<br />
:Changes the loot amount of the given Type (e.g. GOODS) by <amount>. The mission statisic for loot found gets changed too. The new value of the changed type is returned (e.g. the new GOODS value if this has been changed). Note: The LOOT_TOTAL type can't be changed and 0 is returned.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY<br />
::''amount'': can be negative<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeWeaponName'''(string weaponName, string displayName); ====<br />
<br />
:Changes the display name of the given weapon item to something different. Pass an empty string to reset the display name to the definition as found in the weaponDef.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''changeWeaponProjectile'''(string weaponName, string projectileDefName); ====<br />
<br />
:Changes the projectile entityDef name of the given weapon (e.g. "broadhead") to the specified entityDef (e.g. "atdm:projectile_broadhead").<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''chargeAttack'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''checkAAS'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''checkAbsence'''(); ====<br />
<br />
:description missing<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''checkAnim'''(float channel, string animName); ====<br />
<br />
:Ensures that the animation exists and causes an error if it doesn't.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''chooseAnim'''(float channel, string animName); ====<br />
<br />
:Chooses a random anim and returns the name. Useful for doing move tests on anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''clearActiveInventoryMap'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearActiveInventoryMapEnt'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearAllJoints'''(); ====<br />
<br />
:Removes any custom transforms on all joints.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''clearBurn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearController'''(); ====<br />
<br />
:Need separate clearController because scripting doesn't like passing in $null_entity? (greebo: one could remove this function and set the argument type of setController to 'E'.<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent void '''clearEnemy'''(); ====<br />
<br />
:Clears the enemy entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearFlyOffset'''(); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at to the value set in the def file.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearJoint'''(float jointnum); ====<br />
<br />
:Removes any custom transforms on the specified joint.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''clearMouseDeadTime'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearPersistantArgs'''(); ====<br />
<br />
:Clears data that persists between maps.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''clearSignal'''(float signalNum); ====<br />
<br />
:Disables the callback function on the specified signal.<br />
::''signalNum'': signal number<br />
<br />
:Spawnclasses responding to this event: <br />
==== scriptEvent void '''clearSignalThread'''(float signalNum, entity ent); ====<br />
<br />
:Clears the script callback function set for when the given signal is raised on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''clearWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''clipSize'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''Close'''(); ====<br />
<br />
:Closes the frobmover, regardless of its previous state. Mover must be open, otherwise nothing happens.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover'', ''idMover_Binary''<br />
==== scriptEvent entity '''closestEnemyToPoint'''(vector point); ====<br />
<br />
:Returns the enemy closest to the given location.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''closestReachableEnemy'''(); ====<br />
<br />
:Used for determining tactile alert targets<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''closestReachableEnemyOfEntity'''(entity team_mate); ====<br />
<br />
:Finds another character's closest reachable enemy<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''copyBind'''(entity other); ====<br />
<br />
:copy bind information of other to this entity (i.e., bind this entity to the same entity that other is bound to)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''copySpawnArgs'''(entity ent); ====<br />
<br />
:copies the spawn args from an entity<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''cos'''(float degrees); ====<br />
<br />
:Returns the cosine of the given angle in degrees.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''createMissile'''(string jointname); ====<br />
<br />
:returns projectile created<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''createMissileFromDef'''(string defName, string jointName); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''createOverlay'''(string guiFile, float layer); ====<br />
<br />
:Creates a GUI overlay. (must be used on the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''createProjectile'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''CreateTimer'''(float stimId, float hour, float minutes, float seconds, float milliseconds); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''CrossProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the cross product of the two vectors.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''cullAll'''(); ====<br />
<br />
:Cull (remove from world) all entities.<br />
<br />
:Spawnclasses responding to this event: ''Seed''<br />
==== scriptEvent void '''customDeath'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''damage'''(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale); ====<br />
<br />
:Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).<br />
::''inflictor'': the entity causing the damage (maybe a projectile)<br />
::''attacker'': the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)<br />
::''dir'': the direction the attack is coming from.<br />
::''damageDefName'': the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")<br />
::''damageScale'': the scale of the damage (pass 1.0 as default, this should be ok).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''dampenSound'''(float dampen); ====<br />
<br />
:Toggle whether the shattering sound is dampened on the window, e.g., when covered by moss.<br />
::''dampen'': 1 = dampened, 0 = not dampened<br />
<br />
:Spawnclasses responding to this event: ''idBrittleFracture''<br />
==== scriptEvent void '''deathMenu'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''debugArrow'''(vector color, vector start, vector end, float size, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugBounds'''(vector color, vector mins, vector maxs, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugCircle'''(vector color, vector origin, vector dir, float radius, float numSteps, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugLine'''(vector color, vector start, vector end, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''decelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover decelerates.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''decelTime'''(float time); ====<br />
<br />
:Sets the deceleration time. Set this deceleration time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''decelTo'''(float speed, float time); ====<br />
<br />
:Initiates a deceleration to the given speed over the given time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''destroyOverlay'''(float handle); ====<br />
<br />
:Destroys a GUI overlay. (must be used on the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''directDamage'''(entity damageTarget, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
:Spawnclasses responding to this event: ''Seed'', ''idMover_Binary'', ''idTrigger''<br />
==== scriptEvent void '''disableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disableAnimchannel'''(float channel); ====<br />
<br />
:Used to disable a certain animchannel (for example if the ai is dead)<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableClip'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disableEyeFocus'''(); ====<br />
<br />
:Disables eye focus.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableGravity'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''DisableLegIK'''(float num); ====<br />
<br />
:disables leg IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableManualAttack'''(); ====<br />
<br />
:Stop attacking the manually specified enemy or position and return to automatic target acquisition mode.<br />
<br />
:Spawnclasses responding to this event: ''idTurret''<br />
==== scriptEvent void '''disablePain'''(); ====<br />
<br />
:Disables pain animations.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableSplineAngles'''(); ====<br />
<br />
:Disables aligning the mover with the spline direction.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''DisableWalkIK'''(); ====<br />
<br />
:disables walk IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableWeapon'''(); ====<br />
<br />
:Lowers and disables the player weapon.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''distanceTo'''(entity other); ====<br />
<br />
:Returns the distance of this entity to another entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''distanceToPoint'''(vector point); ====<br />
<br />
:Returns the distance of this entity to a point.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''DotProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the dot product of the two vectors.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''drawText'''(string text, vector origin, float scale, vector color, float align, float lifetime); ====<br />
<br />
:text drawing for debugging. lifetime of 0 == 1 frame.<br />
::''align'': 0 = left, 1 = center, 2 = right<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''dropAttachment'''(string attName); ====<br />
<br />
:Drop the attachment for the given attachment name.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''dropAttachmentInd'''(float index); ====<br />
<br />
:Drop the attachment for the given index.<br />
::''index'': starts at 0<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''dropTorch'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''ejectBrass'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''emitParticle'''(string particle, float startTime, float diversity, vector origin, vector angle); ====<br />
<br />
:Start a particle effect in the world without using an entity emitter. Will emit one quad per particle stage when first called with sys.getTime() as the start time. Designed to be called once per frame with the same startTime each call to achieve a normal particle effect, or on demand with sys.getTime() as the startTime for finer grained control, 1 quad at a time. Returns True (1) if there are more particles to be emitted from the stage, False (0) if the stage has released all its quads.<br />
::''particle'': String: name of particle effect.<br />
::''startTime'': Game seconds since map start: use sys.getTime() for the first call unless you want to back-date the particle so that it starts part way through its cycle.<br />
::''diversity'': Randomizer value between 0 and 1. All particles with the same diversity will have the same path and rotation. Use sys.random(1) for a random path.<br />
::''origin'': Origin of the particle effect.<br />
::''angle'': Axis for the particle effect. Use $<entityname>.getAngles() to align the particle to an entity. use '0 0 0' for an upright (world-aligned) particle effect.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''emitterAddModel'''(string modelName, vector modelOffset); ====<br />
<br />
:Adds a new particle (or regular, if you wish) model to the emitter, located at modelOffset units away from the emitter's origin.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter''<br />
==== scriptEvent float '''emitterGetNumModels'''(); ====<br />
<br />
:Returns the number of models/particles this emitter has. Always >= 1.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter''<br />
==== scriptEvent void '''emptyHand'''(string hand); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
:Spawnclasses responding to this event: ''Seed'', ''idMover_Binary'', ''idTrigger''<br />
==== scriptEvent void '''enableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enableAnim'''(float channel, float blendFrames); ====<br />
<br />
:Enables animation on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableClip'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enableDamage'''(float enable); ====<br />
<br />
:enable/disable damage<br />
<br />
:Spawnclasses responding to this event: ''idMoveable''<br />
==== scriptEvent void '''enableEyeFocus'''(); ====<br />
<br />
:Enables eye focus.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableGravity'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''EnableLegIK'''(float num); ====<br />
<br />
:enables leg IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enablePain'''(); ====<br />
<br />
:Enables pain animations.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableSplineAngles'''(); ====<br />
<br />
:Enables aligning the mover with the spline direction.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''EnableWalkIK'''(); ====<br />
<br />
:enables walk IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableWeapon'''(); ====<br />
<br />
:Enables the player weapon.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''endState'''(); ====<br />
<br />
:Ends the current state with the given name, returns TRUE if more than one state is remaining.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''endZoom'''(float duration); ====<br />
<br />
:Starts the zoom out event, which performs a gradual transition back to the default FOV. May be called during a transition as well to intercept a pending zoom in transition.<br />
::''duration'': duration of the transition in msec<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''enemyInCombatCone'''(entity combatNode, float use_current_enemy_location); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyPositionValid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyRange'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyRange2D'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''entityInAttackCone'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''error'''(string text); ====<br />
<br />
:Issues an error.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''exitTeleporter'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''extinguishLights'''(); ====<br />
<br />
:Extinguishes all lights (i.e. the <self> entity plus all bound lights)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''faceEnemy'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''faceEntity'''(entity ent); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''facingIdeal'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''fadeIn'''(vector color, float time); ====<br />
<br />
:Fades towards the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeInLight'''(float time); ====<br />
<br />
:Turns the light on over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''fadeOut'''(vector color, float time); ====<br />
<br />
:Fades from the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeOutLight'''(float time); ====<br />
<br />
:Turns the light out over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''fadeSound'''(float channel, float newLevel, float fadeTime); ====<br />
<br />
:Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''fadeTo'''(vector color, float alpha, float time); ====<br />
<br />
:Fades to the given color up to the given alpha over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeToLight'''(vector color, float time); ====<br />
<br />
:Fades the light to the given color over a given time.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''findActorsInBounds'''(vector mins, vector maxs); ====<br />
<br />
:Returns an entity within the bounds specified<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemy'''(float onlyInFov); ====<br />
<br />
:Finds enemy player in PVS<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemyAI'''(float onlyInFov); ====<br />
<br />
:Finds enemy monster in PVS<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemyInCombatNodes'''(); ====<br />
<br />
:Finds enemy player in attack cones<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findFriendlyAI'''(float team); ====<br />
<br />
:Use this to find a visible AI friendly to ourselves. It basically iterates over all active entities in the map and looks for friendly actors. The pythagorean distance is taken to evaluate the distance. Don't call this every frame, this might get expensive in larger maps. Returns the nearest visible actor entity or the $null_entity, if none was found.<br />
::''team'': used to constrain the search to a given team. Set this to -1 to let the code ignore this argument<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''finishAction'''(string action); ====<br />
<br />
:Finishes the given wait action.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''finishChannelAction'''(float channel, string animname); ====<br />
<br />
:Overloaded finishAction function for setting the waitstate on each channel separately<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''fireMissileAtTarget'''(string jointname, string targetname); ====<br />
<br />
:Launches a missile at entity specified by 'attack_target'. returns projectile fired<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''firstPerson'''(); ====<br />
<br />
:Returns view control to the player entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''flashlight'''(float enable); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''flee'''(entity entToFleeFrom); ====<br />
<br />
:Flee from the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''fleeFromPoint'''(vector pos); ====<br />
<br />
:Flee from the given position.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''floor'''(float x); ====<br />
<br />
:Returns the largest integer that is less than or equal to the given value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated''<br />
==== scriptEvent void '''foundBody'''(entity body); ====<br />
<br />
:Objective callback for when an AI finds a body.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''frob'''(); ====<br />
<br />
:Frobs the entity (i.e. simulates a frob action performed by the player). Returns TRUE if the entity is frobable, FALSE otherwise.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''frobHilight'''(float state); ====<br />
<br />
:ishtvan: Tries to make the entity frobhilight or not<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''frobRidable'''(entity playerController); ====<br />
<br />
:Called when a player directly mounts or dismounts a ridable AI.<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent void '''Gas_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': the entity causing the knockout, can be the $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getActualStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getAcuity'''(string type); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getAlertActor'''(); ====<br />
<br />
:Get the actor that alerted the AI in this frame.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getAlertLevelOfOtherAI'''(entity otherEntity); ====<br />
<br />
:This event gets the alert number of another AI (AI_AlertLevel variable value) Returns the alert number of the other AI, 0.0 if its not an AI or is NULL<br />
::''otherEntity'': the other AI entity who's alert number is being queried<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getAngles'''(); ====<br />
<br />
:Returns the current orientation of this entity (relative to bind parent if any).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getAngularVelocity'''(); ====<br />
<br />
:Gets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getAngularVelocityB'''(float id); ====<br />
<br />
:Get the angular velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent string '''getAnimList'''(float channel); ====<br />
<br />
:Returns a list of all animations and their anim rates.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getAnimRate'''(float channel, string animName); ====<br />
<br />
:Returns the rate for the given animation. Returns -1 if animation cannot be found.<br />
::''animName'': The name of the animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''getAnimState'''(float channel); ====<br />
<br />
:Returns the name of the current animation state script function used for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttachment'''(string attName); ====<br />
<br />
:Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttachmentInd'''(float index); ====<br />
<br />
:Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists<br />
::''index'': starts at 0<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttacker'''(); ====<br />
<br />
:Returns the attacking entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getAttackFlag'''(float combatType); ====<br />
<br />
:Returns 1 if the given attack flag is activated.<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getAudThresh'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getAxialDir'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent entity '''getBindChild'''(float ind); ====<br />
<br />
:Returns the ind_th bind child of this entity or NULL if index is invalid. NOTE: indices start at zero<br />
::''ind'': child index<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getBindMaster'''(); ====<br />
<br />
:Returns the entity's bindmaster<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''getBoolKey'''(string key); ====<br />
<br />
:Retrieves the boolean value of a specific spawn arg, defaulting to false.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getButtons'''(); ====<br />
<br />
:Returns the button state from the current user command.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getCalibratedLightgemValue'''(); ====<br />
<br />
:Returns the calibrated light gem value.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getClipMask'''(); ====<br />
<br />
:Returns the clipmask of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getClosestHiddenTarget'''(string entity_type); ====<br />
<br />
:Finds the closest targeted entity of the specified type.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getColor'''(); ====<br />
<br />
:Gets the color of this entity (shader parms Parm0, Parm1, Parm2).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getCombatNode'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getContents'''(); ====<br />
<br />
:Returns the contents of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvCategory'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory category.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvIcon'''(); ====<br />
<br />
:Returns the icon of the currently highlighted inventory item.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getCurInvItemCount'''(); ====<br />
<br />
:Returns the item count of the currently highlighted inventory Item, if stackable.Returns - 1 if non - stackable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getCurInvItemEntity'''(); ====<br />
<br />
:Returns the currently highlighted inventory item entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvItemId'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_item_id"). Most items will return an empty string, unless the "inv_item_id" is set on purpose.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvItemName'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_name").<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getCurrentMissionNum'''(); ====<br />
<br />
:Returns the number of the current mission (0-based, the first mission has number 0).<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getCurrentWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player is currently holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getCurrentYaw'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getCurWeaponName'''(); ====<br />
<br />
:Returns the name of the current weapon, as defined by "inv_weapon_name" in the weaponDef.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getcvar'''(string name); ====<br />
<br />
:Returns the string for a cvar.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getDifficultyLevel'''(); ====<br />
<br />
:Returns 0 (Easy), 1 (Medium) or 2 (Hard), depending on the difficulty level of the current mission.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getDifficultyName'''(float difficultyLevel); ====<br />
<br />
:Returns the (translated) name of the difficulty level passed as the argument.<br />
::''difficultyLevel'': 0 (Easy), 1 (Medium), 2 (Hard)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''GetDoor'''(); ====<br />
<br />
:Returns the associated door entity for this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoorHandle''<br />
==== scriptEvent entity '''GetDoorhandle'''(); ====<br />
<br />
:Returns the handle entity of this door. Can return NULL (== $null_entity)<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoor''<br />
==== scriptEvent entity '''getDragged'''(); ====<br />
<br />
:Returns the currently dragged body. Returns $null_entity if the body is shouldered, the player has nothing in his hands, or he has a non-AF entity in his hands. See also getShouldered(), getGrabbed() and getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idSecurityCamera''<br />
==== scriptEvent vector '''getEnemyEyePos'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getEnemyPos'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getEntity'''(string name); ====<br />
<br />
:Returns a reference to the entity with the specified name.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getEntityFlag'''(string flagName); ====<br />
<br />
:Returns the value of the specified entity flag.<br />
::''flagName'': Can be one of (case insensitive): notarget: if true never attack or target this entity noknockback: if true no knockback from hits takedamage: if true this entity can be damaged hidden: if true this entity is not visible bindOrientated: if true both the master orientation is used for binding solidForTeam: if true this entity is considered solid when a physics team mate pushes entities forcePhysicsUpdate: if true always update from the physics whether the object moved or not selected: if true the entity is selected for editing neverDormant: if true the entity never goes dormant isDormant: if true the entity is dormant hasAwakened: before a monster has been awakened the first time, use full PVS for dormant instead of area-connected invisible: if true this entity cannot be seen inaudible: if true this entity cannot be heard <br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getEntityKey'''(string key); ====<br />
<br />
:Retrieves the entity specified by the spawn arg.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getEyePos'''(); ====<br />
<br />
:Get eye position of the player and the AI<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent vector '''getFinalAngVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getFinalVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getFloatKey'''(string key); ====<br />
<br />
:Retrieves the floating point value of a specific spawn arg, defaulting to 0.0f.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getFov'''(); ====<br />
<br />
:This returns the current FOV of the player. You can modify the current FOV with startZoom() and endZoom().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''GetFractionalPosition'''(); ====<br />
<br />
:Returns a fraction between 0.00 (closed) and 1.00 (open).<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''getFrameTime'''(); ====<br />
<br />
:returns the length of time between game frames. this is not related to renderer frame rate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getFrobbed'''(); ====<br />
<br />
:Returns the currently frobhilighted entity. This includes entities the player has in his hands. Sets "frob only used by" mode<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getGrabbed'''(); ====<br />
<br />
:Returns the currently entity in the players hands. Returns $null_entity if the player has nothing in his hands Dragging or shouldering a body counts as grabbing it. See also getDragged(), getShouldered(), getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getGui'''(float handle); ====<br />
<br />
:Returns the file currently loaded by a GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getGuiFloat'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getGuiInt'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getGuiString'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getHead'''(); ====<br />
<br />
:Returns the entity used for the character's head, if it has one.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getHealth'''(); ====<br />
<br />
:Returns the current health.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getHinderance'''(string source); ====<br />
<br />
:Used to get hinderance from a source.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getIdealWeapon'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: <br />
==== scriptEvent float '''getImmobilization'''(string source); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getIncidenceAngle'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getInterceptTime'''(vector velocityTarget, float speedInterceptor, vector positionTarget, vector positionInterceptor); ====<br />
<br />
:Returns how much time it will take for an interceptor like a projectile to intercept a moving target at the earliest possible opportunity. Returns 0 if an intercept is not possible or the speed of the target and interceptor are too similar.<br />
::''velocityTarget'': current velocity of target<br />
::''speedInterceptor'': speed of interceptor<br />
::''positionTarget'': current position of target<br />
::''positionInterceptor'': starting position of interceptor<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getIntKey'''(string key); ====<br />
<br />
:Retrieves the integer value of a specific spawn arg, defaulting to 0.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getInventoryOverlay'''(); ====<br />
<br />
:Gets the default inventory overlay for the player. All other entities will return an invalid value.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getJointAngle'''(float jointnum); ====<br />
<br />
:Returns the angular orientation of the joint in world space.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent float '''getJointHandle'''(string jointname); ====<br />
<br />
:Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent vector '''getJointPos'''(float jointnum); ====<br />
<br />
:Returns the position of the joint in world space.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent vector '''getJumpVelocity'''(vector pos, float speed, float max_jump_height); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getKey'''(string key); ====<br />
<br />
:Retrieves the value of a specific spawn arg, defaulting to ''.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getLightInPVS'''(float falloff, float scaling); ====<br />
<br />
:Computes the sum of all light in the PVS of the entity you call this on, and returns a vector with the sum.<br />
::''falloff'': 0: no falloff with distance 0.5: sqrt(linear) falloff (dist 100 => 1/10) 1: linear falloff (dist 100 => 1/100) 2: square falloff (dist 100 => 1/10000) <br />
::''scaling'': factor to scale the distance, can be used to lower/raise distance factor after the linear or square scaling has been used good looking values are approx: sqrt(linear): 0.01, linear: 0.1, square 1.0<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getLightLevel'''(); ====<br />
<br />
:Get level (intensity) of a light, <= 0.0 indicates it is off<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent vector '''getLightOrigin'''(); ====<br />
<br />
:Get the light origin (independent of its visual model)<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent vector '''getLinearVelocity'''(); ====<br />
<br />
:Gets the current linear velocity of this entity. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getLinearVelocityB'''(float id); ====<br />
<br />
:Get the linear velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent vector '''getListenLoc'''(); ====<br />
<br />
:Retrieves the location of the listener when leaning.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getLocation'''(); ====<br />
<br />
:Returns the idLocation entity corresponding to the entity's current location. This was player-specific before, but is now available to all entities.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getLocationPoint'''(vector point); ====<br />
<br />
:Returns the idLocation entity corresponding to the specified point's location.<br />
::''point'': point whose location to check<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''GetLock'''(); ====<br />
<br />
:Returns the associated lock of this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobLockHandle''<br />
==== scriptEvent float '''getLootAmount'''(float type); ====<br />
<br />
:Returns the amount of loot for the given type (e.g. LOOT_GOODS). Pass LOOT_TOTAL to return the sum of all loot types.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY, LOOT_TOTAL<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getMainAmbientLight'''(); ====<br />
<br />
:Returns the entity of the main ambient light.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getMass'''(float body); ====<br />
<br />
:Gets mass of a body for an entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getMaxs'''(); ====<br />
<br />
:Gets the maximum corner of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getMeleeActPhase'''(); ====<br />
<br />
:Returns the current melee action phase (holding,recovering,etc).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeActState'''(); ====<br />
<br />
:Returns the current melee action state (attacking/defending).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeActType'''(); ====<br />
<br />
:Returns the current melee action type (overhead,thrust,etc.).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeLastActTime'''(); ====<br />
<br />
:Returns the melee type of the last attack to hit this actor. Defaults to MELEETYPE_UNBLOCKABLE if we were not hit before.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeLastHitByType'''(); ====<br />
<br />
:Returns the game time that the most recent melee action ended (in ms)<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeResult'''(); ====<br />
<br />
:Get the result of the last melee action Follows MELEERESULT_* enum defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent vector '''getMins'''(); ====<br />
<br />
:Gets the minimum corner of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getMissionStatistic'''(string statisticName); ====<br />
<br />
:Returns current mission statistic.<br />
::''statisticName'': Can be one of (case insensitive): gamePlayTime: gameplay time in seconds damageDealt: damage dealt to enemies damageReceived: damage received by player healthReceived: health received by player pocketsPicked: pockets picked by player foundLoot: loot found by player missionLoot: total loot available in mission totalTimePlayerSeen: total time the player was seen by enemies in seconds. Updates only when AI lose sight of player numberTimesPlayerSeen: number of times player was seen by enemies numberTimesAISuspicious: number of times AI was 'observant' or 'suspicious'. A single AI passing through both alert levels will add 2 to the score. numberTimesAISearched: number of times AI was 'investigating' or 'searching'. A single AI passing through both alert levels will add 2 to the score. sightingScore: sighting score (number of times player was seen * weight) stealthScore: stealth score (sighting score + alerts * weights) killedByPlayer: number of enemies killed by player knockedOutByPlayer: number of enemies knocked out by player bodiesFound: number of times enemies have spotted a body secretsFound: number of secrets found by the player secretsTotal: total number of secrets in the mission <br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getMouseGesture'''(); ====<br />
<br />
:Returns the results of the last mouse gesture in enum form. (see the definition for MOUSEDIR_* for which numbers correspond to which directions)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getMove'''(); ====<br />
<br />
:Returns the movement relative to the player's view angles from the current user command. vector_x = forward, vector_y = right, vector_z = up<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getMoveAnim'''(); ====<br />
<br />
:Returns the name of the player-requested movement anim for a player controlled AI vehicle<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent float '''getMoveSpeed'''(); ====<br />
<br />
:Get the movement speed.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''getMoveTime'''(); ====<br />
<br />
:Gets the movement time.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''getMoveType'''(); ====<br />
<br />
:Returns the current movetype<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getName'''(); ====<br />
<br />
:Returns the name of this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getNextEnemy'''(entity lastMatch); ====<br />
<br />
:Returns the next enemy that the security camera can see.<br />
::''lastMatch'': search will start after this entity.Use $null_entity or pass an uninitialized entity variable to start a new search.The first result in a new search will be the player, if the camera can see him.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent entity '''getNextEntity'''(string key, string value, entity lastMatch); ====<br />
<br />
:Discover all entities in the map. Returns $null_entity when no more found.<br />
::''key'': Optional string: prefix for spawnarg key match. E.g. "target" will match "target", "target1" etc.<br />
::''value'': Optional string: spawnarg value to match. Can be used independently of ''key''. If ''key'' is not set, all spawnargs will be checked for the value.<br />
::''lastMatch'': Last match: search will start after this entity. Use $null_entity or pass an uninitialized entity variable to start a new search.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getNextHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get the next hinderance from a source.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getNextIdleAnim'''(); ====<br />
<br />
:This returns the name of the next idle anim to be played on this AI (used by AnimState scripts).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getNextImmobilization'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getNextInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the next inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getNextKey'''(string prefix, string lastMatch); ====<br />
<br />
:Searches for the name of a spawn arg that matches the prefix. For example, passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy", etc. The returned string is the name of the key which can then be passed into functions like getKey() to lookup the value of that spawn arg. This is useful for when you have multiple values to look up, like when you target multiple objects. To find the next matching key, pass in the previous result and the next key returned will be the first one that matches after the previous result. Pass in "" to get the first match. Passing in a non-existent key is the same as passing in "". Returns "" when no more keys match.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getNextTurnHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Get the next hinderance on the view turning from a source<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getNumAttachments'''(); ====<br />
<br />
:Return the number of attachments on an AI. Used to iterate through the attachments if desired.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getNumBodies'''(); ====<br />
<br />
:Returns the number of bodies in the AF. If the AF physics pointer is NULL, it returns 0.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent float '''getNumMeleeWeapons'''(); ====<br />
<br />
:Returns the number of melee weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_melee' set to '1'.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getNumRangedWeapons'''(); ====<br />
<br />
:Returns the number of ranged weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_ranged' set to '1'.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getObjectiveComp'''(float ObjNum, float CompNum); ====<br />
<br />
:Used to get the state of custom objective components<br />
::''ObjNum'': Starts counting at 1<br />
::''CompNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getObjectiveState'''(float ObjNum); ====<br />
<br />
:Returns the current state of the objective with the number ObjNum. State is one of the following: OBJ_INCOMPLETE = 0, OBJ_COMPLETE = 1, OBJ_INVALID = 2, OBJ_FAILED = 3<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getObjectiveVisible'''(float ObjNum); ====<br />
<br />
:Returns the current visibility of the objective with the number ObjNum.<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getObservationPosition'''(vector targetPoint, float visualAcuityZeroToOne); ====<br />
<br />
:This event is used to get a position that the AI can move to observe a given position. It is useful for looking at hiding spots that can't be reached, and performing other investigation functions. Returns a world position from which the observation can take place. Returns the current AI origin if no such point is found. @sideEffect This uses the AI_DEST_UNREACHABLE flag variable to indicate if a point was found. It will be true if none was found, false if one was found.<br />
::''targetPoint'': the world position to be observed<br />
::''visualAcuityZeroToOne'': the visual acuity of the AI on a scale of 0.0 to 1.0 where 0.0 is blind and 1.0 is perfect vision.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getObstacle'''(); ====<br />
<br />
:Gets the obstacle in the character's path<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getOrigin'''(); ====<br />
<br />
:Returns the current position of this entity (relative to bind parent if any).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getOwner'''(); ====<br />
<br />
:Returns the owning entity<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent string '''getPainAnim'''(); ====<br />
<br />
:Returns the name of the pain animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getPersistantFloat'''(string key); ====<br />
<br />
:Returns the floating point value for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getPersistantString'''(string key); ====<br />
<br />
:Returns the string for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getPersistantVector'''(string key); ====<br />
<br />
:Returns the vector for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortAISoundLoss'''(float handle); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortalHandle'''(); ====<br />
<br />
:Returns the portal handle.<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent float '''getPortPlayerSoundLoss'''(float handle); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortSoundLoss'''(float handle); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getPrevInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the previous inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getPreviousWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player was previously holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getPrime'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''getProjectileState'''(); ====<br />
<br />
:Gets the current state of the projectile. States are defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idProjectile''<br />
==== scriptEvent float '''getProjMass'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getRadius'''(); ====<br />
<br />
:Returns the light radius.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''getRandomTarget'''(string entity_type); ====<br />
<br />
:Finds a random targeted entity of the specified type.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getReachableEntityPosition'''(entity ent); ====<br />
<br />
:Returns the position of the entity within the AAS if possible, otherwise just the entity position.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getRelation'''(float team1, float team2); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getRelationEnt'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''GetResponseEntity'''(); ====<br />
<br />
:Returns the entity which should take the response. Some entities like AI heads are not responding themselves to stims, but relay it to another entity (i.e. the bodies they're attached to).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getSecurityCameraState'''(); ====<br />
<br />
:Returns the security camera's state. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = inactive, 5 = destroyed.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent string '''getShader'''(); ====<br />
<br />
:Gets the shader name used by the light.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent float '''getShaderParm'''(float parm); ====<br />
<br />
:Gets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getShouldered'''(); ====<br />
<br />
:Returns the currently shouldered body, otherwise $null_entity. See also getDragged(), getGrabbed() and getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getSize'''(); ====<br />
<br />
:Gets the size of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getSndDir'''(); ====<br />
<br />
:ai hearing of sound <br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getSoundLoss'''(); ====<br />
<br />
:Returns the sound loss value (dB).<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent float '''getSoundVolume'''(string soundName); ====<br />
<br />
:Get the volume of the sound to play.<br />
::''soundName'': the name of the sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getSpotLight'''(); ====<br />
<br />
:Returns the spotlight used by the camera. Returns null_entity if none is used.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent string '''getState'''(); ====<br />
<br />
:Gets the current state.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getSurfNormal'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent string '''getSurfType'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent entity '''getTactEnt'''(); ====<br />
<br />
:ai sense of touch<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getTalkTarget'''(); ====<br />
<br />
:Returns the entity (player) trying to talk to the character<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getTarget'''(float num); ====<br />
<br />
:Returns the requested target entity.<br />
::''num'': The target number. Starts at 0.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getTDMVersion'''(); ====<br />
<br />
:Get the current TDM version as integer. The value will be 108 for v1.08, 109 for v1.09 and 200 for v2.00 etc.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTeam'''(); ====<br />
<br />
:Returns the current team number.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getTicsPerSecond'''(); ====<br />
<br />
:returns the number of game frames per second. this is not related to renderer frame rate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTime'''(); ====<br />
<br />
:Returns the current game time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceBody'''(); ====<br />
<br />
:Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getTraceEndPos'''(); ====<br />
<br />
:Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getTraceEntity'''(); ====<br />
<br />
:Returns a reference to the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTraceFraction'''(); ====<br />
<br />
:Returns the fraction of movement completed during the last call to trace or tracePoint.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceJoint'''(); ====<br />
<br />
:Returns the number of the skeletal joint closest to the location on the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getTraceNormal'''(); ====<br />
<br />
:Returns the normal of the hit plane during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceSurfType'''(); ====<br />
<br />
:Returns the type of the surface (i.e. metal, snow) which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTurnDelta'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getTurnHinderance'''(string source); ====<br />
<br />
:* Get the hinderance on the view turning from a source<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getTurnRate'''(); ====<br />
<br />
:Gets the rate the character turns.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getTurretState'''(); ====<br />
<br />
:Returns the turret's state. 0 = passive: no active security cameras connected. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = power off, 5 = destroyed.<br />
<br />
:Spawnclasses responding to this event: ''idTurret''<br />
==== scriptEvent vector '''getVectorKey'''(string key); ====<br />
<br />
:Retrieves the vector value of a specific spawn arg, defaulting to '0 0 0'.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVectorToIdealOrigin'''(); ====<br />
<br />
:Returns the vector from where the AI is to where he ideally should be<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getViewAngles'''(); ====<br />
<br />
:Returns the player view angles.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getVinePlantLoc'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVinePlantNormal'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVisDir'''(); ====<br />
<br />
:Returns position of the last visual alert.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getWeaponEntity'''(); ====<br />
<br />
:Returns the entity for the player's weapon<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getWorldModel'''(); ====<br />
<br />
:Returns the entity that controls the world model<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent vector '''getWorldOrigin'''(); ====<br />
<br />
:Returns the current world-space position of this entity (regardless of any bind parent).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Gibbable'', ''idMoveableItem''<br />
==== scriptEvent void '''giveHealthPool'''(float amount); ====<br />
<br />
:This increases/decreases the healthpool of the player by the given amount. The healthpool is gradually decreased over time, healing (damaging?) the player.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''handleMissionEvent'''(entity objEnt, float eventType, string argument); ====<br />
<br />
:Generic interface for passing on mission events from scripts to the SDK. Available since TDM 1.02<br />
::''objEnt'': the entity that triggered this event (e.g. a readable)<br />
::''eventType'': a numeric identifier (enumerated both in MissionData.h and tdm_defs.script) specifying the type of event<br />
::''argument'': an optional string parameter, eventtype-specific.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''hasAnim'''(float channel, string animName); ====<br />
<br />
:Returns true when an entity has a specific animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''hasEnemies'''(); ====<br />
<br />
:Returns true if the actor has one or more enemies.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''hasFunction'''(string functionName); ====<br />
<br />
:checks if an entity's script object has a specific function<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''hasInvItem'''(entity item); ====<br />
<br />
:Tests whether the player has the specified item entity in his inventory.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''hasSeenEvidence'''(); ====<br />
<br />
:This returns 1 when the AI has seen evidence of intruders before (an enemy, a body...)<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''heal'''(string healDefName, float healScale); ====<br />
<br />
:Heals the entity this is called on using the specified healing entityDef. Returns 1 if the entity could be healed, 0 otherwise (if the entity is already at full health, for ex.)<br />
::''healDefName'': the name of the entityDef containing the healing information (e.g. "heal_potion")<br />
::''healScale'': the scaling value to be applied to the healAmount found in the healEntityDef<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''heldEntity'''(); ====<br />
<br />
:Returns the entity currently being held, or $null_entity if the player's hands are empty.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''hide'''(); ====<br />
<br />
:Makes this entity invisible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''holdEntity'''(entity entity); ====<br />
<br />
:Forces the player to hold an entity (e.g. puts it into the grabber). Drops whatever is in the player's hands if $null_entity is passed to it. Returns 1 if successful, 0 if not.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''idleAnim'''(float channel, string animName); ====<br />
<br />
:Plays the given idle animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''ignoreDamage'''(); ====<br />
<br />
:The AI can no longer take damage.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''inAnimState'''(float channel, string stateFunc); ====<br />
<br />
:Returns true if the given animation state script function is currently used for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''influenceActive'''(); ====<br />
<br />
:Checks if an influence is active<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''inPVS'''(); ====<br />
<br />
:Returns non-zero if this entity is in PVS. For lights, it will return true when the light's bounding box is in PVS, even though the light may not actually be in PVS. (an unmoved shadowcasting light may not be visible to PVS areas its bounding box intersects with)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isAtRest'''(); ====<br />
<br />
:Returns true if object is not moving<br />
<br />
:Spawnclasses responding to this event: ''idMoveable''<br />
==== scriptEvent float '''isDroppable'''(); ====<br />
<br />
:Get whether an item may be dropped from the inventory<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isEnemy'''(entity ent); ====<br />
<br />
:Returns true if the given entity is an enemy.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isEntityHidden'''(entity ent, float f_sightThreshold); ====<br />
<br />
:This is an alternate version of canSee, using FOV, distance and lighting.<br />
::''f_sightThreshold'': goes from 0.0 (entity visible in complete darkness) to 1.0 (entity only visible if completely lit up).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''isFriend'''(entity ent); ====<br />
<br />
:Returns true if the given entity is a friend.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isFrobable'''(); ====<br />
<br />
:Get whether the entity is frobable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isHidden'''(); ====<br />
<br />
:checks if the entity's model is invisible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isHilighted'''(); ====<br />
<br />
:Returns true if entity is currently frobhilighted.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isInLiquid'''(); ====<br />
<br />
:Returns 1 if the entity is in or touching a liquid.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isInvisible'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''isLeaning'''(); ====<br />
<br />
:Get whether the player is leaning<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''isLight'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent float '''isMoving'''(); ====<br />
<br />
:Returns true if a mover is moving<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''isNeutral'''(entity ent); ====<br />
<br />
:Returns true if the given entity is neutral.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''IsOpen'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is open, which is basically the same as "not closed". A mover is considered closed when it is at its close position.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''isPeekLeaning'''(); ====<br />
<br />
:Get whether the player is peek leaning (against a keyhole or crack)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent float '''isPlayerResponsibleForDeath'''(); ====<br />
<br />
:Returns true if the player was responsible for the AI's caller's death.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''isRotating'''(); ====<br />
<br />
:Returns true if a mover is rotating<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''isType'''(string spawnclass); ====<br />
<br />
:Returns true if this entity is of the given type.<br />
::''spawnclass'': spawn class name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isVineFriendly'''(); ====<br />
<br />
:Vine-arrow event<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent void '''kickObstacles'''(entity kickEnt, float force); ====<br />
<br />
:Kicks any obstacle in the character's path.<br />
::''kickEnt'': pass in $null_entity if you don't have a specific entity to kick<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''kill'''(); ====<br />
<br />
:Kills the monster.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''killthread'''(string threadName); ====<br />
<br />
:Kills all threads with the specified name<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''KO_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': is the entity causing the knockout, can be the $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''launch'''(vector start, vector dir, vector velocity); ====<br />
<br />
:Launches the projectile from <start> in direction <dir> with the given <velocity><br />
<br />
:Spawnclasses responding to this event: ''idProjectile''<br />
==== scriptEvent void '''launchGuided'''(vector start, vector dir, vector velocity, entity target); ====<br />
<br />
:Launches the guided projectile from <start> in direction <dir> with the given <velocity> at <target entity>. Pass $null_entity to fire an unguided projectile.<br />
<br />
:Spawnclasses responding to this event: ''idGuidedProjectile''<br />
==== scriptEvent entity '''launchMissile'''(vector origin, vector angles); ====<br />
<br />
:Returns the projectile entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''launchMissiles'''(string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay); ====<br />
<br />
:Launches a projectile.<br />
<br />
:Spawnclasses responding to this event: ''idAnimated''<br />
==== scriptEvent void '''launchProjectiles'''(float num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated'', ''idTestModel''<br />
==== scriptEvent float '''loadExternalData'''(string declFile, string prefix); ====<br />
<br />
:Load an external xdata declaration.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''locateEnemy'''(); ====<br />
<br />
:Updates the last known position of the enemy independent from whether or not the enemy is visible.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent float '''log'''(float x); ====<br />
<br />
:Returns the log of the given argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''logString'''(float logClass, float logType, string output); ====<br />
<br />
:This is the script counterpart to DM_LOG<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''lookAt'''(entity focusEntity, float duration); ====<br />
<br />
:Aims the character's eyes and head toward an entity for a period of time.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtAngles'''(float yawAngleClockwise, float pitchAngleUp, float rollAngle, float durationInSeconds); ====<br />
<br />
:A look at event that just looks at a set of angles relative to the current body facing of the AI. This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but it looks at the specified angles from the current body facing of the AI.<br />
::''yawAngleClockwise'': Negative angles are to the left of the AIs body and positive angles are to the right.<br />
::''pitchAngleUp'': Negative values are down and positive values are up where down and up are defined by the body axis.<br />
::''rollAngle'': This is currently unused and does nothing.<br />
::''durationInSeconds'': The duration to look in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtEnemy'''(float duration); ====<br />
<br />
:Aims the character's eyes and head toward the current enemy for a period of time.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtPosition'''(vector lookAtWorldPosition, float durationInSeconds); ====<br />
<br />
:This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but instead of looking at an entity, it looks at a position in worldspace. That is, it turns the head of the AI to look at the position.<br />
::''lookAtWorldPosition'': position in space to look at<br />
::''durationInSeconds'': duration to look in seconds<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''lookupReplacementAnim'''(string anim); ====<br />
<br />
:Returns the current replacement animation for "anim". Returns empty if no replacement anim <br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''markUsed'''(); ====<br />
<br />
:Disables the combat node if "use_once" is set on the entity.<br />
<br />
:Spawnclasses responding to this event: ''idCombatNode''<br />
==== scriptEvent float '''melee'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''meleeActionFinished'''(); ====<br />
<br />
:Called when the animation for the melee action has finished.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeActionHeld'''(); ====<br />
<br />
:Called when the melee action reaches the "hold" point.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeActionReleased'''(); ====<br />
<br />
:Called when the melee action is released from the hold point.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeAttackStarted'''(float attType); ====<br />
<br />
:Registers the start of a given melee attack Intended to be called from a script that also starts the animation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''meleeAttackToJoint'''(string joint, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''meleeBestParry'''(); ====<br />
<br />
:Returns the melee type integer of the best parry given the enemy attacks at the time If no attacking enemy is found, returns default of MELEETYPE_RL Follows MELEETYPE_* enum defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''meleeNameForNum'''(float num); ====<br />
<br />
:Converts a melee type integer to a string name suffix Used for finding the right animation for a given type, etc. Possible names are, in order: "Over, LR, RL, Thrust, General" Where general blocks all attacks types except unblockable<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeParryStarted'''(float parType); ====<br />
<br />
:Registers the start of a given melee parry Intended to be called from a script that also starts the animation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''missionFailed'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''missionSuccess'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''mouseGestureFinished'''(); ====<br />
<br />
:Returns true if the player is not currently doing a mouse gesture.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''move'''(float angle, float distance); ====<br />
<br />
:Initiates a translation with the given distance in the given yaw direction. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveOutOfRange'''(entity ent, float range); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the moving.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''moveStatus'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveTo'''(entity targetEntity); ====<br />
<br />
:Initiates a translation to the position of an entity. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveToAttackPosition'''(entity ent, string attack_anim); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToCover'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToCoverFrom'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEnemyHeight'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEntity'''(entity destination); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToPos'''(vector pos); ====<br />
<br />
:Initiates a translation to an absolute position. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveToPosition'''(vector position); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''music'''(string shaderName); ====<br />
<br />
:Starts playing background music.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''muzzleFlash'''(string jointname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''netEndReload'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''netReload'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent entity '''nextEnemy'''(entity lastEnemy); ====<br />
<br />
:Returns the next enemy the actor has acquired.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''nextWeapon'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''noShadows'''(float noShadows); ====<br />
<br />
:Sets the noShadow property on the entity to true/false, turning shadowcasting on or off for this entity.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''noShadowsDelayed'''(float noShadows, float delay); ====<br />
<br />
:Sets the noShadow property on the entity to true/false after delay in ms, turning shadows cast by this entity on or off.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
::''delay'': delay in ms<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''numBindChildren'''(); ====<br />
<br />
:Returns the number of bound entities lower down in the bind chain than this entity, but be sure to give it the topmost bindmaster<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''numSmokeEmitters'''(); ====<br />
<br />
:Returns the # of emitters defined by 'smokeParticleSystem' in the entitydef<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''numTargets'''(); ====<br />
<br />
:Returns the number of entities this entity has targeted.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''objectiveCompUnlatch'''(float ObjNum, float CompNum); ====<br />
<br />
:Unlatch an irreversible objective component that has latched into a state<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''objectiveUnlatch'''(float ObjNum); ====<br />
<br />
:Unlatch an irreversible objective that has latched into a state<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Switches the emitter off.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter'', ''idLight'', ''idSecurityCamera'', ''idSound''<br />
==== scriptEvent void '''offsetRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Switches the emitter on.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter'', ''idLight'', ''idSecurityCamera'', ''idSound''<br />
==== scriptEvent void '''onSignal'''(float signalNum, entity ent, string functionName); ====<br />
<br />
:Sets a script callback function for when the given signal is raised on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''OpenDoor'''(float master); ====<br />
<br />
:The OpenDoor method is necessary to give the FrobDoorHandles a "low level" open routine. The CFrobDoor::Open() call is re-routed to the FrobDoorHandle::Tap() method, so there must be a way to actually let the door open. Which is what this method does. Note: Shouldn't be called directly by scripters, call handle->Tap() instead. Unless you know what you're doing.<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoor''<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover'', ''idMover_Binary''<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
:Spawnclasses responding to this event: ''CFrobButton'', ''CFrobLever''<br />
==== scriptEvent void '''overrideAnim'''(float channel); ====<br />
<br />
:Disables the animation currently playing on the given channel and syncs the animation with the animation of the nearest animating channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''pause'''(); ====<br />
<br />
:Pauses the current thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''pauseGame'''(); ====<br />
<br />
:Pauses the game. This should only be called for threads that are explicitly maintained by a special SDK method, because ordinary threads won't get executed during g_stopTime == true. Note: This is used by the objective GUI threads. Note: Must be called on the player entity, not the sys entity.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''performRelight'''(); ====<br />
<br />
:Deal with doused lights.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playAndLipSync'''(string soundName, string animName); ====<br />
<br />
:Play the given sound, using the given lipsync animation. The lipsync animation should just be a simple non-loopable animation of the mouth opening in a linear fashion. The code will select individual frames from this to construct a simple lipsyncing effect which is in time with the sound. Returns the length of the played sound in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''playCustomAnim'''(string animName); ====<br />
<br />
:Plays the given animation on legs and torso. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''playStartSound'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''pointInLiquid'''(vector point, entity ignoreEntity); ====<br />
<br />
:Checks if a point is in a liquid, returns 1 if this is the case.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''pointIsInBounds'''(vector point, vector mins, vector maxs); ====<br />
<br />
:Returns true if the point is within the bounds specified.<br />
::''point'': test whether this point is in the bounds<br />
::''mins'': minimal corner of the bounds<br />
::''maxs'': maximal corner of the bounds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''pow'''(float x, float y); ====<br />
<br />
:Returns the power of x to y.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''preBurn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''predictEnemyPos'''(float time); ====<br />
<br />
:Tries to predict the player's movement based on the AAS and his direction of movement.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''preventPain'''(float duration); ====<br />
<br />
:Prevents any pain animation from being played for the given time in seconds.<br />
::''duration'': time in seconds<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''print'''(string text); ====<br />
<br />
:Prints the given string to the console.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''println'''(string text); ====<br />
<br />
:Prints the given line to the console.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''processBlindStim'''(entity stimSource, float skipVisibilityCheck); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''processVisualStim'''(entity stimSource); ====<br />
<br />
:Use this call to let the AI react to a visual stim (coming from the source entity).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''projectDecal'''(vector traceOrigin, vector traceEnd, entity passEntity, string decal, float decalSize, float angle); ====<br />
<br />
:Performs a trace from the specified origin and end positions, then projects a decal in that direction.<br />
::''traceOrigin'': Start of the trace.<br />
::''traceEnd'': End of the trace.<br />
::''passEntity'': This entity will be considered non-solid by the trace.<br />
::''decal'': Decal to be projected.<br />
::''decalSize'': Size of the decal quad.<br />
::''angle'': Angle of the decal quad.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''propagateSound'''(string soundName, float propVolMod, float msgTag); ====<br />
<br />
:Generates a propagated sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''propSound'''(string name); ====<br />
<br />
:Sound propagation scriptfunctions on all entities propagate a sound directly without playing an audible sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''propSoundMod'''(string name, float volMod); ====<br />
<br />
:propagate a sound directly with a volume modifier<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''pushPointIntoAAS'''(vector post); ====<br />
<br />
:Tries to push the point into a valid AAS area<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''pushState'''(string stateName); ====<br />
<br />
:Pushes the state with the given name, current one is postponed.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''radiusDamage'''(vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower); ====<br />
<br />
:damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile).<br />
::''inflictor'': the entity causing the damage<br />
::''ignore'': an entity to not cause damage to<br />
::''dmgPower'': scales the damage (for cases where damage is dependent on time)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''radiusDamageFromJoint'''(string jointname, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''random'''(float range); ====<br />
<br />
:Returns a random value X where 0 <= X < range.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idPathCorner''<br />
==== scriptEvent entity '''randomTarget'''(string ignoreName); ====<br />
<br />
:Returns a random targeted entity. Pass in an entity name to skip that entity.<br />
::''ignoreName'': the name of an entity to ignore<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''rangedThreatTo'''(entity target); ====<br />
<br />
:Could this entity threaten the given (target) entity from a distance?<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''readLightgemModifierFromWorldspawn'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''reAttachToCoords'''(string attName, string joint, vector offset, vector angles); ====<br />
<br />
:Reattach an existing attachment<br />
::''attName'': the name of the attachment we want to reattach. <br />
::''joint'': the name of the joint to attach to<br />
::''offset'': the translation offset from joint<br />
::''angles'': a (pitch, yaw, roll) angle vector that defines the rotation of the attachment relative to the joint's orientation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''reAttachToPos'''(string attName, string position); ====<br />
<br />
:Reattach an existing attachment to a named attachment position. Example: reAttachToPos( melee_weapon, right_hand_held )<br />
::''attName'': the name of the attachment we want to reattach.<br />
::''position'': the new position we want to attach it to.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''reloadTorchReplacementAnims'''(); ====<br />
<br />
:If actor has a torch, reload the torch's replacement anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''remove'''(); ====<br />
<br />
:Removes the entity from the game. For AI, use kill() instead.<br />
<br />
:Spawnclasses responding to this event: ''idClass''<br />
==== scriptEvent void '''removeBinds'''(); ====<br />
<br />
:Removes all attached entities from the game<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeFrobPeer'''(entity peer); ====<br />
<br />
:Removes the passed entity as a frob peer.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeInitialSplineAngles'''(); ====<br />
<br />
:Subtracts the initial spline angles to maintain the initial orientation of the mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''removeKey'''(string key); ====<br />
<br />
:Removes a key from an object's spawnargs, so things like getNextKey() don't retrieve it.<br />
::''key'': the spawnarg to remove<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeReplacementAnim'''(string anim); ====<br />
<br />
:Removes the replacement for the given "anim"<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''removeTarget'''(entity target); ====<br />
<br />
:Remove a target from this entity.<br />
::''target'': the entity to remove from the targets<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''replaceInvItem'''(entity oldItem, entity newItem); ====<br />
<br />
:Replaces the entity <oldItem> with <newItem> in the inventory, while keeping <oldItem>'s inventory position intact. Note: The position guarantee only applies if <oldItem> and newItem share the same category. If the categories are different, the position of <newItem> is likely to be different than the one of <oldItem>. Note that <oldItem> will be removed from the inventory. If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens. Returns 1 if the operation was successful, 0 otherwise.<br />
::''newItem'': can be $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResetTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''resetWeaponProjectile'''(string weaponName); ====<br />
<br />
:Reloads the original projectile def name from the weaponDef. Used to revert a change made by the event changeWeaponProjectile().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''resetZoom'''(); ====<br />
<br />
:Cancels any pending zoom transitions and resets the FOV to normal.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''reskinCollisionModel'''(); ====<br />
<br />
:For use after setSkin() on moveables and static models, if the CM needs to be refreshed to update surface properties after a skin change. CM will be regenerated from the original model file with the new skin.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''respawn'''(); ====<br />
<br />
:Respawn<br />
<br />
:Spawnclasses responding to this event: ''idItem''<br />
==== scriptEvent void '''ResponseAdd'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseAllow'''(float type, entity responder); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseIgnore'''(float type, entity responder); ====<br />
<br />
:This functions must be called on the stim entity. It will add the response to the ignore list, so that subsequent stims, should not trigger the stim anymore.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseSetAction'''(float type, string action); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseTrigger'''(entity source, float stimType); ====<br />
<br />
:Fires a response on this entity, without a stim (a stand-alone response, so to say)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''restartPatrol'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''RestartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''restoreAddedEnts'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''restoreMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''restorePosition'''(); ====<br />
<br />
:Returns this entity to the position stored in the "origin" spawn arg. This is the position the entity was spawned in unless the "origin" key is changed. Note that there is no guarantee that the entity won't be stuck in another entity when moved, so care should be taken to make sure that isn't possible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated'', ''idTestModel''<br />
==== scriptEvent void '''ropeRemovalCleanup'''(entity ropeEnt); ====<br />
<br />
:Called when rope arrow ropes are removed, removes stale pointers on the player object.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''rotate'''(vector angleSpeed); ====<br />
<br />
:Initiates a rotation with the given angular speed. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateDownTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by decreasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateOnce'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the current angles plus the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateTo'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateUpTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by increasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''saveConDump'''(string cmd, string cmd); ====<br />
<br />
:Saves condump into FM directory; first argument is appended to dump filename, everything before last occurence of second argument is removed<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''saveGame'''(string filename); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''saveMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''say'''(string text); ====<br />
<br />
:Multiplayer - Print this line on the network<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''scaleVine'''(float factor); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''selectWeapon'''(string weapon); ====<br />
<br />
:Selects the weapon the player is holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''sessionCommand'''(string cmd); ====<br />
<br />
:Sends the sessioncommand to the game<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setActiveInventoryMapEnt'''(entity mapEnt); ====<br />
<br />
:Notify the player about a new active map entity. This clears out any previously active maps.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setAcuity'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAlertGracePeriod'''(float frac, float duration, float count); ====<br />
<br />
:This starts the alert grace period for an AI. Should be called in the same frame as the alert that pushes them into a higher state.<br />
::''frac'': the fraction of the alert below which they should ignore alerts during the grace period.<br />
::''duration'': the duration of the period in seconds<br />
::''count'': the number of alerts ignored above which the grace period is invalid<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAlertLevel'''(float newLevel); ====<br />
<br />
:Set the alert level (AI_AlertLevel). This should always be called instead of setting AI_AlertLevel directly.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAngles'''(vector angles); ====<br />
<br />
:Sets the current orientation of this entity (relative to bind parent if any)<br />
::''angles'': the new orientation<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setAngularVelocity'''(vector velocity); ====<br />
<br />
:Sets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setAngularVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the angular velocity of a particular body<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setAnimPrefix'''(string prefix); ====<br />
<br />
:Sets a string which is placed in front of any animation names.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''setAnimRate'''(float channel, string animName, float animRate); ====<br />
<br />
:Sets the animation rate to the given value. Returns 1 if successful, otherwise -1<br />
::''animName'': The name of the animation.<br />
::''animRate'': The rate to set the animation to.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setAttackFlag'''(float combatType, float enabled); ====<br />
<br />
:Activate or deactivate the given attack flag<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setAudThresh'''(float val); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''setBoneMod'''(float allowBoneMod); ====<br />
<br />
:Enables or disables head looking (may be obsolete).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setCamera'''(entity cameraEnt); ====<br />
<br />
:Turns over view control to the given camera entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setClipMask'''(float clipMask); ====<br />
<br />
:Sets the clipmask of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setColor'''(float parm0, float parm1, float parm2); ====<br />
<br />
:Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2). See also setColorVec for a variant that accepts a vector instead.<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setColorVec'''(vector newColor); ====<br />
<br />
:Similar to setColor, but accepts the new RGB color as a vector instead of 3 different floats.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''SetConstraintPosition'''(string constraintName, vector position); ====<br />
<br />
:Moves the constraint with the given name that binds this entity to another entity.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setContents'''(float contents); ====<br />
<br />
:Sets the contents of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setController'''(entity playerController); ====<br />
<br />
:Let a player assume movement control of an AI vehicle (may be remote control as in a player on a coach pulled by a horse)<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent float '''setCurInvCategory'''(string categoryName); ====<br />
<br />
:Sets the inventory cursor to the first item of the named category. Returns 1 on success, 0 on failure (e.g. wrong category name)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''setCurInvItem'''(string itemName); ====<br />
<br />
:Sets the inventory cursor to the named item. Returns: the item entity of the newly selected item (can be $null_entity).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setcvar'''(string name, string value); ====<br />
<br />
:Sets a cvar.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setDroppable'''(float droppable); ====<br />
<br />
:Set whether an item may be dropped from the inventory. <br />
::''droppable'': if non-zero the item becomes droppable, when called with 0 the item becomes non-droppable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setEnemy'''(entity enemy); ====<br />
<br />
:Make the given entity an enemy.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setEntityRelation'''(entity ent, float relation); ====<br />
<br />
:Set a relation to another entity, this can be friendly (>0), neutral(0) or hostile (<0)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFlyOffset'''(float offset); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setFlySpeed'''(float speed); ====<br />
<br />
:Set the speed flying creatures move at. Also sets speed for moveTypeSlide.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setFrobable'''(float frobable); ====<br />
<br />
:Set whether the entity is frobable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFrobMaster'''(entity master); ====<br />
<br />
:Sets the passed entity as the frob master. Pass null_entity to remove the current frob master, if any.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFrobOnlyUsedByInv'''(float OnOff); ====<br />
<br />
:Engages or disengages a mode where we only frobhilight entities that can be used by our current inventory item. This also disables general frobactions and only allows "used by" frob actions.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setGui'''(float handle, string guiFile); ====<br />
<br />
:Loads a new file into an existing GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiFloat'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiInt'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiString'''(float handle, string key, string val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiStringFromKey'''(float handle, string key, entity src, string srcKey); ====<br />
<br />
:This is a kludge. It is equivelant to: setGuiString( handle, key, src.getKey(srcKey) ) However, it's used to bypass the 127 char size limit on script strings.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setHealth'''(float health); ====<br />
<br />
:Use these to set the health of AI or players (this also updates the AI_DEAD flag)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Used to set hinderance from a source.<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setImmobilization'''(string source, float type); ====<br />
<br />
:Used to set immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setJointAngle'''(float jointnum, float transform_type, vector angles); ====<br />
<br />
:Modifies the orientation of the joint based on the transform type.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''setJointPos'''(float jointnum, float transform_type, vector pos); ====<br />
<br />
:Modifies the position of the joint based on the transform type.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''setKey'''(string key, string value); ====<br />
<br />
:Sets a key on this entity's spawn args. Note that most spawn args are evaluated when this entity spawns in, so this will not change the entity's behavior in most cases. This is chiefly for saving data the script needs in an entity for later retrieval.<br />
::''key'': the spawnarg to set<br />
::''value'': the value to store<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setLightgemModifier'''(string modifierName, float value); ====<br />
<br />
:Sets the named lightgem modifier to a certain value. An example would be the player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers can be set by concurrent script threads.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setLightOrigin'''(vector pos); ====<br />
<br />
:Set origin of lights independent of model origin<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent void '''setLinearVelocity'''(vector velocity); ====<br />
<br />
:Sets the current linear velocity of this entity in units per second. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setLinearVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the linear velocity of a particular body<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setModel'''(string modelName); ====<br />
<br />
:Sets the model this entity uses<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setMoveType'''(float movetype); ====<br />
<br />
:Set the current movetype. movetypes are defined in tdm_ai.script<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setName'''(string name); ====<br />
<br />
:Sets the name of this entity.<br />
::''name'': the new name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setNeverDormant'''(float enable); ====<br />
<br />
:enables or prevents an entity from going dormant<br />
::''enable'': 1 = enable, 0 = disable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setNextState'''(string stateFunc); ====<br />
<br />
:Sets the next state and waits until thread exits, or a frame delay before calling it. Handy for setting the state in the constructor.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setObjectiveComp'''(float ObjNum, float CompNum, float state); ====<br />
<br />
:Used to set the state of custom objective components<br />
::''ObjNum'': objective number. Starts counting at 1<br />
::''CompNum'': component number. Starts counting at 1<br />
::''state'': 1 or 0 for true or false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveEnabling'''(float ObjNum, string strIn); ====<br />
<br />
:Set an objective's enabling objectives (objectives that must be completed before that objective may be completed).<br />
::''strIn'': takes the form of a string that is a space-delimited list of integer objectives representing the new enabling objectives. E.g. : '1 2 3 4'<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveNotification'''(float ObjNote); ====<br />
<br />
:Turns the notifications (sound ++ text) for objectives on/off.<br />
::''ObjNote'': Turn notifications on/off<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveOngoing'''(float ObjNum, float val); ====<br />
<br />
:Sets objective ongoing.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveOptional'''(float ObjNum, float val); ====<br />
<br />
:Sets objective mandatory.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveState'''(float ObjNum, float State); ====<br />
<br />
:Used to set the state of objectives from the script. For example, use this to invalidate an objective when something happens in your mission. The first argument is the numerical index of the objective (taking 'user' objective indices, starting at 1). Choose from the following for the second argument: OBJ_INCOMPLETE, OBJ_COMPLETE, OBJ_INVALID, OBJ_FAILED. Use this on $player1 like $player1.setObjectiveState(1, OBJ_COMPLETE);<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveText'''(float ObjNum, string newText); ====<br />
<br />
:Modify the displayed text for an objective. Can also be a string template like #str_20000<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveVisible'''(float ObjNum, float val); ====<br />
<br />
:Sets objective visibility.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (relative to it's bind parent if any)<br />
::''origin'': the new origin<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setOwner'''(entity owner); ====<br />
<br />
:Sets the owner of this entity. Entities will never collide with their owner.<br />
::''owner'': the entity which will be made owner of this entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setPeekOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for peeking, depending on aspect ratio.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setPeekView'''(float OnOff, vector origin); ====<br />
<br />
:Toggle whether we should use a view from a peek entity as the player's view<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setPersistantArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair that persists between maps<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortAISoundLoss'''(float handle, float value); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortPlayerSoundLoss'''(float handle, float value); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortSoundLoss'''(float handle, float value); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPrime'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''setRadius'''(float radius); ====<br />
<br />
:Sets the size of the bounding box, x=y=z=radius.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setRadiusXYZ'''(float x, float y, float z); ====<br />
<br />
:Sets the width/length/height of the light bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setReplacementAnim'''(string animToReplace, string replacement); ====<br />
<br />
:Replaces the animation "animToReplace" with "replacement"<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setSavePermissions'''(float permission); ====<br />
<br />
:No description<br />
::''permission'': 0<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setSecretsFound'''(float secrets); ====<br />
<br />
:Set how many secrets the player has found. Use getMissionStatistic() for getting the current value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setSecretsTotal'''(float secrets); ====<br />
<br />
:Set how many secrets exist in the map in total. Use getMissionStatistic() for getting the current value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setShader'''(string shader); ====<br />
<br />
:Sets the shader to be used for the light.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''setShaderParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
::''parm3'': alpha<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSightThreshold'''(float sightThreshold); ====<br />
<br />
:Set the sight threshold of the security camera: how lit up the player's lightgem needs to be in order to be seen. 0.0 to 1.0<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''setSize'''(vector min, vector max); ====<br />
<br />
:Sets the size of this entity's bounding box.<br />
::''min'': minimum corner coordinates<br />
::''max'': maximum corner coordinates<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSkin'''(string skinName); ====<br />
<br />
:Sets the skin this entity uses. Set to "" to turn off the skin.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSmoke'''(string particleDef); ====<br />
<br />
:Changes the smoke particle of a func_smoke.<br />
<br />
:Spawnclasses responding to this event: ''idFuncSmoke''<br />
==== scriptEvent void '''setSmokeVisibility'''(float particle_num, float on); ====<br />
<br />
:enables/disables smoke particles on bones. pass in the particle #, or ALL_PARTICLES for turning on/off all particle systems. particles are spawned in the order they appear in the entityDef<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setSolid'''(float solidity); ====<br />
<br />
:Set the solidity of the entity. If the entity has never been solid before it will be assigned solid and opaque contents/clip masks.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSoundLoss'''(float loss); ====<br />
<br />
:Sets the sound loss value (dB).<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent void '''setSoundVolume'''(float newLevel); ====<br />
<br />
:Set the volume of the sound to play, must be issued before startSoundShader.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSpawnArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair to be used when a new entity is spawned.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setSpyglassOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for the spyglass, depending on aspect ratio.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setStartedOff'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setState'''(string stateFunc); ====<br />
<br />
:Sets the next state and goes to it immediately<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setSyncedAnimWeight'''(float channel, float animindex, float weight); ====<br />
<br />
:Sets the blend amount on multi-point anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setTalkState'''(float state); ====<br />
<br />
:Sets whether the player can talk to this character or not.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setTalkTarget'''(entity target); ====<br />
<br />
:Sets the entity (player) trying to talk to the character<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setTeam'''(float newTeam); ====<br />
<br />
:Sets the team number of this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''SetTimerState'''(float stimId, float state); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setTurnHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Set the hinderance on the view turning from a source<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setTurnRate'''(float rate); ====<br />
<br />
:Set the rate the character turns at<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setViewAngles'''(vector angles); ====<br />
<br />
:Sets the player view angles, e.g. make the player facing this direction. 0 0 0 is east (along the X axis in DR), 0 90 0 north (along the Y axis in DR) 0 180 0 west, 0 270 0 south.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''setWorldOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (regardless of any bind parent).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''shooterFireProjectile'''(); ====<br />
<br />
:Fires a projectile.<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent float '''shooterGetAmmo'''(); ====<br />
<br />
:Get the ammonition<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent float '''shooterGetState'''(); ====<br />
<br />
:Returns the current state of this shooter.<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''shooterSetAmmo'''(float newAmmo); ====<br />
<br />
:Set the ammonition<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''shooterSetState'''(float state); ====<br />
<br />
:Activates / deactivates the shooter entity.<br />
::''state'': 1 = active, 0 = inactive<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''show'''(); ====<br />
<br />
:Makes this entity visible if it has a model.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''shrivel'''(float time); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''sin'''(float degrees); ====<br />
<br />
:Returns the sine of the given angle in degrees.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''slideTo'''(vector position, float time); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''smoking'''(float state); ====<br />
<br />
:flame is now smoking (1), or not (0)<br />
::''state'': 1 = smoking, 0 = not smoking<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''spawn'''(string classname); ====<br />
<br />
:Creates an entity of the specified classname and returns a reference to the entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''SpawnFloat'''(string key, float default); ====<br />
<br />
:Returns the floating point value for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''SpawnString'''(string key, string default); ====<br />
<br />
:Returns the string for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''spawnThrowableProjectile'''(string projectileName, string jointName); ====<br />
<br />
:This method spawns a projectile of the type named by the caller and attaches it to the joint given by the caller. The projectile becomes the AI's firable projectile. Returns a pointer to a projectile entity that can be thrown by the AI. You can use AI_LaunchMissle (e* = launchMissle(v,v) ) to throw the stone.<br />
::''projectileName'': The name of the projectile to spawn (as seen in a .def file) Must be descended from idProjectile<br />
::''jointName'': The name of the joint on the model to which the particle should be attached for throwing. If this is NULL or the empty string, then it is attached to the model center.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''SpawnVector'''(string key, vector default); ====<br />
<br />
:Returns the vector for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''speed'''(float speed); ====<br />
<br />
:Sets the movement speed. Set this speed before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''sqrt'''(float square); ====<br />
<br />
:Returns the square root of the given number.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''start'''(); ====<br />
<br />
:Starts a spline or anim camera moving.<br />
<br />
:Spawnclasses responding to this event: ''idCameraAnim''<br />
==== scriptEvent void '''startFx'''(string fx); ====<br />
<br />
:Starts an FX on this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startGamePlayTimer'''(); ====<br />
<br />
:Resets the game play timer to zero and (re)starts it.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''startMouseGesture'''(float key, float thresh, float test, float inverted, float turnHinderance, float decideTime, float deadTime); ====<br />
<br />
:Start tracking a mouse gesture that started when the key impulse was pressed. Discretizes analog mouse movement into a few different gesture possibilities. Impulse arg can also be a button, see the UB_* enum in usercmdgen.h. For now, only one mouse gesture check at a time.<br />
::''thresh'': Waits until the threshold mouse input thresh is reached before deciding.<br />
::''test'': determines which test to do (0 = up/down, 1 = left/right, 2 = 4 directions, 3 = 8 directions).<br />
::''inverted'': inverts the movement if set to 1, does not if 0<br />
::''turnHinderance'': Sets the max player view turn rate when checking this mouse gesture (0 => player view locked, 1.0 => no effect on view turning)<br />
::''decideTime'': time in milliseconds after which the mouse gesture is auto-decided, in the event that the mouse movement threshold was not reached. A DecideTime of -1 means wait forever until the button is released.<br />
::''deadTime'': how long after attack is pressed that mouse control remains dampened by the fraction turnHinderance.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''startRagdoll'''(); ====<br />
<br />
:Switches to a ragdoll taking over the animation.<br />
<br />
:Spawnclasses responding to this event: ''idAnimated''<br />
==== scriptEvent float '''startSound'''(string sound, float channel, float netSync); ====<br />
<br />
:Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound in seconds. This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.<br />
::''sound'': the spawnarg to reference, e.g. 'snd_move'<br />
::''channel'': the channel to play on<br />
::''netSync'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''startSoundShader'''(string shaderName, float channel); ====<br />
<br />
:Plays a specific sound shader on the channel and returns the length of the sound in seconds. This is not the preferred method of playing a sound since you must ensure that the sound is loaded.<br />
::''shaderName'': the sound shader to play<br />
::''channel'': the channel to play the sound on<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startSpline'''(entity spline); ====<br />
<br />
:Starts moving along a spline stored on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''StartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startZoom'''(float duration, float startFOV, float endFOV); ====<br />
<br />
:Call this to start the zoom in event. The player FOV is gradually zoomed in until over the given timespan.<br />
::''duration'': duration of the transition in msec<br />
::''startFOV'': The start FOV, this is clamped to [1..179]<br />
::''endFOV'': The end FOV, this is clamped to [1..179]<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''state_light'''(float set); ====<br />
<br />
:Switches the spotlight on or off. Respects the security camera's power state.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_AI'''(float set); ====<br />
<br />
:Set whether the camera can see AIs.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_animals'''(float set); ====<br />
<br />
:Set whether the camera can see animals. Checked after seeAI or seeBodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_bodies'''(float set); ====<br />
<br />
:Set whether the camera can see bodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_player'''(float set); ====<br />
<br />
:Set whether the camera can see the player.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_sweep'''(float set); ====<br />
<br />
:Enables or disables the camera's sweeping.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''StimAdd'''(float type, float radius); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimClearIgnoreList'''(float type); ====<br />
<br />
:This clears the ignore list for the stim of the given type It can be used if an entity changes state in some way that it would no longer be ignored<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimEmit'''(float type, float radius, vector stimOrigin); ====<br />
<br />
:Emits a stim in a radius around the specified origin. The entity from which this event is called needs to have the corresponding stim setup on itself, it does not need to be active.<br />
::''type'': Index ID of the stim to emit, i.e. 21 or STIM_TRIGGER for a trigger stim.<br />
::''radius'': How far the stim will reach. Pass negative to use the radius settings on the entity.<br />
::''stimOrigin'': Emit the stim from here.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''stop'''(); ====<br />
<br />
:Stops a spline or anim camera moving.<br />
<br />
:Spawnclasses responding to this event: ''idCameraAnim''<br />
==== scriptEvent void '''stopAnim'''(float channel, float frames); ====<br />
<br />
:Stops the animation currently playing on the given channel over the given number of frames.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''stopFxFov'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''stopMouseGesture'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''stopMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopMoving'''(); ====<br />
<br />
:Stops any translational movement.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopPatrol'''(); ====<br />
<br />
:Stops an AI from patrolling<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopRagdoll'''(); ====<br />
<br />
:turns off the ragdoll<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopRotating'''(); ====<br />
<br />
:Stops any rotational movement.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopSound'''(float channel, float netSync); ====<br />
<br />
:Stops a specific sound shader on the channel.<br />
::''channel'': the channel to stop playback on<br />
::''netSync'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''stopSpline'''(); ====<br />
<br />
:Stops moving along a spline.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopThinking'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''StopTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''strFind'''(string text, string find, float casesensitive, float start, float end); ====<br />
<br />
:Return the position of the given substring, counting from 0, or -1 if not found.<br />
::''casesensitive'': 0<br />
::''start'': 0<br />
::''end'': -1<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strLeft'''(string text, float num); ====<br />
<br />
:Returns a string composed of the first num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strLength'''(string text); ====<br />
<br />
:Returns the number of characters in the string<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strMid'''(string text, float start, float num); ====<br />
<br />
:Returns a string composed of the characters from start to start + num<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strRemove'''(string text, string remove); ====<br />
<br />
:Replace all occurances of the given substring with "". Example: StrRemove("abba","bb") results in "aa".<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strReplace'''(string text, string remove, string replace); ====<br />
<br />
:Replace all occurances of the given string with the replacement string. Example: StrRemove("abba","bb","ccc") results in "accca".<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strRight'''(string text, float num); ====<br />
<br />
:Returns a string composed of the last num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strSkip'''(string text, float num); ====<br />
<br />
:Returns the string following the first num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strToFloat'''(string text); ====<br />
<br />
:Returns the numeric value of the given string.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strToInt'''(string text); ====<br />
<br />
:Returns the integer value of the given string.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''sway'''(float speed, float phase, vector angles); ====<br />
<br />
:Initiates a rotation back and forth along the given angles with the given speed and phase.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''Switch'''(float newState); ====<br />
<br />
:Move the lever to the on or off position (0 = off).<br />
<br />
:Spawnclasses responding to this event: ''CFrobLever''<br />
==== scriptEvent void '''switchState'''(string stateName); ====<br />
<br />
:Switches to the state with the given name, current one is ended.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''syncAnimChannels'''(float fromChannel, float toChannel, float blendFrames); ====<br />
<br />
:Synchronises the channels<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''Tap'''(); ====<br />
<br />
:Operates this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobHandle''<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock'', ''idProjectile''<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''teleportTo'''(entity other); ====<br />
<br />
:Teleports the entity to the position of the other entity, plus a possible offset and random offset (defined on the spawnargs of the entity to be teleported)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''terminate'''(float threadNumber); ====<br />
<br />
:Terminates a thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''testAnimAttack'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testAnimMove'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testAnimMoveTowardEnemy'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testChargeAttack'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testEvent1'''(float float_pi, float int_beef, float float_exp, string string_tdm, float float_exp10, float int_food); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''testEvent2'''(float int_prevres, vector vec_123, float int_food, entity ent_player, entity ent_null, float float_pi, float float_exp); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''testEvent3'''(entity ent_prevres, vector vec_123, float float_pi, entity ent_player); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''testMeleeAttack'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testMoveToPosition'''(vector position); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''threadname'''(string name); ====<br />
<br />
:Sets the name of the current thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''throwAF'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''throwMoveable'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''time'''(float time); ====<br />
<br />
:Sets the movement time. Set this time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''Toggle'''(); ====<br />
<br />
:Turns the forcefield on and off.<br />
<br />
:Spawnclasses responding to this event: ''idForceField''<br />
==== scriptEvent void '''toggle_light'''(); ====<br />
<br />
:Toggles the spotlight on/off.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_AI'''(); ====<br />
<br />
:Toggles whether the camera can see AIs.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_animals'''(); ====<br />
<br />
:Toggles whether the camera can see bodies. Checked after seeAI or seeBodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_bodies'''(); ====<br />
<br />
:Toggles whether the camera can see bodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_player'''(); ====<br />
<br />
:Toggles whether the camera can see the player.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_sweep'''(); ====<br />
<br />
:Toggles the camera sweep.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''ToggleOpen'''(); ====<br />
<br />
:Toggles the mover state. Closes when fully open, opens when fully closed. If the mover is "interrupted" (e.g. when the player frobbed the mover in between), the move direction depends on the state of the internal "intent_open" flag. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''totalAmmoCount'''(); ====<br />
<br />
:Amount of ammo in inventory. since each shot may use more than 1 ammo, this is different than ammoAvailable()<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''touches'''(entity other); ====<br />
<br />
:Returns true if this entity touches the other entity.<br />
::''other'': the entity to check against<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''trace'''(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''tracePoint'''(vector start, vector end, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the trace hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''translate'''(string input); ====<br />
<br />
:Translates a string (like #str_12345) into the current language<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''travelDistanceBetweenEntities'''(entity source, entity dest); ====<br />
<br />
:Approximate travel distance between two entities.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceBetweenPoints'''(vector source, vector dest); ====<br />
<br />
:Approximate travel distance between two points.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceToEntity'''(entity destination); ====<br />
<br />
:Approximate travel distance to entity.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceToPoint'''(vector destination); ====<br />
<br />
:Approximate travel distance to point.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''trigger'''(entity entityToTrigger); ====<br />
<br />
:Triggers the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''triggerMissionEnd'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''triggerParticles'''(string jointName); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnTo'''(float yaw); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnToEntity'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnToPos'''(vector pos); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''unbind'''(); ====<br />
<br />
:Detaches this entity from its master.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''unpauseGame'''(); ====<br />
<br />
:Unpauses the game. Most scripts are not executed during g_stopTime == true and won't get into the position of calling this.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''useAmmo'''(float amount); ====<br />
<br />
:Eats the specified amount of ammo<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''vecLength'''(vector vec); ====<br />
<br />
:Returns the length of the given vector.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''vecNormalize'''(vector vec); ====<br />
<br />
:Returns the normalized version of the given vector.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''VecRotate'''(vector vector, vector angles); ====<br />
<br />
:Rotates a vector by the specified angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''VecToAngles'''(vector vec); ====<br />
<br />
:Returns Euler angles for the given direction.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''visScan'''(); ====<br />
<br />
:Checks for enemies or player in the AI's FOV, using light level and distance. For now the check is only done on the player. Returns a reference to the sighted actor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''waitAction'''(string name); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''waitFor'''(entity mover); ====<br />
<br />
:Waits for the given entity to complete its move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitForRender'''(entity e); ====<br />
<br />
:Suspends the current thread until 'e' might have been rendered. It's event based, so it doesn't waste CPU repeatedly checking inPVS(). e.inPVS() will very likely be true when the thread resumes. If e.inPVS() is true, calling waitForRender() will probably just wait a frame, unless D3 can figure out that the entity doesn't need to be rendered. Optimizations regarding shadowcasting lights may not apply to this function - it is based purely off whether or not the entity's bounding box is visible.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitForThread'''(float threadNumber); ====<br />
<br />
:Waits for the given thread to terminate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''waitMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wakeOnFlashlight'''(float enable); ====<br />
<br />
:Tells the monster to activate when flashlight shines on them.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wander'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''warning'''(string text); ====<br />
<br />
:Issues a warning.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''wasDamaged'''(); ====<br />
<br />
:Check if the player was damaged this frame.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''weaponHolstered'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponLowering'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponOutOfAmmo'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponReady'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponReloading'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponRising'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponState'''(string stateFunction, float blendFrames); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
<br />
== Events by Spawnclass / Entity Type ==<br />
=== idClass ===<br />
==== scriptEvent void '''remove'''(); ====<br />
<br />
:Removes the entity from the game. For AI, use kill() instead.<br />
<br />
=== idActor ===<br />
==== scriptEvent float '''animDistance'''(float channel, string animName); ====<br />
<br />
:Returns the distance that the anim travels. If the entity has multiple anims with animName, the distance may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animDistance.<br />
<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
==== scriptEvent float '''animLength'''(float channel, string animName); ====<br />
<br />
:Returns the length of the anim in seconds. If the entity has multiple anims with animName, length may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animLength.<br />
<br />
==== scriptEvent void '''animState'''(float channel, string stateFunction, float blendFrame); ====<br />
<br />
:Sets a new animation state script function for the given channel.<br />
<br />
==== scriptEvent void '''attach'''(entity ent, string attName); ====<br />
<br />
:Attach an entity to the AI. Entity spawnArgs checked for attachments are: - "origin", "angles", and "joint". These must be set prior to calling attach.<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
==== scriptEvent void '''attachToPos'''(entity ent, string position, string attName); ====<br />
<br />
:Attach an entity to the AI, using a named attachment position<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
==== scriptEvent void '''checkAnim'''(float channel, string animName); ====<br />
<br />
:Ensures that the animation exists and causes an error if it doesn't.<br />
<br />
==== scriptEvent string '''chooseAnim'''(float channel, string animName); ====<br />
<br />
:Chooses a random anim and returns the name. Useful for doing move tests on anims.<br />
<br />
==== scriptEvent entity '''closestEnemyToPoint'''(vector point); ====<br />
<br />
:Returns the enemy closest to the given location.<br />
<br />
==== scriptEvent void '''disableAnimchannel'''(float channel); ====<br />
<br />
:Used to disable a certain animchannel (for example if the ai is dead)<br />
<br />
==== scriptEvent void '''disableEyeFocus'''(); ====<br />
<br />
:Disables eye focus.<br />
<br />
==== scriptEvent void '''DisableLegIK'''(float num); ====<br />
<br />
:disables leg IK<br />
<br />
==== scriptEvent void '''disablePain'''(); ====<br />
<br />
:Disables pain animations.<br />
<br />
==== scriptEvent void '''DisableWalkIK'''(); ====<br />
<br />
:disables walk IK<br />
<br />
==== scriptEvent void '''dropAttachment'''(string attName); ====<br />
<br />
:Drop the attachment for the given attachment name.<br />
<br />
==== scriptEvent void '''dropAttachmentInd'''(float index); ====<br />
<br />
:Drop the attachment for the given index.<br />
::''index'': starts at 0<br />
<br />
==== scriptEvent void '''enableAnim'''(float channel, float blendFrames); ====<br />
<br />
:Enables animation on the given channel.<br />
<br />
==== scriptEvent void '''enableEyeFocus'''(); ====<br />
<br />
:Enables eye focus.<br />
<br />
==== scriptEvent void '''EnableLegIK'''(float num); ====<br />
<br />
:enables leg IK<br />
<br />
==== scriptEvent void '''enablePain'''(); ====<br />
<br />
:Enables pain animations.<br />
<br />
==== scriptEvent void '''EnableWalkIK'''(); ====<br />
<br />
:enables walk IK<br />
<br />
==== scriptEvent void '''finishAction'''(string action); ====<br />
<br />
:Finishes the given wait action.<br />
<br />
==== scriptEvent void '''finishChannelAction'''(float channel, string animname); ====<br />
<br />
:Overloaded finishAction function for setting the waitstate on each channel separately<br />
<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
==== scriptEvent string '''getAnimList'''(float channel); ====<br />
<br />
:Returns a list of all animations and their anim rates.<br />
<br />
==== scriptEvent float '''getAnimRate'''(float channel, string animName); ====<br />
<br />
:Returns the rate for the given animation. Returns -1 if animation cannot be found.<br />
::''animName'': The name of the animation.<br />
<br />
==== scriptEvent string '''getAnimState'''(float channel); ====<br />
<br />
:Returns the name of the current animation state script function used for the given channel.<br />
<br />
==== scriptEvent entity '''getAttachment'''(string attName); ====<br />
<br />
:Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists<br />
<br />
==== scriptEvent entity '''getAttachmentInd'''(float index); ====<br />
<br />
:Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists<br />
::''index'': starts at 0<br />
<br />
==== scriptEvent float '''getAttackFlag'''(float combatType); ====<br />
<br />
:Returns 1 if the given attack flag is activated.<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent vector '''getEyePos'''(); ====<br />
<br />
:Get eye position of the player and the AI<br />
<br />
==== scriptEvent entity '''getHead'''(); ====<br />
<br />
:Returns the entity used for the character's head, if it has one.<br />
<br />
==== scriptEvent float '''getMeleeActPhase'''(); ====<br />
<br />
:Returns the current melee action phase (holding,recovering,etc).<br />
<br />
==== scriptEvent float '''getMeleeActState'''(); ====<br />
<br />
:Returns the current melee action state (attacking/defending).<br />
<br />
==== scriptEvent float '''getMeleeActType'''(); ====<br />
<br />
:Returns the current melee action type (overhead,thrust,etc.).<br />
<br />
==== scriptEvent float '''getMeleeLastActTime'''(); ====<br />
<br />
:Returns the melee type of the last attack to hit this actor. Defaults to MELEETYPE_UNBLOCKABLE if we were not hit before.<br />
<br />
==== scriptEvent float '''getMeleeLastHitByType'''(); ====<br />
<br />
:Returns the game time that the most recent melee action ended (in ms)<br />
<br />
==== scriptEvent float '''getMeleeResult'''(); ====<br />
<br />
:Get the result of the last melee action Follows MELEERESULT_* enum defined in tdm_defs.script<br />
<br />
==== scriptEvent float '''getNumAttachments'''(); ====<br />
<br />
:Return the number of attachments on an AI. Used to iterate through the attachments if desired.<br />
<br />
==== scriptEvent float '''getNumMeleeWeapons'''(); ====<br />
<br />
:Returns the number of melee weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_melee' set to '1'.<br />
<br />
==== scriptEvent float '''getNumRangedWeapons'''(); ====<br />
<br />
:Returns the number of ranged weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_ranged' set to '1'.<br />
<br />
==== scriptEvent string '''getPainAnim'''(); ====<br />
<br />
:Returns the name of the pain animation.<br />
<br />
==== scriptEvent string '''getState'''(); ====<br />
<br />
:Gets the current state.<br />
<br />
==== scriptEvent float '''hasAnim'''(float channel, string animName); ====<br />
<br />
:Returns true when an entity has a specific animation.<br />
<br />
==== scriptEvent float '''hasEnemies'''(); ====<br />
<br />
:Returns true if the actor has one or more enemies.<br />
<br />
==== scriptEvent float '''idleAnim'''(float channel, string animName); ====<br />
<br />
:Plays the given idle animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''inAnimState'''(float channel, string stateFunc); ====<br />
<br />
:Returns true if the given animation state script function is currently used for the given channel.<br />
<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent string '''lookupReplacementAnim'''(string anim); ====<br />
<br />
:Returns the current replacement animation for "anim". Returns empty if no replacement anim <br />
<br />
==== scriptEvent void '''meleeActionFinished'''(); ====<br />
<br />
:Called when the animation for the melee action has finished.<br />
<br />
==== scriptEvent void '''meleeActionHeld'''(); ====<br />
<br />
:Called when the melee action reaches the "hold" point.<br />
<br />
==== scriptEvent void '''meleeActionReleased'''(); ====<br />
<br />
:Called when the melee action is released from the hold point.<br />
<br />
==== scriptEvent void '''meleeAttackStarted'''(float attType); ====<br />
<br />
:Registers the start of a given melee attack Intended to be called from a script that also starts the animation<br />
<br />
==== scriptEvent float '''meleeBestParry'''(); ====<br />
<br />
:Returns the melee type integer of the best parry given the enemy attacks at the time If no attacking enemy is found, returns default of MELEETYPE_RL Follows MELEETYPE_* enum defined in tdm_defs.script<br />
<br />
==== scriptEvent string '''meleeNameForNum'''(float num); ====<br />
<br />
:Converts a melee type integer to a string name suffix Used for finding the right animation for a given type, etc. Possible names are, in order: "Over, LR, RL, Thrust, General" Where general blocks all attacks types except unblockable<br />
<br />
==== scriptEvent void '''meleeParryStarted'''(float parType); ====<br />
<br />
:Registers the start of a given melee parry Intended to be called from a script that also starts the animation<br />
<br />
==== scriptEvent entity '''nextEnemy'''(entity lastEnemy); ====<br />
<br />
:Returns the next enemy the actor has acquired.<br />
<br />
==== scriptEvent void '''overrideAnim'''(float channel); ====<br />
<br />
:Disables the animation currently playing on the given channel and syncs the animation with the animation of the nearest animating channel.<br />
<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''preventPain'''(float duration); ====<br />
<br />
:Prevents any pain animation from being played for the given time in seconds.<br />
::''duration'': time in seconds<br />
<br />
==== scriptEvent void '''reAttachToCoords'''(string attName, string joint, vector offset, vector angles); ====<br />
<br />
:Reattach an existing attachment<br />
::''attName'': the name of the attachment we want to reattach. <br />
::''joint'': the name of the joint to attach to<br />
::''offset'': the translation offset from joint<br />
::''angles'': a (pitch, yaw, roll) angle vector that defines the rotation of the attachment relative to the joint's orientation<br />
<br />
==== scriptEvent void '''reAttachToPos'''(string attName, string position); ====<br />
<br />
:Reattach an existing attachment to a named attachment position. Example: reAttachToPos( melee_weapon, right_hand_held )<br />
::''attName'': the name of the attachment we want to reattach.<br />
::''position'': the new position we want to attach it to.<br />
<br />
==== scriptEvent void '''reloadTorchReplacementAnims'''(); ====<br />
<br />
:If actor has a torch, reload the torch's replacement anims.<br />
<br />
==== scriptEvent void '''removeReplacementAnim'''(string anim); ====<br />
<br />
:Removes the replacement for the given "anim"<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''setAnimPrefix'''(string prefix); ====<br />
<br />
:Sets a string which is placed in front of any animation names.<br />
<br />
==== scriptEvent float '''setAnimRate'''(float channel, string animName, float animRate); ====<br />
<br />
:Sets the animation rate to the given value. Returns 1 if successful, otherwise -1<br />
::''animName'': The name of the animation.<br />
::''animRate'': The rate to set the animation to.<br />
<br />
==== scriptEvent void '''setAttackFlag'''(float combatType, float enabled); ====<br />
<br />
:Activate or deactivate the given attack flag<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent void '''setNextState'''(string stateFunc); ====<br />
<br />
:Sets the next state and waits until thread exits, or a frame delay before calling it. Handy for setting the state in the constructor.<br />
<br />
==== scriptEvent void '''setReplacementAnim'''(string animToReplace, string replacement); ====<br />
<br />
:Replaces the animation "animToReplace" with "replacement"<br />
<br />
==== scriptEvent void '''setState'''(string stateFunc); ====<br />
<br />
:Sets the next state and goes to it immediately<br />
<br />
==== scriptEvent void '''setSyncedAnimWeight'''(float channel, float animindex, float weight); ====<br />
<br />
:Sets the blend amount on multi-point anims.<br />
<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''stopAnim'''(float channel, float frames); ====<br />
<br />
:Stops the animation currently playing on the given channel over the given number of frames.<br />
<br />
==== scriptEvent void '''syncAnimChannels'''(float fromChannel, float toChannel, float blendFrames); ====<br />
<br />
:Synchronises the channels<br />
<br />
=== idAFEntity_Base ===<br />
==== scriptEvent vector '''getAngularVelocityB'''(float id); ====<br />
<br />
:Get the angular velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
==== scriptEvent vector '''getLinearVelocityB'''(float id); ====<br />
<br />
:Get the linear velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
==== scriptEvent float '''getNumBodies'''(); ====<br />
<br />
:Returns the number of bodies in the AF. If the AF physics pointer is NULL, it returns 0.<br />
<br />
==== scriptEvent void '''restoreAddedEnts'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setAngularVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the angular velocity of a particular body<br />
<br />
==== scriptEvent void '''SetConstraintPosition'''(string constraintName, vector position); ====<br />
<br />
:Moves the constraint with the given name that binds this entity to another entity.<br />
<br />
==== scriptEvent void '''setLinearVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the linear velocity of a particular body<br />
<br />
=== idAFEntity_Gibbable ===<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
=== idAFEntity_Generic ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idAFEntity_WithAttachedHead ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CAIVehicle ===<br />
==== scriptEvent void '''clearController'''(); ====<br />
<br />
:Need separate clearController because scripting doesn't like passing in $null_entity? (greebo: one could remove this function and set the argument type of setController to 'E'.<br />
<br />
==== scriptEvent void '''frobRidable'''(entity playerController); ====<br />
<br />
:Called when a player directly mounts or dismounts a ridable AI.<br />
<br />
==== scriptEvent string '''getMoveAnim'''(); ====<br />
<br />
:Returns the name of the player-requested movement anim for a player controlled AI vehicle<br />
<br />
==== scriptEvent void '''setController'''(entity playerController); ====<br />
<br />
:Let a player assume movement control of an AI vehicle (may be remote control as in a player on a coach pulled by a horse)<br />
<br />
=== idCombatNode ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''markUsed'''(); ====<br />
<br />
:Disables the combat node if "use_once" is set on the entity.<br />
<br />
=== idAI ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''alert'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent void '''alertAI'''(string type, float amount, entity actor); ====<br />
<br />
:internal<br />
::''type'': alert type<br />
::''amount'': alert amount<br />
::''actor'': actor causing alert<br />
<br />
==== scriptEvent void '''allowDamage'''(); ====<br />
<br />
:The AI can take damage again.<br />
<br />
==== scriptEvent void '''allowHiddenMovement'''(float enable); ====<br />
<br />
:Normally, when hidden, monsters do not run physics. This enables physics when hidden.<br />
<br />
==== scriptEvent void '''allowMovement'''(float allow); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''animTurn'''(float angle); ====<br />
<br />
:Enable/disable animation controlled turning.<br />
::''angle'': Pass in the maximum # of degrees the animation turns. Use an amount of 0 to disable.<br />
<br />
==== scriptEvent void '''attackBegin'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''attackEnd'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''attackMelee'''(string damageDef); ====<br />
<br />
:Returns true if the attack hit<br />
<br />
==== scriptEvent entity '''attackMissile'''(string jointName); ====<br />
<br />
:returns projectile fired<br />
<br />
==== scriptEvent void '''bark'''(string sound); ====<br />
<br />
:Let the AI bark a certain sound.<br />
::''sound'': sound name, e.g. 'snd_warn_response'<br />
<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
==== scriptEvent float '''becomeRagdoll'''(); ====<br />
<br />
:enables the ragdoll if the entity has one<br />
<br />
==== scriptEvent void '''becomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''burn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canBecomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemyFromAnim'''(string anim); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemyFromJoint'''(string jointname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canReachEnemy'''(); ====<br />
<br />
:Returns true if character can walk to enemy's position. For walking monsters, enemy should be near the floor.<br />
<br />
==== scriptEvent float '''canReachEntity'''(entity ent); ====<br />
<br />
:Returns true if character can walk to entity's position. For walking monsters, entity should be near the floor.<br />
<br />
==== scriptEvent float '''canReachPosition'''(vector pos); ====<br />
<br />
:Returns true if character can walk to specified position. For walking monsters, position should be near the floor.<br />
<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canSeeExt'''(entity ent, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSee that can optionally choose to use field of vision and lighting calculations.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If b_useLighting is 0 the entity will be visible in complete darkness. If it is 1, the entity will only be visible if there is light shining on it, but the slightest light is enought. Use "isEntityHidden" as a script event with a threshold instead.<br />
<br />
==== scriptEvent float '''canSeePositionExt'''(vector position, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSeeExt that tests a location rather than an entity. Note that any actor at the position may make it not seeable from a distance.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If 0 the entity will be visible in complete darkness<br />
<br />
==== scriptEvent void '''chargeAttack'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''clearBurn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''clearEnemy'''(); ====<br />
<br />
:Clears the enemy entity<br />
<br />
==== scriptEvent void '''clearFlyOffset'''(); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at to the value set in the def file.<br />
<br />
==== scriptEvent entity '''closestReachableEnemy'''(); ====<br />
<br />
:Used for determining tactile alert targets<br />
<br />
==== scriptEvent entity '''closestReachableEnemyOfEntity'''(entity team_mate); ====<br />
<br />
:Finds another character's closest reachable enemy<br />
<br />
==== scriptEvent entity '''createMissile'''(string jointname); ====<br />
<br />
:returns projectile created<br />
<br />
==== scriptEvent entity '''createMissileFromDef'''(string defName, string jointName); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''directDamage'''(entity damageTarget, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableClip'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableGravity'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''dropTorch'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''emptyHand'''(string hand); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableClip'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableGravity'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''endState'''(); ====<br />
<br />
:Ends the current state with the given name, returns TRUE if more than one state is remaining.<br />
<br />
==== scriptEvent float '''enemyInCombatCone'''(entity combatNode, float use_current_enemy_location); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyPositionValid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyRange'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyRange2D'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''entityInAttackCone'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''faceEnemy'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''faceEntity'''(entity ent); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''facingIdeal'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''findActorsInBounds'''(vector mins, vector maxs); ====<br />
<br />
:Returns an entity within the bounds specified<br />
<br />
==== scriptEvent entity '''findEnemy'''(float onlyInFov); ====<br />
<br />
:Finds enemy player in PVS<br />
<br />
==== scriptEvent entity '''findEnemyAI'''(float onlyInFov); ====<br />
<br />
:Finds enemy monster in PVS<br />
<br />
==== scriptEvent entity '''findEnemyInCombatNodes'''(); ====<br />
<br />
:Finds enemy player in attack cones<br />
<br />
==== scriptEvent entity '''findFriendlyAI'''(float team); ====<br />
<br />
:Use this to find a visible AI friendly to ourselves. It basically iterates over all active entities in the map and looks for friendly actors. The pythagorean distance is taken to evaluate the distance. Don't call this every frame, this might get expensive in larger maps. Returns the nearest visible actor entity or the $null_entity, if none was found.<br />
::''team'': used to constrain the search to a given team. Set this to -1 to let the code ignore this argument<br />
<br />
==== scriptEvent entity '''fireMissileAtTarget'''(string jointname, string targetname); ====<br />
<br />
:Launches a missile at entity specified by 'attack_target'. returns projectile fired<br />
<br />
==== scriptEvent void '''flee'''(entity entToFleeFrom); ====<br />
<br />
:Flee from the given entity.<br />
<br />
==== scriptEvent void '''fleeFromPoint'''(vector pos); ====<br />
<br />
:Flee from the given position.<br />
<br />
==== scriptEvent void '''foundBody'''(entity body); ====<br />
<br />
:Objective callback for when an AI finds a body.<br />
<br />
==== scriptEvent void '''Gas_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': the entity causing the knockout, can be the $null_entity<br />
<br />
==== scriptEvent float '''getAcuity'''(string type); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent entity '''getAlertActor'''(); ====<br />
<br />
:Get the actor that alerted the AI in this frame.<br />
<br />
==== scriptEvent float '''getAlertLevelOfOtherAI'''(entity otherEntity); ====<br />
<br />
:This event gets the alert number of another AI (AI_AlertLevel variable value) Returns the alert number of the other AI, 0.0 if its not an AI or is NULL<br />
::''otherEntity'': the other AI entity who's alert number is being queried<br />
<br />
==== scriptEvent entity '''getAttacker'''(); ====<br />
<br />
:Returns the attacking entity<br />
<br />
==== scriptEvent float '''getAudThresh'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getClosestHiddenTarget'''(string entity_type); ====<br />
<br />
:Finds the closest targeted entity of the specified type.<br />
<br />
==== scriptEvent entity '''getCombatNode'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getCurrentYaw'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getEnemyEyePos'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getEnemyPos'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getJumpVelocity'''(vector pos, float speed, float max_jump_height); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getMoveType'''(); ====<br />
<br />
:Returns the current movetype<br />
<br />
==== scriptEvent string '''getNextIdleAnim'''(); ====<br />
<br />
:This returns the name of the next idle anim to be played on this AI (used by AnimState scripts).<br />
<br />
==== scriptEvent vector '''getObservationPosition'''(vector targetPoint, float visualAcuityZeroToOne); ====<br />
<br />
:This event is used to get a position that the AI can move to observe a given position. It is useful for looking at hiding spots that can't be reached, and performing other investigation functions. Returns a world position from which the observation can take place. Returns the current AI origin if no such point is found. @sideEffect This uses the AI_DEST_UNREACHABLE flag variable to indicate if a point was found. It will be true if none was found, false if one was found.<br />
::''targetPoint'': the world position to be observed<br />
::''visualAcuityZeroToOne'': the visual acuity of the AI on a scale of 0.0 to 1.0 where 0.0 is blind and 1.0 is perfect vision.<br />
<br />
==== scriptEvent entity '''getObstacle'''(); ====<br />
<br />
:Gets the obstacle in the character's path<br />
<br />
==== scriptEvent entity '''getRandomTarget'''(string entity_type); ====<br />
<br />
:Finds a random targeted entity of the specified type.<br />
<br />
==== scriptEvent vector '''getReachableEntityPosition'''(entity ent); ====<br />
<br />
:Returns the position of the entity within the AAS if possible, otherwise just the entity position.<br />
<br />
==== scriptEvent float '''getRelationEnt'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getSndDir'''(); ====<br />
<br />
:ai hearing of sound <br />
<br />
==== scriptEvent entity '''getTactEnt'''(); ====<br />
<br />
:ai sense of touch<br />
<br />
==== scriptEvent entity '''getTalkTarget'''(); ====<br />
<br />
:Returns the entity (player) trying to talk to the character<br />
<br />
==== scriptEvent float '''getTurnDelta'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getTurnRate'''(); ====<br />
<br />
:Gets the rate the character turns.<br />
<br />
==== scriptEvent vector '''getVectorToIdealOrigin'''(); ====<br />
<br />
:Returns the vector from where the AI is to where he ideally should be<br />
<br />
==== scriptEvent vector '''getVisDir'''(); ====<br />
<br />
:Returns position of the last visual alert.<br />
<br />
==== scriptEvent float '''hasSeenEvidence'''(); ====<br />
<br />
:This returns 1 when the AI has seen evidence of intruders before (an enemy, a body...)<br />
<br />
==== scriptEvent void '''ignoreDamage'''(); ====<br />
<br />
:The AI can no longer take damage.<br />
<br />
==== scriptEvent float '''isEntityHidden'''(entity ent, float f_sightThreshold); ====<br />
<br />
:This is an alternate version of canSee, using FOV, distance and lighting.<br />
::''f_sightThreshold'': goes from 0.0 (entity visible in complete darkness) to 1.0 (entity only visible if completely lit up).<br />
<br />
==== scriptEvent float '''isPlayerResponsibleForDeath'''(); ====<br />
<br />
:Returns true if the player was responsible for the AI's caller's death.<br />
<br />
==== scriptEvent void '''kickObstacles'''(entity kickEnt, float force); ====<br />
<br />
:Kicks any obstacle in the character's path.<br />
::''kickEnt'': pass in $null_entity if you don't have a specific entity to kick<br />
<br />
==== scriptEvent void '''kill'''(); ====<br />
<br />
:Kills the monster.<br />
<br />
==== scriptEvent void '''KO_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': is the entity causing the knockout, can be the $null_entity<br />
<br />
==== scriptEvent entity '''launchMissile'''(vector origin, vector angles); ====<br />
<br />
:Returns the projectile entity<br />
<br />
==== scriptEvent void '''locateEnemy'''(); ====<br />
<br />
:Updates the last known position of the enemy independent from whether or not the enemy is visible.<br />
<br />
==== scriptEvent void '''lookAt'''(entity focusEntity, float duration); ====<br />
<br />
:Aims the character's eyes and head toward an entity for a period of time.<br />
<br />
==== scriptEvent void '''lookAtAngles'''(float yawAngleClockwise, float pitchAngleUp, float rollAngle, float durationInSeconds); ====<br />
<br />
:A look at event that just looks at a set of angles relative to the current body facing of the AI. This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but it looks at the specified angles from the current body facing of the AI.<br />
::''yawAngleClockwise'': Negative angles are to the left of the AIs body and positive angles are to the right.<br />
::''pitchAngleUp'': Negative values are down and positive values are up where down and up are defined by the body axis.<br />
::''rollAngle'': This is currently unused and does nothing.<br />
::''durationInSeconds'': The duration to look in seconds.<br />
<br />
==== scriptEvent void '''lookAtEnemy'''(float duration); ====<br />
<br />
:Aims the character's eyes and head toward the current enemy for a period of time.<br />
<br />
==== scriptEvent void '''lookAtPosition'''(vector lookAtWorldPosition, float durationInSeconds); ====<br />
<br />
:This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but instead of looking at an entity, it looks at a position in worldspace. That is, it turns the head of the AI to look at the position.<br />
::''lookAtWorldPosition'': position in space to look at<br />
::''durationInSeconds'': duration to look in seconds<br />
<br />
==== scriptEvent float '''meleeAttackToJoint'''(string joint, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveOutOfRange'''(entity ent, float range); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''moveStatus'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToAttackPosition'''(entity ent, string attack_anim); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''moveToCover'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToCoverFrom'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEnemyHeight'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEntity'''(entity destination); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''moveToPosition'''(vector position); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''muzzleFlash'''(string jointname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''numSmokeEmitters'''(); ====<br />
<br />
:Returns the # of emitters defined by 'smokeParticleSystem' in the entitydef<br />
<br />
==== scriptEvent void '''performRelight'''(); ====<br />
<br />
:Deal with doused lights.<br />
<br />
==== scriptEvent float '''playAndLipSync'''(string soundName, string animName); ====<br />
<br />
:Play the given sound, using the given lipsync animation. The lipsync animation should just be a simple non-loopable animation of the mouth opening in a linear fashion. The code will select individual frames from this to construct a simple lipsyncing effect which is in time with the sound. Returns the length of the played sound in seconds.<br />
<br />
==== scriptEvent float '''playCustomAnim'''(string animName); ====<br />
<br />
:Plays the given animation on legs and torso. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''preBurn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''predictEnemyPos'''(float time); ====<br />
<br />
:Tries to predict the player's movement based on the AAS and his direction of movement.<br />
<br />
==== scriptEvent void '''processBlindStim'''(entity stimSource, float skipVisibilityCheck); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''processVisualStim'''(entity stimSource); ====<br />
<br />
:Use this call to let the AI react to a visual stim (coming from the source entity).<br />
<br />
==== scriptEvent vector '''pushPointIntoAAS'''(vector post); ====<br />
<br />
:Tries to push the point into a valid AAS area<br />
<br />
==== scriptEvent void '''pushState'''(string stateName); ====<br />
<br />
:Pushes the state with the given name, current one is postponed.<br />
<br />
==== scriptEvent void '''radiusDamageFromJoint'''(string jointname, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''restartPatrol'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''restoreMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''saveMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''setAcuity'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent void '''setAlertGracePeriod'''(float frac, float duration, float count); ====<br />
<br />
:This starts the alert grace period for an AI. Should be called in the same frame as the alert that pushes them into a higher state.<br />
::''frac'': the fraction of the alert below which they should ignore alerts during the grace period.<br />
::''duration'': the duration of the period in seconds<br />
::''count'': the number of alerts ignored above which the grace period is invalid<br />
<br />
==== scriptEvent void '''setAlertLevel'''(float newLevel); ====<br />
<br />
:Set the alert level (AI_AlertLevel). This should always be called instead of setting AI_AlertLevel directly.<br />
<br />
==== scriptEvent void '''setAudThresh'''(float val); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''setBoneMod'''(float allowBoneMod); ====<br />
<br />
:Enables or disables head looking (may be obsolete).<br />
<br />
==== scriptEvent void '''setEnemy'''(entity enemy); ====<br />
<br />
:Make the given entity an enemy.<br />
<br />
==== scriptEvent void '''setFlyOffset'''(float offset); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at.<br />
<br />
==== scriptEvent void '''setFlySpeed'''(float speed); ====<br />
<br />
:Set the speed flying creatures move at. Also sets speed for moveTypeSlide.<br />
<br />
==== scriptEvent void '''setMoveType'''(float movetype); ====<br />
<br />
:Set the current movetype. movetypes are defined in tdm_ai.script<br />
<br />
==== scriptEvent void '''setSmokeVisibility'''(float particle_num, float on); ====<br />
<br />
:enables/disables smoke particles on bones. pass in the particle #, or ALL_PARTICLES for turning on/off all particle systems. particles are spawned in the order they appear in the entityDef<br />
<br />
==== scriptEvent void '''setTalkState'''(float state); ====<br />
<br />
:Sets whether the player can talk to this character or not.<br />
<br />
==== scriptEvent void '''setTalkTarget'''(entity target); ====<br />
<br />
:Sets the entity (player) trying to talk to the character<br />
<br />
==== scriptEvent void '''setTurnRate'''(float rate); ====<br />
<br />
:Set the rate the character turns at<br />
<br />
==== scriptEvent void '''shrivel'''(float time); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''slideTo'''(vector position, float time); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''spawnThrowableProjectile'''(string projectileName, string jointName); ====<br />
<br />
:This method spawns a projectile of the type named by the caller and attaches it to the joint given by the caller. The projectile becomes the AI's firable projectile. Returns a pointer to a projectile entity that can be thrown by the AI. You can use AI_LaunchMissle (e* = launchMissle(v,v) ) to throw the stone.<br />
::''projectileName'': The name of the projectile to spawn (as seen in a .def file) Must be descended from idProjectile<br />
::''jointName'': The name of the joint on the model to which the particle should be attached for throwing. If this is NULL or the empty string, then it is attached to the model center.<br />
<br />
==== scriptEvent void '''stopMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''stopPatrol'''(); ====<br />
<br />
:Stops an AI from patrolling<br />
<br />
==== scriptEvent void '''stopRagdoll'''(); ====<br />
<br />
:turns off the ragdoll<br />
<br />
==== scriptEvent void '''stopThinking'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''switchState'''(string stateName); ====<br />
<br />
:Switches to the state with the given name, current one is ended.<br />
<br />
==== scriptEvent float '''testAnimAttack'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testAnimMove'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testAnimMoveTowardEnemy'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testChargeAttack'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testMeleeAttack'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testMoveToPosition'''(vector position); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''throwAF'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''throwMoveable'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''travelDistanceBetweenEntities'''(entity source, entity dest); ====<br />
<br />
:Approximate travel distance between two entities.<br />
<br />
==== scriptEvent float '''travelDistanceBetweenPoints'''(vector source, vector dest); ====<br />
<br />
:Approximate travel distance between two points.<br />
<br />
==== scriptEvent float '''travelDistanceToEntity'''(entity destination); ====<br />
<br />
:Approximate travel distance to entity.<br />
<br />
==== scriptEvent float '''travelDistanceToPoint'''(vector destination); ====<br />
<br />
:Approximate travel distance to point.<br />
<br />
==== scriptEvent void '''triggerParticles'''(string jointName); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnTo'''(float yaw); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnToEntity'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnToPos'''(vector pos); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''visScan'''(); ====<br />
<br />
:Checks for enemies or player in the AI's FOV, using light level and distance. For now the check is only done on the player. Returns a reference to the sighted actor.<br />
<br />
==== scriptEvent void '''waitAction'''(string name); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''waitMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''wakeOnFlashlight'''(float enable); ====<br />
<br />
:Tells the monster to activate when flashlight shines on them.<br />
<br />
==== scriptEvent void '''wander'''(); ====<br />
<br />
:no description<br />
<br />
=== idTestModel ===<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
=== CBinaryFrobMover ===<br />
==== scriptEvent void '''Close'''(); ====<br />
<br />
:Closes the frobmover, regardless of its previous state. Mover must be open, otherwise nothing happens.<br />
<br />
==== scriptEvent float '''GetFractionalPosition'''(); ====<br />
<br />
:Returns a fraction between 0.00 (closed) and 1.00 (open).<br />
<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
==== scriptEvent float '''IsOpen'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is open, which is basically the same as "not closed". A mover is considered closed when it is at its close position.<br />
<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
==== scriptEvent void '''ToggleOpen'''(); ====<br />
<br />
:Toggles the mover state. Closes when fully open, opens when fully closed. If the mover is "interrupted" (e.g. when the player frobbed the mover in between), the move direction depends on the state of the internal "intent_open" flag. <br />
<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
=== idBrittleFracture ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''dampenSound'''(float dampen); ====<br />
<br />
:Toggle whether the shattering sound is dampened on the window, e.g., when covered by moss.<br />
::''dampen'': 1 = dampened, 0 = not dampened<br />
<br />
=== idCameraView ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idCameraAnim ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''start'''(); ====<br />
<br />
:Starts a spline or anim camera moving.<br />
<br />
==== scriptEvent void '''stop'''(); ====<br />
<br />
:Stops a spline or anim camera moving.<br />
<br />
=== idFuncEmitter ===<br />
==== scriptEvent void '''emitterAddModel'''(string modelName, vector modelOffset); ====<br />
<br />
:Adds a new particle (or regular, if you wish) model to the emitter, located at modelOffset units away from the emitter's origin.<br />
<br />
==== scriptEvent float '''emitterGetNumModels'''(); ====<br />
<br />
:Returns the number of models/particles this emitter has. Always >= 1.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Switches the emitter off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Switches the emitter on.<br />
<br />
=== idEntity ===<br />
==== scriptEvent void '''activateContacts'''(); ====<br />
<br />
:Activate objects sitting on this object.<br />
<br />
==== scriptEvent void '''activateTargets'''(entity activator); ====<br />
<br />
:Causes this entity to activate all it's targets. Similar to how a trigger activates entities.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''addFrobPeer'''(entity peer); ====<br />
<br />
:Adds the passed entity as a frob peer.<br />
<br />
==== scriptEvent void '''addInvItem'''(entity inv_item); ====<br />
<br />
:Adds the given item to the inventory. Depending on the type the passed entity will be removed from the game (as for loot items) or hidden.<br />
<br />
==== scriptEvent void '''addItemToInv'''(entity target); ====<br />
<br />
:Adds the entity to the given entity's inventory. Depending on the type the entity will be removed from the game (as for loot items) or hidden. Example: $book->addItemToInv($player1);<br />
<br />
==== scriptEvent void '''addTarget'''(entity target); ====<br />
<br />
:Add a target to this entity.<br />
::''target'': the entity to add as target<br />
<br />
==== scriptEvent void '''applyImpulse'''(entity source, float bodyid, vector point, vector impulse); ====<br />
<br />
:Applies an impulse to the entity. Example: entity.applyImpulse($player1, 0, entity.getOrigin(), '0 0 2');<br />
::''source'': Pass $null_entity or the entity that applies the impulse<br />
::''bodyid'': For articulated figures, ID of the body, 0 for the first (main) body. Otherwise use 0.<br />
::''point'': Point on the body where the impulse is applied to<br />
::''impulse'': Vector of the impulse<br />
<br />
==== scriptEvent void '''bind'''(entity master); ====<br />
<br />
:Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
==== scriptEvent void '''bindPosition'''(entity master); ====<br />
<br />
:Fixes this entity's position (but not orientation) relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
==== scriptEvent void '''bindToBody'''(entity master, float bodyID, float orientated); ====<br />
<br />
:Bind to AF body<br />
::''master'': entity to bind to<br />
::''bodyID'': AF body ID to bind to<br />
::''orientated'': binds the orientation as well as position, if set to 1<br />
<br />
==== scriptEvent void '''bindToJoint'''(entity master, string boneName, float rotateWithMaster); ====<br />
<br />
:Fixes this entity's position and orientation relative to a bone on another entity, such that when the master's bone moves, so does this entity.<br />
::''master'': the entity to bind to<br />
::''boneName'': the bone name<br />
::''rotateWithMaster'': -<br />
<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
==== scriptEvent void '''callFunction'''(string functionName); ====<br />
<br />
:Calls a function on an entity's script object. See also callGlobalFunction().<br />
<br />
==== scriptEvent void '''callGlobalFunction'''(string functionName, entity other); ====<br />
<br />
:calls a global function and passes the other entity along as the first argument calls the function in a new thread, so it continues executing in the current thread right away (unlike entity.callFunction( "blah"))<br />
<br />
==== scriptEvent void '''callGui'''(float handle, string namedEvent); ====<br />
<br />
:Calls a named event in a GUI.<br />
<br />
==== scriptEvent float '''canBeUsedBy'''(entity ent); ====<br />
<br />
:Returns true if the entity can be used by the argument entity<br />
<br />
==== scriptEvent float '''canSeeEntity'''(entity target, float useLighting); ====<br />
<br />
:This is a general version of idAI::canSee, that can be used by all entities. It doesn't regard FOV, it just performs a trace to check whether the target is occluded by world geometry. Is probably useful for stim/response as well Pass useLighting = true to take the lighting of the target entity into account. Use "isEntityHidden" as a script event with a threshold. The constant threshold value for useLighting is defined within the SDK in game/entity.h.<br />
<br />
==== scriptEvent void '''changeEntityRelation'''(entity ent, float relationChange); ====<br />
<br />
:This changes the current relation to an entity by adding the new amount.<br />
<br />
==== scriptEvent void '''changeInvIcon'''(string name, string category, string icon); ====<br />
<br />
:Sets the inventory icon of the given item in the given category to <icon>.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent void '''changeInvItemCount'''(string name, string category, float amount); ====<br />
<br />
:Decreases the inventory item stack count by amount. The item is addressed using the name and category of the item. These are usually defined on the inventory item entity ("inv_name", "inv_category") Amount can be both negative and positive.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent void '''changeInvLightgemModifier'''(string name, string category, float amount); ====<br />
<br />
:Sets the lightgem modifier value of the given item. Valid arguments are between 0 and 32 (which is the maximum lightgem value).<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent float '''changeLootAmount'''(float type, float amount); ====<br />
<br />
:Changes the loot amount of the given Type (e.g. GOODS) by <amount>. The mission statisic for loot found gets changed too. The new value of the changed type is returned (e.g. the new GOODS value if this has been changed). Note: The LOOT_TOTAL type can't be changed and 0 is returned.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY<br />
::''amount'': can be negative<br />
<br />
==== scriptEvent void '''checkAbsence'''(); ====<br />
<br />
:description missing<br />
<br />
==== scriptEvent void '''copyBind'''(entity other); ====<br />
<br />
:copy bind information of other to this entity (i.e., bind this entity to the same entity that other is bound to)<br />
<br />
==== scriptEvent float '''createOverlay'''(string guiFile, float layer); ====<br />
<br />
:Creates a GUI overlay. (must be used on the player)<br />
<br />
==== scriptEvent void '''CreateTimer'''(float stimId, float hour, float minutes, float seconds, float milliseconds); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''damage'''(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale); ====<br />
<br />
:Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).<br />
::''inflictor'': the entity causing the damage (maybe a projectile)<br />
::''attacker'': the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)<br />
::''dir'': the direction the attack is coming from.<br />
::''damageDefName'': the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")<br />
::''damageScale'': the scale of the damage (pass 1.0 as default, this should be ok).<br />
<br />
==== scriptEvent void '''destroyOverlay'''(float handle); ====<br />
<br />
:Destroys a GUI overlay. (must be used on the player)<br />
<br />
==== scriptEvent float '''distanceTo'''(entity other); ====<br />
<br />
:Returns the distance of this entity to another entity.<br />
<br />
==== scriptEvent float '''distanceToPoint'''(vector point); ====<br />
<br />
:Returns the distance of this entity to a point.<br />
<br />
==== scriptEvent void '''extinguishLights'''(); ====<br />
<br />
:Extinguishes all lights (i.e. the <self> entity plus all bound lights)<br />
<br />
==== scriptEvent void '''fadeSound'''(float channel, float newLevel, float fadeTime); ====<br />
<br />
:Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds.<br />
<br />
==== scriptEvent float '''frob'''(); ====<br />
<br />
:Frobs the entity (i.e. simulates a frob action performed by the player). Returns TRUE if the entity is frobable, FALSE otherwise.<br />
<br />
==== scriptEvent void '''frobHilight'''(float state); ====<br />
<br />
:ishtvan: Tries to make the entity frobhilight or not<br />
<br />
==== scriptEvent vector '''getAngles'''(); ====<br />
<br />
:Returns the current orientation of this entity (relative to bind parent if any).<br />
<br />
==== scriptEvent vector '''getAngularVelocity'''(); ====<br />
<br />
:Gets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
==== scriptEvent entity '''getBindChild'''(float ind); ====<br />
<br />
:Returns the ind_th bind child of this entity or NULL if index is invalid. NOTE: indices start at zero<br />
::''ind'': child index<br />
<br />
==== scriptEvent entity '''getBindMaster'''(); ====<br />
<br />
:Returns the entity's bindmaster<br />
<br />
==== scriptEvent float '''getBoolKey'''(string key); ====<br />
<br />
:Retrieves the boolean value of a specific spawn arg, defaulting to false.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent float '''getClipMask'''(); ====<br />
<br />
:Returns the clipmask of the physics object.<br />
<br />
==== scriptEvent vector '''getColor'''(); ====<br />
<br />
:Gets the color of this entity (shader parms Parm0, Parm1, Parm2).<br />
<br />
==== scriptEvent float '''getContents'''(); ====<br />
<br />
:Returns the contents of the physics object.<br />
<br />
==== scriptEvent string '''getCurInvCategory'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory category.<br />
<br />
==== scriptEvent string '''getCurInvIcon'''(); ====<br />
<br />
:Returns the icon of the currently highlighted inventory item.<br />
<br />
==== scriptEvent float '''getCurInvItemCount'''(); ====<br />
<br />
:Returns the item count of the currently highlighted inventory Item, if stackable.Returns - 1 if non - stackable<br />
<br />
==== scriptEvent entity '''getCurInvItemEntity'''(); ====<br />
<br />
:Returns the currently highlighted inventory item entity.<br />
<br />
==== scriptEvent string '''getCurInvItemId'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_item_id"). Most items will return an empty string, unless the "inv_item_id" is set on purpose.<br />
<br />
==== scriptEvent string '''getCurInvItemName'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_name").<br />
<br />
==== scriptEvent float '''getEntityFlag'''(string flagName); ====<br />
<br />
:Returns the value of the specified entity flag.<br />
::''flagName'': Can be one of (case insensitive): notarget: if true never attack or target this entity noknockback: if true no knockback from hits takedamage: if true this entity can be damaged hidden: if true this entity is not visible bindOrientated: if true both the master orientation is used for binding solidForTeam: if true this entity is considered solid when a physics team mate pushes entities forcePhysicsUpdate: if true always update from the physics whether the object moved or not selected: if true the entity is selected for editing neverDormant: if true the entity never goes dormant isDormant: if true the entity is dormant hasAwakened: before a monster has been awakened the first time, use full PVS for dormant instead of area-connected invisible: if true this entity cannot be seen inaudible: if true this entity cannot be heard <br />
<br />
==== scriptEvent entity '''getEntityKey'''(string key); ====<br />
<br />
:Retrieves the entity specified by the spawn arg.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent float '''getFloatKey'''(string key); ====<br />
<br />
:Retrieves the floating point value of a specific spawn arg, defaulting to 0.0f.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent string '''getGui'''(float handle); ====<br />
<br />
:Returns the file currently loaded by a GUI.<br />
<br />
==== scriptEvent float '''getGuiFloat'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent float '''getGuiInt'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent string '''getGuiString'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent float '''getHealth'''(); ====<br />
<br />
:Returns the current health.<br />
<br />
==== scriptEvent float '''getIntKey'''(string key); ====<br />
<br />
:Retrieves the integer value of a specific spawn arg, defaulting to 0.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent string '''getKey'''(string key); ====<br />
<br />
:Retrieves the value of a specific spawn arg, defaulting to ''.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent vector '''getLightInPVS'''(float falloff, float scaling); ====<br />
<br />
:Computes the sum of all light in the PVS of the entity you call this on, and returns a vector with the sum.<br />
::''falloff'': 0: no falloff with distance 0.5: sqrt(linear) falloff (dist 100 => 1/10) 1: linear falloff (dist 100 => 1/100) 2: square falloff (dist 100 => 1/10000) <br />
::''scaling'': factor to scale the distance, can be used to lower/raise distance factor after the linear or square scaling has been used good looking values are approx: sqrt(linear): 0.01, linear: 0.1, square 1.0<br />
<br />
==== scriptEvent vector '''getLinearVelocity'''(); ====<br />
<br />
:Gets the current linear velocity of this entity. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
==== scriptEvent entity '''getLocation'''(); ====<br />
<br />
:Returns the idLocation entity corresponding to the entity's current location. This was player-specific before, but is now available to all entities.<br />
<br />
==== scriptEvent float '''getLootAmount'''(float type); ====<br />
<br />
:Returns the amount of loot for the given type (e.g. LOOT_GOODS). Pass LOOT_TOTAL to return the sum of all loot types.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY, LOOT_TOTAL<br />
<br />
==== scriptEvent float '''getMass'''(float body); ====<br />
<br />
:Gets mass of a body for an entity<br />
<br />
==== scriptEvent vector '''getMaxs'''(); ====<br />
<br />
:Gets the maximum corner of this entity's bounding box.<br />
<br />
==== scriptEvent vector '''getMins'''(); ====<br />
<br />
:Gets the minimum corner of this entity's bounding box.<br />
<br />
==== scriptEvent string '''getName'''(); ====<br />
<br />
:Returns the name of this entity.<br />
<br />
==== scriptEvent entity '''getNextInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the next inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
==== scriptEvent string '''getNextKey'''(string prefix, string lastMatch); ====<br />
<br />
:Searches for the name of a spawn arg that matches the prefix. For example, passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy", etc. The returned string is the name of the key which can then be passed into functions like getKey() to lookup the value of that spawn arg. This is useful for when you have multiple values to look up, like when you target multiple objects. To find the next matching key, pass in the previous result and the next key returned will be the first one that matches after the previous result. Pass in "" to get the first match. Passing in a non-existent key is the same as passing in "". Returns "" when no more keys match.<br />
<br />
==== scriptEvent vector '''getOrigin'''(); ====<br />
<br />
:Returns the current position of this entity (relative to bind parent if any).<br />
<br />
==== scriptEvent entity '''getPrevInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the previous inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
==== scriptEvent entity '''GetResponseEntity'''(); ====<br />
<br />
:Returns the entity which should take the response. Some entities like AI heads are not responding themselves to stims, but relay it to another entity (i.e. the bodies they're attached to).<br />
<br />
==== scriptEvent float '''getShaderParm'''(float parm); ====<br />
<br />
:Gets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
<br />
==== scriptEvent vector '''getSize'''(); ====<br />
<br />
:Gets the size of this entity's bounding box.<br />
<br />
==== scriptEvent float '''getSoundVolume'''(string soundName); ====<br />
<br />
:Get the volume of the sound to play.<br />
::''soundName'': the name of the sound<br />
<br />
==== scriptEvent entity '''getTarget'''(float num); ====<br />
<br />
:Returns the requested target entity.<br />
::''num'': The target number. Starts at 0.<br />
<br />
==== scriptEvent float '''getTeam'''(); ====<br />
<br />
:Returns the current team number.<br />
<br />
==== scriptEvent vector '''getVectorKey'''(string key); ====<br />
<br />
:Retrieves the vector value of a specific spawn arg, defaulting to '0 0 0'.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent vector '''getVinePlantLoc'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
==== scriptEvent vector '''getVinePlantNormal'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
==== scriptEvent vector '''getWorldOrigin'''(); ====<br />
<br />
:Returns the current world-space position of this entity (regardless of any bind parent).<br />
<br />
==== scriptEvent float '''hasFunction'''(string functionName); ====<br />
<br />
:checks if an entity's script object has a specific function<br />
<br />
==== scriptEvent float '''hasInvItem'''(entity item); ====<br />
<br />
:Tests whether the player has the specified item entity in his inventory.<br />
<br />
==== scriptEvent float '''heal'''(string healDefName, float healScale); ====<br />
<br />
:Heals the entity this is called on using the specified healing entityDef. Returns 1 if the entity could be healed, 0 otherwise (if the entity is already at full health, for ex.)<br />
::''healDefName'': the name of the entityDef containing the healing information (e.g. "heal_potion")<br />
::''healScale'': the scaling value to be applied to the healAmount found in the healEntityDef<br />
<br />
==== scriptEvent void '''hide'''(); ====<br />
<br />
:Makes this entity invisible.<br />
<br />
==== scriptEvent float '''inPVS'''(); ====<br />
<br />
:Returns non-zero if this entity is in PVS. For lights, it will return true when the light's bounding box is in PVS, even though the light may not actually be in PVS. (an unmoved shadowcasting light may not be visible to PVS areas its bounding box intersects with)<br />
<br />
==== scriptEvent float '''isDroppable'''(); ====<br />
<br />
:Get whether an item may be dropped from the inventory<br />
<br />
==== scriptEvent float '''isEnemy'''(entity ent); ====<br />
<br />
:Returns true if the given entity is an enemy.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isFriend'''(entity ent); ====<br />
<br />
:Returns true if the given entity is a friend.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isFrobable'''(); ====<br />
<br />
:Get whether the entity is frobable<br />
<br />
==== scriptEvent float '''isHidden'''(); ====<br />
<br />
:checks if the entity's model is invisible.<br />
<br />
==== scriptEvent float '''isHilighted'''(); ====<br />
<br />
:Returns true if entity is currently frobhilighted.<br />
<br />
==== scriptEvent float '''isInLiquid'''(); ====<br />
<br />
:Returns 1 if the entity is in or touching a liquid.<br />
<br />
==== scriptEvent float '''isLight'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''isNeutral'''(entity ent); ====<br />
<br />
:Returns true if the given entity is neutral.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isType'''(string spawnclass); ====<br />
<br />
:Returns true if this entity is of the given type.<br />
::''spawnclass'': spawn class name<br />
<br />
==== scriptEvent float '''loadExternalData'''(string declFile, string prefix); ====<br />
<br />
:Load an external xdata declaration.<br />
<br />
==== scriptEvent void '''noShadows'''(float noShadows); ====<br />
<br />
:Sets the noShadow property on the entity to true/false, turning shadowcasting on or off for this entity.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
<br />
==== scriptEvent void '''noShadowsDelayed'''(float noShadows, float delay); ====<br />
<br />
:Sets the noShadow property on the entity to true/false after delay in ms, turning shadows cast by this entity on or off.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
::''delay'': delay in ms<br />
<br />
==== scriptEvent float '''numBindChildren'''(); ====<br />
<br />
:Returns the number of bound entities lower down in the bind chain than this entity, but be sure to give it the topmost bindmaster<br />
<br />
==== scriptEvent float '''numTargets'''(); ====<br />
<br />
:Returns the number of entities this entity has targeted.<br />
<br />
==== scriptEvent void '''propagateSound'''(string soundName, float propVolMod, float msgTag); ====<br />
<br />
:Generates a propagated sound<br />
<br />
==== scriptEvent void '''propSound'''(string name); ====<br />
<br />
:Sound propagation scriptfunctions on all entities propagate a sound directly without playing an audible sound<br />
<br />
==== scriptEvent void '''propSoundMod'''(string name, float volMod); ====<br />
<br />
:propagate a sound directly with a volume modifier<br />
<br />
==== scriptEvent entity '''randomTarget'''(string ignoreName); ====<br />
<br />
:Returns a random targeted entity. Pass in an entity name to skip that entity.<br />
::''ignoreName'': the name of an entity to ignore<br />
<br />
==== scriptEvent float '''rangedThreatTo'''(entity target); ====<br />
<br />
:Could this entity threaten the given (target) entity from a distance?<br />
<br />
==== scriptEvent void '''removeBinds'''(); ====<br />
<br />
:Removes all attached entities from the game<br />
<br />
==== scriptEvent void '''removeFrobPeer'''(entity peer); ====<br />
<br />
:Removes the passed entity as a frob peer.<br />
<br />
==== scriptEvent void '''removeKey'''(string key); ====<br />
<br />
:Removes a key from an object's spawnargs, so things like getNextKey() don't retrieve it.<br />
::''key'': the spawnarg to remove<br />
<br />
==== scriptEvent void '''removeTarget'''(entity target); ====<br />
<br />
:Remove a target from this entity.<br />
::''target'': the entity to remove from the targets<br />
<br />
==== scriptEvent float '''replaceInvItem'''(entity oldItem, entity newItem); ====<br />
<br />
:Replaces the entity <oldItem> with <newItem> in the inventory, while keeping <oldItem>'s inventory position intact. Note: The position guarantee only applies if <oldItem> and newItem share the same category. If the categories are different, the position of <newItem> is likely to be different than the one of <oldItem>. Note that <oldItem> will be removed from the inventory. If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens. Returns 1 if the operation was successful, 0 otherwise.<br />
::''newItem'': can be $null_entity<br />
<br />
==== scriptEvent void '''ResetTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''reskinCollisionModel'''(); ====<br />
<br />
:For use after setSkin() on moveables and static models, if the CM needs to be refreshed to update surface properties after a skin change. CM will be regenerated from the original model file with the new skin.<br />
<br />
==== scriptEvent void '''ResponseAdd'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseAllow'''(float type, entity responder); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
==== scriptEvent void '''ResponseIgnore'''(float type, entity responder); ====<br />
<br />
:This functions must be called on the stim entity. It will add the response to the ignore list, so that subsequent stims, should not trigger the stim anymore.<br />
<br />
==== scriptEvent void '''ResponseRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseSetAction'''(float type, string action); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseTrigger'''(entity source, float stimType); ====<br />
<br />
:Fires a response on this entity, without a stim (a stand-alone response, so to say)<br />
<br />
==== scriptEvent void '''RestartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''restorePosition'''(); ====<br />
<br />
:Returns this entity to the position stored in the "origin" spawn arg. This is the position the entity was spawned in unless the "origin" key is changed. Note that there is no guarantee that the entity won't be stuck in another entity when moved, so care should be taken to make sure that isn't possible.<br />
<br />
==== scriptEvent void '''setAngles'''(vector angles); ====<br />
<br />
:Sets the current orientation of this entity (relative to bind parent if any)<br />
::''angles'': the new orientation<br />
<br />
==== scriptEvent void '''setAngularVelocity'''(vector velocity); ====<br />
<br />
:Sets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
==== scriptEvent void '''setClipMask'''(float clipMask); ====<br />
<br />
:Sets the clipmask of the physics object.<br />
<br />
==== scriptEvent void '''setColor'''(float parm0, float parm1, float parm2); ====<br />
<br />
:Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2). See also setColorVec for a variant that accepts a vector instead.<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
<br />
==== scriptEvent void '''setColorVec'''(vector newColor); ====<br />
<br />
:Similar to setColor, but accepts the new RGB color as a vector instead of 3 different floats.<br />
<br />
==== scriptEvent void '''setContents'''(float contents); ====<br />
<br />
:Sets the contents of the physics object.<br />
<br />
==== scriptEvent float '''setCurInvCategory'''(string categoryName); ====<br />
<br />
:Sets the inventory cursor to the first item of the named category. Returns 1 on success, 0 on failure (e.g. wrong category name)<br />
<br />
==== scriptEvent entity '''setCurInvItem'''(string itemName); ====<br />
<br />
:Sets the inventory cursor to the named item. Returns: the item entity of the newly selected item (can be $null_entity).<br />
<br />
==== scriptEvent void '''setDroppable'''(float droppable); ====<br />
<br />
:Set whether an item may be dropped from the inventory. <br />
::''droppable'': if non-zero the item becomes droppable, when called with 0 the item becomes non-droppable<br />
<br />
==== scriptEvent void '''setEntityRelation'''(entity ent, float relation); ====<br />
<br />
:Set a relation to another entity, this can be friendly (>0), neutral(0) or hostile (<0)<br />
<br />
==== scriptEvent void '''setFrobable'''(float frobable); ====<br />
<br />
:Set whether the entity is frobable<br />
<br />
==== scriptEvent void '''setFrobMaster'''(entity master); ====<br />
<br />
:Sets the passed entity as the frob master. Pass null_entity to remove the current frob master, if any.<br />
<br />
==== scriptEvent void '''setGui'''(float handle, string guiFile); ====<br />
<br />
:Loads a new file into an existing GUI.<br />
<br />
==== scriptEvent void '''setGuiFloat'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiInt'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiString'''(float handle, string key, string val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiStringFromKey'''(float handle, string key, entity src, string srcKey); ====<br />
<br />
:This is a kludge. It is equivelant to: setGuiString( handle, key, src.getKey(srcKey) ) However, it's used to bypass the 127 char size limit on script strings.<br />
<br />
==== scriptEvent void '''setHealth'''(float health); ====<br />
<br />
:Use these to set the health of AI or players (this also updates the AI_DEAD flag)<br />
<br />
==== scriptEvent void '''setKey'''(string key, string value); ====<br />
<br />
:Sets a key on this entity's spawn args. Note that most spawn args are evaluated when this entity spawns in, so this will not change the entity's behavior in most cases. This is chiefly for saving data the script needs in an entity for later retrieval.<br />
::''key'': the spawnarg to set<br />
::''value'': the value to store<br />
<br />
==== scriptEvent void '''setLinearVelocity'''(vector velocity); ====<br />
<br />
:Sets the current linear velocity of this entity in units per second. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
==== scriptEvent void '''setModel'''(string modelName); ====<br />
<br />
:Sets the model this entity uses<br />
<br />
==== scriptEvent void '''setName'''(string name); ====<br />
<br />
:Sets the name of this entity.<br />
::''name'': the new name<br />
<br />
==== scriptEvent void '''setNeverDormant'''(float enable); ====<br />
<br />
:enables or prevents an entity from going dormant<br />
::''enable'': 1 = enable, 0 = disable<br />
<br />
==== scriptEvent void '''setOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (relative to it's bind parent if any)<br />
::''origin'': the new origin<br />
<br />
==== scriptEvent void '''setOwner'''(entity owner); ====<br />
<br />
:Sets the owner of this entity. Entities will never collide with their owner.<br />
::''owner'': the entity which will be made owner of this entity<br />
<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
==== scriptEvent void '''setShaderParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
::''parm3'': alpha<br />
<br />
==== scriptEvent void '''setSize'''(vector min, vector max); ====<br />
<br />
:Sets the size of this entity's bounding box.<br />
::''min'': minimum corner coordinates<br />
::''max'': maximum corner coordinates<br />
<br />
==== scriptEvent void '''setSkin'''(string skinName); ====<br />
<br />
:Sets the skin this entity uses. Set to "" to turn off the skin.<br />
<br />
==== scriptEvent void '''setSolid'''(float solidity); ====<br />
<br />
:Set the solidity of the entity. If the entity has never been solid before it will be assigned solid and opaque contents/clip masks.<br />
<br />
==== scriptEvent void '''setSoundVolume'''(float newLevel); ====<br />
<br />
:Set the volume of the sound to play, must be issued before startSoundShader.<br />
<br />
==== scriptEvent void '''setTeam'''(float newTeam); ====<br />
<br />
:Sets the team number of this entity.<br />
<br />
==== scriptEvent void '''SetTimerState'''(float stimId, float state); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setWorldOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (regardless of any bind parent).<br />
<br />
==== scriptEvent void '''show'''(); ====<br />
<br />
:Makes this entity visible if it has a model.<br />
<br />
==== scriptEvent void '''startFx'''(string fx); ====<br />
<br />
:Starts an FX on this entity.<br />
<br />
==== scriptEvent float '''startSound'''(string sound, float channel, float netSync); ====<br />
<br />
:Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound in seconds. This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.<br />
::''sound'': the spawnarg to reference, e.g. 'snd_move'<br />
::''channel'': the channel to play on<br />
::''netSync'': -<br />
<br />
==== scriptEvent float '''startSoundShader'''(string shaderName, float channel); ====<br />
<br />
:Plays a specific sound shader on the channel and returns the length of the sound in seconds. This is not the preferred method of playing a sound since you must ensure that the sound is loaded.<br />
::''shaderName'': the sound shader to play<br />
::''channel'': the channel to play the sound on<br />
<br />
==== scriptEvent void '''StartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''StimAdd'''(float type, float radius); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''StimClearIgnoreList'''(float type); ====<br />
<br />
:This clears the ignore list for the stim of the given type It can be used if an entity changes state in some way that it would no longer be ignored<br />
<br />
==== scriptEvent void '''StimEmit'''(float type, float radius, vector stimOrigin); ====<br />
<br />
:Emits a stim in a radius around the specified origin. The entity from which this event is called needs to have the corresponding stim setup on itself, it does not need to be active.<br />
::''type'': Index ID of the stim to emit, i.e. 21 or STIM_TRIGGER for a trigger stim.<br />
::''radius'': How far the stim will reach. Pass negative to use the radius settings on the entity.<br />
::''stimOrigin'': Emit the stim from here.<br />
<br />
==== scriptEvent void '''StimEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
==== scriptEvent void '''StimRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''stopSound'''(float channel, float netSync); ====<br />
<br />
:Stops a specific sound shader on the channel.<br />
::''channel'': the channel to stop playback on<br />
::''netSync'': -<br />
<br />
==== scriptEvent void '''StopTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''teleportTo'''(entity other); ====<br />
<br />
:Teleports the entity to the position of the other entity, plus a possible offset and random offset (defined on the spawnargs of the entity to be teleported)<br />
<br />
==== scriptEvent float '''touches'''(entity other); ====<br />
<br />
:Returns true if this entity touches the other entity.<br />
::''other'': the entity to check against<br />
<br />
==== scriptEvent void '''unbind'''(); ====<br />
<br />
:Detaches this entity from its master.<br />
<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
=== idAnimatedEntity ===<br />
==== scriptEvent void '''clearAllJoints'''(); ====<br />
<br />
:Removes any custom transforms on all joints.<br />
<br />
==== scriptEvent void '''clearJoint'''(float jointnum); ====<br />
<br />
:Removes any custom transforms on the specified joint.<br />
<br />
==== scriptEvent vector '''getJointAngle'''(float jointnum); ====<br />
<br />
:Returns the angular orientation of the joint in world space.<br />
<br />
==== scriptEvent float '''getJointHandle'''(string jointname); ====<br />
<br />
:Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found.<br />
<br />
==== scriptEvent vector '''getJointPos'''(float jointnum); ====<br />
<br />
:Returns the position of the joint in world space.<br />
<br />
==== scriptEvent void '''setJointAngle'''(float jointnum, float transform_type, vector angles); ====<br />
<br />
:Modifies the orientation of the joint based on the transform type.<br />
<br />
==== scriptEvent void '''setJointPos'''(float jointnum, float transform_type, vector pos); ====<br />
<br />
:Modifies the position of the joint based on the transform type.<br />
<br />
=== CFrobButton ===<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
=== CFrobDoor ===<br />
==== scriptEvent entity '''GetDoorhandle'''(); ====<br />
<br />
:Returns the handle entity of this door. Can return NULL (== $null_entity)<br />
<br />
==== scriptEvent void '''OpenDoor'''(float master); ====<br />
<br />
:The OpenDoor method is necessary to give the FrobDoorHandles a "low level" open routine. The CFrobDoor::Open() call is re-routed to the FrobDoorHandle::Tap() method, so there must be a way to actually let the door open. Which is what this method does. Note: Shouldn't be called directly by scripters, call handle->Tap() instead. Unless you know what you're doing.<br />
<br />
=== CFrobDoorHandle ===<br />
==== scriptEvent entity '''GetDoor'''(); ====<br />
<br />
:Returns the associated door entity for this handle.<br />
<br />
=== CFrobHandle ===<br />
==== scriptEvent void '''Tap'''(); ====<br />
<br />
:Operates this handle.<br />
<br />
=== CFrobLever ===<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
==== scriptEvent void '''Switch'''(float newState); ====<br />
<br />
:Move the lever to the on or off position (0 = off).<br />
<br />
=== CFrobLock ===<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
=== CFrobLockHandle ===<br />
==== scriptEvent entity '''GetLock'''(); ====<br />
<br />
:Returns the associated lock of this handle.<br />
<br />
=== tdmFuncShooter ===<br />
==== scriptEvent void '''shooterFireProjectile'''(); ====<br />
<br />
:Fires a projectile.<br />
<br />
==== scriptEvent float '''shooterGetAmmo'''(); ====<br />
<br />
:Get the ammonition<br />
<br />
==== scriptEvent float '''shooterGetState'''(); ====<br />
<br />
:Returns the current state of this shooter.<br />
<br />
==== scriptEvent void '''shooterSetAmmo'''(float newAmmo); ====<br />
<br />
:Set the ammonition<br />
<br />
==== scriptEvent void '''shooterSetState'''(float state); ====<br />
<br />
:Activates / deactivates the shooter entity.<br />
::''state'': 1 = active, 0 = inactive<br />
<br />
=== idEntityFx ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idItem ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''respawn'''(); ====<br />
<br />
:Respawn<br />
<br />
=== idMoveableItem ===<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
=== idLight ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''fadeInLight'''(float time); ====<br />
<br />
:Turns the light on over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeOutLight'''(float time); ====<br />
<br />
:Turns the light out over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeToLight'''(vector color, float time); ====<br />
<br />
:Fades the light to the given color over a given time.<br />
<br />
==== scriptEvent float '''getLightLevel'''(); ====<br />
<br />
:Get level (intensity) of a light, <= 0.0 indicates it is off<br />
<br />
==== scriptEvent vector '''getLightOrigin'''(); ====<br />
<br />
:Get the light origin (independent of its visual model)<br />
<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
==== scriptEvent vector '''getRadius'''(); ====<br />
<br />
:Returns the light radius.<br />
<br />
==== scriptEvent string '''getShader'''(); ====<br />
<br />
:Gets the shader name used by the light.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Switches the emitter off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Switches the emitter on.<br />
<br />
==== scriptEvent void '''setLightOrigin'''(vector pos); ====<br />
<br />
:Set origin of lights independent of model origin<br />
<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
==== scriptEvent void '''setRadius'''(float radius); ====<br />
<br />
:Sets the size of the bounding box, x=y=z=radius.<br />
<br />
==== scriptEvent void '''setRadiusXYZ'''(float x, float y, float z); ====<br />
<br />
:Sets the width/length/height of the light bounding box.<br />
<br />
==== scriptEvent void '''setShader'''(string shader); ====<br />
<br />
:Sets the shader to be used for the light.<br />
<br />
==== scriptEvent void '''setStartedOff'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''smoking'''(float state); ====<br />
<br />
:flame is now smoking (1), or not (0)<br />
::''state'': 1 = smoking, 0 = not smoking<br />
<br />
=== idListener ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPlayerStart ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idActivator ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPathCorner ===<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
=== idDamagable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idExplodable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idForceField ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''Toggle'''(); ====<br />
<br />
:Turns the forcefield on and off.<br />
<br />
=== idAnimated ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
==== scriptEvent void '''launchMissiles'''(string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay); ====<br />
<br />
:Launches a projectile.<br />
<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''startRagdoll'''(); ====<br />
<br />
:Switches to a ragdoll taking over the animation.<br />
<br />
=== idStaticEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncSmoke ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''setSmoke'''(string particleDef); ====<br />
<br />
:Changes the smoke particle of a func_smoke.<br />
<br />
=== idVacuumSeparatorEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPortalEntity ===<br />
==== scriptEvent float '''getPortalHandle'''(); ====<br />
<br />
:Returns the portal handle.<br />
<br />
==== scriptEvent float '''getSoundLoss'''(); ====<br />
<br />
:Returns the sound loss value (dB).<br />
<br />
==== scriptEvent void '''setSoundLoss'''(float loss); ====<br />
<br />
:Sets the sound loss value (dB).<br />
<br />
=== idBeam ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idShaking ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idEarthQuake ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncPortal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncAASPortal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncAASObstacle ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPhantomObjects ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPortalSky ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== tdmVine ===<br />
==== scriptEvent void '''addDescendant'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent float '''canWater'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''clearWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent entity '''getPrime'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''scaleVine'''(float factor); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''setPrime'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''setWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
=== idMoveable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
==== scriptEvent void '''enableDamage'''(float enable); ====<br />
<br />
:enable/disable damage<br />
<br />
==== scriptEvent float '''isAtRest'''(); ====<br />
<br />
:Returns true if object is not moving<br />
<br />
=== idMover ===<br />
==== scriptEvent void '''accelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover accelerates.<br />
<br />
==== scriptEvent void '''accelTime'''(float time); ====<br />
<br />
:Sets the acceleration time. Set this acceleration time before initiating a new move.<br />
<br />
==== scriptEvent void '''accelTo'''(float speed, float time); ====<br />
<br />
:Initiates an acceleration to the given speed over the given time in seconds.<br />
<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''bob'''(float speed, float phase, vector distance); ====<br />
<br />
:Initiates a translation back and forth along the given vector with the given speed and phase.<br />
<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''decelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover decelerates.<br />
<br />
==== scriptEvent void '''decelTime'''(float time); ====<br />
<br />
:Sets the deceleration time. Set this deceleration time before initiating a new move.<br />
<br />
==== scriptEvent void '''decelTo'''(float speed, float time); ====<br />
<br />
:Initiates a deceleration to the given speed over the given time in seconds.<br />
<br />
==== scriptEvent void '''disableSplineAngles'''(); ====<br />
<br />
:Disables aligning the mover with the spline direction.<br />
<br />
==== scriptEvent void '''enableSplineAngles'''(); ====<br />
<br />
:Enables aligning the mover with the spline direction.<br />
<br />
==== scriptEvent float '''getMoveSpeed'''(); ====<br />
<br />
:Get the movement speed.<br />
<br />
==== scriptEvent float '''getMoveTime'''(); ====<br />
<br />
:Gets the movement time.<br />
<br />
==== scriptEvent float '''isMoving'''(); ====<br />
<br />
:Returns true if a mover is moving<br />
<br />
==== scriptEvent float '''isRotating'''(); ====<br />
<br />
:Returns true if a mover is rotating<br />
<br />
==== scriptEvent void '''move'''(float angle, float distance); ====<br />
<br />
:Initiates a translation with the given distance in the given yaw direction. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''moveSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the moving.<br />
<br />
==== scriptEvent void '''moveTo'''(entity targetEntity); ====<br />
<br />
:Initiates a translation to the position of an entity. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''moveToPos'''(vector pos); ====<br />
<br />
:Initiates a translation to an absolute position. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''removeInitialSplineAngles'''(); ====<br />
<br />
:Subtracts the initial spline angles to maintain the initial orientation of the mover.<br />
<br />
==== scriptEvent void '''rotate'''(vector angleSpeed); ====<br />
<br />
:Initiates a rotation with the given angular speed. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateDownTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by decreasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateOnce'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the current angles plus the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateTo'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateUpTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by increasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''speed'''(float speed); ====<br />
<br />
:Sets the movement speed. Set this speed before initiating a new move.<br />
<br />
==== scriptEvent void '''startSpline'''(entity spline); ====<br />
<br />
:Starts moving along a spline stored on the given entity.<br />
<br />
==== scriptEvent void '''stopMoving'''(); ====<br />
<br />
:Stops any translational movement.<br />
<br />
==== scriptEvent void '''stopRotating'''(); ====<br />
<br />
:Stops any rotational movement.<br />
<br />
==== scriptEvent void '''stopSpline'''(); ====<br />
<br />
:Stops moving along a spline.<br />
<br />
==== scriptEvent void '''sway'''(float speed, float phase, vector angles); ====<br />
<br />
:Initiates a rotation back and forth along the given angles with the given speed and phase.<br />
<br />
==== scriptEvent void '''time'''(float time); ====<br />
<br />
:Sets the movement time. Set this time before initiating a new move.<br />
<br />
=== idMover_Binary ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
=== idRotater ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idRiser ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPlayer ===<br />
==== scriptEvent void '''changeWeaponName'''(string weaponName, string displayName); ====<br />
<br />
:Changes the display name of the given weapon item to something different. Pass an empty string to reset the display name to the definition as found in the weaponDef.<br />
<br />
==== scriptEvent void '''changeWeaponProjectile'''(string weaponName, string projectileDefName); ====<br />
<br />
:Changes the projectile entityDef name of the given weapon (e.g. "broadhead") to the specified entityDef (e.g. "atdm:projectile_broadhead").<br />
<br />
==== scriptEvent void '''checkAAS'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''clearActiveInventoryMap'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
==== scriptEvent void '''clearActiveInventoryMapEnt'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
==== scriptEvent void '''clearMouseDeadTime'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''customDeath'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''deathMenu'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''disableWeapon'''(); ====<br />
<br />
:Lowers and disables the player weapon.<br />
<br />
==== scriptEvent void '''enableWeapon'''(); ====<br />
<br />
:Enables the player weapon.<br />
<br />
==== scriptEvent void '''endZoom'''(float duration); ====<br />
<br />
:Starts the zoom out event, which performs a gradual transition back to the default FOV. May be called during a transition as well to intercept a pending zoom in transition.<br />
::''duration'': duration of the transition in msec<br />
<br />
==== scriptEvent void '''exitTeleporter'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getButtons'''(); ====<br />
<br />
:Returns the button state from the current user command.<br />
<br />
==== scriptEvent float '''getCalibratedLightgemValue'''(); ====<br />
<br />
:Returns the calibrated light gem value.<br />
<br />
==== scriptEvent string '''getCurrentWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player is currently holding.<br />
<br />
==== scriptEvent string '''getCurWeaponName'''(); ====<br />
<br />
:Returns the name of the current weapon, as defined by "inv_weapon_name" in the weaponDef.<br />
<br />
==== scriptEvent entity '''getDragged'''(); ====<br />
<br />
:Returns the currently dragged body. Returns $null_entity if the body is shouldered, the player has nothing in his hands, or he has a non-AF entity in his hands. See also getShouldered(), getGrabbed() and getFrobbed().<br />
<br />
==== scriptEvent float '''getFov'''(); ====<br />
<br />
:This returns the current FOV of the player. You can modify the current FOV with startZoom() and endZoom().<br />
<br />
==== scriptEvent entity '''getFrobbed'''(); ====<br />
<br />
:Returns the currently frobhilighted entity. This includes entities the player has in his hands. Sets "frob only used by" mode<br />
<br />
==== scriptEvent entity '''getGrabbed'''(); ====<br />
<br />
:Returns the currently entity in the players hands. Returns $null_entity if the player has nothing in his hands Dragging or shouldering a body counts as grabbing it. See also getDragged(), getShouldered(), getFrobbed().<br />
<br />
==== scriptEvent vector '''getHinderance'''(string source); ====<br />
<br />
:Used to get hinderance from a source.<br />
<br />
==== scriptEvent float '''getImmobilization'''(string source); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent float '''getInventoryOverlay'''(); ====<br />
<br />
:Gets the default inventory overlay for the player. All other entities will return an invalid value.<br />
<br />
==== scriptEvent vector '''getListenLoc'''(); ====<br />
<br />
:Retrieves the location of the listener when leaning.<br />
<br />
==== scriptEvent float '''getMouseGesture'''(); ====<br />
<br />
:Returns the results of the last mouse gesture in enum form. (see the definition for MOUSEDIR_* for which numbers correspond to which directions)<br />
<br />
==== scriptEvent vector '''getMove'''(); ====<br />
<br />
:Returns the movement relative to the player's view angles from the current user command. vector_x = forward, vector_y = right, vector_z = up<br />
<br />
==== scriptEvent string '''getNextHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get the next hinderance from a source.<br />
<br />
==== scriptEvent string '''getNextImmobilization'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent string '''getNextTurnHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Get the next hinderance on the view turning from a source<br />
<br />
==== scriptEvent float '''getObjectiveComp'''(float ObjNum, float CompNum); ====<br />
<br />
:Used to get the state of custom objective components<br />
::''ObjNum'': Starts counting at 1<br />
::''CompNum'': Starts counting at 1<br />
<br />
==== scriptEvent float '''getObjectiveState'''(float ObjNum); ====<br />
<br />
:Returns the current state of the objective with the number ObjNum. State is one of the following: OBJ_INCOMPLETE = 0, OBJ_COMPLETE = 1, OBJ_INVALID = 2, OBJ_FAILED = 3<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent float '''getObjectiveVisible'''(float ObjNum); ====<br />
<br />
:Returns the current visibility of the objective with the number ObjNum.<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent string '''getPreviousWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player was previously holding.<br />
<br />
==== scriptEvent entity '''getShouldered'''(); ====<br />
<br />
:Returns the currently shouldered body, otherwise $null_entity. See also getDragged(), getGrabbed() and getFrobbed().<br />
<br />
==== scriptEvent vector '''getTurnHinderance'''(string source); ====<br />
<br />
:* Get the hinderance on the view turning from a source<br />
<br />
==== scriptEvent vector '''getViewAngles'''(); ====<br />
<br />
:Returns the player view angles.<br />
<br />
==== scriptEvent entity '''getWeaponEntity'''(); ====<br />
<br />
:Returns the entity for the player's weapon<br />
<br />
==== scriptEvent void '''giveHealthPool'''(float amount); ====<br />
<br />
:This increases/decreases the healthpool of the player by the given amount. The healthpool is gradually decreased over time, healing (damaging?) the player.<br />
<br />
==== scriptEvent entity '''heldEntity'''(); ====<br />
<br />
:Returns the entity currently being held, or $null_entity if the player's hands are empty.<br />
<br />
==== scriptEvent float '''holdEntity'''(entity entity); ====<br />
<br />
:Forces the player to hold an entity (e.g. puts it into the grabber). Drops whatever is in the player's hands if $null_entity is passed to it. Returns 1 if successful, 0 if not.<br />
<br />
==== scriptEvent float '''isLeaning'''(); ====<br />
<br />
:Get whether the player is leaning<br />
<br />
==== scriptEvent float '''isPeekLeaning'''(); ====<br />
<br />
:Get whether the player is peek leaning (against a keyhole or crack)<br />
<br />
==== scriptEvent void '''missionFailed'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''missionSuccess'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''mouseGestureFinished'''(); ====<br />
<br />
:Returns true if the player is not currently doing a mouse gesture.<br />
<br />
==== scriptEvent void '''objectiveCompUnlatch'''(float ObjNum, float CompNum); ====<br />
<br />
:Unlatch an irreversible objective component that has latched into a state<br />
<br />
==== scriptEvent void '''objectiveUnlatch'''(float ObjNum); ====<br />
<br />
:Unlatch an irreversible objective that has latched into a state<br />
<br />
==== scriptEvent void '''pauseGame'''(); ====<br />
<br />
:Pauses the game. This should only be called for threads that are explicitly maintained by a special SDK method, because ordinary threads won't get executed during g_stopTime == true. Note: This is used by the objective GUI threads. Note: Must be called on the player entity, not the sys entity.<br />
<br />
==== scriptEvent void '''playStartSound'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''readLightgemModifierFromWorldspawn'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''resetWeaponProjectile'''(string weaponName); ====<br />
<br />
:Reloads the original projectile def name from the weaponDef. Used to revert a change made by the event changeWeaponProjectile().<br />
<br />
==== scriptEvent void '''resetZoom'''(); ====<br />
<br />
:Cancels any pending zoom transitions and resets the FOV to normal.<br />
<br />
==== scriptEvent void '''ropeRemovalCleanup'''(entity ropeEnt); ====<br />
<br />
:Called when rope arrow ropes are removed, removes stale pointers on the player object.<br />
<br />
==== scriptEvent void '''saveGame'''(string filename); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''selectWeapon'''(string weapon); ====<br />
<br />
:Selects the weapon the player is holding.<br />
<br />
==== scriptEvent void '''setActiveInventoryMapEnt'''(entity mapEnt); ====<br />
<br />
:Notify the player about a new active map entity. This clears out any previously active maps.<br />
<br />
==== scriptEvent void '''setFrobOnlyUsedByInv'''(float OnOff); ====<br />
<br />
:Engages or disengages a mode where we only frobhilight entities that can be used by our current inventory item. This also disables general frobactions and only allows "used by" frob actions.<br />
<br />
==== scriptEvent void '''setHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Used to set hinderance from a source.<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
==== scriptEvent void '''setImmobilization'''(string source, float type); ====<br />
<br />
:Used to set immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent void '''setLightgemModifier'''(string modifierName, float value); ====<br />
<br />
:Sets the named lightgem modifier to a certain value. An example would be the player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers can be set by concurrent script threads.<br />
<br />
==== scriptEvent void '''setObjectiveComp'''(float ObjNum, float CompNum, float state); ====<br />
<br />
:Used to set the state of custom objective components<br />
::''ObjNum'': objective number. Starts counting at 1<br />
::''CompNum'': component number. Starts counting at 1<br />
::''state'': 1 or 0 for true or false<br />
<br />
==== scriptEvent void '''setObjectiveEnabling'''(float ObjNum, string strIn); ====<br />
<br />
:Set an objective's enabling objectives (objectives that must be completed before that objective may be completed).<br />
::''strIn'': takes the form of a string that is a space-delimited list of integer objectives representing the new enabling objectives. E.g. : '1 2 3 4'<br />
<br />
==== scriptEvent void '''setObjectiveNotification'''(float ObjNote); ====<br />
<br />
:Turns the notifications (sound ++ text) for objectives on/off.<br />
::''ObjNote'': Turn notifications on/off<br />
<br />
==== scriptEvent void '''setObjectiveOngoing'''(float ObjNum, float val); ====<br />
<br />
:Sets objective ongoing.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setObjectiveOptional'''(float ObjNum, float val); ====<br />
<br />
:Sets objective mandatory.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setObjectiveState'''(float ObjNum, float State); ====<br />
<br />
:Used to set the state of objectives from the script. For example, use this to invalidate an objective when something happens in your mission. The first argument is the numerical index of the objective (taking 'user' objective indices, starting at 1). Choose from the following for the second argument: OBJ_INCOMPLETE, OBJ_COMPLETE, OBJ_INVALID, OBJ_FAILED. Use this on $player1 like $player1.setObjectiveState(1, OBJ_COMPLETE);<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent void '''setObjectiveText'''(float ObjNum, string newText); ====<br />
<br />
:Modify the displayed text for an objective. Can also be a string template like #str_20000<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent void '''setObjectiveVisible'''(float ObjNum, float val); ====<br />
<br />
:Sets objective visibility.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setPeekOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for peeking, depending on aspect ratio.<br />
<br />
==== scriptEvent void '''setPeekView'''(float OnOff, vector origin); ====<br />
<br />
:Toggle whether we should use a view from a peek entity as the player's view<br />
<br />
==== scriptEvent void '''setSavePermissions'''(float permission); ====<br />
<br />
:No description<br />
::''permission'': 0<br />
<br />
==== scriptEvent void '''setSpyglassOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for the spyglass, depending on aspect ratio.<br />
<br />
==== scriptEvent void '''setTurnHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Set the hinderance on the view turning from a source<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
==== scriptEvent void '''setViewAngles'''(vector angles); ====<br />
<br />
:Sets the player view angles, e.g. make the player facing this direction. 0 0 0 is east (along the X axis in DR), 0 90 0 north (along the Y axis in DR) 0 180 0 west, 0 270 0 south.<br />
<br />
==== scriptEvent void '''startGamePlayTimer'''(); ====<br />
<br />
:Resets the game play timer to zero and (re)starts it.<br />
<br />
==== scriptEvent void '''startMouseGesture'''(float key, float thresh, float test, float inverted, float turnHinderance, float decideTime, float deadTime); ====<br />
<br />
:Start tracking a mouse gesture that started when the key impulse was pressed. Discretizes analog mouse movement into a few different gesture possibilities. Impulse arg can also be a button, see the UB_* enum in usercmdgen.h. For now, only one mouse gesture check at a time.<br />
::''thresh'': Waits until the threshold mouse input thresh is reached before deciding.<br />
::''test'': determines which test to do (0 = up/down, 1 = left/right, 2 = 4 directions, 3 = 8 directions).<br />
::''inverted'': inverts the movement if set to 1, does not if 0<br />
::''turnHinderance'': Sets the max player view turn rate when checking this mouse gesture (0 => player view locked, 1.0 => no effect on view turning)<br />
::''decideTime'': time in milliseconds after which the mouse gesture is auto-decided, in the event that the mouse movement threshold was not reached. A DecideTime of -1 means wait forever until the button is released.<br />
::''deadTime'': how long after attack is pressed that mouse control remains dampened by the fraction turnHinderance.<br />
<br />
==== scriptEvent void '''startZoom'''(float duration, float startFOV, float endFOV); ====<br />
<br />
:Call this to start the zoom in event. The player FOV is gradually zoomed in until over the given timespan.<br />
::''duration'': duration of the transition in msec<br />
::''startFOV'': The start FOV, this is clamped to [1..179]<br />
::''endFOV'': The end FOV, this is clamped to [1..179]<br />
<br />
==== scriptEvent void '''stopFxFov'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''stopMouseGesture'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''testEvent1'''(float float_pi, float int_beef, float float_exp, string string_tdm, float float_exp10, float int_food); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''testEvent2'''(float int_prevres, vector vec_123, float int_food, entity ent_player, entity ent_null, float float_pi, float float_exp); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent vector '''testEvent3'''(entity ent_prevres, vector vec_123, float float_pi, entity ent_player); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''triggerMissionEnd'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''unpauseGame'''(); ====<br />
<br />
:Unpauses the game. Most scripts are not executed during g_stopTime == true and won't get into the position of calling this.<br />
<br />
==== scriptEvent float '''wasDamaged'''(); ====<br />
<br />
:Check if the player was damaged this frame.<br />
<br />
=== idProjectile ===<br />
==== scriptEvent float '''getProjectileState'''(); ====<br />
<br />
:Gets the current state of the projectile. States are defined in tdm_defs.script<br />
<br />
==== scriptEvent void '''launch'''(vector start, vector dir, vector velocity); ====<br />
<br />
:Launches the projectile from <start> in direction <dir> with the given <velocity><br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
=== idGuidedProjectile ===<br />
==== scriptEvent void '''launchGuided'''(vector start, vector dir, vector velocity, entity target); ====<br />
<br />
:Launches the guided projectile from <start> in direction <dir> with the given <velocity> at <target entity>. Pass $null_entity to fire an unguided projectile.<br />
<br />
=== CProjectileResult ===<br />
==== scriptEvent entity '''getActualStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getAxialDir'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getFinalAngVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getFinalVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''getIncidenceAngle'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''getProjMass'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent entity '''getStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getSurfNormal'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent string '''getSurfType'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''isVineFriendly'''(); ====<br />
<br />
:Vine-arrow event<br />
<br />
=== CTarget_SetRelations ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetEntityRelation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeEntityRelation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idThread ===<br />
==== scriptEvent float '''acos'''(float cosine); ====<br />
<br />
:Returns the angle in degrees with the given cosine.<br />
<br />
==== scriptEvent vector '''angToForward'''(vector angles); ====<br />
<br />
:Returns a forward vector for the given Euler angles.<br />
<br />
==== scriptEvent vector '''angToRight'''(vector angles); ====<br />
<br />
:Returns a right vector for the given Euler angles.<br />
<br />
==== scriptEvent vector '''angToUp'''(vector angles); ====<br />
<br />
:Returns an up vector for the given Euler angles.<br />
<br />
==== scriptEvent float '''asin'''(float sine); ====<br />
<br />
:Returns the angle in degrees with the given sine.<br />
<br />
==== scriptEvent void '''assert'''(float condition); ====<br />
<br />
:Breaks if the condition is zero. (Only works in debug builds.)<br />
<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
==== scriptEvent void '''callFunctionsByWildcard'''(string functionName); ====<br />
<br />
:Calls global functions with names matching the specified wildcard in separate threads (in lexicographical order). INTERNAL: don't use in mission scripting!<br />
<br />
==== scriptEvent float '''canPlant'''(vector traceStart, vector traceEnd, entity ignore, entity vine); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''ceil'''(float x); ====<br />
<br />
:Returns the smallest integer that is greater than or equal to the given value.<br />
<br />
==== scriptEvent void '''clearPersistantArgs'''(); ====<br />
<br />
:Clears data that persists between maps.<br />
<br />
==== scriptEvent void '''clearSignalThread'''(float signalNum, entity ent); ====<br />
<br />
:Clears the script callback function set for when the given signal is raised on the given entity.<br />
<br />
==== scriptEvent void '''copySpawnArgs'''(entity ent); ====<br />
<br />
:copies the spawn args from an entity<br />
<br />
==== scriptEvent float '''cos'''(float degrees); ====<br />
<br />
:Returns the cosine of the given angle in degrees.<br />
<br />
==== scriptEvent vector '''CrossProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the cross product of the two vectors.<br />
<br />
==== scriptEvent void '''debugArrow'''(vector color, vector start, vector end, float size, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugBounds'''(vector color, vector mins, vector maxs, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugCircle'''(vector color, vector origin, vector dir, float radius, float numSteps, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugLine'''(vector color, vector start, vector end, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent float '''DotProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the dot product of the two vectors.<br />
<br />
==== scriptEvent void '''drawText'''(string text, vector origin, float scale, vector color, float align, float lifetime); ====<br />
<br />
:text drawing for debugging. lifetime of 0 == 1 frame.<br />
::''align'': 0 = left, 1 = center, 2 = right<br />
<br />
==== scriptEvent float '''emitParticle'''(string particle, float startTime, float diversity, vector origin, vector angle); ====<br />
<br />
:Start a particle effect in the world without using an entity emitter. Will emit one quad per particle stage when first called with sys.getTime() as the start time. Designed to be called once per frame with the same startTime each call to achieve a normal particle effect, or on demand with sys.getTime() as the startTime for finer grained control, 1 quad at a time. Returns True (1) if there are more particles to be emitted from the stage, False (0) if the stage has released all its quads.<br />
::''particle'': String: name of particle effect.<br />
::''startTime'': Game seconds since map start: use sys.getTime() for the first call unless you want to back-date the particle so that it starts part way through its cycle.<br />
::''diversity'': Randomizer value between 0 and 1. All particles with the same diversity will have the same path and rotation. Use sys.random(1) for a random path.<br />
::''origin'': Origin of the particle effect.<br />
::''angle'': Axis for the particle effect. Use $<entityname>.getAngles() to align the particle to an entity. use '0 0 0' for an upright (world-aligned) particle effect.<br />
<br />
==== scriptEvent void '''error'''(string text); ====<br />
<br />
:Issues an error.<br />
<br />
==== scriptEvent void '''fadeIn'''(vector color, float time); ====<br />
<br />
:Fades towards the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeOut'''(vector color, float time); ====<br />
<br />
:Fades from the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeTo'''(vector color, float alpha, float time); ====<br />
<br />
:Fades to the given color up to the given alpha over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''firstPerson'''(); ====<br />
<br />
:Returns view control to the player entity.<br />
<br />
==== scriptEvent float '''floor'''(float x); ====<br />
<br />
:Returns the largest integer that is less than or equal to the given value.<br />
<br />
==== scriptEvent float '''getCurrentMissionNum'''(); ====<br />
<br />
:Returns the number of the current mission (0-based, the first mission has number 0).<br />
<br />
==== scriptEvent string '''getcvar'''(string name); ====<br />
<br />
:Returns the string for a cvar.<br />
<br />
==== scriptEvent float '''getDifficultyLevel'''(); ====<br />
<br />
:Returns 0 (Easy), 1 (Medium) or 2 (Hard), depending on the difficulty level of the current mission.<br />
<br />
==== scriptEvent string '''getDifficultyName'''(float difficultyLevel); ====<br />
<br />
:Returns the (translated) name of the difficulty level passed as the argument.<br />
::''difficultyLevel'': 0 (Easy), 1 (Medium), 2 (Hard)<br />
<br />
==== scriptEvent entity '''getEntity'''(string name); ====<br />
<br />
:Returns a reference to the entity with the specified name.<br />
<br />
==== scriptEvent float '''getFrameTime'''(); ====<br />
<br />
:returns the length of time between game frames. this is not related to renderer frame rate.<br />
<br />
==== scriptEvent float '''getInterceptTime'''(vector velocityTarget, float speedInterceptor, vector positionTarget, vector positionInterceptor); ====<br />
<br />
:Returns how much time it will take for an interceptor like a projectile to intercept a moving target at the earliest possible opportunity. Returns 0 if an intercept is not possible or the speed of the target and interceptor are too similar.<br />
::''velocityTarget'': current velocity of target<br />
::''speedInterceptor'': speed of interceptor<br />
::''positionTarget'': current position of target<br />
::''positionInterceptor'': starting position of interceptor<br />
<br />
==== scriptEvent entity '''getLocationPoint'''(vector point); ====<br />
<br />
:Returns the idLocation entity corresponding to the specified point's location.<br />
::''point'': point whose location to check<br />
<br />
==== scriptEvent entity '''getMainAmbientLight'''(); ====<br />
<br />
:Returns the entity of the main ambient light.<br />
<br />
==== scriptEvent float '''getMissionStatistic'''(string statisticName); ====<br />
<br />
:Returns current mission statistic.<br />
::''statisticName'': Can be one of (case insensitive): gamePlayTime: gameplay time in seconds damageDealt: damage dealt to enemies damageReceived: damage received by player healthReceived: health received by player pocketsPicked: pockets picked by player foundLoot: loot found by player missionLoot: total loot available in mission totalTimePlayerSeen: total time the player was seen by enemies in seconds. Updates only when AI lose sight of player numberTimesPlayerSeen: number of times player was seen by enemies numberTimesAISuspicious: number of times AI was 'observant' or 'suspicious'. A single AI passing through both alert levels will add 2 to the score. numberTimesAISearched: number of times AI was 'investigating' or 'searching'. A single AI passing through both alert levels will add 2 to the score. sightingScore: sighting score (number of times player was seen * weight) stealthScore: stealth score (sighting score + alerts * weights) killedByPlayer: number of enemies killed by player knockedOutByPlayer: number of enemies knocked out by player bodiesFound: number of times enemies have spotted a body secretsFound: number of secrets found by the player secretsTotal: total number of secrets in the mission <br />
<br />
==== scriptEvent entity '''getNextEntity'''(string key, string value, entity lastMatch); ====<br />
<br />
:Discover all entities in the map. Returns $null_entity when no more found.<br />
::''key'': Optional string: prefix for spawnarg key match. E.g. "target" will match "target", "target1" etc.<br />
::''value'': Optional string: spawnarg value to match. Can be used independently of ''key''. If ''key'' is not set, all spawnargs will be checked for the value.<br />
::''lastMatch'': Last match: search will start after this entity. Use $null_entity or pass an uninitialized entity variable to start a new search.<br />
<br />
==== scriptEvent float '''getPersistantFloat'''(string key); ====<br />
<br />
:Returns the floating point value for the given persistent arg<br />
<br />
==== scriptEvent string '''getPersistantString'''(string key); ====<br />
<br />
:Returns the string for the given persistent arg<br />
<br />
==== scriptEvent vector '''getPersistantVector'''(string key); ====<br />
<br />
:Returns the vector for the given persistent arg<br />
<br />
==== scriptEvent float '''getPortAISoundLoss'''(float handle); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getPortPlayerSoundLoss'''(float handle); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getPortSoundLoss'''(float handle); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getRelation'''(float team1, float team2); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getTDMVersion'''(); ====<br />
<br />
:Get the current TDM version as integer. The value will be 108 for v1.08, 109 for v1.09 and 200 for v2.00 etc.<br />
<br />
==== scriptEvent float '''getTicsPerSecond'''(); ====<br />
<br />
:returns the number of game frames per second. this is not related to renderer frame rate.<br />
<br />
==== scriptEvent float '''getTime'''(); ====<br />
<br />
:Returns the current game time in seconds.<br />
<br />
==== scriptEvent string '''getTraceBody'''(); ====<br />
<br />
:Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent vector '''getTraceEndPos'''(); ====<br />
<br />
:Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint<br />
<br />
==== scriptEvent entity '''getTraceEntity'''(); ====<br />
<br />
:Returns a reference to the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent float '''getTraceFraction'''(); ====<br />
<br />
:Returns the fraction of movement completed during the last call to trace or tracePoint.<br />
<br />
==== scriptEvent string '''getTraceJoint'''(); ====<br />
<br />
:Returns the number of the skeletal joint closest to the location on the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent vector '''getTraceNormal'''(); ====<br />
<br />
:Returns the normal of the hit plane during the last call to trace or tracePoint<br />
<br />
==== scriptEvent string '''getTraceSurfType'''(); ====<br />
<br />
:Returns the type of the surface (i.e. metal, snow) which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent void '''handleMissionEvent'''(entity objEnt, float eventType, string argument); ====<br />
<br />
:Generic interface for passing on mission events from scripts to the SDK. Available since TDM 1.02<br />
::''objEnt'': the entity that triggered this event (e.g. a readable)<br />
::''eventType'': a numeric identifier (enumerated both in MissionData.h and tdm_defs.script) specifying the type of event<br />
::''argument'': an optional string parameter, eventtype-specific.<br />
<br />
==== scriptEvent float '''influenceActive'''(); ====<br />
<br />
:Checks if an influence is active<br />
<br />
==== scriptEvent void '''killthread'''(string threadName); ====<br />
<br />
:Kills all threads with the specified name<br />
<br />
==== scriptEvent float '''log'''(float x); ====<br />
<br />
:Returns the log of the given argument.<br />
<br />
==== scriptEvent void '''logString'''(float logClass, float logType, string output); ====<br />
<br />
:This is the script counterpart to DM_LOG<br />
<br />
==== scriptEvent void '''music'''(string shaderName); ====<br />
<br />
:Starts playing background music.<br />
<br />
==== scriptEvent void '''offsetRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''onSignal'''(float signalNum, entity ent, string functionName); ====<br />
<br />
:Sets a script callback function for when the given signal is raised on the given entity.<br />
<br />
==== scriptEvent void '''pause'''(); ====<br />
<br />
:Pauses the current thread.<br />
<br />
==== scriptEvent float '''pointInLiquid'''(vector point, entity ignoreEntity); ====<br />
<br />
:Checks if a point is in a liquid, returns 1 if this is the case.<br />
<br />
==== scriptEvent float '''pointIsInBounds'''(vector point, vector mins, vector maxs); ====<br />
<br />
:Returns true if the point is within the bounds specified.<br />
::''point'': test whether this point is in the bounds<br />
::''mins'': minimal corner of the bounds<br />
::''maxs'': maximal corner of the bounds<br />
<br />
==== scriptEvent float '''pow'''(float x, float y); ====<br />
<br />
:Returns the power of x to y.<br />
<br />
==== scriptEvent void '''print'''(string text); ====<br />
<br />
:Prints the given string to the console.<br />
<br />
==== scriptEvent void '''println'''(string text); ====<br />
<br />
:Prints the given line to the console.<br />
<br />
==== scriptEvent void '''projectDecal'''(vector traceOrigin, vector traceEnd, entity passEntity, string decal, float decalSize, float angle); ====<br />
<br />
:Performs a trace from the specified origin and end positions, then projects a decal in that direction.<br />
::''traceOrigin'': Start of the trace.<br />
::''traceEnd'': End of the trace.<br />
::''passEntity'': This entity will be considered non-solid by the trace.<br />
::''decal'': Decal to be projected.<br />
::''decalSize'': Size of the decal quad.<br />
::''angle'': Angle of the decal quad.<br />
<br />
==== scriptEvent void '''radiusDamage'''(vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower); ====<br />
<br />
:damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile).<br />
::''inflictor'': the entity causing the damage<br />
::''ignore'': an entity to not cause damage to<br />
::''dmgPower'': scales the damage (for cases where damage is dependent on time)<br />
<br />
==== scriptEvent float '''random'''(float range); ====<br />
<br />
:Returns a random value X where 0 <= X < range.<br />
<br />
==== scriptEvent void '''saveConDump'''(string cmd, string cmd); ====<br />
<br />
:Saves condump into FM directory; first argument is appended to dump filename, everything before last occurence of second argument is removed<br />
<br />
==== scriptEvent void '''say'''(string text); ====<br />
<br />
:Multiplayer - Print this line on the network<br />
<br />
==== scriptEvent void '''sessionCommand'''(string cmd); ====<br />
<br />
:Sends the sessioncommand to the game<br />
<br />
==== scriptEvent void '''setCamera'''(entity cameraEnt); ====<br />
<br />
:Turns over view control to the given camera entity.<br />
<br />
==== scriptEvent void '''setcvar'''(string name, string value); ====<br />
<br />
:Sets a cvar.<br />
<br />
==== scriptEvent void '''setPersistantArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair that persists between maps<br />
<br />
==== scriptEvent void '''setPortAISoundLoss'''(float handle, float value); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setPortPlayerSoundLoss'''(float handle, float value); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setPortSoundLoss'''(float handle, float value); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setSecretsFound'''(float secrets); ====<br />
<br />
:Set how many secrets the player has found. Use getMissionStatistic() for getting the current value.<br />
<br />
==== scriptEvent void '''setSecretsTotal'''(float secrets); ====<br />
<br />
:Set how many secrets exist in the map in total. Use getMissionStatistic() for getting the current value.<br />
<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
==== scriptEvent void '''setSpawnArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair to be used when a new entity is spawned.<br />
<br />
==== scriptEvent float '''sin'''(float degrees); ====<br />
<br />
:Returns the sine of the given angle in degrees.<br />
<br />
==== scriptEvent entity '''spawn'''(string classname); ====<br />
<br />
:Creates an entity of the specified classname and returns a reference to the entity.<br />
<br />
==== scriptEvent float '''SpawnFloat'''(string key, float default); ====<br />
<br />
:Returns the floating point value for the given spawn argument.<br />
<br />
==== scriptEvent string '''SpawnString'''(string key, string default); ====<br />
<br />
:Returns the string for the given spawn argument.<br />
<br />
==== scriptEvent vector '''SpawnVector'''(string key, vector default); ====<br />
<br />
:Returns the vector for the given spawn argument.<br />
<br />
==== scriptEvent float '''sqrt'''(float square); ====<br />
<br />
:Returns the square root of the given number.<br />
<br />
==== scriptEvent float '''strFind'''(string text, string find, float casesensitive, float start, float end); ====<br />
<br />
:Return the position of the given substring, counting from 0, or -1 if not found.<br />
::''casesensitive'': 0<br />
::''start'': 0<br />
::''end'': -1<br />
<br />
==== scriptEvent string '''strLeft'''(string text, float num); ====<br />
<br />
:Returns a string composed of the first num characters<br />
<br />
==== scriptEvent float '''strLength'''(string text); ====<br />
<br />
:Returns the number of characters in the string<br />
<br />
==== scriptEvent string '''strMid'''(string text, float start, float num); ====<br />
<br />
:Returns a string composed of the characters from start to start + num<br />
<br />
==== scriptEvent string '''strRemove'''(string text, string remove); ====<br />
<br />
:Replace all occurances of the given substring with "". Example: StrRemove("abba","bb") results in "aa".<br />
<br />
==== scriptEvent string '''strReplace'''(string text, string remove, string replace); ====<br />
<br />
:Replace all occurances of the given string with the replacement string. Example: StrRemove("abba","bb","ccc") results in "accca".<br />
<br />
==== scriptEvent string '''strRight'''(string text, float num); ====<br />
<br />
:Returns a string composed of the last num characters<br />
<br />
==== scriptEvent string '''strSkip'''(string text, float num); ====<br />
<br />
:Returns the string following the first num characters<br />
<br />
==== scriptEvent float '''strToFloat'''(string text); ====<br />
<br />
:Returns the numeric value of the given string.<br />
<br />
==== scriptEvent float '''strToInt'''(string text); ====<br />
<br />
:Returns the integer value of the given string.<br />
<br />
==== scriptEvent void '''terminate'''(float threadNumber); ====<br />
<br />
:Terminates a thread.<br />
<br />
==== scriptEvent void '''threadname'''(string name); ====<br />
<br />
:Sets the name of the current thread.<br />
<br />
==== scriptEvent float '''trace'''(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
==== scriptEvent float '''tracePoint'''(vector start, vector end, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the trace hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
==== scriptEvent string '''translate'''(string input); ====<br />
<br />
:Translates a string (like #str_12345) into the current language<br />
<br />
==== scriptEvent void '''trigger'''(entity entityToTrigger); ====<br />
<br />
:Triggers the given entity.<br />
<br />
==== scriptEvent float '''vecLength'''(vector vec); ====<br />
<br />
:Returns the length of the given vector.<br />
<br />
==== scriptEvent vector '''vecNormalize'''(vector vec); ====<br />
<br />
:Returns the normalized version of the given vector.<br />
<br />
==== scriptEvent vector '''VecRotate'''(vector vector, vector angles); ====<br />
<br />
:Rotates a vector by the specified angles.<br />
<br />
==== scriptEvent vector '''VecToAngles'''(vector vec); ====<br />
<br />
:Returns Euler angles for the given direction.<br />
<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
==== scriptEvent void '''waitFor'''(entity mover); ====<br />
<br />
:Waits for the given entity to complete its move.<br />
<br />
==== scriptEvent void '''waitForRender'''(entity e); ====<br />
<br />
:Suspends the current thread until 'e' might have been rendered. It's event based, so it doesn't waste CPU repeatedly checking inPVS(). e.inPVS() will very likely be true when the thread resumes. If e.inPVS() is true, calling waitForRender() will probably just wait a frame, unless D3 can figure out that the entity doesn't need to be rendered. Optimizations regarding shadowcasting lights may not apply to this function - it is based purely off whether or not the entity's bounding box is visible.<br />
<br />
==== scriptEvent void '''waitForThread'''(float threadNumber); ====<br />
<br />
:Waits for the given thread to terminate.<br />
<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
==== scriptEvent void '''warning'''(string text); ====<br />
<br />
:Issues a warning.<br />
<br />
=== idSecurityCamera ===<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getNextEnemy'''(entity lastMatch); ====<br />
<br />
:Returns the next enemy that the security camera can see.<br />
::''lastMatch'': search will start after this entity.Use $null_entity or pass an uninitialized entity variable to start a new search.The first result in a new search will be the player, if the camera can see him.<br />
<br />
==== scriptEvent float '''getSecurityCameraState'''(); ====<br />
<br />
:Returns the security camera's state. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = inactive, 5 = destroyed.<br />
<br />
==== scriptEvent entity '''getSpotLight'''(); ====<br />
<br />
:Returns the spotlight used by the camera. Returns null_entity if none is used.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Switches the emitter off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Switches the emitter on.<br />
<br />
==== scriptEvent void '''setSightThreshold'''(float sightThreshold); ====<br />
<br />
:Set the sight threshold of the security camera: how lit up the player's lightgem needs to be in order to be seen. 0.0 to 1.0<br />
<br />
==== scriptEvent void '''state_light'''(float set); ====<br />
<br />
:Switches the spotlight on or off. Respects the security camera's power state.<br />
<br />
==== scriptEvent void '''state_see_AI'''(float set); ====<br />
<br />
:Set whether the camera can see AIs.<br />
<br />
==== scriptEvent void '''state_see_animals'''(float set); ====<br />
<br />
:Set whether the camera can see animals. Checked after seeAI or seeBodies.<br />
<br />
==== scriptEvent void '''state_see_bodies'''(float set); ====<br />
<br />
:Set whether the camera can see bodies.<br />
<br />
==== scriptEvent void '''state_see_player'''(float set); ====<br />
<br />
:Set whether the camera can see the player.<br />
<br />
==== scriptEvent void '''state_sweep'''(float set); ====<br />
<br />
:Enables or disables the camera's sweeping.<br />
<br />
==== scriptEvent void '''toggle_light'''(); ====<br />
<br />
:Toggles the spotlight on/off.<br />
<br />
==== scriptEvent void '''toggle_see_AI'''(); ====<br />
<br />
:Toggles whether the camera can see AIs.<br />
<br />
==== scriptEvent void '''toggle_see_animals'''(); ====<br />
<br />
:Toggles whether the camera can see bodies. Checked after seeAI or seeBodies.<br />
<br />
==== scriptEvent void '''toggle_see_bodies'''(); ====<br />
<br />
:Toggles whether the camera can see bodies.<br />
<br />
==== scriptEvent void '''toggle_see_player'''(); ====<br />
<br />
:Toggles whether the camera can see the player.<br />
<br />
==== scriptEvent void '''toggle_sweep'''(); ====<br />
<br />
:Toggles the camera sweep.<br />
<br />
=== Seed ===<br />
==== scriptEvent void '''cullAll'''(); ====<br />
<br />
:Cull (remove from world) all entities.<br />
<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
=== idSound ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Switches the emitter off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Switches the emitter on.<br />
<br />
=== idTarget_Remove ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Show ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Damage ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SessionCommand ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_EndLevel ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_WaitForButton ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetGlobalShaderTime ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetShaderParm ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetShaderTime ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_FadeEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_LightFadeIn ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_LightFadeOut ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Give ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetModel ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetInfluence ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetKeyVal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetFov ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_CallObjectFunction ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_PostScriptEvent ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_EnableLevelWeapons ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_RemoveWeapons ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_FadeSoundClass ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_AddObjectives ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveVisibility ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveComponentState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_StartConversation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetFrobable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_CallScriptFunction ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeLockState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeTarget ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_InterMissionTrigger ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetTeam ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ItemRemove ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger ===<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
=== idTrigger_Multi ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_EntityName ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Timer ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Count ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Hurt ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Fade ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Touch ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTurret ===<br />
==== scriptEvent void '''attack'''(entity enemy, float ignoreCollisions); ====<br />
<br />
:Direct the turret to manually attack the specified entity. Use disableManualAttack() to disable.<br />
::''enemy'': enemy to attack<br />
::''ignoreCollisions'': whether to ignore obstacles in the way to the enemy when planning to attack<br />
<br />
==== scriptEvent void '''attackPosition'''(vector targetPos, float ignoreCollisions); ====<br />
<br />
:Direct the turret to manually attack a position. Use disableManualAttack() to disable.<br />
::''targetPos'': position to attack<br />
::''ignoreCollisions'': whether to ignore obstacles in the way to the target position when planning to attack. Recommended true for this event.<br />
<br />
==== scriptEvent void '''disableManualAttack'''(); ====<br />
<br />
:Stop attacking the manually specified enemy or position and return to automatic target acquisition mode.<br />
<br />
==== scriptEvent float '''getTurretState'''(); ====<br />
<br />
:Returns the turret's state. 0 = passive: no active security cameras connected. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = power off, 5 = destroyed.<br />
<br />
=== idWeapon ===<br />
==== scriptEvent void '''addToClip'''(float amount); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''allowDrop'''(float allow); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''ammoAvailable'''(); ====<br />
<br />
:Number of shots left in inventory<br />
<br />
==== scriptEvent float '''ammoInClip'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
==== scriptEvent float '''clipSize'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''createProjectile'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''ejectBrass'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''flashlight'''(float enable); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
==== scriptEvent entity '''getOwner'''(); ====<br />
<br />
:Returns the owning entity<br />
<br />
==== scriptEvent entity '''getWorldModel'''(); ====<br />
<br />
:Returns the entity that controls the world model<br />
<br />
==== scriptEvent float '''isInvisible'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''launchProjectiles'''(float num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''melee'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''netEndReload'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''netReload'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''nextWeapon'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent float '''totalAmmoCount'''(); ====<br />
<br />
:Amount of ammo in inventory. since each shot may use more than 1 ammo, this is different than ammoAvailable()<br />
<br />
==== scriptEvent void '''useAmmo'''(float amount); ====<br />
<br />
:Eats the specified amount of ammo<br />
<br />
==== scriptEvent void '''weaponHolstered'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponLowering'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponOutOfAmmo'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponReady'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponReloading'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponRising'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponState'''(string stateFunction, float blendFrames); ====<br />
<br />
:no description<br />
<br />
[[Category:Scripting]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Libraries_and_Dependencies&diff=30940Libraries and Dependencies2023-12-16T14:05:15Z<p>Stgatilov: libpng is now used directly, DevIL was removed several versions ago.</p>
<hr />
<div>All the third-party libraries are downloaded, configured and built using [https://conan.io/ conan package manager].<br />
This is the recommended way to handle libraries.<br />
Read file '''ThirdParty/readme.md''' for more details about this way.<br />
<br />
Even if conan is not your good friend, be sure to follow these rules regarding location in the source code repo:<br />
# Everything related to third-party libraries '''must''' be inside <tt>ThirdParty</tt> subdirectory.<br />
# All the binaries (e.g. .lib and .a files) '''must''' be inside <tt>ThirdParty/artefacts</tt> subdirectory, sorted by platform+ABI according to conventions.<br />
<br />
Note that some libraries are embedded directly into the source code (MD4 and MD5 hashes, PropTree GUI helper).<br />
However, this way is discouraged: think twice and ask guys of forums before using it!<br />
<br />
=== List of libraries ===<br />
<br />
This table is a record of what libraries and dependencies are currently used in TheDarkMod game and tdm_installer.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Name !! Notes !! License !! Initial TDM Version<br />
|-<br />
|[http://www.ijg.org/ libjpeg] ||used by DevIL; JPEG_INTERNALS ||[https://jpegclub.org/reference/libjpeg-license/ BSD-like] ||<1.00<br />
|-<br />
|[http://www.libpng.org/pub/png/libpng.html libpng] || ||[http://libpng.org/pub/png/src/libpng-LICENSE.txt zlib] ||1.03<br />
|-<br />
|[https://xiph.org/vorbis/ libvorbis] || ||[https://github.com/xiph/vorbis/blob/master/COPYING BSD-like] ||<1.00<br />
|-<br />
|[https://xiph.org/ogg/ libogg] ||used only by libvorbis ||[https://github.com/xiph/ogg/blob/master/COPYING BSD-like] ||<1.00<br />
|-<br />
|[http://kcat.strangesoft.net/openal.html OpenAL Soft] || ||[https://www.gnu.org/licenses/old-licenses/lgpl-2.0-standalone.html LGPL 2.0] ||2.06<br />
|-<br />
|[https://www.alsa-project.org/wiki/Main_Page ALSA] ||used only by OpenAL (Linux-only) ||[https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html LGPL 2.1] ||2.08<br />
|-<br />
|[https://ffmpeg.org/ FFmpeg] ||heavily reduced build ||[https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html LGPL 2.1] ||2.06<br />
|-<br />
|[http://curl.haxx.se/ libcurl] || ||[https://curl.haxx.se/docs/copyright.html MIT-like] ||<1.00<br />
|-<br />
|[https://tls.mbed.org/ mbed TLS] ||used only by libcurl ||[https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0] ||2.03?<br />
|-<br />
|[http://www.winimage.com/zLibDll/minizip.html minizip] ||game defines some extensions ||[https://zlib.net/zlib_license.html zlib] ||<1.00<br />
|-<br />
|[http://zlib.net/ zlib] ||used by minizip ||[https://zlib.net/zlib_license.html zlib] ||<1.00<br />
|-<br />
|[https://pugixml.org/ pugixml] || ||[https://pugixml.org/license.html MIT] ||1.03<br />
|-<br />
|[https://github.com/c42f/tinyformat tinyformat] || ||[http://www.boost.org/LICENSE_1_0.txt BSL 1.0] ||2.08<br />
|-<br />
|[https://github.com/onqtam/doctest doctest] || ||[https://github.com/onqtam/doctest/blob/master/LICENSE.txt MIT] ||2.08<br />
|-<br />
|[https://www.glfw.org/ glfw] || ||[https://www.glfw.org/license zlib] ||2.09<br />
|-<br />
|[https://www.blake2.net/ BLAKE2] ||used only in tdm_installer ||[https://github.com/BLAKE2/BLAKE2/blob/master/COPYING CC0 1.0] ||2.09<br />
|-<br />
|[https://www.fltk.org/ fltk] ||used only in tdm_installer ||[https://www.fltk.org/COPYING.php LGPL 2.0] ||2.09<br />
|-<br />
|[https://github.com/wolfpld/tracy Tracy] ||embedded timeline profiler ||[https://github.com/wolfpld/tracy/blob/master/LICENSE BSD 3cl] ||2.10<br />
|-<br />
|[https://github.com/ianlancetaylor/libbacktrace libbacktrace] ||used by Tracy ||[https://github.com/wolfpld/tracy/blob/master/libbacktrace/LICENSE BSD 3cl] ||2.10<br />
|}<br />
<br />
<br />
[[Category:Coding]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Release_Mechanics&diff=30939TDM Release Mechanics2023-12-16T13:59:24Z<p>Stgatilov: Updated packager build instructions (#5076 is done).</p>
<hr />
<div>This article describes the process of creating TDM releases.<br />
<br />
<br />
= Preliminaries =<br />
<br />
Before even starting to build a package, make sure you have all the following tools ready.<br />
<br />
<br />
=== Packager ===<br />
<br />
The tdm_package tool inspects your working copy of assets SVN, and generates PK4 archives from it.<br />
<br />
Prebuilt Windows executable can be downloaded from TDM server: [http://update.thedarkmod.com/zipsync/tdm_package.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_package</tt> subdirectory.<br />
It is built using CMake both on Windows and Linux, without any special details.<br />
<br />
For instance:<br />
* Run cmake-gui.<br />
* Point "Where is the source code" to <tt>tdm_package</tt> directory.<br />
* Point "Where to build the binaries" to <tt>tdm_package/output</tt> directory.<br />
* Click "Configure" button, select the compiler & platform you need.<br />
* Click "Finish".<br />
* Click "Generate", and you should get build files in <tt>output</tt> subdirectory.<br />
* Build:<br />
** On Windows: click "Open Project", select "RelWithDebInfo" configuration and use "Build -> Build Solution" option in menu.<br />
** On Linux: you should probably run "make" in the <tt>output</tt> subdirectory.<br />
<br />
In the end, find packager executable <tt>tdm_package.???</tt> in the <tt>output</tt> subdirectory.<br />
<br />
<br />
If the packager tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
=== Zipsync ===<br />
<br />
Zipsync command-line tool is used to integrate a freshly generated set of pk4 archives into the database of releases.<br />
More details provided in article [[Tdm_installer_and_zipsync#Command-line_tool]].<br />
<br />
Prebuilt Windows executable can be downloaded here: [http://update.thedarkmod.com/zipsync/zipsync.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer/zipsync</tt> subdirectory.<br />
Unlike all the other TDM projects, this one does not use artefacts from <tt>ThirdParty</tt> directory.<br />
Hence, you need to install and use [https://conan.io/ conan] directly if you want to build it.<br />
<br />
Build instructions:<br />
* Get packages: <tt>conan install . -if build -s build_type=RelWithDebInfo --build=outdated</tt><br />
* Build: <tt>conan build . -bf build</tt><br />
The binaries should be ready in <tt>build/RelWithDebInfo</tt>.<br />
In case of MSVC, the CMake-generated solution will be somewhere nearby.<br />
<br />
<br />
If the zipsync tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
<br />
=== Installer ===<br />
<br />
Tdm_installer is GUI application, used to install/update the game on player's machine.<br />
More details provided in article [[Tdm installer and zipsync#tdm_installer]].<br />
<br />
Prebuilt executables can be obtained from Downloads section on the website.<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer</tt> subdirectory.<br />
It can be built with CMake in pretty standard way.<br />
For example:<br />
* Create <tt>build</tt> directory, switch to it.<br />
* Run <tt>cmake ..</tt> to generate project or makefile.<br />
* Windows: Open generated solution, build RelWithDebInfo '''Win32''' configuration.<br />
* Linux: Run <tt>make</tt> to finish build.<br />
<br />
You only need to build 32-bit executable on Windows: it will work fine on 64-bit OS too.<br />
For Linux, build both 64-bit and 32-bit executables separately.<br />
<br />
In order to build 32-bit executable on 64-bit Linux, run cmake with additional parameters:<br />
* <tt>cmake .. -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32</tt><br />
<br />
<br />
If tdm_installer is modified, update all prebuilt executables on TDM server.<br />
<br />
For the self-update to work, each executable must be packaged into a special zip archive:<br />
* <tt>zipsync hashzip tdm_installer.exe</tt><br />
* <tt>zipsync hashzip tdm_installer.linux64</tt><br />
* <tt>zipsync hashzip tdm_installer.linux32</tt><br />
<br />
The resulting zip archives should be uploaded onto the TDM server (contact admin for access).<br />
Note that tdm_installer automatically updates itself to the executable on the server: if you put a bad build, make sure to fix it quickly!<br />
<br />
<br />
= Development Phase =<br />
<br />
Development phase takes the majority of time. During this time, day-to-day development happens on SVN trunk, so all commits end up there. Stuff gets broken, stuff gets fixed, stuff gets evaluated, some might be ripped out again. See also [[SVN]] article.<br />
<br />
<br />
=== Dev Builds ===<br />
<br />
New development build/release is created roughly every 2-4 weeks (might depend on the amount of changes) from trunk. Even though these builds are unstable and untested, and may include features will be heavily changed of even removed by the time of the next major release, there are many reasons to provide them:<br />
* Beta-testers are able to bisect over development history to find when an issue started happening.<br />
* External programmers can get assets compatible with recent source code trunk.<br />
* Curious players can test new features and provide early feedback.<br />
<br />
The rest of this chapter describes how to create such a dev build.<br />
Note: mostly the same steps are done when building beta releases and major releases.<br />
<br />
<br />
=== Compile Game Binaries ===<br />
<br />
The assets SVN repo contains TDM executable files, which are copied into PK4 archives by the packager.<br />
They are rarely up-to-date, so the very first step is to build new executables from the source code and commit them to the assets repo.<br />
<br />
Ensure you have clean and most recent revision of darkmod_src repo.<br />
The detailed build instructions are provided in [[TDM Compilation Guide]], and the process of updating executables is explained in [[SVN#Executables Update]].<br />
Just a few remainders:<br />
* Better explicitly delete all executables before building. For major releases, better delete <tt>build</tt> directory and build everything from scratch.<br />
* Always build Release configuration.<br />
* Build binaries for all officially supported platforms: Linux and Windows. Deprecated 32-bit executables are '''not''' built, except for the major releases and the last beta.<br />
* Don't forget to save debug symbols (.pdb and .debug files) somewhere when you commit executables, so that you don't accidentally overwrite them later!<br />
* Note that shaders (<tt>glprogs</tt> directory) are also copied to assets repo when you build TDM, so don't forget to commit them too.<br />
<br />
The easiest way to build executables for Windows and Linux at once is to use Windows machine with Linux virtual machine. Detailed setup instructions for virtual machine are provided in [[VirtualBox: Virtual machine with Linux for TDM|VirtualBox]] and [[VMWare: Virtual machine with Linux|VMWare]] articles.<br />
<br />
Better choose fairly popular and '''old''' version of Linux, for instance a five-year-old Ubuntu LTS (still using 16.04 in 2021).<br />
Due to how GLIBC symbols versioning works, sometimes TDM executable built on a new Linux won't start on an old one.<br />
<br />
The debug symbols take quite a lot of space, but are indispensible for [[Analyze a Memory Dump|analyzing crashes]] on players' machines.<br />
So release manager must keep them safe on a local disk, and probably share them with other programmers on some cloud storage.<br />
For major releases, Windows debug symbols are even committed to the assets repo (see below).<br />
<br />
<br />
=== Release Manifest ===<br />
<br />
The "manifest" is a huge list of all the files that are nominated to go into the release package. Not all files in SVN are supposed to be released (like test files, test maps, other broken or unfinished stuff), so a white list is needed. Aside from that, some rules are needed to decide how files are divided among pk4 archives.<br />
<br />
Here are the files related to manifest:<br />
* <tt>devel/manifests/base.txt</tt>: an explicit list of files which are packaged regardless of any other conditions.<br />
* <tt>devel/manifests/darkmod_maps.txt</tt>: sequence of include/exclude commands with regexes.<br />
* <tt>devel/manifests/darkmod.txt</tt>: full manifest file generated from the previous two files using tdm_package.<br />
* <tt>devel/manifests/darkmod_pk4s.txt</tt>: set of regex-powered rules describing which files go into which pk4 archive.<br />
<br />
==== Build Manifest ====<br />
The manifest file <tt>devel/manifests/darkmod.txt</tt> is generated by the tdm_package application.<br />
I run it with the following command:<br />
* <tt>tdm_package --create-manifest --darkmoddir=G:\TheDarkMod\darkmod >update_manifest.log</tt><br />
Here darkmoddir argument points to your working copy of assets SVN (it should be clean and up-to-date).<br />
<br />
After the packager finishes, review the packager log file and the changes in the file <tt>devel/manifests/darkmod.txt</tt>.<br />
If everything looks good, commit the updated manifest to the assets repo.<br />
If not, then adjust some files (e.g. the maps file) and try again. Commit your adjustments to SVN of course.<br />
<br />
==== Include/Exclude From Manifest ====<br />
The main place to specify what should be included into release is <tt>darkmod_maps.txt</tt> file.<br />
As a rare exception, some files are specified in <tt>base.txt</tt>. But it is very small, and should probably be merged into the maps file in the future.<br />
Here is how maps file works.<br />
<br />
In the first step, all files in specific folders are included:<br />
# Include all these files (but without parsing them like maps), each<br />
# statement will include files (from SVN) in that folder:<br />
INCLUDE def/<br />
INCLUDE dds/<br />
...<br />
INCLUDE video/<br />
INCLUDE xdata/<br />
As seen in the above example, the sharp character # is used to denote comments. Put that at the beginning of a line to disable the statement.<br />
<br />
As the next step, the algorithm will exclude certain files matching the regular expressions in EXCLUDE statements like this:<br />
EXCLUDE dds/darkmod/test<br />
In 95% of the cases it's enough to just specify the path of the files you want to exclude (use forward slashes), but you can do more fancy stuff like this:<br />
EXCLUDE models/md5/chars/undead/revenant/.*.md5anim<br />
EXCLUDE ^(dds/)?models/md5/chars/undead/revenant<br />
The first line will exclude all MD5ANIM files in the revenant folder. The second line will exclude all files in models/md5/chars/undead/revenant '''and''' the ones in '''dds/'''models/md5/chars/undead/revenant (the dds/ part is marked to be optional). <br />
<br />
In summary, all files that are INCLUDE'd as denoted above and afterwards manage to get through the hundreds of lines of EXCLUDE filters will end up in the manifest file.<br />
<br />
==== Distribute files into PK4s ====<br />
Each of the thousands of files in the manifest needs to be sorted into the correct PK4.<br />
This is done by defining a rules in the file <tt>devel/manifests/darkmod_pk4s.txt</tt>. Each of the lines there defines a PK4 and which files go into it:<br />
# Miscellaneous stuff (GL Progs, Script, Language Files, Rope Arrow)<br />
tdm_base01.pk4: ^glprogs, ^script, ^strings, sound\.wav, _emptyname\.wav, ^models/md5/environments, ^dds/models/md5/environments, ...<br />
Again, lines starting with the sharp # character denote comments.<br />
<br />
Leftmost is the PK4 filename, followed by a colon character. To the right of the colon a list comma-separated patterns is defined, whereas each pattern is interpreted as regular expression. As with the <tt>darkmod_maps.txt</tt> you don't need to know very much about regular expressions to define those rules, it's usually enough to write the folder names and use wildcards like <tt>.*.md5anim</tt><br />
<br />
Note that a file will not get into the release package if no rule covers it in the darkmod_pk4s.txt, even if it is present in the full manifest.<br />
The packager prints a warning in such case when pk4 files are created.<br />
<br />
<br />
=== Create Package ===<br />
<br />
After the manifest is ready, we can finally use packager to pack working copy of assets SVN into a set of pk4 files.<br />
Make sure your working copy is clean beforehand: unversioned files will be ignored, but local modifications will get into the package!<br />
* <tt>tdm_package --create-package --darkmoddir=G:/TheDarkMod/darkmod --outputdir=G:/TheDarkMod/tmp_package >create_package.log</tt><br />
Here darkmoddir specifies path to SVN working copy, and outputdir specifies path to an empty directory where pk4 files will be generated.<br />
<br />
Be sure to look through the log file!<br />
If some file is not covered by pk4 distribution rules, you will see the corresponding message there.<br />
<br />
<br />
=== Add Release ===<br />
<br />
All versions of TDM are stored in one zipsync database, which looks like a big tree of differential packages.<br />
Read [[Tdm_installer_and_zipsync#Version_conventions]] carefully and decide 1) how to name the new version, and 2) which previously released version should serve as a parent for the new version.<br />
<br />
First of all, you need the parent version somewhere on local disk (in clean state: without any additional files).<br />
If you don't have it, you can download it via tdm_installer:<br />
# Create new directory. You can optionally copy some tdm_XXX.pk4 files to it to reduce download time.<br />
# Copy tdm_installer to the directory, start it.<br />
# On the first page, check '''"Bitwise exact zips"''' advanced setting! Also check "Get custom version".<br />
# On the second page, choose the parent version.<br />
# Optional: After installation is complete, you can delete <tt>.zipsync</tt> directory and all files with extensions other than pk4 and zip.<br />
'''Note:''' It is much easier to save all versions you create on the local disk, so that you can use them as parent versions later.<br />
<br />
Rename the directories with new version and with parent version: the directory name must match the name of the version.<br />
Let's say parent version is <tt>dev01234-8765</tt>, and new version is <tt>dev12345-9876</tt>.<br />
<br />
Run analysis on the new version (remove <tt>-j0</tt> unless data is stored on SSD):<br />
* <tt>zipsync analyze -r G:\tdmrel\dev12345-9876 -cn -j0 *.pk4 *.zip</tt><br />
Then create a differential package:<br />
* <tt>zipsync diff -r G:\tdmrel\dev12345-9876 -s G:\tdmrel\dev01234-8765\manifest.iniz -o G:\tdmrel\dev12345-9876_from_dev01234-8765</tt><br />
Detailed explanation of how to use zipsync command line tool is provided in [[Tdm installer and zipsync]].<br />
<br />
Now you need to connect to TDM server via SSH.<br />
For simplicity, I recommend storing exact copy of the whole zipsync database locally.<br />
In order to push your modifications, you can log to TDM server using WinSCP and use Commands:Synchronize with the properly set Direction/Target.<br />
<br />
Look at the directory structure in the database and put the new differential package appropriately, e.g. into <tt>dev/210/dev12345-9876_from_dev01234-8765</tt>.<br />
Then open <tt>tdm_installer.ini</tt> in text editor, find appropriate place for the new version, and add it there, e.g.:<br />
[Version dev12345-9876]<br />
manifestUrl=${MIRROR}/dev/210/dev12345-9876_from_dev01234-8765/manifest.iniz<br />
depends=dev01234-8765<br />
folder=dev/2.10<br />
When you are sure that you edited it properly, synchronize your changes to the server.<br />
Immediately after that try to switch some of your TDM installations to the new version using tdm_installer (with "Bitwise exact zips" flag).<br />
If something does not work for you, fix the problem as soon as possible.<br />
<br />
=== Changelog and Announcement ===<br />
<br />
The current tradition for changelog is:<br />
* Changelog for all the dev builds after the last major release is in the second post of [https://forums.thedarkmod.com/index.php?/topic/20824-public-access-to-development-versions/ this forum thread].<br />
* When beta phase is started, a separate thread is created for it, and changelog of all dev builds is moved to there.<br />
* Changelog for beta releases is added to the beta testing thread. One post should contain changelog for all dev builds and beta releases in chronological order.<br />
* In the message with changelog, post link to the changelog for previous versions (making a linked list of forum posts).<br />
<br />
Use SVN log over both repos to write changelog.<br />
Try to write in language which users can understand, whenever possible.<br />
Post as much links as you can: links to bugtracker as especially welcome, or links to feature discussion thread.<br />
Some very minor things can be omitted in changelog, but don't miss anything which can break something or cause any type of negative consequences.<br />
Most likely you will often read this changelog yourself =)<br />
<br />
When changelog is ready, post short message that new version is available in the appropriate forum thread.<br />
<br />
<br />
=== Dev Build: Recap ===<br />
<br />
Here are all steps for creating a new dev build:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
<br />
<br />
= Beta Phase =<br />
<br />
At some moment the development phase is over, and beta phase starts.<br />
The main goal of beta phase is to create a new major release, which will be used by most players for the next year or so.<br />
Of course, it is preceded by lengthy public beta testing.<br />
<br />
<br />
=== Agree on Schedule ===<br />
<br />
The beta phase starts with branching off the release, and typically lasts for 1-2 months after that.<br />
There is usually a rough plan about when to hold beta phase and when to release, but as time comes close, it's better to discuss it with team members again.<br />
Team members are supposed to wrap up their pending changes and commit them to the trunk before beta phase starts.<br />
About two weeks are long enough of a time span for people to get everything into SVN.<br />
<br />
<br />
=== Libraries and License ===<br />
<br />
A few weeks before branching, it is a good idea to revise the set of third-party libraries used.<br />
Starting from TDM 2.08, it should be easy to check it thanks to the new conventions on third-party stuff (see also [[Libraries and Dependencies]]).<br />
Some minor code pieces get embedded directly into the source, try to recall all of them.<br />
<br />
It is necessary to update the <tt>LICENSE.txt</tt> file in SVN repositories if something is not up-to-date.<br />
Note that you should commit the same updated file into '''both''' source code and assets repos.<br />
<br />
<br />
=== Update Script Reference ===<br />
<br />
Another thing which needs update prior to branching is the script reference.<br />
It can be regenerated using the <tt>tdm_gen_script_event_doc</tt> command in game console:<br />
* <tt>tdm_gen_script_event_doc tdm_events.script d3script</tt><br />
* <tt>tdm_gen_script_event_doc forwiki.mw mediawiki</tt><br />
The files will be created in the FM directory.<br />
Copy mediawiki output to the wiki article [[TDM Script Reference]].<br />
Copy script output to <tt>script/tdm_events.script</tt> file in the assets repo and commit.<br />
<br />
<br />
=== Branching off ===<br />
<br />
Once the deadline arrives, create the '''release branch''' in both repos: [[Image:Create release branch.png|right|350px]]<br />
* Update your working copy of assets repo (darkmod).<br />
* Update working copy of source code repo (darkmod_src) too.<br />
* Right-click the darkmod_src folder to create the branch<br />
** Select SVN > Branch/Tag...<br />
** A new dialog appears asking for a URL. Enter a URL like this: [https://server/svn/darkmod_src/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod_src/branches/releaseX.YY] where X.YY is replaced by whatever version the next release will be. <br />
** You'll probably want to switch to the new branch once it is created, so make sure the check button at the bottom of the dialog is active.<br />
** Hit OK to let the SVN server create the branch.<br />
* Do the same for darkmod repository, using the URL scheme [https://server/svn/darkmod/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod/branches/releaseX.YY]<br />
<br />
At this point there is new "release" branch in each of the two repos.<br />
The release branch and trunk live independently from each other: each working copy is attached to one of these branches, and commits done to one branch do not change the state of the other.<br />
All the beta releases and the final major release will be packaged from the release branch, thus it is important to keep it stable and only commit there the changes which are necessary for the release.<br />
Trunk will continue to evolve after the beta phase ends, so it is in principle possible to commit there some work which is not intended for release (although not desirable).<br />
<br />
The release manager has to establish the workflow for developers, in order to avoid confusion with changes and branches.<br />
The typical workflow is: everyone commits his changes to trunk and notifies release manager that changes are intended for release, release manager merges the necessary changes to release branch when needed.<br />
If developer knows well how to deal with branches and commits merging in SVN, he can also merge his commits to release branch himself.<br />
<br />
While trunk is technically independent from release branch, it is desirable to freeze or at least cool down all development not intended for the upcoming release.<br />
The reason for that is that during beta phase it is necessary to merge commits between branches a lot.<br />
If you merge 100% of commits from trunk to release, then beta phase can last forever or some major bug can slip into release at the last moment.<br />
On the other hand, the more unmerged commits you have, the more likely merge conflicts become.<br />
Refactoring, files renaming, and massive changes over the codebase are strongly discouraged.<br />
<br />
<br />
=== Publish Beta Release ===<br />
<br />
Beta release is created and published the same way as dev build.<br />
The main difference is that dev builds are created on SVN trunk, and beta releases are created on the release branch.<br />
So make sure your SVN working copy is switched to release branch both in the source code repo and in the assets repo.<br />
Another difference between dev builds and beta releases is [[Tdm_installer_and_zipsync#Version_conventions|naming TDM versions in zipsync database]].<br />
<br />
Once again, the steps are:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
The announcement differs greatly when beta phase starts.<br />
Usually release manager creates a dedicated forum thread in public subforum, like e.g. [https://forums.thedarkmod.com/index.php?/topic/20691-beta-testing-209/ Beta Testing 2.09].<br />
This thread should contain changelog of beta releases. Changelog of dev builds should be moved here too.<br />
I usually reserve three forum post immediately: the first one on how to install and what is beta about, the second one giving high-level overview of changes and new cvars/commands, and the third one with detailed changelog.<br />
<br />
<br />
=== Testing Cycle ===<br />
<br />
After beta release is published, testers update to it and post their bug reports.<br />
Developers investigate them and fix whatever they can.<br />
In typical workflow, the fixes are committed to the trunk (both for darkmod and darkmod_src repos), and the release manager merges them into the release branch.<br />
<br />
One point to keep in mind is that SVN does not have real branches: a branch is merely a copy of the whole directory.<br />
As the result, SVN does not have proper branch merging either: it simply takes the selected commits as patches and reapplies them onto the working copy (more like cherry-picking).<br />
This is not a big problem in our context, since usually you don't want to merge everything: only a nontrivial subset of commits from trunk will be merged into the release branch.<br />
In order to avoid confusion, keep an eye on svn:mergeinfo property: it should list the commits which were merged, so that you don't merge them again.<br />
<br />
Here is how I merge commits from trunk to release branch using TortoiseSVN:<br />
* Make sure your working copy is switched to the release branch and is clean from local modifications.<br />
* Now right-click the SVN root directory and choose SVN > Merge.<br />
* Select ''Merge a range of revisions''.<br />
* As ''URL to merge from'' use the address of the trunk.<br />
* In the field ''Revision range to merge'', click the ''Show Log'' button right next to the entry field. You will see log of commits in trunk, with the already merged commits greyed out. You can select one commit, or hold Ctrl to select an arbitrary subset of commits. You can press Ctrl+C when you finish selection, then paste the list of commits to a text file: later you can post it to developers so that they understand what was merged.<br />
* Hit ''Next'', then ''Merge''.<br />
* Now that the changes are incorporated into your working copy, test and review them briefly and commit to release branch.<br />
<br />
After some number of fixes has been committed and merged to release branch, repeat again from section [[#Publish Beta Release]].<br />
Publish new beta release, wait for feedback, fix, merge fixes to release branch, publish new release, etc.<br />
<br />
= Major Release =<br />
<br />
At some moment beta phase ends, and the next major release is created from the latest state of the release branch.<br />
<br />
<br />
=== Finalization ===<br />
<br />
The common approach is to turn the latest beta release (called "release candidate") into the major release without even rebuilding/repackaging it.<br />
In such case you can take the full package of release candidate and proceed directly to [[#Add Release]] section: determine how major release is named (e.g. <tt>release210</tt>), its parent version (it is always the previous major release), create differential package, upload it to server and update tdm_installer.ini.<br />
When editing tdm_installer.ini, move the <tt>default=1</tt> line from the previous major release to the new one.<br />
<br />
The next thing is saving Windows debug symbols. You must have saved them when you built executables which are in the final package. If you did not save them, then you cannot simply publish the existing package, and you have to start over from section [[#Compile Game Binaries]].<br />
Compress debug symbols (TheDarkModx64.pdb and thedarkmod.x64.debug) with 7z, put them into devel/release/debugging/X.YY in assets repo. Commit them to both to trunk and to release branch (commit + merge).<br />
<br />
Exact state of SVN repos should be saved for every major release.<br />
So create a tag <tt>tags/X.YY</tt> in both SVN repos from the state of the release branch that you used to create release from.<br />
<br />
While 32-bit executables are deprecated, we still provide them as a separate download for the latest major version.<br />
Thus, you should take 32-bit executables <tt>TheDarkMod.exe</tt> and <tt>thedarkmod.x86</tt> and pack them into <tt>tdm_exe32.zip</tt>.<br />
If you did not build 32-bit executables previously, build them exactly from the same source code which was used to build 64-bit executables.<br />
Put them at <tt>_aux/XYY/tdm_exe32.zip</tt> in the zipsync database (where X.YY is the TDM version).<br />
<br />
=== Update Website ===<br />
<br />
Be sure to update the following pages on the website to reflect the latest release version:<br />
* [http://www.thedarkmod.com/downloads/ http://www.thedarkmod.com/downloads/]<br />
* [http://www.thedarkmod.com/download-sourcecode/ http://www.thedarkmod.com/download-sourcecode/]<br />
<br />
To generate the latest source code package for the pages above:<br />
* Export the code from the release tag. E.g. svn export https://svn.thedarkmod.com/svn/darkmod_src/tags/x.yy<br />
* Create a 7zip archive with the following naming convention: thedarkmod.x.yy.src.7z<br />
** 7z a -r ../thedarkmod.x.yy.src.7z ./* <br />
* Upload the source code archive to http://www.thedarkmod.com/sources (ask admin for assistance with this or use the ftp upload user)<br />
<br />
Also update the link to 32-bit executables.<br />
It should point to <tt>https://update.thedarkmod.com/zipsync/_aux/XYY/tdm_exe32.zip</tt> --- that's where it was put inside the zipsync database.<br />
<br />
=== Update Wiki ===<br />
<br />
The wiki contains one page for each release. You can find them all in the [[:Category:What's New]] category. <br />
<br />
First update the current release page:<br />
<br />
* Change the "roadmap" link on the current release to a "changelog" link by swapping ''"roadmap_page.php?version_id=XX"'' with ''"changelog_page.php?version=XX"''.<br />
* Add the ''<nowiki>{{released|2.01|2014-01-30}}</nowiki>'' Template on top of the current release page with the correct date.<br />
<br />
Then add a new page for the next release. To do this, add a link to it in this template: [[Template:Whatsnew]] by editing it. After saving the template, a link to the new release version page appears in the list and in the category. Edit this page and insert some text into it (you can copy it from an older release page).<br />
<br />
Also insert a link to the current roadmap on the bugtracker, you can find out the version_id by looking at [http://bugs.thedarkmod.com/roadmap_page.php the roadmap page].<br />
<br />
<br />
=== Forum Announcement ===<br />
<br />
Post thread about new version on the [https://forums.thedarkmod.com/index.php?/forum/10-news-amp-announcements/ News & Announcements] subforum.<br />
<br />
<br />
=== Back to Development Phase ===<br />
<br />
After the dust of release settles, it's time to start the next release cycle and return to development phase.<br />
* Make sure all changes from release branch are also present in trunk, since you will unlikely return to the release branch in future.<br />
* Switch working copies of both repos back to trunk.<br />
* Open <tt>framework/Licensee.h</tt> in the source code repo, and update <tt>TDM_VERSION_MAJOR</tt>, <tt>TDM_VERSION_MINOR</tt>, <tt>ENGINE_VERSION</tt> for the next major release. Commit the change.<br />
* Go to [https://bugs.thedarkmod.com/manage_proj_page.php Manage section of bugtracker], choose The Dark Mod project. Click "Edit" for the just released version, set it to "Released" state. Add new version if not yet present.<br />
<br />
<br />
=== Hotfix Release ===<br />
<br />
Ideally, players use the major release for about a year, until the next major release comes out.<br />
But in the real world, we often discover some issues which cannot/shouldn't be delayed until the next major release.<br />
In such case, it is possible to create a special release, which is historically called "hotfix" release.<br />
It is something like a "patch release" from semantic versioning: a new version which is almost the same as the major release, but with a few small fixes added.<br />
<br />
The hotfix release is created from the previous release branch.<br />
For instance, if 2.09 is the last published major release and 2.10 is currently in development, then hotfix release 2.09a is created from release2.09 branch (in both SVN repos).<br />
Review Changelog or SVN commits since the last major release, and choose the changes which should be added in the hotfix. Discuss them with team members.<br />
Proper beta phase lasts months, and you don't want to waste much time on hotfix release, so be very careful and critical about the changes you include:<br />
* Included commits should be done some time ago, so that at least developers have already tested them.<br />
* Included commits must not break savegame format, i.e. they must not change any calls to <tt>idSaveGame</tt>/<tt>idRestoreGame</tt> objects.<br />
* Included commits should be small and have little risk of breaking something.<br />
* Do not include commits which provide a new feature: new features are for new major release.<br />
Usually, commits are included in the following cases:<br />
* Fixing game crashes, race conditions, data corruption. Especially the ones which players bump into.<br />
* Fixing wrong usage of OpenGL API. Or adding workarounds for bad OpenGL drivers. Same for OpenAL and other machine-dependent stuff.<br />
* Fixing interaction with outside projects (FM database, DarkRadiant, tdm_installer, etc.) in case it has been broken.<br />
<br />
Note that unlike typical convention, we guarantee full savegame compatibility between the hotfix release and its predecessor.<br />
The game writes SVN revision into every savegame and checks that it is the same when it loads game, complaining if it does not match.<br />
To silence this warning, go to the method <tt>RevisionTracker::GetSavegameRevision</tt> and make it return the hardcoded number: the revision reported by the original major release.<br />
Commit this change to branch (but '''not''' to trunk): now all executables created from this branch will use the same revision number when writing and reading savegames.<br />
Don't forget to test that savegames created in original release load properly in hotfix release and vice versa.<br />
<br />
When everyone agrees on the set of included commits, merge them all to the release branch.<br />
<br />
Now do the typical steps for creating a new release:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
Use release branch. Name the added version appropriately in zipsync database (e.g. <tt>release209a</tt>).<br />
Write announcement on public forums with changelog describing the merged commits, and instructions how to get hotfix (like [https://forums.thedarkmod.com/index.php?/topic/20930-beta-testing-209a-aka-hotfix/ this one]).<br />
<br />
After a very brief public beta-testing, move the <tt>default=1</tt> line from the original release to the hotfix release in <tt>tdm_installer.ini</tt>.<br />
Now everyone who runs tdm_installer without explicitly specifying version will get the hotfix release.<br />
<br />
Now do the ordinary finalization steps:<br />
# Publish 32-bit executables.<br />
# Commit 7zipped Windows PDB files to <tt>devel/release/debugging</tt>, replacing the files from original release.<br />
# Create SVN tags in both repos.<br />
# Update website: replace link to 32-bit executables and source code archive.<br />
# Write announcements, so that people know they should update.<br />
<br />
Of course, you can provide more than one hotfix release for one major release: 2.09a, 2.09b, 2.09c, etc.<br />
Also note that the original release is not lost: players can even install it if they want.</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Subtitles&diff=30844Subtitles2023-06-27T16:30:04Z<p>Stgatilov: Fixed "fromVideo" explanation and example: it should be material name, not video file name.</p>
<hr />
<div>Support for subtitles (or closed captions) was added in TDM 2.10.<br />
<br />
=== What the player sees ===<br />
In 2.10+, the player can control subtitle visualization under Settings/Audio/Subtitles, which takes one of these values:<br />
* Story - display only story-related subtitles<br />
* On - display subtitles for all speech<br />
* Off - disable subtitles<br />
"Story" is the default. If "On" is chosen, story and non-story speech subtitles (like for AI "barks") appear.<br />
<br />
Each subtitle has an implicit or explicit start and end time relative to its audio clip. To handle multiple overlapping sounds, the text is not interwoven; instead, there are 3 separate, non-overlapping fields, stacked in the lower part of the screen. When a subtitle is shown, it is as white text on a translucent field-rectangle background. A text line that is too long is wrapped to two lines.<br />
<br />
One immediate purpose for TDM's subtitles is to provide English captions for English audio. This will assist understanding of accented dialog for those who are hearing-impaired or whose English is less fluent. (In theory, subtitles could be relied upon to play an FM silently, but the lack of audio positional and distance cues, e.g., for footsteps, would be detrimental.)<br />
<br />
As for translation, i.e., subtitles shown in other TDM-supported languages, the current system provides an important and usable building block. An FM author could employ it to provide "story" subtitles in a particular language other than English. Furthermore, a non-TDM site for a specific non-English audience - one that hosts full ports of TDM and its FMs - could create its own subtitle files in the target language. Other ideas for future capabilities, such as easy switching among multiple subtitle languages, are [https://forums.thedarkmod.com/index.php?/topic/21741-subtitles-possibilities-beyond-211/ under discussion].<br />
<br />
=== Rollout so far ===<br />
''As of 2.11''<br />
<br />
The "Subtitles" setting affects the CVar "cv_tdm_subtitles", as follows:<br />
* Story --> 1 --- show only story-relevant<br />
* On --> 2 --- show all speech<br />
* Off --> 0 --- hide all<br />
<br />
There is an additional cv_tdm_subtitles value, 3. It means "show everything", including additional subtitles for sound effects. No core sound effect subtitles are provided yet.<br />
<br />
Subtitles are not generated on the fly. They are pre-encoded into game files (as detailed below), and this will take human effort over time. "Story" subtitles are chiefly associated with custom sound files and typically the responsibility of the FM author. Conversely, subtitles for AI standard speech phrases (as well as standard sound effects) are seen as mainly core resources. <br />
<br />
For the FMs included in the standard distribution, "Tears of Saint Lucia" (in 2.10) and "A New Job" (planned in 2.11) have "Story" speech English subtitles.<br />
<br />
Non-story speech (as of 2.10) is limited to a dozen phrases of the "Cynic" voice, used by some attacking guards. Since this is part of the core distribution, these English subtitles become available to existing games automatically. [https://forums.thedarkmod.com/index.php?/topic/21740-english-subtitles-for-ai-barks/ A project to expand this coverage for 2.12] has been started.<br />
<br />
=== How it works ===<br />
<br />
Subtitles work on a very low level: where the engine manages sound samples and sound channels.<br />
This approach allows to reliably add subtitles for sounds of any kind, but has some downsides too: the system does '''not''' know anything at all about entities, spawnargs, scripts, and other gameplay stuff.<br />
The system allows to assign chunks of text directly to sound samples (which are usually .ogg and .wav files), so that when a sound sample is played, the assigned text is shown on the screen.<br />
<br />
=== Subtitles decls ===<br />
<br />
The assignment of text to sound samples is specified in a new type of decl files. These files must:<br />
# be in '''subtitles''' directory,<br />
# have '''.subs''' extension,<br />
# contain declarations of type '''subtitles'''.<br />
For comparison, materials are another type of decls, which must be in <tt>materials</tt> directory, in files with <tt>.mtr</tt> extension, and be of type <tt>material</tt>.<br />
<br />
To avoid any conflicts between core game and missions, FM authors should follow the conventions:<br />
# Names of subtitles decl files must start with '''fm_''', e.g.: <tt>fm_conversations.subs</tt><br />
# Names of declarations must start with '''fm_''' too, e.g.: <tt>fm_paul_intro_convo</tt><br />
<br />
Here is an example of <tt>fm_conversations.subs</tt> contents:<br />
<br />
//note: comments work as they normally do<br />
<br />
subtitles fm_intro_convo {<br />
verbosity story<br />
inline "sound/voices/paul/sound1.ogg" "My name is Paul, and I'm a city guard."<br />
inline "sound/voices/bjorn/sound2.ogg" "Welcome to Anonymous City Guards! Call me Bjorn."<br />
inline "sound/voices/paul/sound3.ogg" "I started cutting thieves' throats when I was 17..."<br />
inline "sound/voices/paul/sound4.ogg" "... and now I cannot stop doing that!"<br />
<br />
verbosity effect<br />
inline "sound/voices/paul/sound5.ogg" "(starts weeping)"<br />
<br />
verbosity story<br />
inline "sound/voices/bjorn/sound6.ogg" "Calm down, Paul! We all were in your shoes!"<br />
inline "sound/voices/bjorn/sound7.ogg" "Let us first watch an educational video about the harm from cutting throats."<br />
<br />
srt "sound/voices/bjorn/sound8_long.ogg" "sound/voices/bjorn/sound8_long.srt"<br />
}<br />
<br />
subtitles fm_briefing {<br />
verbosity story<br />
srt "fromVideo video/sts_briefing_intro" "video/briefing/briefing.srt"<br />
}<br />
<br />
==== displayed text ====<br />
<br />
There are two ways to specify subtitle text: inline and srt-based.<br />
<br />
'''inline''' command is followed by a name of sound sample and the text to be displayed while it is being played.<br />
In this case, the text is written straight in the decl file, and it is displayed for the whole duration of the sound sample.<br />
This way is convenient for short sounds, which are the majority of sound samples, including phrases of a conversation. A "\n" can be embedded in the text to force a line break.<br />
<br />
'''srt''' command is followed by paths to a sound sample and its .srt file, typically with matching filenames. This method, while more complicated than inline, has the flexibility to support a long sound file that needs multiple sequential subtitles, such as the sound sample of a briefing video. An .srt file, in "SubRip" format, is usually placed either with its sound file or in a "subtitles" folder. It contains a sequence of text messages to show during the sound sample, each with start and end HH:MM:SS,sss timestamps within the sample's timeline. For example:<br />
1<br />
00:00:03,612 --> 00:00:10,376<br />
Bugger me!<br />
Something's wrong with this crystal ball.<br />
<br />
2<br />
00:00:25,336 --> 00:00:28,167<br />
Ah! Here we go. <br />
Creating .srt files is best done with third-party AV software, not writing them manually. For TDM, files must be in engine-native encoding (internationalization is not supported yet anyway) and have no BOM mark. While implementations of the [https://en.wikipedia.org/wiki/Subrip#SubRip_file_format "SubRip" file format] often include HTML-style markups for font attributes like bold or italics, these are not possible for TDM. What TDM ''does'' have is limited primary-color font markup, applicable to inline and srt subtitles; see [[Text_Decals_for_Signs_etc.#Signs_with_Illuminated_Colored_Letters | Signs_with_Illuminated_Colored_Letters]] for details.<br />
<br />
==== sound sample ====<br />
<br />
In order to specify sound sample, write path to the file the same way you do e.g. in sound shaders.<br />
<br />
One complicated case is when you have an [[Cutscene_video_with_FFmpeg#Play_video_with_sound|FFmpeg-based video with embedded sound]].<br />
In this case write material name, prepended with '''fromVideo''' keyword and space, just like you do in the sound shader.<br />
See <tt>fm_briefing</tt> in the example above.<br />
<br />
==== verbosity ====<br />
<br />
Currently there are three verbosity levels for subtitles:<br />
<br />
* '''story''': This level should be applied to all story-related subtitles, everything that player should absolutely notice and understand.<br />
* '''speech''': This is for subtitles of speech which is usually of little interest to the player, or is repeated too often. For instance, regular AI barks (e.g. "I'll get ya!") belong here.<br />
* '''effect''': This level is reserved for non-speech subtitles which have little interest to the player, like "(bang)" or "(ding)", etc.<br />
<br />
It is not yet clear how exactly these levels will be used in the long term. For now:<br />
<br />
# By default, players only see <tt>story</tt>-level subtitles, although they can enable the other two categories in settings, or disable subtitles entirely.<br />
# It is expected that almost all FM-specific subtitles get into <tt>story</tt> category. The other two exist mostly for core TDM sounds, which include a lot of AI barks (<tt>speech</tt> level) and trivial sound effects like arrow hit (<tt>effect</tt> level).<br />
<br />
Every subtitles declaration must start with '''verbosity''' command.<br />
This command applies to all the subsequent commands, until the other <tt>verbosity</tt> is met or declaration ends (whichever happens first).<br />
For instance, all subtitles have <tt>story</tt> verbosity level in the example above, except for the "(starts weeping)" text, which has <tt>effect</tt> verbosity.<br />
<br />
==== include ====<br />
<br />
While the engine parses all declarations that are present in the files, the subtitles system only uses one subtitles decl named <tt>tdm_root</tt>. ''Include'' commands are used in order to put other subtitle decls into it. (The <tt>tdm_root</tt> decl is in file <tt>tdm_root.subs</tt>. As of TDM 2.11, this file, and all core non-game-specific tdm_*.subs, can be found in tdm_sound_vocals_decls01.pk4/subtitles/. An ''fm_root.subs'' file exists there, whose stub fm_root decl is over-ridden by your FM's fm_root as described next.)<br />
<br />
'''include''' command has one argument: the name of the subtitles decl to be included. Note that it is the name of the decl, not the name of the file which contains it! Included decl can in turn include other decls.<br />
<br />
FM-specific subtitles are always included from the decl named '''fm_root''', which must be in the '''fm_root.subs''' file. For instance, the contents of the <tt>fm_conversations.subs</tt> file from the example above will have no effect until we add the file <tt>fm_root.subs</tt> with contents:<br />
<br />
/**<br />
* This file should be overridden in order to provide mission-specific subtitles.<br />
* When doing so, please follow the conventions:<br />
* 1) The root decl is called "fm_root" and is located in file "fm_root.subs".<br />
* 2) All other subtitle decls start with "fm_" prefix and are located in files starting with "fm_".<br />
*/<br />
<br />
subtitles fm_root {<br />
include "fm_intro_convo"<br />
include "fm_briefing"<br />
include "fm_much_later" // points to the decl below<br />
}<br />
<br />
// Decls and their "inline"/"srt" commands can be in the fm_root.subs file, not just in other .subs files:<br />
subtitles fm_much_later { <br />
verbosity story<br />
inline "sound/voices/paul/sound14.ogg" "Where did I put that knife sharpener?"<br />
}<br />
<br />
Notice that one decl can be used to do any number of subtitle assignments, so it is not necessary to have many decls and decl files. The easiest way to do FM-specific subtitles is to have one <tt>fm_root.subs</tt> file with one <tt>fm_root</tt> decl, and specify all your subtitles right there. Splitting subtitles across decls and files is entirely optional and can be used for grouping subtitles. It was added mainly for core TDM sounds: there are several thousands of them, so keeping all subtitles in a single file can become a headache quickly.<br />
<br />
=== Output ===<br />
<br />
The subtitles which should be displayed right now are provided to GUI code as '''gui::subtitleN''' variables, where N ranges from 0 to 3 (although only 0 to 2 will be made visible by the standard GUI scripting described next).<br />
GUI scripts display these variables as non-overlapping text messages. Given a logical screen height of 480, each of the 3 fields is 45 units high. N = 0 is the lowest, at Y-origin 400; 1 at 350; 2 at 300.<br />
The responsible code is located in <tt>tdm_subtitles_common.gui</tt> file, and is already used in several places:<br />
* in the following states of the main menu: briefing, briefing video, and debriefing video<br />
* in the always-on GUI overlay during gameplay<br />
<br />
For example, here is how it is used in <tt>mainmenu_briefing.gui</tt>:<br />
<br />
//note: each include of tdm_subtitles_common must have different name prefix!<br />
#define SUBTITLES_NAMEPREFIX Briefing<br />
#include "guis/tdm_subtitles_common.gui"<br />
<br />
Usually, you don't need to do anything about it. However, this information can be relevant if you write some custom GUI and want to see subtitles there.<br />
<br />
Note: it is not clear yet which kind of customization is necessary for the subtitles GUI.<br />
If you have any ideas, please share them on forums.<br />
<br />
=== See also ===<br />
<br />
'''TODO:''' "Tears of Saint Lucia" mission as an example?...<br />
<br />
{{GUI}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Subtitles&diff=30680Subtitles2023-02-08T20:54:43Z<p>Stgatilov: gamer -> player</p>
<hr />
<div>Support for subtitles (or closed captions) was added in TDM 2.10.<br />
<br />
=== What the player sees ===<br />
In 2.10+, the player can control subtitle visualization under Settings/Audio/Subtitles, which takes one of these values:<br />
* Story - display only story-related subtitles<br />
* On - display subtitles for all speech<br />
* Off - disable subtitles<br />
"Story" is the default. If "On" is chosen, story and non-story speech subtitles (like for AI "barks") appear.<br />
<br />
Each subtitle has an implicit or explicit start and end time relative to its audio clip. To handle multiple overlapping sounds, the text is not interwoven; instead, there are 3 separate, non-overlapping fields, stacked in the lower part of the screen. When a subtitle is shown, it is as white text on a translucent field-rectangle background. A text line that is too long is wrapped to two lines.<br />
<br />
One immediate purpose for TDM's subtitles is to provide English captions for English audio. This will assist understanding of accented dialog for those who are hearing-impaired or whose English is less fluent. (In theory, subtitles could be relied upon to play an FM silently, but the lack of audio positional and distance cues, e.g., for footsteps, would be detrimental.)<br />
<br />
As for translation, i.e., subtitles shown in other TDM-supported languages, the current system provides an important and usable building block. An FM author could employ it to provide "story" subtitles in a particular language other than English. Furthermore, a non-TDM site for a specific non-English audience - one that hosts full ports of TDM and its FMs - could create its own subtitle files in the target language. Other ideas for future capabilities, such as easy switching among multiple subtitle languages, are [https://forums.thedarkmod.com/index.php?/topic/21741-subtitles-possibilities-beyond-211/ under discussion].<br />
<br />
=== Rollout so far ===<br />
''As of 2.11''<br />
<br />
The "Subtitles" setting affects the CVar "cv_tdm_subtitles", as follows:<br />
* Story --> 1 --- show only story-relevant<br />
* On --> 2 --- show all speech<br />
* Off --> 0 --- hide all<br />
<br />
There is an additional cv_tdm_subtitles value, 3. It means "show everything", including additional subtitles for sound effects. No core sound effect subtitles are provided yet.<br />
<br />
Subtitles are not generated on the fly. They are pre-encoded into game files (as detailed below), and this will take human effort over time. "Story" subtitles are chiefly associated with custom sound files and typically the responsibility of the FM author. Conversely, subtitles for AI standard speech phrases (as well as standard sound effects) are seen as mainly core resources. <br />
<br />
For the FMs included in the standard distribution, "Tears of Saint Lucia" (in 2.10) and "A New Job" (planned in 2.11) have "Story" speech English subtitles.<br />
<br />
Non-story speech (as of 2.10) is limited to a dozen phrases of the "Cynic" voice, used by some attacking guards. Since this is part of the core distribution, these English subtitles become available to existing games automatically. [https://forums.thedarkmod.com/index.php?/topic/21740-english-subtitles-for-ai-barks/ A project to expand this coverage for 2.12] has been started.<br />
<br />
=== How it works ===<br />
<br />
Subtitles work on a very low level: where the engine manages sound samples and sound channels.<br />
This approach allows to reliably add subtitles for sounds of any kind, but has some downsides too: the system does '''not''' know anything at all about entities, spawnargs, scripts, and other gameplay stuff.<br />
The system allows to assign chunks of text directly to sound samples (which are usually .ogg and .wav files), so that when a sound sample is played, the assigned text is shown on the screen.<br />
<br />
=== Subtitles decls ===<br />
<br />
The assignment of text to sound samples is specified in a new type of decl files. These files must:<br />
# be in '''subtitles''' directory,<br />
# have '''.subs''' extension,<br />
# contain declarations of type '''subtitles'''.<br />
For comparison, materials are another type of decls, which must be in <tt>materials</tt> directory, in files with <tt>.mtr</tt> extension, and be of type <tt>material</tt>.<br />
<br />
To avoid any conflicts between core game and missions, FM authors should follow the conventions:<br />
# Names of subtitles decl files must start with '''fm_''', e.g.: <tt>fm_conversations.subs</tt><br />
# Names of declarations must start with '''fm_''' too, e.g.: <tt>fm_paul_intro_convo</tt><br />
<br />
Here is an example of <tt>fm_conversations.subs</tt> contents:<br />
<br />
//note: comments work as they normally do<br />
<br />
subtitles fm_intro_convo {<br />
verbosity story<br />
inline "sound/voices/paul/sound1.ogg" "My name is Paul, and I'm a city guard."<br />
inline "sound/voices/bjorn/sound2.ogg" "Welcome to Anonymous City Guards! Call me Bjorn."<br />
inline "sound/voices/paul/sound3.ogg" "I started cutting thieves' throats when I was 17..."<br />
inline "sound/voices/paul/sound4.ogg" "... and now I cannot stop doing that!"<br />
<br />
verbosity effect<br />
inline "sound/voices/paul/sound5.ogg" "(starts weeping)"<br />
<br />
verbosity story<br />
inline "sound/voices/bjorn/sound6.ogg" "Calm down, Paul! We all were in your shoes!"<br />
inline "sound/voices/bjorn/sound7.ogg" "Let us first watch an educational video about the harm from cutting throats."<br />
<br />
srt "sound/voices/bjorn/sound8_long.ogg" "sound/voices/bjorn/sound8_long.srt"<br />
}<br />
<br />
subtitles fm_briefing {<br />
verbosity story<br />
srt "fromVideo video/briefing/briefing.mp4" "video/briefing/briefing.srt"<br />
}<br />
<br />
==== displayed text ====<br />
<br />
There are two ways to specify subtitle text: inline and srt-based.<br />
<br />
'''inline''' command is followed by a name of sound sample and the text to be displayed while it is being played.<br />
In this case, the text is written straight in the decl file, and it is displayed for the whole duration of the sound sample.<br />
This way is convenient for short sounds, which are the majority of sound samples, including phrases of a conversation.<br />
<br />
'''srt''' command is followed by a name of sound sample and a path to .srt file.<br />
The <tt>.srt</tt> file format is described e.g. [https://en.wikipedia.org/wiki/Subrip#SubRip_file_format].<br />
The file must be in engine-native encoding (internationalization is not supported yet anyway) and have no BOM mark.<br />
It contains a sequence of text messages to show during the sound sample, with timestamps and durations.<br />
It is recommended to use common software to create .srt files for sound samples, instead of writing them manually.<br />
This way is more flexible but more complicated, and it is only necessary for long sounds, for instance sound sample of a briefing video.<br />
<br />
==== sound sample ====<br />
<br />
In order to specify sound sample, write path to the file the same way you do e.g. in sound shaders.<br />
<br />
One complicated case is when you have an [[Cutscene_video_with_FFmpeg#Play_video_with_sound|FFmpeg-based video with embedded sound]].<br />
In this case write path to the video file, prepended with '''fromVideo''' keyword and space, just like you do in the sound shader.<br />
See <tt>fm_briefing</tt> in the example above.<br />
<br />
==== verbosity ====<br />
<br />
Currently there are three verbosity levels for subtitles:<br />
<br />
* '''story''': This level should be applied to all story-related subtitles, everything that player should absolutely notice and understand.<br />
* '''speech''': This is for subtitles of speech which is usually of little interest to the player, or is repeated too often. For instance, regular AI barks (e.g. "I'll get ya!") belong here.<br />
* '''effect''': This level is reserved for non-speech subtitles which have little interest to the player, like "(bang)" or "(ding)", etc.<br />
<br />
It is not yet clear how exactly these levels will be used in the long term. For now:<br />
<br />
# By default, players only see <tt>story</tt>-level subtitles, although they can enable the other two categories in settings, or disable subtitles entirely.<br />
# It is expected that almost all FM-specific subtitles get into <tt>story</tt> category. The other two exist mostly for core TDM sounds, which include a lot of AI barks (<tt>speech</tt> level) and trivial sound effects like arrow hit (<tt>effect</tt> level).<br />
<br />
Every subtitles declaration must start with '''verbosity''' command.<br />
This command applies to all the subsequent commands, until the other <tt>verbosity</tt> is met or declaration ends (whichever happens first).<br />
For instance, all subtitles have <tt>story</tt> verbosity level in the example above, except for the "(starts weeping)" text, which has <tt>effect</tt> verbosity.<br />
<br />
==== include ====<br />
<br />
While the engine parses all declarations that are present in the files, the subtitles system only uses one subtitles decl named <tt>tdm_root</tt>. ''Include'' commands are used in order to put other subtitle decls into it. (The <tt>tdm_root</tt> decl is in file <tt>tdm_root.subs</tt>. As of TDM 2.11, this file, and all core non-game-specific tdm_*.subs, can be found in tdm_sound_vocals_decls01.pk4/subtitles/. An ''fm_root.subs'' file exists there, whose stub fm_root decl is over-ridden by your FM's fm_root as described next.)<br />
<br />
'''include''' command has one argument: the name of the subtitles decl to be included. Note that it is the name of the decl, not the name of the file which contains it! Included decl can in turn include other decls.<br />
<br />
FM-specific subtitles are always included from the decl named '''fm_root''', which must be in the '''fm_root.subs''' file. For instance, the contents of the <tt>fm_test.subs</tt> file from the example above will have no effect until we add the file <tt>fm_root.subs</tt> with contents:<br />
<br />
/**<br />
* This file should be overridden in order to provide mission-specific subtitles.<br />
* When doing so, please follow the conventions:<br />
* 1) The root decl is called "fm_root" and is located in file "fm_root.subs".<br />
* 2) All other subtitle decls start with "fm_" prefix and are located in files starting with "fm_".<br />
*/<br />
<br />
subtitles fm_root {<br />
include "fm_intro_convo"<br />
include "fm_briefing"<br />
include "fm_much_later" // points to the decl below<br />
}<br />
<br />
// Decls and their "inline"/"srt" commands can be in the fm_root.subs file, not just in other .subs files:<br />
subtitles fm_much_later { <br />
verbosity story<br />
inline "sound/voices/paul/sound14.ogg" "Where did I put that knife sharpener?"<br />
}<br />
<br />
Notice that one decl can be used to do any number of subtitle assignments, so it is not necessary to have many decls and decl files. The easiest way to do FM-specific subtitles is to have one <tt>fm_root.subs</tt> file with one <tt>fm_root</tt> decl, and specify all your subtitles right there. Splitting subtitles across decls and files is entirely optional and can be used for grouping subtitles. It was added mainly for core TDM sounds: there are several thousands of them, so keeping all subtitles in a single file can become a headache quickly.<br />
<br />
=== Output ===<br />
<br />
The subtitles which should be displayed right now are provided to GUI code as '''gui::subtitleN''' variables, where N ranges from 0 to 3 (although only 0 to 2 will be made visible by the standard GUI scripting described next).<br />
GUI scripts display these variables as non-overlapping text messages. Given a logical screen height of 480, each of the 3 fields is 45 units high. N = 0 is the lowest, at Y-origin 400; 1 at 350; 2 at 300.<br />
The responsible code is located in <tt>tdm_subtitles_common.gui</tt> file, and is already used in several places:<br />
* in the following states of the main menu: briefing, briefing video, and debriefing video<br />
* in the always-on GUI overlay during gameplay<br />
<br />
For example, here is how it is used in <tt>mainmenu_briefing.gui</tt>:<br />
<br />
//note: each include of tdm_subtitles_common must have different name prefix!<br />
#define SUBTITLES_NAMEPREFIX Briefing<br />
#include "guis/tdm_subtitles_common.gui"<br />
<br />
Usually, you don't need to do anything about it. However, this information can be relevant if you write some custom GUI and want to see subtitles there.<br />
<br />
Note: it is not clear yet which kind of customization is necessary for the subtitles GUI.<br />
If you have any ideas, please share them on forums.<br />
<br />
=== See also ===<br />
<br />
'''TODO:''' "Tears of Saint Lucia" mission as an example?...<br />
<br />
{{GUI}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Release_Mechanics&diff=30662TDM Release Mechanics2023-02-05T11:10:56Z<p>Stgatilov: 32-bit executables package: use https in download link</p>
<hr />
<div>This article describes the process of creating TDM releases.<br />
<br />
<br />
= Preliminaries =<br />
<br />
Before even starting to build a package, make sure you have all the following tools ready.<br />
<br />
<br />
=== Packager ===<br />
<br />
The tdm_package tool inspects your working copy of assets SVN, and generates PK4 archives from it.<br />
<br />
Prebuilt Windows executable can be downloaded from TDM server: [http://update.thedarkmod.com/zipsync/tdm_package.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_update</tt> subdirectory.<br />
Build instructions:<br />
* Windows: Open <tt>tdm_update.sln</tt>, build Release configuration<br />
* Linux: Run <tt>scons BUILD="release"</tt><br />
As the result, packager executable <tt>tdm_package.???</tt> will be created in <tt>bin</tt> subdirectory.<br />
<br />
<br />
If the packager tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
'''TODO:''' update this section when [https://bugs.thedarkmod.com/view.php?id=5076 #5076] is done.<br />
<br />
<br />
=== Zipsync ===<br />
<br />
Zipsync command-line tool is used to integrate a freshly generated set of pk4 archives into the database of releases.<br />
More details provided in article [[Tdm_installer_and_zipsync#Command-line_tool]].<br />
<br />
Prebuilt Windows executable can be downloaded here: [http://update.thedarkmod.com/zipsync/zipsync.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer/zipsync</tt> subdirectory.<br />
Unlike all the other TDM projects, this one does not use artefacts from <tt>ThirdParty</tt> directory.<br />
Hence, you need to install and use [https://conan.io/ conan] directly if you want to build it.<br />
<br />
Build instructions:<br />
* Get packages: <tt>conan install . -if build -s build_type=RelWithDebInfo --build=outdated</tt><br />
* Build: <tt>conan build . -bf build</tt><br />
The binaries should be ready in <tt>build/RelWithDebInfo</tt>.<br />
In case of MSVC, the CMake-generated solution will be somewhere nearby.<br />
<br />
<br />
If the zipsync tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
<br />
=== Installer ===<br />
<br />
Tdm_installer is GUI application, used to install/update the game on player's machine.<br />
More details provided in article [[Tdm installer and zipsync#tdm_installer]].<br />
<br />
Prebuilt executables can be obtained from Downloads section on the website.<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer</tt> subdirectory.<br />
It can be built with CMake in pretty standard way.<br />
For example:<br />
* Create <tt>build</tt> directory, switch to it.<br />
* Run <tt>cmake ..</tt> to generate project or makefile.<br />
* Windows: Open generated solution, build RelWithDebInfo '''Win32''' configuration.<br />
* Linux: Run <tt>make</tt> to finish build.<br />
<br />
You only need to build 32-bit executable on Windows: it will work fine on 64-bit OS too.<br />
For Linux, build both 64-bit and 32-bit executables separately.<br />
<br />
In order to build 32-bit executable on 64-bit Linux, run cmake with additional parameters:<br />
* <tt>cmake .. -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32</tt><br />
<br />
<br />
If tdm_installer is modified, update all prebuilt executables on TDM server.<br />
<br />
For the self-update to work, each executable must be packaged into a special zip archive:<br />
* <tt>zipsync hashzip tdm_installer.exe</tt><br />
* <tt>zipsync hashzip tdm_installer.linux64</tt><br />
* <tt>zipsync hashzip tdm_installer.linux32</tt><br />
<br />
The resulting zip archives should be uploaded onto the TDM server (contact admin for access).<br />
Note that tdm_installer automatically updates itself to the executable on the server: if you put a bad build, make sure to fix it quickly!<br />
<br />
<br />
= Development Phase =<br />
<br />
Development phase takes the majority of time. During this time, day-to-day development happens on SVN trunk, so all commits end up there. Stuff gets broken, stuff gets fixed, stuff gets evaluated, some might be ripped out again. See also [[SVN]] article.<br />
<br />
<br />
=== Dev Builds ===<br />
<br />
New development build/release is created roughly every 2-4 weeks (might depend on the amount of changes) from trunk. Even though these builds are unstable and untested, and may include features will be heavily changed of even removed by the time of the next major release, there are many reasons to provide them:<br />
* Beta-testers are able to bisect over development history to find when an issue started happening.<br />
* External programmers can get assets compatible with recent source code trunk.<br />
* Curious players can test new features and provide early feedback.<br />
<br />
The rest of this chapter describes how to create such a dev build.<br />
Note: mostly the same steps are done when building beta releases and major releases.<br />
<br />
<br />
=== Compile Game Binaries ===<br />
<br />
The assets SVN repo contains TDM executable files, which are copied into PK4 archives by the packager.<br />
They are rarely up-to-date, so the very first step is to build new executables from the source code and commit them to the assets repo.<br />
<br />
Ensure you have clean and most recent revision of darkmod_src repo.<br />
The detailed build instructions are provided in [[TDM Compilation Guide]], and the process of updating executables is explained in [[SVN#Executables Update]].<br />
Just a few remainders:<br />
* Better explicitly delete all executables before building. For major releases, better delete <tt>build</tt> directory and build everything from scratch.<br />
* Always build Release configuration.<br />
* Build binaries for all officially supported platforms: Linux and Windows. Deprecated 32-bit executables are '''not''' built, except for the major releases and the last beta.<br />
* Don't forget to save debug symbols (.pdb and .debug files) somewhere when you commit executables, so that you don't accidentally overwrite them later!<br />
* Note that shaders (<tt>glprogs</tt> directory) are also copied to assets repo when you build TDM, so don't forget to commit them too.<br />
<br />
The easiest way to build executables for Windows and Linux at once is to use Windows machine with Linux virtual machine. Detailed setup instructions for virtual machine are provided in [[VirtualBox: Virtual machine with Linux for TDM|VirtualBox]] and [[VMWare: Virtual machine with Linux|VMWare]] articles.<br />
<br />
Better choose fairly popular and '''old''' version of Linux, for instance a five-year-old Ubuntu LTS (still using 16.04 in 2021).<br />
Due to how GLIBC symbols versioning works, sometimes TDM executable built on a new Linux won't start on an old one.<br />
<br />
The debug symbols take quite a lot of space, but are indispensible for [[Analyze a Memory Dump|analyzing crashes]] on players' machines.<br />
So release manager must keep them safe on a local disk, and probably share them with other programmers on some cloud storage.<br />
For major releases, Windows debug symbols are even committed to the assets repo (see below).<br />
<br />
<br />
=== Release Manifest ===<br />
<br />
The "manifest" is a huge list of all the files that are nominated to go into the release package. Not all files in SVN are supposed to be released (like test files, test maps, other broken or unfinished stuff), so a white list is needed. Aside from that, some rules are needed to decide how files are divided among pk4 archives.<br />
<br />
Here are the files related to manifest:<br />
* <tt>devel/manifests/base.txt</tt>: an explicit list of files which are packaged regardless of any other conditions.<br />
* <tt>devel/manifests/darkmod_maps.txt</tt>: sequence of include/exclude commands with regexes.<br />
* <tt>devel/manifests/darkmod.txt</tt>: full manifest file generated from the previous two files using tdm_package.<br />
* <tt>devel/manifests/darkmod_pk4s.txt</tt>: set of regex-powered rules describing which files go into which pk4 archive.<br />
<br />
==== Build Manifest ====<br />
The manifest file <tt>devel/manifests/darkmod.txt</tt> is generated by the tdm_package application.<br />
I run it with the following command:<br />
* <tt>tdm_package --create-manifest --darkmoddir=G:\TheDarkMod\darkmod >update_manifest.log</tt><br />
Here darkmoddir argument points to your working copy of assets SVN (it should be clean and up-to-date).<br />
<br />
After the packager finishes, review the packager log file and the changes in the file <tt>devel/manifests/darkmod.txt</tt>.<br />
If everything looks good, commit the updated manifest to the assets repo.<br />
If not, then adjust some files (e.g. the maps file) and try again. Commit your adjustments to SVN of course.<br />
<br />
==== Include/Exclude From Manifest ====<br />
The main place to specify what should be included into release is <tt>darkmod_maps.txt</tt> file.<br />
As a rare exception, some files are specified in <tt>base.txt</tt>. But it is very small, and should probably be merged into the maps file in the future.<br />
Here is how maps file works.<br />
<br />
In the first step, all files in specific folders are included:<br />
# Include all these files (but without parsing them like maps), each<br />
# statement will include files (from SVN) in that folder:<br />
INCLUDE def/<br />
INCLUDE dds/<br />
...<br />
INCLUDE video/<br />
INCLUDE xdata/<br />
As seen in the above example, the sharp character # is used to denote comments. Put that at the beginning of a line to disable the statement.<br />
<br />
As the next step, the algorithm will exclude certain files matching the regular expressions in EXCLUDE statements like this:<br />
EXCLUDE dds/darkmod/test<br />
In 95% of the cases it's enough to just specify the path of the files you want to exclude (use forward slashes), but you can do more fancy stuff like this:<br />
EXCLUDE models/md5/chars/undead/revenant/.*.md5anim<br />
EXCLUDE ^(dds/)?models/md5/chars/undead/revenant<br />
The first line will exclude all MD5ANIM files in the revenant folder. The second line will exclude all files in models/md5/chars/undead/revenant '''and''' the ones in '''dds/'''models/md5/chars/undead/revenant (the dds/ part is marked to be optional). <br />
<br />
In summary, all files that are INCLUDE'd as denoted above and afterwards manage to get through the hundreds of lines of EXCLUDE filters will end up in the manifest file.<br />
<br />
==== Distribute files into PK4s ====<br />
Each of the thousands of files in the manifest needs to be sorted into the correct PK4.<br />
This is done by defining a rules in the file <tt>devel/manifests/darkmod_pk4s.txt</tt>. Each of the lines there defines a PK4 and which files go into it:<br />
# Miscellaneous stuff (GL Progs, Script, Language Files, Rope Arrow)<br />
tdm_base01.pk4: ^glprogs, ^script, ^strings, sound\.wav, _emptyname\.wav, ^models/md5/environments, ^dds/models/md5/environments, ...<br />
Again, lines starting with the sharp # character denote comments.<br />
<br />
Leftmost is the PK4 filename, followed by a colon character. To the right of the colon a list comma-separated patterns is defined, whereas each pattern is interpreted as regular expression. As with the <tt>darkmod_maps.txt</tt> you don't need to know very much about regular expressions to define those rules, it's usually enough to write the folder names and use wildcards like <tt>.*.md5anim</tt><br />
<br />
Note that a file will not get into the release package if no rule covers it in the darkmod_pk4s.txt, even if it is present in the full manifest.<br />
The packager prints a warning in such case when pk4 files are created.<br />
<br />
<br />
=== Create Package ===<br />
<br />
After the manifest is ready, we can finally use packager to pack working copy of assets SVN into a set of pk4 files.<br />
Make sure your working copy is clean beforehand: unversioned files will be ignored, but local modifications will get into the package!<br />
* <tt>tdm_package --create-package --darkmoddir=G:/TheDarkMod/darkmod --outputdir=G:/TheDarkMod/tmp_package >create_package.log</tt><br />
Here darkmoddir specifies path to SVN working copy, and outputdir specifies path to an empty directory where pk4 files will be generated.<br />
<br />
Be sure to look through the log file!<br />
If some file is not covered by pk4 distribution rules, you will see the corresponding message there.<br />
<br />
<br />
=== Add Release ===<br />
<br />
All versions of TDM are stored in one zipsync database, which looks like a big tree of differential packages.<br />
Read [[Tdm_installer_and_zipsync#Version_conventions]] carefully and decide 1) how to name the new version, and 2) which previously released version should serve as a parent for the new version.<br />
<br />
First of all, you need the parent version somewhere on local disk (in clean state: without any additional files).<br />
If you don't have it, you can download it via tdm_installer:<br />
# Create new directory. You can optionally copy some tdm_XXX.pk4 files to it to reduce download time.<br />
# Copy tdm_installer to the directory, start it.<br />
# On the first page, check '''"Bitwise exact zips"''' advanced setting! Also check "Get custom version".<br />
# On the second page, choose the parent version.<br />
# Optional: After installation is complete, you can delete <tt>.zipsync</tt> directory and all files with extensions other than pk4 and zip.<br />
'''Note:''' It is much easier to save all versions you create on the local disk, so that you can use them as parent versions later.<br />
<br />
Rename the directories with new version and with parent version: the directory name must match the name of the version.<br />
Let's say parent version is <tt>dev01234-8765</tt>, and new version is <tt>dev12345-9876</tt>.<br />
<br />
Run analysis on the new version (remove <tt>-j0</tt> unless data is stored on SSD):<br />
* <tt>zipsync analyze -r G:\tdmrel\dev12345-9876 -cn -j0 *.pk4 *.zip</tt><br />
Then create a differential package:<br />
* <tt>zipsync diff -r G:\tdmrel\dev12345-9876 -s G:\tdmrel\dev01234-8765\manifest.iniz -o G:\tdmrel\dev12345-9876_from_dev01234-8765</tt><br />
Detailed explanation of how to use zipsync command line tool is provided in [[Tdm installer and zipsync]].<br />
<br />
Now you need to connect to TDM server via SSH.<br />
For simplicity, I recommend storing exact copy of the whole zipsync database locally.<br />
In order to push your modifications, you can log to TDM server using WinSCP and use Commands:Synchronize with the properly set Direction/Target.<br />
<br />
Look at the directory structure in the database and put the new differential package appropriately, e.g. into <tt>dev/210/dev12345-9876_from_dev01234-8765</tt>.<br />
Then open <tt>tdm_installer.ini</tt> in text editor, find appropriate place for the new version, and add it there, e.g.:<br />
[Version dev12345-9876]<br />
manifestUrl=${MIRROR}/dev/210/dev12345-9876_from_dev01234-8765/manifest.iniz<br />
depends=dev01234-8765<br />
folder=dev/2.10<br />
When you are sure that you edited it properly, synchronize your changes to the server.<br />
Immediately after that try to switch some of your TDM installations to the new version using tdm_installer (with "Bitwise exact zips" flag).<br />
If something does not work for you, fix the problem as soon as possible.<br />
<br />
=== Changelog and Announcement ===<br />
<br />
The current tradition for changelog is:<br />
* Changelog for all the dev builds after the last major release is in the second post of [https://forums.thedarkmod.com/index.php?/topic/20824-public-access-to-development-versions/ this forum thread].<br />
* When beta phase is started, a separate thread is created for it, and changelog of all dev builds is moved to there.<br />
* Changelog for beta releases is added to the beta testing thread. One post should contain changelog for all dev builds and beta releases in chronological order.<br />
* In the message with changelog, post link to the changelog for previous versions (making a linked list of forum posts).<br />
<br />
Use SVN log over both repos to write changelog.<br />
Try to write in language which users can understand, whenever possible.<br />
Post as much links as you can: links to bugtracker as especially welcome, or links to feature discussion thread.<br />
Some very minor things can be omitted in changelog, but don't miss anything which can break something or cause any type of negative consequences.<br />
Most likely you will often read this changelog yourself =)<br />
<br />
When changelog is ready, post short message that new version is available in the appropriate forum thread.<br />
<br />
<br />
=== Dev Build: Recap ===<br />
<br />
Here are all steps for creating a new dev build:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
<br />
<br />
= Beta Phase =<br />
<br />
At some moment the development phase is over, and beta phase starts.<br />
The main goal of beta phase is to create a new major release, which will be used by most players for the next year or so.<br />
Of course, it is preceded by lengthy public beta testing.<br />
<br />
<br />
=== Agree on Schedule ===<br />
<br />
The beta phase starts with branching off the release, and typically lasts for 1-2 months after that.<br />
There is usually a rough plan about when to hold beta phase and when to release, but as time comes close, it's better to discuss it with team members again.<br />
Team members are supposed to wrap up their pending changes and commit them to the trunk before beta phase starts.<br />
About two weeks are long enough of a time span for people to get everything into SVN.<br />
<br />
<br />
=== Libraries and License ===<br />
<br />
A few weeks before branching, it is a good idea to revise the set of third-party libraries used.<br />
Starting from TDM 2.08, it should be easy to check it thanks to the new conventions on third-party stuff (see also [[Libraries and Dependencies]]).<br />
Some minor code pieces get embedded directly into the source, try to recall all of them.<br />
<br />
It is necessary to update the <tt>LICENSE.txt</tt> file in SVN repositories if something is not up-to-date.<br />
Note that you should commit the same updated file into '''both''' source code and assets repos.<br />
<br />
<br />
=== Update Script Reference ===<br />
<br />
Another thing which needs update prior to branching is the script reference.<br />
It can be regenerated using the <tt>tdm_gen_script_event_doc</tt> command in game console:<br />
* <tt>tdm_gen_script_event_doc tdm_events.script d3script</tt><br />
* <tt>tdm_gen_script_event_doc forwiki.mw mediawiki</tt><br />
The files will be created in the FM directory.<br />
Copy mediawiki output to the wiki article [[TDM Script Reference]].<br />
Copy script output to <tt>script/tdm_events.script</tt> file in the assets repo and commit.<br />
<br />
<br />
=== Branching off ===<br />
<br />
Once the deadline arrives, create the '''release branch''' in both repos: [[Image:Create release branch.png|right|350px]]<br />
* Update your working copy of assets repo (darkmod).<br />
* Update working copy of source code repo (darkmod_src) too.<br />
* Right-click the darkmod_src folder to create the branch<br />
** Select SVN > Branch/Tag...<br />
** A new dialog appears asking for a URL. Enter a URL like this: [https://server/svn/darkmod_src/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod_src/branches/releaseX.YY] where X.YY is replaced by whatever version the next release will be. <br />
** You'll probably want to switch to the new branch once it is created, so make sure the check button at the bottom of the dialog is active.<br />
** Hit OK to let the SVN server create the branch.<br />
* Do the same for darkmod repository, using the URL scheme [https://server/svn/darkmod/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod/branches/releaseX.YY]<br />
<br />
At this point there is new "release" branch in each of the two repos.<br />
The release branch and trunk live independently from each other: each working copy is attached to one of these branches, and commits done to one branch do not change the state of the other.<br />
All the beta releases and the final major release will be packaged from the release branch, thus it is important to keep it stable and only commit there the changes which are necessary for the release.<br />
Trunk will continue to evolve after the beta phase ends, so it is in principle possible to commit there some work which is not intended for release (although not desirable).<br />
<br />
The release manager has to establish the workflow for developers, in order to avoid confusion with changes and branches.<br />
The typical workflow is: everyone commits his changes to trunk and notifies release manager that changes are intended for release, release manager merges the necessary changes to release branch when needed.<br />
If developer knows well how to deal with branches and commits merging in SVN, he can also merge his commits to release branch himself.<br />
<br />
While trunk is technically independent from release branch, it is desirable to freeze or at least cool down all development not intended for the upcoming release.<br />
The reason for that is that during beta phase it is necessary to merge commits between branches a lot.<br />
If you merge 100% of commits from trunk to release, then beta phase can last forever or some major bug can slip into release at the last moment.<br />
On the other hand, the more unmerged commits you have, the more likely merge conflicts become.<br />
Refactoring, files renaming, and massive changes over the codebase are strongly discouraged.<br />
<br />
<br />
=== Publish Beta Release ===<br />
<br />
Beta release is created and published the same way as dev build.<br />
The main difference is that dev builds are created on SVN trunk, and beta releases are created on the release branch.<br />
So make sure your SVN working copy is switched to release branch both in the source code repo and in the assets repo.<br />
Another difference between dev builds and beta releases is [[Tdm_installer_and_zipsync#Version_conventions|naming TDM versions in zipsync database]].<br />
<br />
Once again, the steps are:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
The announcement differs greatly when beta phase starts.<br />
Usually release manager creates a dedicated forum thread in public subforum, like e.g. [https://forums.thedarkmod.com/index.php?/topic/20691-beta-testing-209/ Beta Testing 2.09].<br />
This thread should contain changelog of beta releases. Changelog of dev builds should be moved here too.<br />
I usually reserve three forum post immediately: the first one on how to install and what is beta about, the second one giving high-level overview of changes and new cvars/commands, and the third one with detailed changelog.<br />
<br />
<br />
=== Testing Cycle ===<br />
<br />
After beta release is published, testers update to it and post their bug reports.<br />
Developers investigate them and fix whatever they can.<br />
In typical workflow, the fixes are committed to the trunk (both for darkmod and darkmod_src repos), and the release manager merges them into the release branch.<br />
<br />
One point to keep in mind is that SVN does not have real branches: a branch is merely a copy of the whole directory.<br />
As the result, SVN does not have proper branch merging either: it simply takes the selected commits as patches and reapplies them onto the working copy (more like cherry-picking).<br />
This is not a big problem in our context, since usually you don't want to merge everything: only a nontrivial subset of commits from trunk will be merged into the release branch.<br />
In order to avoid confusion, keep an eye on svn:mergeinfo property: it should list the commits which were merged, so that you don't merge them again.<br />
<br />
Here is how I merge commits from trunk to release branch using TortoiseSVN:<br />
* Make sure your working copy is switched to the release branch and is clean from local modifications.<br />
* Now right-click the SVN root directory and choose SVN > Merge.<br />
* Select ''Merge a range of revisions''.<br />
* As ''URL to merge from'' use the address of the trunk.<br />
* In the field ''Revision range to merge'', click the ''Show Log'' button right next to the entry field. You will see log of commits in trunk, with the already merged commits greyed out. You can select one commit, or hold Ctrl to select an arbitrary subset of commits. You can press Ctrl+C when you finish selection, then paste the list of commits to a text file: later you can post it to developers so that they understand what was merged.<br />
* Hit ''Next'', then ''Merge''.<br />
* Now that the changes are incorporated into your working copy, test and review them briefly and commit to release branch.<br />
<br />
After some number of fixes has been committed and merged to release branch, repeat again from section [[#Publish Beta Release]].<br />
Publish new beta release, wait for feedback, fix, merge fixes to release branch, publish new release, etc.<br />
<br />
= Major Release =<br />
<br />
At some moment beta phase ends, and the next major release is created from the latest state of the release branch.<br />
<br />
<br />
=== Finalization ===<br />
<br />
The common approach is to turn the latest beta release (called "release candidate") into the major release without even rebuilding/repackaging it.<br />
In such case you can take the full package of release candidate and proceed directly to [[#Add Release]] section: determine how major release is named (e.g. <tt>release210</tt>), its parent version (it is always the previous major release), create differential package, upload it to server and update tdm_installer.ini.<br />
When editing tdm_installer.ini, move the <tt>default=1</tt> line from the previous major release to the new one.<br />
<br />
The next thing is saving Windows debug symbols. You must have saved them when you built executables which are in the final package. If you did not save them, then you cannot simply publish the existing package, and you have to start over from section [[#Compile Game Binaries]].<br />
Compress debug symbols (TheDarkModx64.pdb and thedarkmod.x64.debug) with 7z, put them into devel/release/debugging/X.YY in assets repo. Commit them to both to trunk and to release branch (commit + merge).<br />
<br />
Exact state of SVN repos should be saved for every major release.<br />
So create a tag <tt>tags/X.YY</tt> in both SVN repos from the state of the release branch that you used to create release from.<br />
<br />
While 32-bit executables are deprecated, we still provide them as a separate download for the latest major version.<br />
Thus, you should take 32-bit executables <tt>TheDarkMod.exe</tt> and <tt>thedarkmod.x86</tt> and pack them into <tt>tdm_exe32.zip</tt>.<br />
If you did not build 32-bit executables previously, build them exactly from the same source code which was used to build 64-bit executables.<br />
Put them at <tt>_aux/XYY/tdm_exe32.zip</tt> in the zipsync database (where X.YY is the TDM version).<br />
<br />
=== Update Website ===<br />
<br />
Be sure to update the following pages on the website to reflect the latest release version:<br />
* [http://www.thedarkmod.com/downloads/ http://www.thedarkmod.com/downloads/]<br />
* [http://www.thedarkmod.com/download-sourcecode/ http://www.thedarkmod.com/download-sourcecode/]<br />
<br />
To generate the latest source code package for the pages above:<br />
* Export the code from the release tag. E.g. svn export https://svn.thedarkmod.com/svn/darkmod_src/tags/x.yy<br />
* Create a 7zip archive with the following naming convention: thedarkmod.x.yy.src.7z<br />
** 7z a -r ../thedarkmod.x.yy.src.7z ./* <br />
* Upload the source code archive to http://www.thedarkmod.com/sources (ask admin for assistance with this or use the ftp upload user)<br />
<br />
Also update the link to 32-bit executables.<br />
It should point to <tt>https://update.thedarkmod.com/zipsync/_aux/XYY/tdm_exe32.zip</tt> --- that's where it was put inside the zipsync database.<br />
<br />
=== Update Wiki ===<br />
<br />
The wiki contains one page for each release. You can find them all in the [[:Category:What's New]] category. <br />
<br />
First update the current release page:<br />
<br />
* Change the "roadmap" link on the current release to a "changelog" link by swapping ''"roadmap_page.php?version_id=XX"'' with ''"changelog_page.php?version=XX"''.<br />
* Add the ''<nowiki>{{released|2.01|2014-01-30}}</nowiki>'' Template on top of the current release page with the correct date.<br />
<br />
Then add a new page for the next release. To do this, add a link to it in this template: [[Template:Whatsnew]] by editing it. After saving the template, a link to the new release version page appears in the list and in the category. Edit this page and insert some text into it (you can copy it from an older release page).<br />
<br />
Also insert a link to the current roadmap on the bugtracker, you can find out the version_id by looking at [http://bugs.thedarkmod.com/roadmap_page.php the roadmap page].<br />
<br />
<br />
=== Forum Announcement ===<br />
<br />
Post thread about new version on the [https://forums.thedarkmod.com/index.php?/forum/10-news-amp-announcements/ News & Announcements] subforum.<br />
<br />
<br />
=== Back to Development Phase ===<br />
<br />
After the dust of release settles, it's time to start the next release cycle and return to development phase.<br />
* Make sure all changes from release branch are also present in trunk, since you will unlikely return to the release branch in future.<br />
* Switch working copies of both repos back to trunk.<br />
* Open <tt>framework/Licensee.h</tt> in the source code repo, and update <tt>TDM_VERSION_MAJOR</tt>, <tt>TDM_VERSION_MINOR</tt>, <tt>ENGINE_VERSION</tt> for the next major release. Commit the change.<br />
* Go to [https://bugs.thedarkmod.com/manage_proj_page.php Manage section of bugtracker], choose The Dark Mod project. Click "Edit" for the just released version, set it to "Released" state. Add new version if not yet present.<br />
<br />
<br />
=== Hotfix Release ===<br />
<br />
Ideally, players use the major release for about a year, until the next major release comes out.<br />
But in the real world, we often discover some issues which cannot/shouldn't be delayed until the next major release.<br />
In such case, it is possible to create a special release, which is historically called "hotfix" release.<br />
It is something like a "patch release" from semantic versioning: a new version which is almost the same as the major release, but with a few small fixes added.<br />
<br />
The hotfix release is created from the previous release branch.<br />
For instance, if 2.09 is the last published major release and 2.10 is currently in development, then hotfix release 2.09a is created from release2.09 branch (in both SVN repos).<br />
Review Changelog or SVN commits since the last major release, and choose the changes which should be added in the hotfix. Discuss them with team members.<br />
Proper beta phase lasts months, and you don't want to waste much time on hotfix release, so be very careful and critical about the changes you include:<br />
* Included commits should be done some time ago, so that at least developers have already tested them.<br />
* Included commits must not break savegame format, i.e. they must not change any calls to <tt>idSaveGame</tt>/<tt>idRestoreGame</tt> objects.<br />
* Included commits should be small and have little risk of breaking something.<br />
* Do not include commits which provide a new feature: new features are for new major release.<br />
Usually, commits are included in the following cases:<br />
* Fixing game crashes, race conditions, data corruption. Especially the ones which players bump into.<br />
* Fixing wrong usage of OpenGL API. Or adding workarounds for bad OpenGL drivers. Same for OpenAL and other machine-dependent stuff.<br />
* Fixing interaction with outside projects (FM database, DarkRadiant, tdm_installer, etc.) in case it has been broken.<br />
<br />
Note that unlike typical convention, we guarantee full savegame compatibility between the hotfix release and its predecessor.<br />
The game writes SVN revision into every savegame and checks that it is the same when it loads game, complaining if it does not match.<br />
To silence this warning, go to the method <tt>RevisionTracker::GetSavegameRevision</tt> and make it return the hardcoded number: the revision reported by the original major release.<br />
Commit this change to branch (but '''not''' to trunk): now all executables created from this branch will use the same revision number when writing and reading savegames.<br />
Don't forget to test that savegames created in original release load properly in hotfix release and vice versa.<br />
<br />
When everyone agrees on the set of included commits, merge them all to the release branch.<br />
<br />
Now do the typical steps for creating a new release:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
Use release branch. Name the added version appropriately in zipsync database (e.g. <tt>release209a</tt>).<br />
Write announcement on public forums with changelog describing the merged commits, and instructions how to get hotfix (like [https://forums.thedarkmod.com/index.php?/topic/20930-beta-testing-209a-aka-hotfix/ this one]).<br />
<br />
After a very brief public beta-testing, move the <tt>default=1</tt> line from the original release to the hotfix release in <tt>tdm_installer.ini</tt>.<br />
Now everyone who runs tdm_installer without explicitly specifying version will get the hotfix release.<br />
<br />
Now do the ordinary finalization steps:<br />
# Publish 32-bit executables.<br />
# Commit 7zipped Windows PDB files to <tt>devel/release/debugging</tt>, replacing the files from original release.<br />
# Create SVN tags in both repos.<br />
# Update website: replace link to 32-bit executables and source code archive.<br />
# Write announcements, so that people know they should update.<br />
<br />
Of course, you can provide more than one hotfix release for one major release: 2.09a, 2.09b, 2.09c, etc.<br />
Also note that the original release is not lost: players can even install it if they want.</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Release_Mechanics&diff=30661TDM Release Mechanics2023-02-05T11:02:04Z<p>Stgatilov: Release debug symbols: save Windows and Linux, but x64 only</p>
<hr />
<div>This article describes the process of creating TDM releases.<br />
<br />
<br />
= Preliminaries =<br />
<br />
Before even starting to build a package, make sure you have all the following tools ready.<br />
<br />
<br />
=== Packager ===<br />
<br />
The tdm_package tool inspects your working copy of assets SVN, and generates PK4 archives from it.<br />
<br />
Prebuilt Windows executable can be downloaded from TDM server: [http://update.thedarkmod.com/zipsync/tdm_package.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_update</tt> subdirectory.<br />
Build instructions:<br />
* Windows: Open <tt>tdm_update.sln</tt>, build Release configuration<br />
* Linux: Run <tt>scons BUILD="release"</tt><br />
As the result, packager executable <tt>tdm_package.???</tt> will be created in <tt>bin</tt> subdirectory.<br />
<br />
<br />
If the packager tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
'''TODO:''' update this section when [https://bugs.thedarkmod.com/view.php?id=5076 #5076] is done.<br />
<br />
<br />
=== Zipsync ===<br />
<br />
Zipsync command-line tool is used to integrate a freshly generated set of pk4 archives into the database of releases.<br />
More details provided in article [[Tdm_installer_and_zipsync#Command-line_tool]].<br />
<br />
Prebuilt Windows executable can be downloaded here: [http://update.thedarkmod.com/zipsync/zipsync.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer/zipsync</tt> subdirectory.<br />
Unlike all the other TDM projects, this one does not use artefacts from <tt>ThirdParty</tt> directory.<br />
Hence, you need to install and use [https://conan.io/ conan] directly if you want to build it.<br />
<br />
Build instructions:<br />
* Get packages: <tt>conan install . -if build -s build_type=RelWithDebInfo --build=outdated</tt><br />
* Build: <tt>conan build . -bf build</tt><br />
The binaries should be ready in <tt>build/RelWithDebInfo</tt>.<br />
In case of MSVC, the CMake-generated solution will be somewhere nearby.<br />
<br />
<br />
If the zipsync tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
<br />
=== Installer ===<br />
<br />
Tdm_installer is GUI application, used to install/update the game on player's machine.<br />
More details provided in article [[Tdm installer and zipsync#tdm_installer]].<br />
<br />
Prebuilt executables can be obtained from Downloads section on the website.<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer</tt> subdirectory.<br />
It can be built with CMake in pretty standard way.<br />
For example:<br />
* Create <tt>build</tt> directory, switch to it.<br />
* Run <tt>cmake ..</tt> to generate project or makefile.<br />
* Windows: Open generated solution, build RelWithDebInfo '''Win32''' configuration.<br />
* Linux: Run <tt>make</tt> to finish build.<br />
<br />
You only need to build 32-bit executable on Windows: it will work fine on 64-bit OS too.<br />
For Linux, build both 64-bit and 32-bit executables separately.<br />
<br />
In order to build 32-bit executable on 64-bit Linux, run cmake with additional parameters:<br />
* <tt>cmake .. -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32</tt><br />
<br />
<br />
If tdm_installer is modified, update all prebuilt executables on TDM server.<br />
<br />
For the self-update to work, each executable must be packaged into a special zip archive:<br />
* <tt>zipsync hashzip tdm_installer.exe</tt><br />
* <tt>zipsync hashzip tdm_installer.linux64</tt><br />
* <tt>zipsync hashzip tdm_installer.linux32</tt><br />
<br />
The resulting zip archives should be uploaded onto the TDM server (contact admin for access).<br />
Note that tdm_installer automatically updates itself to the executable on the server: if you put a bad build, make sure to fix it quickly!<br />
<br />
<br />
= Development Phase =<br />
<br />
Development phase takes the majority of time. During this time, day-to-day development happens on SVN trunk, so all commits end up there. Stuff gets broken, stuff gets fixed, stuff gets evaluated, some might be ripped out again. See also [[SVN]] article.<br />
<br />
<br />
=== Dev Builds ===<br />
<br />
New development build/release is created roughly every 2-4 weeks (might depend on the amount of changes) from trunk. Even though these builds are unstable and untested, and may include features will be heavily changed of even removed by the time of the next major release, there are many reasons to provide them:<br />
* Beta-testers are able to bisect over development history to find when an issue started happening.<br />
* External programmers can get assets compatible with recent source code trunk.<br />
* Curious players can test new features and provide early feedback.<br />
<br />
The rest of this chapter describes how to create such a dev build.<br />
Note: mostly the same steps are done when building beta releases and major releases.<br />
<br />
<br />
=== Compile Game Binaries ===<br />
<br />
The assets SVN repo contains TDM executable files, which are copied into PK4 archives by the packager.<br />
They are rarely up-to-date, so the very first step is to build new executables from the source code and commit them to the assets repo.<br />
<br />
Ensure you have clean and most recent revision of darkmod_src repo.<br />
The detailed build instructions are provided in [[TDM Compilation Guide]], and the process of updating executables is explained in [[SVN#Executables Update]].<br />
Just a few remainders:<br />
* Better explicitly delete all executables before building. For major releases, better delete <tt>build</tt> directory and build everything from scratch.<br />
* Always build Release configuration.<br />
* Build binaries for all officially supported platforms: Linux and Windows. Deprecated 32-bit executables are '''not''' built, except for the major releases and the last beta.<br />
* Don't forget to save debug symbols (.pdb and .debug files) somewhere when you commit executables, so that you don't accidentally overwrite them later!<br />
* Note that shaders (<tt>glprogs</tt> directory) are also copied to assets repo when you build TDM, so don't forget to commit them too.<br />
<br />
The easiest way to build executables for Windows and Linux at once is to use Windows machine with Linux virtual machine. Detailed setup instructions for virtual machine are provided in [[VirtualBox: Virtual machine with Linux for TDM|VirtualBox]] and [[VMWare: Virtual machine with Linux|VMWare]] articles.<br />
<br />
Better choose fairly popular and '''old''' version of Linux, for instance a five-year-old Ubuntu LTS (still using 16.04 in 2021).<br />
Due to how GLIBC symbols versioning works, sometimes TDM executable built on a new Linux won't start on an old one.<br />
<br />
The debug symbols take quite a lot of space, but are indispensible for [[Analyze a Memory Dump|analyzing crashes]] on players' machines.<br />
So release manager must keep them safe on a local disk, and probably share them with other programmers on some cloud storage.<br />
For major releases, Windows debug symbols are even committed to the assets repo (see below).<br />
<br />
<br />
=== Release Manifest ===<br />
<br />
The "manifest" is a huge list of all the files that are nominated to go into the release package. Not all files in SVN are supposed to be released (like test files, test maps, other broken or unfinished stuff), so a white list is needed. Aside from that, some rules are needed to decide how files are divided among pk4 archives.<br />
<br />
Here are the files related to manifest:<br />
* <tt>devel/manifests/base.txt</tt>: an explicit list of files which are packaged regardless of any other conditions.<br />
* <tt>devel/manifests/darkmod_maps.txt</tt>: sequence of include/exclude commands with regexes.<br />
* <tt>devel/manifests/darkmod.txt</tt>: full manifest file generated from the previous two files using tdm_package.<br />
* <tt>devel/manifests/darkmod_pk4s.txt</tt>: set of regex-powered rules describing which files go into which pk4 archive.<br />
<br />
==== Build Manifest ====<br />
The manifest file <tt>devel/manifests/darkmod.txt</tt> is generated by the tdm_package application.<br />
I run it with the following command:<br />
* <tt>tdm_package --create-manifest --darkmoddir=G:\TheDarkMod\darkmod >update_manifest.log</tt><br />
Here darkmoddir argument points to your working copy of assets SVN (it should be clean and up-to-date).<br />
<br />
After the packager finishes, review the packager log file and the changes in the file <tt>devel/manifests/darkmod.txt</tt>.<br />
If everything looks good, commit the updated manifest to the assets repo.<br />
If not, then adjust some files (e.g. the maps file) and try again. Commit your adjustments to SVN of course.<br />
<br />
==== Include/Exclude From Manifest ====<br />
The main place to specify what should be included into release is <tt>darkmod_maps.txt</tt> file.<br />
As a rare exception, some files are specified in <tt>base.txt</tt>. But it is very small, and should probably be merged into the maps file in the future.<br />
Here is how maps file works.<br />
<br />
In the first step, all files in specific folders are included:<br />
# Include all these files (but without parsing them like maps), each<br />
# statement will include files (from SVN) in that folder:<br />
INCLUDE def/<br />
INCLUDE dds/<br />
...<br />
INCLUDE video/<br />
INCLUDE xdata/<br />
As seen in the above example, the sharp character # is used to denote comments. Put that at the beginning of a line to disable the statement.<br />
<br />
As the next step, the algorithm will exclude certain files matching the regular expressions in EXCLUDE statements like this:<br />
EXCLUDE dds/darkmod/test<br />
In 95% of the cases it's enough to just specify the path of the files you want to exclude (use forward slashes), but you can do more fancy stuff like this:<br />
EXCLUDE models/md5/chars/undead/revenant/.*.md5anim<br />
EXCLUDE ^(dds/)?models/md5/chars/undead/revenant<br />
The first line will exclude all MD5ANIM files in the revenant folder. The second line will exclude all files in models/md5/chars/undead/revenant '''and''' the ones in '''dds/'''models/md5/chars/undead/revenant (the dds/ part is marked to be optional). <br />
<br />
In summary, all files that are INCLUDE'd as denoted above and afterwards manage to get through the hundreds of lines of EXCLUDE filters will end up in the manifest file.<br />
<br />
==== Distribute files into PK4s ====<br />
Each of the thousands of files in the manifest needs to be sorted into the correct PK4.<br />
This is done by defining a rules in the file <tt>devel/manifests/darkmod_pk4s.txt</tt>. Each of the lines there defines a PK4 and which files go into it:<br />
# Miscellaneous stuff (GL Progs, Script, Language Files, Rope Arrow)<br />
tdm_base01.pk4: ^glprogs, ^script, ^strings, sound\.wav, _emptyname\.wav, ^models/md5/environments, ^dds/models/md5/environments, ...<br />
Again, lines starting with the sharp # character denote comments.<br />
<br />
Leftmost is the PK4 filename, followed by a colon character. To the right of the colon a list comma-separated patterns is defined, whereas each pattern is interpreted as regular expression. As with the <tt>darkmod_maps.txt</tt> you don't need to know very much about regular expressions to define those rules, it's usually enough to write the folder names and use wildcards like <tt>.*.md5anim</tt><br />
<br />
Note that a file will not get into the release package if no rule covers it in the darkmod_pk4s.txt, even if it is present in the full manifest.<br />
The packager prints a warning in such case when pk4 files are created.<br />
<br />
<br />
=== Create Package ===<br />
<br />
After the manifest is ready, we can finally use packager to pack working copy of assets SVN into a set of pk4 files.<br />
Make sure your working copy is clean beforehand: unversioned files will be ignored, but local modifications will get into the package!<br />
* <tt>tdm_package --create-package --darkmoddir=G:/TheDarkMod/darkmod --outputdir=G:/TheDarkMod/tmp_package >create_package.log</tt><br />
Here darkmoddir specifies path to SVN working copy, and outputdir specifies path to an empty directory where pk4 files will be generated.<br />
<br />
Be sure to look through the log file!<br />
If some file is not covered by pk4 distribution rules, you will see the corresponding message there.<br />
<br />
<br />
=== Add Release ===<br />
<br />
All versions of TDM are stored in one zipsync database, which looks like a big tree of differential packages.<br />
Read [[Tdm_installer_and_zipsync#Version_conventions]] carefully and decide 1) how to name the new version, and 2) which previously released version should serve as a parent for the new version.<br />
<br />
First of all, you need the parent version somewhere on local disk (in clean state: without any additional files).<br />
If you don't have it, you can download it via tdm_installer:<br />
# Create new directory. You can optionally copy some tdm_XXX.pk4 files to it to reduce download time.<br />
# Copy tdm_installer to the directory, start it.<br />
# On the first page, check '''"Bitwise exact zips"''' advanced setting! Also check "Get custom version".<br />
# On the second page, choose the parent version.<br />
# Optional: After installation is complete, you can delete <tt>.zipsync</tt> directory and all files with extensions other than pk4 and zip.<br />
'''Note:''' It is much easier to save all versions you create on the local disk, so that you can use them as parent versions later.<br />
<br />
Rename the directories with new version and with parent version: the directory name must match the name of the version.<br />
Let's say parent version is <tt>dev01234-8765</tt>, and new version is <tt>dev12345-9876</tt>.<br />
<br />
Run analysis on the new version (remove <tt>-j0</tt> unless data is stored on SSD):<br />
* <tt>zipsync analyze -r G:\tdmrel\dev12345-9876 -cn -j0 *.pk4 *.zip</tt><br />
Then create a differential package:<br />
* <tt>zipsync diff -r G:\tdmrel\dev12345-9876 -s G:\tdmrel\dev01234-8765\manifest.iniz -o G:\tdmrel\dev12345-9876_from_dev01234-8765</tt><br />
Detailed explanation of how to use zipsync command line tool is provided in [[Tdm installer and zipsync]].<br />
<br />
Now you need to connect to TDM server via SSH.<br />
For simplicity, I recommend storing exact copy of the whole zipsync database locally.<br />
In order to push your modifications, you can log to TDM server using WinSCP and use Commands:Synchronize with the properly set Direction/Target.<br />
<br />
Look at the directory structure in the database and put the new differential package appropriately, e.g. into <tt>dev/210/dev12345-9876_from_dev01234-8765</tt>.<br />
Then open <tt>tdm_installer.ini</tt> in text editor, find appropriate place for the new version, and add it there, e.g.:<br />
[Version dev12345-9876]<br />
manifestUrl=${MIRROR}/dev/210/dev12345-9876_from_dev01234-8765/manifest.iniz<br />
depends=dev01234-8765<br />
folder=dev/2.10<br />
When you are sure that you edited it properly, synchronize your changes to the server.<br />
Immediately after that try to switch some of your TDM installations to the new version using tdm_installer (with "Bitwise exact zips" flag).<br />
If something does not work for you, fix the problem as soon as possible.<br />
<br />
=== Changelog and Announcement ===<br />
<br />
The current tradition for changelog is:<br />
* Changelog for all the dev builds after the last major release is in the second post of [https://forums.thedarkmod.com/index.php?/topic/20824-public-access-to-development-versions/ this forum thread].<br />
* When beta phase is started, a separate thread is created for it, and changelog of all dev builds is moved to there.<br />
* Changelog for beta releases is added to the beta testing thread. One post should contain changelog for all dev builds and beta releases in chronological order.<br />
* In the message with changelog, post link to the changelog for previous versions (making a linked list of forum posts).<br />
<br />
Use SVN log over both repos to write changelog.<br />
Try to write in language which users can understand, whenever possible.<br />
Post as much links as you can: links to bugtracker as especially welcome, or links to feature discussion thread.<br />
Some very minor things can be omitted in changelog, but don't miss anything which can break something or cause any type of negative consequences.<br />
Most likely you will often read this changelog yourself =)<br />
<br />
When changelog is ready, post short message that new version is available in the appropriate forum thread.<br />
<br />
<br />
=== Dev Build: Recap ===<br />
<br />
Here are all steps for creating a new dev build:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
<br />
<br />
= Beta Phase =<br />
<br />
At some moment the development phase is over, and beta phase starts.<br />
The main goal of beta phase is to create a new major release, which will be used by most players for the next year or so.<br />
Of course, it is preceded by lengthy public beta testing.<br />
<br />
<br />
=== Agree on Schedule ===<br />
<br />
The beta phase starts with branching off the release, and typically lasts for 1-2 months after that.<br />
There is usually a rough plan about when to hold beta phase and when to release, but as time comes close, it's better to discuss it with team members again.<br />
Team members are supposed to wrap up their pending changes and commit them to the trunk before beta phase starts.<br />
About two weeks are long enough of a time span for people to get everything into SVN.<br />
<br />
<br />
=== Libraries and License ===<br />
<br />
A few weeks before branching, it is a good idea to revise the set of third-party libraries used.<br />
Starting from TDM 2.08, it should be easy to check it thanks to the new conventions on third-party stuff (see also [[Libraries and Dependencies]]).<br />
Some minor code pieces get embedded directly into the source, try to recall all of them.<br />
<br />
It is necessary to update the <tt>LICENSE.txt</tt> file in SVN repositories if something is not up-to-date.<br />
Note that you should commit the same updated file into '''both''' source code and assets repos.<br />
<br />
<br />
=== Update Script Reference ===<br />
<br />
Another thing which needs update prior to branching is the script reference.<br />
It can be regenerated using the <tt>tdm_gen_script_event_doc</tt> command in game console:<br />
* <tt>tdm_gen_script_event_doc tdm_events.script d3script</tt><br />
* <tt>tdm_gen_script_event_doc forwiki.mw mediawiki</tt><br />
The files will be created in the FM directory.<br />
Copy mediawiki output to the wiki article [[TDM Script Reference]].<br />
Copy script output to <tt>script/tdm_events.script</tt> file in the assets repo and commit.<br />
<br />
<br />
=== Branching off ===<br />
<br />
Once the deadline arrives, create the '''release branch''' in both repos: [[Image:Create release branch.png|right|350px]]<br />
* Update your working copy of assets repo (darkmod).<br />
* Update working copy of source code repo (darkmod_src) too.<br />
* Right-click the darkmod_src folder to create the branch<br />
** Select SVN > Branch/Tag...<br />
** A new dialog appears asking for a URL. Enter a URL like this: [https://server/svn/darkmod_src/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod_src/branches/releaseX.YY] where X.YY is replaced by whatever version the next release will be. <br />
** You'll probably want to switch to the new branch once it is created, so make sure the check button at the bottom of the dialog is active.<br />
** Hit OK to let the SVN server create the branch.<br />
* Do the same for darkmod repository, using the URL scheme [https://server/svn/darkmod/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod/branches/releaseX.YY]<br />
<br />
At this point there is new "release" branch in each of the two repos.<br />
The release branch and trunk live independently from each other: each working copy is attached to one of these branches, and commits done to one branch do not change the state of the other.<br />
All the beta releases and the final major release will be packaged from the release branch, thus it is important to keep it stable and only commit there the changes which are necessary for the release.<br />
Trunk will continue to evolve after the beta phase ends, so it is in principle possible to commit there some work which is not intended for release (although not desirable).<br />
<br />
The release manager has to establish the workflow for developers, in order to avoid confusion with changes and branches.<br />
The typical workflow is: everyone commits his changes to trunk and notifies release manager that changes are intended for release, release manager merges the necessary changes to release branch when needed.<br />
If developer knows well how to deal with branches and commits merging in SVN, he can also merge his commits to release branch himself.<br />
<br />
While trunk is technically independent from release branch, it is desirable to freeze or at least cool down all development not intended for the upcoming release.<br />
The reason for that is that during beta phase it is necessary to merge commits between branches a lot.<br />
If you merge 100% of commits from trunk to release, then beta phase can last forever or some major bug can slip into release at the last moment.<br />
On the other hand, the more unmerged commits you have, the more likely merge conflicts become.<br />
Refactoring, files renaming, and massive changes over the codebase are strongly discouraged.<br />
<br />
<br />
=== Publish Beta Release ===<br />
<br />
Beta release is created and published the same way as dev build.<br />
The main difference is that dev builds are created on SVN trunk, and beta releases are created on the release branch.<br />
So make sure your SVN working copy is switched to release branch both in the source code repo and in the assets repo.<br />
Another difference between dev builds and beta releases is [[Tdm_installer_and_zipsync#Version_conventions|naming TDM versions in zipsync database]].<br />
<br />
Once again, the steps are:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
The announcement differs greatly when beta phase starts.<br />
Usually release manager creates a dedicated forum thread in public subforum, like e.g. [https://forums.thedarkmod.com/index.php?/topic/20691-beta-testing-209/ Beta Testing 2.09].<br />
This thread should contain changelog of beta releases. Changelog of dev builds should be moved here too.<br />
I usually reserve three forum post immediately: the first one on how to install and what is beta about, the second one giving high-level overview of changes and new cvars/commands, and the third one with detailed changelog.<br />
<br />
<br />
=== Testing Cycle ===<br />
<br />
After beta release is published, testers update to it and post their bug reports.<br />
Developers investigate them and fix whatever they can.<br />
In typical workflow, the fixes are committed to the trunk (both for darkmod and darkmod_src repos), and the release manager merges them into the release branch.<br />
<br />
One point to keep in mind is that SVN does not have real branches: a branch is merely a copy of the whole directory.<br />
As the result, SVN does not have proper branch merging either: it simply takes the selected commits as patches and reapplies them onto the working copy (more like cherry-picking).<br />
This is not a big problem in our context, since usually you don't want to merge everything: only a nontrivial subset of commits from trunk will be merged into the release branch.<br />
In order to avoid confusion, keep an eye on svn:mergeinfo property: it should list the commits which were merged, so that you don't merge them again.<br />
<br />
Here is how I merge commits from trunk to release branch using TortoiseSVN:<br />
* Make sure your working copy is switched to the release branch and is clean from local modifications.<br />
* Now right-click the SVN root directory and choose SVN > Merge.<br />
* Select ''Merge a range of revisions''.<br />
* As ''URL to merge from'' use the address of the trunk.<br />
* In the field ''Revision range to merge'', click the ''Show Log'' button right next to the entry field. You will see log of commits in trunk, with the already merged commits greyed out. You can select one commit, or hold Ctrl to select an arbitrary subset of commits. You can press Ctrl+C when you finish selection, then paste the list of commits to a text file: later you can post it to developers so that they understand what was merged.<br />
* Hit ''Next'', then ''Merge''.<br />
* Now that the changes are incorporated into your working copy, test and review them briefly and commit to release branch.<br />
<br />
After some number of fixes has been committed and merged to release branch, repeat again from section [[#Publish Beta Release]].<br />
Publish new beta release, wait for feedback, fix, merge fixes to release branch, publish new release, etc.<br />
<br />
= Major Release =<br />
<br />
At some moment beta phase ends, and the next major release is created from the latest state of the release branch.<br />
<br />
<br />
=== Finalization ===<br />
<br />
The common approach is to turn the latest beta release (called "release candidate") into the major release without even rebuilding/repackaging it.<br />
In such case you can take the full package of release candidate and proceed directly to [[#Add Release]] section: determine how major release is named (e.g. <tt>release210</tt>), its parent version (it is always the previous major release), create differential package, upload it to server and update tdm_installer.ini.<br />
When editing tdm_installer.ini, move the <tt>default=1</tt> line from the previous major release to the new one.<br />
<br />
The next thing is saving Windows debug symbols. You must have saved them when you built executables which are in the final package. If you did not save them, then you cannot simply publish the existing package, and you have to start over from section [[#Compile Game Binaries]].<br />
Compress debug symbols (TheDarkModx64.pdb and thedarkmod.x64.debug) with 7z, put them into devel/release/debugging/X.YY in assets repo. Commit them to both to trunk and to release branch (commit + merge).<br />
<br />
Exact state of SVN repos should be saved for every major release.<br />
So create a tag <tt>tags/X.YY</tt> in both SVN repos from the state of the release branch that you used to create release from.<br />
<br />
While 32-bit executables are deprecated, we still provide them as a separate download for the latest major version.<br />
Thus, you should take 32-bit executables <tt>TheDarkMod.exe</tt> and <tt>thedarkmod.x86</tt> and pack them into <tt>tdm_exe32.zip</tt>.<br />
If you did not build 32-bit executables previously, build them exactly from the same source code which was used to build 64-bit executables.<br />
Put them at <tt>_aux/XYY/tdm_exe32.zip</tt> in the zipsync database (where X.YY is the TDM version).<br />
<br />
=== Update Website ===<br />
<br />
Be sure to update the following pages on the website to reflect the latest release version:<br />
* [http://www.thedarkmod.com/downloads/ http://www.thedarkmod.com/downloads/]<br />
* [http://www.thedarkmod.com/download-sourcecode/ http://www.thedarkmod.com/download-sourcecode/]<br />
<br />
To generate the latest source code package for the pages above:<br />
* Export the code from the release tag. E.g. svn export https://svn.thedarkmod.com/svn/darkmod_src/tags/x.yy<br />
* Create a 7zip archive with the following naming convention: thedarkmod.x.yy.src.7z<br />
** 7z a -r ../thedarkmod.x.yy.src.7z ./* <br />
* Upload the source code archive to http://www.thedarkmod.com/sources (ask admin for assistance with this or use the ftp upload user)<br />
<br />
Also update the link to 32-bit executables.<br />
It should point to <tt>http://update.thedarkmod.com/zipsync/_aux/XYY/tdm_exe32.zip</tt> --- that's where it was put inside the zipsync database.<br />
<br />
<br />
=== Update Wiki ===<br />
<br />
The wiki contains one page for each release. You can find them all in the [[:Category:What's New]] category. <br />
<br />
First update the current release page:<br />
<br />
* Change the "roadmap" link on the current release to a "changelog" link by swapping ''"roadmap_page.php?version_id=XX"'' with ''"changelog_page.php?version=XX"''.<br />
* Add the ''<nowiki>{{released|2.01|2014-01-30}}</nowiki>'' Template on top of the current release page with the correct date.<br />
<br />
Then add a new page for the next release. To do this, add a link to it in this template: [[Template:Whatsnew]] by editing it. After saving the template, a link to the new release version page appears in the list and in the category. Edit this page and insert some text into it (you can copy it from an older release page).<br />
<br />
Also insert a link to the current roadmap on the bugtracker, you can find out the version_id by looking at [http://bugs.thedarkmod.com/roadmap_page.php the roadmap page].<br />
<br />
<br />
=== Forum Announcement ===<br />
<br />
Post thread about new version on the [https://forums.thedarkmod.com/index.php?/forum/10-news-amp-announcements/ News & Announcements] subforum.<br />
<br />
<br />
=== Back to Development Phase ===<br />
<br />
After the dust of release settles, it's time to start the next release cycle and return to development phase.<br />
* Make sure all changes from release branch are also present in trunk, since you will unlikely return to the release branch in future.<br />
* Switch working copies of both repos back to trunk.<br />
* Open <tt>framework/Licensee.h</tt> in the source code repo, and update <tt>TDM_VERSION_MAJOR</tt>, <tt>TDM_VERSION_MINOR</tt>, <tt>ENGINE_VERSION</tt> for the next major release. Commit the change.<br />
* Go to [https://bugs.thedarkmod.com/manage_proj_page.php Manage section of bugtracker], choose The Dark Mod project. Click "Edit" for the just released version, set it to "Released" state. Add new version if not yet present.<br />
<br />
<br />
=== Hotfix Release ===<br />
<br />
Ideally, players use the major release for about a year, until the next major release comes out.<br />
But in the real world, we often discover some issues which cannot/shouldn't be delayed until the next major release.<br />
In such case, it is possible to create a special release, which is historically called "hotfix" release.<br />
It is something like a "patch release" from semantic versioning: a new version which is almost the same as the major release, but with a few small fixes added.<br />
<br />
The hotfix release is created from the previous release branch.<br />
For instance, if 2.09 is the last published major release and 2.10 is currently in development, then hotfix release 2.09a is created from release2.09 branch (in both SVN repos).<br />
Review Changelog or SVN commits since the last major release, and choose the changes which should be added in the hotfix. Discuss them with team members.<br />
Proper beta phase lasts months, and you don't want to waste much time on hotfix release, so be very careful and critical about the changes you include:<br />
* Included commits should be done some time ago, so that at least developers have already tested them.<br />
* Included commits must not break savegame format, i.e. they must not change any calls to <tt>idSaveGame</tt>/<tt>idRestoreGame</tt> objects.<br />
* Included commits should be small and have little risk of breaking something.<br />
* Do not include commits which provide a new feature: new features are for new major release.<br />
Usually, commits are included in the following cases:<br />
* Fixing game crashes, race conditions, data corruption. Especially the ones which players bump into.<br />
* Fixing wrong usage of OpenGL API. Or adding workarounds for bad OpenGL drivers. Same for OpenAL and other machine-dependent stuff.<br />
* Fixing interaction with outside projects (FM database, DarkRadiant, tdm_installer, etc.) in case it has been broken.<br />
<br />
Note that unlike typical convention, we guarantee full savegame compatibility between the hotfix release and its predecessor.<br />
The game writes SVN revision into every savegame and checks that it is the same when it loads game, complaining if it does not match.<br />
To silence this warning, go to the method <tt>RevisionTracker::GetSavegameRevision</tt> and make it return the hardcoded number: the revision reported by the original major release.<br />
Commit this change to branch (but '''not''' to trunk): now all executables created from this branch will use the same revision number when writing and reading savegames.<br />
Don't forget to test that savegames created in original release load properly in hotfix release and vice versa.<br />
<br />
When everyone agrees on the set of included commits, merge them all to the release branch.<br />
<br />
Now do the typical steps for creating a new release:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
Use release branch. Name the added version appropriately in zipsync database (e.g. <tt>release209a</tt>).<br />
Write announcement on public forums with changelog describing the merged commits, and instructions how to get hotfix (like [https://forums.thedarkmod.com/index.php?/topic/20930-beta-testing-209a-aka-hotfix/ this one]).<br />
<br />
After a very brief public beta-testing, move the <tt>default=1</tt> line from the original release to the hotfix release in <tt>tdm_installer.ini</tt>.<br />
Now everyone who runs tdm_installer without explicitly specifying version will get the hotfix release.<br />
<br />
Now do the ordinary finalization steps:<br />
# Publish 32-bit executables.<br />
# Commit 7zipped Windows PDB files to <tt>devel/release/debugging</tt>, replacing the files from original release.<br />
# Create SVN tags in both repos.<br />
# Update website: replace link to 32-bit executables and source code archive.<br />
# Write announcements, so that people know they should update.<br />
<br />
Of course, you can provide more than one hotfix release for one major release: 2.09a, 2.09b, 2.09c, etc.<br />
Also note that the original release is not lost: players can even install it if they want.</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Release_Mechanics&diff=30576TDM Release Mechanics2023-01-29T18:07:01Z<p>Stgatilov: Tracy issue is no longer present after library update</p>
<hr />
<div>This article describes the process of creating TDM releases.<br />
<br />
<br />
= Preliminaries =<br />
<br />
Before even starting to build a package, make sure you have all the following tools ready.<br />
<br />
<br />
=== Packager ===<br />
<br />
The tdm_package tool inspects your working copy of assets SVN, and generates PK4 archives from it.<br />
<br />
Prebuilt Windows executable can be downloaded from TDM server: [http://update.thedarkmod.com/zipsync/tdm_package.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_update</tt> subdirectory.<br />
Build instructions:<br />
* Windows: Open <tt>tdm_update.sln</tt>, build Release configuration<br />
* Linux: Run <tt>scons BUILD="release"</tt><br />
As the result, packager executable <tt>tdm_package.???</tt> will be created in <tt>bin</tt> subdirectory.<br />
<br />
<br />
If the packager tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
'''TODO:''' update this section when [https://bugs.thedarkmod.com/view.php?id=5076 #5076] is done.<br />
<br />
<br />
=== Zipsync ===<br />
<br />
Zipsync command-line tool is used to integrate a freshly generated set of pk4 archives into the database of releases.<br />
More details provided in article [[Tdm_installer_and_zipsync#Command-line_tool]].<br />
<br />
Prebuilt Windows executable can be downloaded here: [http://update.thedarkmod.com/zipsync/zipsync.exe link]<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer/zipsync</tt> subdirectory.<br />
Unlike all the other TDM projects, this one does not use artefacts from <tt>ThirdParty</tt> directory.<br />
Hence, you need to install and use [https://conan.io/ conan] directly if you want to build it.<br />
<br />
Build instructions:<br />
* Get packages: <tt>conan install . -if build -s build_type=RelWithDebInfo --build=outdated</tt><br />
* Build: <tt>conan build . -bf build</tt><br />
The binaries should be ready in <tt>build/RelWithDebInfo</tt>.<br />
In case of MSVC, the CMake-generated solution will be somewhere nearby.<br />
<br />
<br />
If the zipsync tool is modified, update the prebuilt executable on TDM server.<br />
Contact admin if you don't have SSH access for it.<br />
<br />
<br />
=== Installer ===<br />
<br />
Tdm_installer is GUI application, used to install/update the game on player's machine.<br />
More details provided in article [[Tdm installer and zipsync#tdm_installer]].<br />
<br />
Prebuilt executables can be obtained from Downloads section on the website.<br />
<br />
<br />
The source code is located in source code SVN in <tt>tdm_installer</tt> subdirectory.<br />
It can be built with CMake in pretty standard way.<br />
For example:<br />
* Create <tt>build</tt> directory, switch to it.<br />
* Run <tt>cmake ..</tt> to generate project or makefile.<br />
* Windows: Open generated solution, build RelWithDebInfo '''Win32''' configuration.<br />
* Linux: Run <tt>make</tt> to finish build.<br />
<br />
You only need to build 32-bit executable on Windows: it will work fine on 64-bit OS too.<br />
For Linux, build both 64-bit and 32-bit executables separately.<br />
<br />
In order to build 32-bit executable on 64-bit Linux, run cmake with additional parameters:<br />
* <tt>cmake .. -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32</tt><br />
<br />
<br />
If tdm_installer is modified, update all prebuilt executables on TDM server.<br />
<br />
For the self-update to work, each executable must be packaged into a special zip archive:<br />
* <tt>zipsync hashzip tdm_installer.exe</tt><br />
* <tt>zipsync hashzip tdm_installer.linux64</tt><br />
* <tt>zipsync hashzip tdm_installer.linux32</tt><br />
<br />
The resulting zip archives should be uploaded onto the TDM server (contact admin for access).<br />
Note that tdm_installer automatically updates itself to the executable on the server: if you put a bad build, make sure to fix it quickly!<br />
<br />
<br />
= Development Phase =<br />
<br />
Development phase takes the majority of time. During this time, day-to-day development happens on SVN trunk, so all commits end up there. Stuff gets broken, stuff gets fixed, stuff gets evaluated, some might be ripped out again. See also [[SVN]] article.<br />
<br />
<br />
=== Dev Builds ===<br />
<br />
New development build/release is created roughly every 2-4 weeks (might depend on the amount of changes) from trunk. Even though these builds are unstable and untested, and may include features will be heavily changed of even removed by the time of the next major release, there are many reasons to provide them:<br />
* Beta-testers are able to bisect over development history to find when an issue started happening.<br />
* External programmers can get assets compatible with recent source code trunk.<br />
* Curious players can test new features and provide early feedback.<br />
<br />
The rest of this chapter describes how to create such a dev build.<br />
Note: mostly the same steps are done when building beta releases and major releases.<br />
<br />
<br />
=== Compile Game Binaries ===<br />
<br />
The assets SVN repo contains TDM executable files, which are copied into PK4 archives by the packager.<br />
They are rarely up-to-date, so the very first step is to build new executables from the source code and commit them to the assets repo.<br />
<br />
Ensure you have clean and most recent revision of darkmod_src repo.<br />
The detailed build instructions are provided in [[TDM Compilation Guide]], and the process of updating executables is explained in [[SVN#Executables Update]].<br />
Just a few remainders:<br />
* Better explicitly delete all executables before building. For major releases, better delete <tt>build</tt> directory and build everything from scratch.<br />
* Always build Release configuration.<br />
* Build binaries for all officially supported platforms: Linux and Windows. Deprecated 32-bit executables are '''not''' built, except for the major releases and the last beta.<br />
* Don't forget to save debug symbols (.pdb and .debug files) somewhere when you commit executables, so that you don't accidentally overwrite them later!<br />
* Note that shaders (<tt>glprogs</tt> directory) are also copied to assets repo when you build TDM, so don't forget to commit them too.<br />
<br />
The easiest way to build executables for Windows and Linux at once is to use Windows machine with Linux virtual machine. Detailed setup instructions for virtual machine are provided in [[VirtualBox: Virtual machine with Linux for TDM|VirtualBox]] and [[VMWare: Virtual machine with Linux|VMWare]] articles.<br />
<br />
Better choose fairly popular and '''old''' version of Linux, for instance a five-year-old Ubuntu LTS (still using 16.04 in 2021).<br />
Due to how GLIBC symbols versioning works, sometimes TDM executable built on a new Linux won't start on an old one.<br />
<br />
The debug symbols take quite a lot of space, but are indispensible for [[Analyze a Memory Dump|analyzing crashes]] on players' machines.<br />
So release manager must keep them safe on a local disk, and probably share them with other programmers on some cloud storage.<br />
For major releases, Windows debug symbols are even committed to the assets repo (see below).<br />
<br />
<br />
=== Release Manifest ===<br />
<br />
The "manifest" is a huge list of all the files that are nominated to go into the release package. Not all files in SVN are supposed to be released (like test files, test maps, other broken or unfinished stuff), so a white list is needed. Aside from that, some rules are needed to decide how files are divided among pk4 archives.<br />
<br />
Here are the files related to manifest:<br />
* <tt>devel/manifests/base.txt</tt>: an explicit list of files which are packaged regardless of any other conditions.<br />
* <tt>devel/manifests/darkmod_maps.txt</tt>: sequence of include/exclude commands with regexes.<br />
* <tt>devel/manifests/darkmod.txt</tt>: full manifest file generated from the previous two files using tdm_package.<br />
* <tt>devel/manifests/darkmod_pk4s.txt</tt>: set of regex-powered rules describing which files go into which pk4 archive.<br />
<br />
==== Build Manifest ====<br />
The manifest file <tt>devel/manifests/darkmod.txt</tt> is generated by the tdm_package application.<br />
I run it with the following command:<br />
* <tt>tdm_package --create-manifest --darkmoddir=G:\TheDarkMod\darkmod >update_manifest.log</tt><br />
Here darkmoddir argument points to your working copy of assets SVN (it should be clean and up-to-date).<br />
<br />
After the packager finishes, review the packager log file and the changes in the file <tt>devel/manifests/darkmod.txt</tt>.<br />
If everything looks good, commit the updated manifest to the assets repo.<br />
If not, then adjust some files (e.g. the maps file) and try again. Commit your adjustments to SVN of course.<br />
<br />
==== Include/Exclude From Manifest ====<br />
The main place to specify what should be included into release is <tt>darkmod_maps.txt</tt> file.<br />
As a rare exception, some files are specified in <tt>base.txt</tt>. But it is very small, and should probably be merged into the maps file in the future.<br />
Here is how maps file works.<br />
<br />
In the first step, all files in specific folders are included:<br />
# Include all these files (but without parsing them like maps), each<br />
# statement will include files (from SVN) in that folder:<br />
INCLUDE def/<br />
INCLUDE dds/<br />
...<br />
INCLUDE video/<br />
INCLUDE xdata/<br />
As seen in the above example, the sharp character # is used to denote comments. Put that at the beginning of a line to disable the statement.<br />
<br />
As the next step, the algorithm will exclude certain files matching the regular expressions in EXCLUDE statements like this:<br />
EXCLUDE dds/darkmod/test<br />
In 95% of the cases it's enough to just specify the path of the files you want to exclude (use forward slashes), but you can do more fancy stuff like this:<br />
EXCLUDE models/md5/chars/undead/revenant/.*.md5anim<br />
EXCLUDE ^(dds/)?models/md5/chars/undead/revenant<br />
The first line will exclude all MD5ANIM files in the revenant folder. The second line will exclude all files in models/md5/chars/undead/revenant '''and''' the ones in '''dds/'''models/md5/chars/undead/revenant (the dds/ part is marked to be optional). <br />
<br />
In summary, all files that are INCLUDE'd as denoted above and afterwards manage to get through the hundreds of lines of EXCLUDE filters will end up in the manifest file.<br />
<br />
==== Distribute files into PK4s ====<br />
Each of the thousands of files in the manifest needs to be sorted into the correct PK4.<br />
This is done by defining a rules in the file <tt>devel/manifests/darkmod_pk4s.txt</tt>. Each of the lines there defines a PK4 and which files go into it:<br />
# Miscellaneous stuff (GL Progs, Script, Language Files, Rope Arrow)<br />
tdm_base01.pk4: ^glprogs, ^script, ^strings, sound\.wav, _emptyname\.wav, ^models/md5/environments, ^dds/models/md5/environments, ...<br />
Again, lines starting with the sharp # character denote comments.<br />
<br />
Leftmost is the PK4 filename, followed by a colon character. To the right of the colon a list comma-separated patterns is defined, whereas each pattern is interpreted as regular expression. As with the <tt>darkmod_maps.txt</tt> you don't need to know very much about regular expressions to define those rules, it's usually enough to write the folder names and use wildcards like <tt>.*.md5anim</tt><br />
<br />
Note that a file will not get into the release package if no rule covers it in the darkmod_pk4s.txt, even if it is present in the full manifest.<br />
The packager prints a warning in such case when pk4 files are created.<br />
<br />
<br />
=== Create Package ===<br />
<br />
After the manifest is ready, we can finally use packager to pack working copy of assets SVN into a set of pk4 files.<br />
Make sure your working copy is clean beforehand: unversioned files will be ignored, but local modifications will get into the package!<br />
* <tt>tdm_package --create-package --darkmoddir=G:/TheDarkMod/darkmod --outputdir=G:/TheDarkMod/tmp_package >create_package.log</tt><br />
Here darkmoddir specifies path to SVN working copy, and outputdir specifies path to an empty directory where pk4 files will be generated.<br />
<br />
Be sure to look through the log file!<br />
If some file is not covered by pk4 distribution rules, you will see the corresponding message there.<br />
<br />
<br />
=== Add Release ===<br />
<br />
All versions of TDM are stored in one zipsync database, which looks like a big tree of differential packages.<br />
Read [[Tdm_installer_and_zipsync#Version_conventions]] carefully and decide 1) how to name the new version, and 2) which previously released version should serve as a parent for the new version.<br />
<br />
First of all, you need the parent version somewhere on local disk (in clean state: without any additional files).<br />
If you don't have it, you can download it via tdm_installer:<br />
# Create new directory. You can optionally copy some tdm_XXX.pk4 files to it to reduce download time.<br />
# Copy tdm_installer to the directory, start it.<br />
# On the first page, check '''"Bitwise exact zips"''' advanced setting! Also check "Get custom version".<br />
# On the second page, choose the parent version.<br />
# Optional: After installation is complete, you can delete <tt>.zipsync</tt> directory and all files with extensions other than pk4 and zip.<br />
'''Note:''' It is much easier to save all versions you create on the local disk, so that you can use them as parent versions later.<br />
<br />
Rename the directories with new version and with parent version: the directory name must match the name of the version.<br />
Let's say parent version is <tt>dev01234-8765</tt>, and new version is <tt>dev12345-9876</tt>.<br />
<br />
Run analysis on the new version (remove <tt>-j0</tt> unless data is stored on SSD):<br />
* <tt>zipsync analyze -r G:\tdmrel\dev12345-9876 -cn -j0 *.pk4 *.zip</tt><br />
Then create a differential package:<br />
* <tt>zipsync diff -r G:\tdmrel\dev12345-9876 -s G:\tdmrel\dev01234-8765\manifest.iniz -o G:\tdmrel\dev12345-9876_from_dev01234-8765</tt><br />
Detailed explanation of how to use zipsync command line tool is provided in [[Tdm installer and zipsync]].<br />
<br />
Now you need to connect to TDM server via SSH.<br />
For simplicity, I recommend storing exact copy of the whole zipsync database locally.<br />
In order to push your modifications, you can log to TDM server using WinSCP and use Commands:Synchronize with the properly set Direction/Target.<br />
<br />
Look at the directory structure in the database and put the new differential package appropriately, e.g. into <tt>dev/210/dev12345-9876_from_dev01234-8765</tt>.<br />
Then open <tt>tdm_installer.ini</tt> in text editor, find appropriate place for the new version, and add it there, e.g.:<br />
[Version dev12345-9876]<br />
manifestUrl=${MIRROR}/dev/210/dev12345-9876_from_dev01234-8765/manifest.iniz<br />
depends=dev01234-8765<br />
folder=dev/2.10<br />
When you are sure that you edited it properly, synchronize your changes to the server.<br />
Immediately after that try to switch some of your TDM installations to the new version using tdm_installer (with "Bitwise exact zips" flag).<br />
If something does not work for you, fix the problem as soon as possible.<br />
<br />
=== Changelog and Announcement ===<br />
<br />
The current tradition for changelog is:<br />
* Changelog for all the dev builds after the last major release is in the second post of [https://forums.thedarkmod.com/index.php?/topic/20824-public-access-to-development-versions/ this forum thread].<br />
* When beta phase is started, a separate thread is created for it, and changelog of all dev builds is moved to there.<br />
* Changelog for beta releases is added to the beta testing thread. One post should contain changelog for all dev builds and beta releases in chronological order.<br />
* In the message with changelog, post link to the changelog for previous versions (making a linked list of forum posts).<br />
<br />
Use SVN log over both repos to write changelog.<br />
Try to write in language which users can understand, whenever possible.<br />
Post as much links as you can: links to bugtracker as especially welcome, or links to feature discussion thread.<br />
Some very minor things can be omitted in changelog, but don't miss anything which can break something or cause any type of negative consequences.<br />
Most likely you will often read this changelog yourself =)<br />
<br />
When changelog is ready, post short message that new version is available in the appropriate forum thread.<br />
<br />
<br />
=== Dev Build: Recap ===<br />
<br />
Here are all steps for creating a new dev build:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
<br />
<br />
= Beta Phase =<br />
<br />
At some moment the development phase is over, and beta phase starts.<br />
The main goal of beta phase is to create a new major release, which will be used by most players for the next year or so.<br />
Of course, it is preceded by lengthy public beta testing.<br />
<br />
<br />
=== Agree on Schedule ===<br />
<br />
The beta phase starts with branching off the release, and typically lasts for 1-2 months after that.<br />
There is usually a rough plan about when to hold beta phase and when to release, but as time comes close, it's better to discuss it with team members again.<br />
Team members are supposed to wrap up their pending changes and commit them to the trunk before beta phase starts.<br />
About two weeks are long enough of a time span for people to get everything into SVN.<br />
<br />
<br />
=== Libraries and License ===<br />
<br />
A few weeks before branching, it is a good idea to revise the set of third-party libraries used.<br />
Starting from TDM 2.08, it should be easy to check it thanks to the new conventions on third-party stuff (see also [[Libraries and Dependencies]]).<br />
Some minor code pieces get embedded directly into the source, try to recall all of them.<br />
<br />
It is necessary to update the <tt>LICENSE.txt</tt> file in SVN repositories if something is not up-to-date.<br />
Note that you should commit the same updated file into '''both''' source code and assets repos.<br />
<br />
<br />
=== Update Script Reference ===<br />
<br />
Another thing which needs update prior to branching is the script reference.<br />
It can be regenerated using the <tt>tdm_gen_script_event_doc</tt> command in game console:<br />
* <tt>tdm_gen_script_event_doc tdm_events.script d3script</tt><br />
* <tt>tdm_gen_script_event_doc forwiki.mw mediawiki</tt><br />
The files will be created in the FM directory.<br />
Copy mediawiki output to the wiki article [[TDM Script Reference]].<br />
Copy script output to <tt>script/tdm_events.script</tt> file in the assets repo and commit.<br />
<br />
<br />
=== Branching off ===<br />
<br />
Once the deadline arrives, create the '''release branch''' in both repos: [[Image:Create release branch.png|right|350px]]<br />
* Update your working copy of assets repo (darkmod).<br />
* Update working copy of source code repo (darkmod_src) too.<br />
* Right-click the darkmod_src folder to create the branch<br />
** Select SVN > Branch/Tag...<br />
** A new dialog appears asking for a URL. Enter a URL like this: [https://server/svn/darkmod_src/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod_src/branches/releaseX.YY] where X.YY is replaced by whatever version the next release will be. <br />
** You'll probably want to switch to the new branch once it is created, so make sure the check button at the bottom of the dialog is active.<br />
** Hit OK to let the SVN server create the branch.<br />
* Do the same for darkmod repository, using the URL scheme [https://server/svn/darkmod/branches/releaseX.YY https://<darkmod_server_here>/svn/darkmod/branches/releaseX.YY]<br />
<br />
At this point there is new "release" branch in each of the two repos.<br />
The release branch and trunk live independently from each other: each working copy is attached to one of these branches, and commits done to one branch do not change the state of the other.<br />
All the beta releases and the final major release will be packaged from the release branch, thus it is important to keep it stable and only commit there the changes which are necessary for the release.<br />
Trunk will continue to evolve after the beta phase ends, so it is in principle possible to commit there some work which is not intended for release (although not desirable).<br />
<br />
The release manager has to establish the workflow for developers, in order to avoid confusion with changes and branches.<br />
The typical workflow is: everyone commits his changes to trunk and notifies release manager that changes are intended for release, release manager merges the necessary changes to release branch when needed.<br />
If developer knows well how to deal with branches and commits merging in SVN, he can also merge his commits to release branch himself.<br />
<br />
While trunk is technically independent from release branch, it is desirable to freeze or at least cool down all development not intended for the upcoming release.<br />
The reason for that is that during beta phase it is necessary to merge commits between branches a lot.<br />
If you merge 100% of commits from trunk to release, then beta phase can last forever or some major bug can slip into release at the last moment.<br />
On the other hand, the more unmerged commits you have, the more likely merge conflicts become.<br />
Refactoring, files renaming, and massive changes over the codebase are strongly discouraged.<br />
<br />
<br />
=== Publish Beta Release ===<br />
<br />
Beta release is created and published the same way as dev build.<br />
The main difference is that dev builds are created on SVN trunk, and beta releases are created on the release branch.<br />
So make sure your SVN working copy is switched to release branch both in the source code repo and in the assets repo.<br />
Another difference between dev builds and beta releases is [[Tdm_installer_and_zipsync#Version_conventions|naming TDM versions in zipsync database]].<br />
<br />
Once again, the steps are:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
<br />
The announcement differs greatly when beta phase starts.<br />
Usually release manager creates a dedicated forum thread in public subforum, like e.g. [https://forums.thedarkmod.com/index.php?/topic/20691-beta-testing-209/ Beta Testing 2.09].<br />
This thread should contain changelog of beta releases. Changelog of dev builds should be moved here too.<br />
I usually reserve three forum post immediately: the first one on how to install and what is beta about, the second one giving high-level overview of changes and new cvars/commands, and the third one with detailed changelog.<br />
<br />
<br />
=== Testing Cycle ===<br />
<br />
After beta release is published, testers update to it and post their bug reports.<br />
Developers investigate them and fix whatever they can.<br />
In typical workflow, the fixes are committed to the trunk (both for darkmod and darkmod_src repos), and the release manager merges them into the release branch.<br />
<br />
One point to keep in mind is that SVN does not have real branches: a branch is merely a copy of the whole directory.<br />
As the result, SVN does not have proper branch merging either: it simply takes the selected commits as patches and reapplies them onto the working copy (more like cherry-picking).<br />
This is not a big problem in our context, since usually you don't want to merge everything: only a nontrivial subset of commits from trunk will be merged into the release branch.<br />
In order to avoid confusion, keep an eye on svn:mergeinfo property: it should list the commits which were merged, so that you don't merge them again.<br />
<br />
Here is how I merge commits from trunk to release branch using TortoiseSVN:<br />
* Make sure your working copy is switched to the release branch and is clean from local modifications.<br />
* Now right-click the SVN root directory and choose SVN > Merge.<br />
* Select ''Merge a range of revisions''.<br />
* As ''URL to merge from'' use the address of the trunk.<br />
* In the field ''Revision range to merge'', click the ''Show Log'' button right next to the entry field. You will see log of commits in trunk, with the already merged commits greyed out. You can select one commit, or hold Ctrl to select an arbitrary subset of commits. You can press Ctrl+C when you finish selection, then paste the list of commits to a text file: later you can post it to developers so that they understand what was merged.<br />
* Hit ''Next'', then ''Merge''.<br />
* Now that the changes are incorporated into your working copy, test and review them briefly and commit to release branch.<br />
<br />
After some number of fixes has been committed and merged to release branch, repeat again from section [[#Publish Beta Release]].<br />
Publish new beta release, wait for feedback, fix, merge fixes to release branch, publish new release, etc.<br />
<br />
= Major Release =<br />
<br />
At some moment beta phase ends, and the next major release is created from the latest state of the release branch.<br />
<br />
<br />
=== Finalization ===<br />
<br />
The common approach is to turn the latest beta release (called "release candidate") into the major release without even rebuilding/repackaging it.<br />
In such case you can take the full package of release candidate and proceed directly to [[#Add Release]] section: determine how major release is named (e.g. <tt>release210</tt>), its parent version (it is always the previous major release), create differential package, upload it to server and update tdm_installer.ini.<br />
When editing tdm_installer.ini, move the <tt>default=1</tt> line from the previous major release to the new one.<br />
<br />
The next thing is saving Windows debug symbols. You must have saved them when you built executables which are in the final package. If you did not save them, then you cannot simply publish the existing package, and you have to start over from section [[#Compile Game Binaries]].<br />
Compress Windows debug symbols (TheDarkMod.pdb and TheDarkModx64.pdb) with 7z, put them into devel/release/debugging/X.YY in assets repo. Commit them to both to trunk and to release branch (commit + merge).<br />
<br />
Exact state of SVN repos should be saved for every major release.<br />
So create a tag <tt>tags/X.YY</tt> in both SVN repos from the state of the release branch that you used to create release from.<br />
<br />
While 32-bit executables are deprecated, we still provide them as a separate download for the latest major version.<br />
Thus, you should take 32-bit executables <tt>TheDarkMod.exe</tt> and <tt>thedarkmod.x86</tt> and pack them into <tt>tdm_exe32.zip</tt>.<br />
If you did not build 32-bit executables previously, build them exactly from the same source code which was used to build 64-bit executables.<br />
Put them at <tt>_aux/XYY/tdm_exe32.zip</tt> in the zipsync database (where X.YY is the TDM version).<br />
<br />
<br />
=== Update Website ===<br />
<br />
Be sure to update the following pages on the website to reflect the latest release version:<br />
* [http://www.thedarkmod.com/downloads/ http://www.thedarkmod.com/downloads/]<br />
* [http://www.thedarkmod.com/download-sourcecode/ http://www.thedarkmod.com/download-sourcecode/]<br />
<br />
To generate the latest source code package for the pages above:<br />
* Export the code from the release tag. E.g. svn export https://svn.thedarkmod.com/svn/darkmod_src/tags/x.yy<br />
* Create a 7zip archive with the following naming convention: thedarkmod.x.yy.src.7z<br />
** 7z a -r ../thedarkmod.x.yy.src.7z ./* <br />
* Upload the source code archive to http://www.thedarkmod.com/sources (ask admin for assistance with this or use the ftp upload user)<br />
<br />
Also update the link to 32-bit executables.<br />
It should point to <tt>http://update.thedarkmod.com/zipsync/_aux/XYY/tdm_exe32.zip</tt> --- that's where it was put inside the zipsync database.<br />
<br />
<br />
=== Update Wiki ===<br />
<br />
The wiki contains one page for each release. You can find them all in the [[:Category:What's New]] category. <br />
<br />
First update the current release page:<br />
<br />
* Change the "roadmap" link on the current release to a "changelog" link by swapping ''"roadmap_page.php?version_id=XX"'' with ''"changelog_page.php?version=XX"''.<br />
* Add the ''<nowiki>{{released|2.01|2014-01-30}}</nowiki>'' Template on top of the current release page with the correct date.<br />
<br />
Then add a new page for the next release. To do this, add a link to it in this template: [[Template:Whatsnew]] by editing it. After saving the template, a link to the new release version page appears in the list and in the category. Edit this page and insert some text into it (you can copy it from an older release page).<br />
<br />
Also insert a link to the current roadmap on the bugtracker, you can find out the version_id by looking at [http://bugs.thedarkmod.com/roadmap_page.php the roadmap page].<br />
<br />
<br />
=== Forum Announcement ===<br />
<br />
Post thread about new version on the [https://forums.thedarkmod.com/index.php?/forum/10-news-amp-announcements/ News & Announcements] subforum.<br />
<br />
<br />
=== Back to Development Phase ===<br />
<br />
After the dust of release settles, it's time to start the next release cycle and return to development phase.<br />
* Make sure all changes from release branch are also present in trunk, since you will unlikely return to the release branch in future.<br />
* Switch working copies of both repos back to trunk.<br />
* Open <tt>framework/Licensee.h</tt> in the source code repo, and update <tt>TDM_VERSION_MAJOR</tt>, <tt>TDM_VERSION_MINOR</tt>, <tt>ENGINE_VERSION</tt> for the next major release. Commit the change.<br />
* Go to [https://bugs.thedarkmod.com/manage_proj_page.php Manage section of bugtracker], choose The Dark Mod project. Click "Edit" for the just released version, set it to "Released" state. Add new version if not yet present.<br />
<br />
<br />
=== Hotfix Release ===<br />
<br />
Ideally, players use the major release for about a year, until the next major release comes out.<br />
But in the real world, we often discover some issues which cannot/shouldn't be delayed until the next major release.<br />
In such case, it is possible to create a special release, which is historically called "hotfix" release.<br />
It is something like a "patch release" from semantic versioning: a new version which is almost the same as the major release, but with a few small fixes added.<br />
<br />
The hotfix release is created from the previous release branch.<br />
For instance, if 2.09 is the last published major release and 2.10 is currently in development, then hotfix release 2.09a is created from release2.09 branch (in both SVN repos).<br />
Review Changelog or SVN commits since the last major release, and choose the changes which should be added in the hotfix. Discuss them with team members.<br />
Proper beta phase lasts months, and you don't want to waste much time on hotfix release, so be very careful and critical about the changes you include:<br />
* Included commits should be done some time ago, so that at least developers have already tested them.<br />
* Included commits must not break savegame format, i.e. they must not change any calls to <tt>idSaveGame</tt>/<tt>idRestoreGame</tt> objects.<br />
* Included commits should be small and have little risk of breaking something.<br />
* Do not include commits which provide a new feature: new features are for new major release.<br />
Usually, commits are included in the following cases:<br />
* Fixing game crashes, race conditions, data corruption. Especially the ones which players bump into.<br />
* Fixing wrong usage of OpenGL API. Or adding workarounds for bad OpenGL drivers. Same for OpenAL and other machine-dependent stuff.<br />
* Fixing interaction with outside projects (FM database, DarkRadiant, tdm_installer, etc.) in case it has been broken.<br />
<br />
Note that unlike typical convention, we guarantee full savegame compatibility between the hotfix release and its predecessor.<br />
The game writes SVN revision into every savegame and checks that it is the same when it loads game, complaining if it does not match.<br />
To silence this warning, go to the method <tt>RevisionTracker::GetSavegameRevision</tt> and make it return the hardcoded number: the revision reported by the original major release.<br />
Commit this change to branch (but '''not''' to trunk): now all executables created from this branch will use the same revision number when writing and reading savegames.<br />
Don't forget to test that savegames created in original release load properly in hotfix release and vice versa.<br />
<br />
When everyone agrees on the set of included commits, merge them all to the release branch.<br />
<br />
Now do the typical steps for creating a new release:<br />
# [[#Compile Game Binaries]]<br />
# [[#Build Manifest]]<br />
# [[#Create Package]]<br />
# [[#Add Release]] to zipsync database.<br />
# Write [[#Changelog and Announcement]].<br />
Use release branch. Name the added version appropriately in zipsync database (e.g. <tt>release209a</tt>).<br />
Write announcement on public forums with changelog describing the merged commits, and instructions how to get hotfix (like [https://forums.thedarkmod.com/index.php?/topic/20930-beta-testing-209a-aka-hotfix/ this one]).<br />
<br />
After a very brief public beta-testing, move the <tt>default=1</tt> line from the original release to the hotfix release in <tt>tdm_installer.ini</tt>.<br />
Now everyone who runs tdm_installer without explicitly specifying version will get the hotfix release.<br />
<br />
Now do the ordinary finalization steps:<br />
# Publish 32-bit executables.<br />
# Commit 7zipped Windows PDB files to <tt>devel/release/debugging</tt>, replacing the files from original release.<br />
# Create SVN tags in both repos.<br />
# Update website: replace link to 32-bit executables and source code archive.<br />
# Write announcements, so that people know they should update.<br />
<br />
Of course, you can provide more than one hotfix release for one major release: 2.09a, 2.09b, 2.09c, etc.<br />
Also note that the original release is not lost: players can even install it if they want.</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=What%27s_new_in_TDM_2.11&diff=30535What's new in TDM 2.112023-01-14T10:22:25Z<p>Stgatilov: /* Gameplay */</p>
<hr />
<div><!-- keywords whats new --><br />
{{notreleasedyet|2.11}}<br />
See the [http://bugs.thedarkmod.com/roadmap_page.php roadmap] on our bugtracker.<br />
<!-- See the [https://bugs.thedarkmod.com/changelog_page.php?version_id=96 changelog] on our bugtracker. --><br />
<!-- {{released|2.11|XXXX-XX-XX}} --><br />
<br />
<br><br><br />
'''<font size="5">The Dark Mod 2.11</font>'''<br />
<br><br><br />
<br />
<font size="3">TDM 2.11 is a major bugfix release. Longstanding problems with stealth scoring, load\save crashes and<br />
<br>visual glitches when changing loading or menu screens have gotten overdue repairs or improvement.<br />
<br><br />
<br>Dragofer deserves extra credit for fixing hundreds of assets and ensuring that the console is mostly free of useless warning messages<br />
<br>due to these asset bugs. Along the way, hundreds of asset submissions from both team members and forum members that the TDM team <br />
<br>hadn't had time to quality check and\or complete have been added to the project.<br />
<br><br />
<br>In line with the theme of fixing longstanding issues, Obsttorte developed a new Blackjack system that doesn't rely <br />
<br>on physically moving the player arm through a rotation arc and instead uses a trace to the destination target and adaptive animation.<br />
<br><br />
<br>stgatilov performed so many major performance improvements this release it could probably also be considered a "performance release".<br />
<br>Included in the long list of performance improvements is an improvement to the visual quality of the new Volumetric Lights so that players no<br />
<br>longer need to increase the number of samples to an absurd value to get a smooth visual gradient (thus killing performance).<br />
<br><br />
<br>Finally, JackFarmer and datiswous added EFX reverb and other fixes to Tears of Saint Lucia, while boissiere and Dragofer added subtitles to A New Job<br />
<br>Thus making the included intro missions feature complete with regard to audio and accessibility<br />
<br />
<br />
----<br />
<br><br><br />
<br />
== <br><br> <font size="4">'''Important CVARS'''</font> ==<br />
<br />
=== <font size="4">GENERIC</font> ===<br />
<br><br />
<br />
'''r_volumetric*''' --- for tweaking volumetric light algorithm (if defaults are not good enough).<br />
<br />
'''tdm_blackjack_indicate''' --- raise arm up to indicate when blackjacking can result in KO.<br />
<br />
'''pm_mantle_roll_mod''' --- allows to tune down motions during mantling.<br />
<br />
'''tdm_multiloot_min_interval, tdm_multiloot_max_interval''' --- configures timings for multiloot grabbing feature.<br />
<br />
'''teleportArea''' --- command to quickly find a visportal area with specified index.<br />
<br />
{{clear}}<br />
<br />
<br><br />
=== <font size="3">TROUBLESHOOTING</font> ===<br />
<br><br />
<br />
'''r_modelBvh*''' --- configures all BVH-related optimizations. r_modelBvhBuild is the "kill switch".<br />
<br />
'''r_softShadowsMipmaps''' --- enables the new bandwidth optimization for soft stencil shadows.<br />
<br />
'''com_useMinorTics''' --- enables AI interleaving optimization for low FPS.<br />
<br />
'''r_useParallelAddModels''' --- old optimization also known as "Frontend Acceleration", enabled by default in beta211-03.<br />
'''<br />
r_frobDefault*''' --- controls addition of implicit frob-highlight stages.<br />
<br />
'''decl_fix_mission_override, decl_skip_redefine_warning''' --- controls the rules for decl overrides.<br />
<br />
'''dmap_tjunctionsAlgorithm''' --- new dmap optimization in FixGlobalTJunctions function.<br />
<br />
'''dmap_disableCellSnappingTjunc, dmap_aasExpandBrushUseEdgesOnce''' --- enables dmap changes for better numeric stability.<br />
<br />
<br><br />
== '''Graphics''' ==<br />
<br />
'''2.11 is packed with performance optimizations!!!'''<br />
<br><br><br />
* Volumetric Lights are now blurred offscreen leading to a much smoother appearance with less performance impact<br />
* GLSL shaders have been reorganized to take better advantage of shared data and branching.<br />
* Ambient Lighting no longer multiplies some diffuse into the specular so the specular color chosen by the author is fully respected<br />
* The default Ambient World material now uses a cubemap to create the "light from sky" effect. Other ambient lights are direction neutral and better suited for faked Global Illumination<br />
* Soft Stencil Shadows use a tile-based optimization to prevent sampling from being run against every screen pixel<br />
* Shadow Maps now have better mipmap and LOD behavior. They no longer waste as much memory on distant objects<br />
* Renderer should deal with large meshes much faster, thanks to BVH optimizations.<br />
Recall that idTech4 was made for very low-poly models. When renderer frontend sees a "surface" in a model, it always treats this surface as an atomic piece, <br />
doing all computations for all of its vertices and triangles. <br />
This is very good for low-poly models, can heavily drag performance down with large meshes, as several recent missions noticed during beta.<br />
The BVH data structure breaks every surface into smaller chunks, allowing renderer to quickly cull away whole chunks. <br />
This makes a big difference in case of large meshes (e.g. terrain) lit by many small lights.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''AI''' ==<br />
<br />
Thanks to a certain "AI-heavy" mission, the game code has received major optimizations.<br />
It is most noticeable in low performance conditions, when game modelling takes a lot of CPU time. <br />
Previously the game could easily descend into the "spiral of death" with FPS falling below 5, now it is way harder due to better scheduling of AI thinking.<br />
There is a variety of other game code optimizations which make our lives slightly better.<br />
<br />
* AIs notice broken fracture entities<br />
<br />
See the mapping heading for a few other AI related changes<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Mapping''' ==<br />
<br />
* The engine now supports OBJ model format.<br />
This format is much more popular than ASE and LWO. The engine loading code is very lightweight: it will use your model exactly is as, and load it very quickly. <br />
The OBJ format is preferred for large meshes due for faster loading times. <br />
The only possible downside is somewhat larger download size compared to LWO, although not much and not always.<br />
<br />
* You no longer have to write frob-highlight stages in materials, since they are added implicitly.<br />
The problem with these stages was that were very easy to forget, which resulted in no highlight on frobable items. <br />
Also it increased cognitive load and scared mappers away.<br />
While writing frobstages is no longer necessary, the old stages work just fine. So mappers can still customize frob-highlighting if they really want to.<br />
<br />
* It is now legal to override a single decl of core game in your mission.<br />
Recall that "decl" means a material, a skin, an entityDef, a particle, etc.<br />
Note that overriding a whole file from core game always worked as expected, but overriding a single decl from a file did not work reliably before (despite the common belief that it should).<br />
<br />
* The major cleaning of shaders resulted in some changes in lighting model.<br />
The aim was to make TDM lighting closer to the standard Phong model, and make it more logical in general. <br />
The changes should rarely make a big difference, aside from probably stronger specular.<br />
<br />
* Added error-reporting to the GUI scripting engine.<br />
Implementing GUI scripts is very hard, error-prone, and confusing. Aside from surprising differences in Doom 3 GUI behavior compared to e.g. Javascript in DOM, <br />
a lot of confusion was caused by total lack of any error handling whatsoever!<br />
In the new version, all possible errors should result in easy-to-understand console warnings, so writing correct GUI is much easier.<br />
Also, we fixed a few features, and added a few new ones to the GUI engine.<br />
<br />
* dmap command received minor improvements.<br />
Yet another big rewrite happened for T-junctions fixing code, since it took tremendous amount of time on one mission. Also a few precision improvements were made.<br />
<br />
* Other small fixes and additions:<br />
<br />
added script functions getAnimRate / setAnimRate for tweaking animations<br />
added script function setObjectiveNotification for silent objective change<br />
added script function getCurInvItemCount for interaction with inventory<br />
added script variable "AI_ENEMY_TACTILE" to the base AI scriptobject, which is true whenever the AI is in tactile range of an enemy<br />
added spawnarg absence_alert_increase for loot items as a proper substitute for absence_alert, giving control over how much an AI gets alerted if that piece goes missing<br />
added spawnargs allow_idle_anims / allow_random_headturning for customization during a running mission, useful i.e. for cutscenes<br />
AIs notice broken fracture entities<br />
trigger_multiple now works on stationary AIs<br />
almost doubled tracemodel limits, raising the restrictive limits for making collision meshes for moveable items<br />
door movers can now call "used_action_script" whenever something like a key, lockpick or other item is used on them, if they have the spawnarg "call_used_action_script" "1".<br />
<br />
<br />
<br />
{{clear}}<br />
<br />
== '''Coding''' ==<br />
<br />
* Under the hood, we updated third-party libraries, and moved to Visual Studio 2022.<br />
* The "Debug With Inlines" configuration was split into "Debug Editable" (with hot-reload support) and "Debug Fast" (fastest debuggable).<br />
* Marking the final step in transition to tdm_installer, the old tdm_update program is finally removed, with TDM packaging code extracted to standalone program.<br />
* There were a ton of small bugfixes for issues like: bow stuck after load, wrong strafe-walk sound, crash when saving shortly after the death of an elemental, <br>issues with leaning onto doors, missing fracture sounds after loading a save, X-ray glitch in the first frame, toggling solidity/visibility, etc. <br />
<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Assets''' ==<br />
<br />
* Many new assets from capable creators in our community have been incorporated into the core assets. These include:<br />
<br />
Loot assets:<br />
Detailed coins and ingots with accompanying lore. Link<br />
Ancient loot items suitable for museums, collectors and ancient sites, first seen in the Volta series.<br />
A tiling treasure hoard texture for those with unimagineable wealth.<br />
6 detailed book skins including 3 that are lootable, a first for TDM. Link<br />
Security assets<br />
Highly detailed standing and wall safes - with or without an accompanying combination lock. Link<br />
The combination "safe lock" is now part of core assets and can be operated by either scrolling or frobbing. <br />
Mappers no longer need to track down this asset and include it with their FM files as a custom asset.<br />
Wall-mounted locks in the style of those commonly found in the original Thief games.<br />
Camgoyle sentry, a magical stone guardian based on the security camera shooting magical projectiles at the player, first seen in Written in Stone. <br />
The prefab also includes a power source pedestal. Link<br />
Fully useable audiograph for playing recorded sounds, first seen in the Accountant and Shadow of Northdale missions. <br />
A new full-featured scriptobject makes them easy to implement and control via spawnargs. Wiki<br />
Furniture assets<br />
Posh upholstered armchairs and sofas for the wealthiest nobles. Link<br />
A new high-detail grandfather clock with a working scriptobject and a mantle clock. Link<br />
A gothic-style cabinet. Link<br />
Office assets<br />
Including bundled stacks of paper, blueprints, a letter, crumpled paper, waste bins, an end table and an ornate table.<br />
Nautical assets<br />
Full-scale modular ship prefabs with interiors, allowing anyone to assemble a ship for a nautical mission in a matter of seconds. <br />
1 merchant galleon and 2 smaller sailing ships are available. Link Link Link<br />
A large galleon ship wreck in 2 pieces for those sailors who have met an unfortunate end.<br />
Decorative assets<br />
An impressive multi-tiered wall fountain, first seen in the mansion in Noble Affairs.<br />
A new pair of marble lion statues. Link<br />
A standing stone menir with carved symbols on it, ideal for pagan missions. Link<br />
Stone pedestal with purple cloth for presenting valuable items.<br />
Textures<br />
High-resolution cobblestone textures for detailing the streets of TDM. Link<br />
Starry wallpaper.<br />
Lamps<br />
A set of 6 bronze vintage lamps has been added for particulary posh establishments. Link<br />
Thief-style charge post streetlamp.<br />
A new open-top carriage, the barouche. Link<br />
Miscellaneous other models, including: wall planter, 7 small "foliage" herbs, 2 mine carts, 6 shop signs, equippable feather duster and 5 decor plates<br />
<br />
* We fixed all loading warnings on all existing assets.<br />
This became possible after creating an automatic map generator which forces the engine to load all assets from every group. <br />
All the references to missing files are fixed too, which means a variety of assets have become available:<br />
Old noblewoman skin, plain mage robes skin, moor helmet, electrical arcs, stone window decals (5178), yellow banner skin (5563), wine barrel (Link), <br />
grass particles (5689), lampion lights and more graffiti decals.<br />
<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Gameplay''' ==<br />
<br />
* Stealth scoring is greatly improved. The ignore player loop that was used to prevent AI from detecting players<br>at a distance too quickly has been restructured.<br>In addition, AI have been given a tactile response for players touching them in the dark. <br />
* The core mechanics of blackjacking enemies has received subtle, yet helpful improvements.<br />
* Now you can grab many close pieces of loot by holding down the frob button, instead of picking up each item individually.<br />
* There are several improvements to crouching, making it more responsive (thanks to @Daft Mugi).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''GUIs''' ==<br />
<br />
* Mission 1: A New Job now has subtitles ( boissiere and Dragofer )<br />
* Subtitles have been give a slightly larger render window to prevent cutoff characters<br />
* The in-game downloader now supports "sort by release date" ordering.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Sound''' ==<br />
<br />
* Mission 2: Tears of Saint Lucia now has EFX Reverb ( JackFarmer and datiswous )<br />
* Added "looping" keyword to looping clock ticking sounds.<br />
* Avoid sound amplification due to negative sound loss spawnarg (5913).<br />
* Fixed chandelier_gas4 model (6125) <br />
* Improved wooden chest prefab sounds (4206).<br />
* Hardwood materials now use wooden footstep sounds (4988)<br />
* Fixed lean-peeking sound not always stopping when player goes away from door (5899).<br />
* Fixed wrong sounds of func_fracture after save/load (5363).<br />
* Fixed wrong sound on strafe right (5554).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Translation''' ==<br />
<br />
* The Load \ Save and Downloads titles have been converted to a translatable format. Example translations for Spanish and Italian applied<br />
Note: The translated headlines will show up at the wrong size until you restart TDM after changing the language<br />
<br />
{{clear}}<br />
<br><br />
<br />
{{whatsnew|sort=211}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=What%27s_new_in_TDM_2.11&diff=30534What's new in TDM 2.112023-01-14T10:19:51Z<p>Stgatilov: Deleted (thread)</p>
<hr />
<div><!-- keywords whats new --><br />
{{notreleasedyet|2.11}}<br />
See the [http://bugs.thedarkmod.com/roadmap_page.php roadmap] on our bugtracker.<br />
<!-- See the [https://bugs.thedarkmod.com/changelog_page.php?version_id=96 changelog] on our bugtracker. --><br />
<!-- {{released|2.11|XXXX-XX-XX}} --><br />
<br />
<br><br><br />
'''<font size="5">The Dark Mod 2.11</font>'''<br />
<br><br><br />
<br />
<font size="3">TDM 2.11 is a major bugfix release. Longstanding problems with stealth scoring, load\save crashes and<br />
<br>visual glitches when changing loading or menu screens have gotten overdue repairs or improvement.<br />
<br><br />
<br>Dragofer deserves extra credit for fixing hundreds of assets and ensuring that the console is mostly free of useless warning messages<br />
<br>due to these asset bugs. Along the way, hundreds of asset submissions from both team members and forum members that the TDM team <br />
<br>hadn't had time to quality check and\or complete have been added to the project.<br />
<br><br />
<br>In line with the theme of fixing longstanding issues, Obsttorte developed a new Blackjack system that doesn't rely <br />
<br>on physically moving the player arm through a rotation arc and instead uses a trace to the destination target and adaptive animation.<br />
<br><br />
<br>stgatilov performed so many major performance improvements this release it could probably also be considered a "performance release".<br />
<br>Included in the long list of performance improvements is an improvement to the visual quality of the new Volumetric Lights so that players no<br />
<br>longer need to increase the number of samples to an absurd value to get a smooth visual gradient (thus killing performance).<br />
<br><br />
<br>Finally, JackFarmer and datiswous added EFX reverb and other fixes to Tears of Saint Lucia, while boissiere and Dragofer added subtitles to A New Job<br />
<br>Thus making the included intro missions feature complete with regard to audio and accessibility<br />
<br />
<br />
----<br />
<br><br><br />
<br />
== <br><br> <font size="4">'''Important CVARS'''</font> ==<br />
<br />
=== <font size="4">GENERIC</font> ===<br />
<br><br />
<br />
'''r_volumetric*''' --- for tweaking volumetric light algorithm (if defaults are not good enough).<br />
<br />
'''tdm_blackjack_indicate''' --- raise arm up to indicate when blackjacking can result in KO.<br />
<br />
'''pm_mantle_roll_mod''' --- allows to tune down motions during mantling.<br />
<br />
'''tdm_multiloot_min_interval, tdm_multiloot_max_interval''' --- configures timings for multiloot grabbing feature.<br />
<br />
'''teleportArea''' --- command to quickly find a visportal area with specified index.<br />
<br />
{{clear}}<br />
<br />
<br><br />
=== <font size="3">TROUBLESHOOTING</font> ===<br />
<br><br />
<br />
'''r_modelBvh*''' --- configures all BVH-related optimizations. r_modelBvhBuild is the "kill switch".<br />
<br />
'''r_softShadowsMipmaps''' --- enables the new bandwidth optimization for soft stencil shadows.<br />
<br />
'''com_useMinorTics''' --- enables AI interleaving optimization for low FPS.<br />
<br />
'''r_useParallelAddModels''' --- old optimization also known as "Frontend Acceleration", enabled by default in beta211-03.<br />
'''<br />
r_frobDefault*''' --- controls addition of implicit frob-highlight stages.<br />
<br />
'''decl_fix_mission_override, decl_skip_redefine_warning''' --- controls the rules for decl overrides.<br />
<br />
'''dmap_tjunctionsAlgorithm''' --- new dmap optimization in FixGlobalTJunctions function.<br />
<br />
'''dmap_disableCellSnappingTjunc, dmap_aasExpandBrushUseEdgesOnce''' --- enables dmap changes for better numeric stability.<br />
<br />
<br><br />
== '''Graphics''' ==<br />
<br />
'''2.11 is packed with performance optimizations!!!'''<br />
<br><br><br />
* Volumetric Lights are now blurred offscreen leading to a much smoother appearance with less performance impact<br />
* GLSL shaders have been reorganized to take better advantage of shared data and branching.<br />
* Ambient Lighting no longer multiplies some diffuse into the specular so the specular color chosen by the author is fully respected<br />
* The default Ambient World material now uses a cubemap to create the "light from sky" effect. Other ambient lights are direction neutral and better suited for faked Global Illumination<br />
* Soft Stencil Shadows use a tile-based optimization to prevent sampling from being run against every screen pixel<br />
* Shadow Maps now have better mipmap and LOD behavior. They no longer waste as much memory on distant objects<br />
* Renderer should deal with large meshes much faster, thanks to BVH optimizations.<br />
Recall that idTech4 was made for very low-poly models. When renderer frontend sees a "surface" in a model, it always treats this surface as an atomic piece, <br />
doing all computations for all of its vertices and triangles. <br />
This is very good for low-poly models, can heavily drag performance down with large meshes, as several recent missions noticed during beta.<br />
The BVH data structure breaks every surface into smaller chunks, allowing renderer to quickly cull away whole chunks. <br />
This makes a big difference in case of large meshes (e.g. terrain) lit by many small lights.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''AI''' ==<br />
<br />
Thanks to a certain "AI-heavy" mission, the game code has received major optimizations.<br />
It is most noticeable in low performance conditions, when game modelling takes a lot of CPU time. <br />
Previously the game could easily descend into the "spiral of death" with FPS falling below 5, now it is way harder due to better scheduling of AI thinking.<br />
There is a variety of other game code optimizations which make our lives slightly better.<br />
<br />
* AIs notice broken fracture entities<br />
<br />
See the mapping heading for a few other AI related changes<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Mapping''' ==<br />
<br />
* The engine now supports OBJ model format.<br />
This format is much more popular than ASE and LWO. The engine loading code is very lightweight: it will use your model exactly is as, and load it very quickly. <br />
The OBJ format is preferred for large meshes due for faster loading times. <br />
The only possible downside is somewhat larger download size compared to LWO, although not much and not always.<br />
<br />
* You no longer have to write frob-highlight stages in materials, since they are added implicitly.<br />
The problem with these stages was that were very easy to forget, which resulted in no highlight on frobable items. <br />
Also it increased cognitive load and scared mappers away.<br />
While writing frobstages is no longer necessary, the old stages work just fine. So mappers can still customize frob-highlighting if they really want to.<br />
<br />
* It is now legal to override a single decl of core game in your mission.<br />
Recall that "decl" means a material, a skin, an entityDef, a particle, etc.<br />
Note that overriding a whole file from core game always worked as expected, but overriding a single decl from a file did not work reliably before (despite the common belief that it should).<br />
<br />
* The major cleaning of shaders resulted in some changes in lighting model.<br />
The aim was to make TDM lighting closer to the standard Phong model, and make it more logical in general. <br />
The changes should rarely make a big difference, aside from probably stronger specular.<br />
<br />
* Added error-reporting to the GUI scripting engine.<br />
Implementing GUI scripts is very hard, error-prone, and confusing. Aside from surprising differences in Doom 3 GUI behavior compared to e.g. Javascript in DOM, <br />
a lot of confusion was caused by total lack of any error handling whatsoever!<br />
In the new version, all possible errors should result in easy-to-understand console warnings, so writing correct GUI is much easier.<br />
Also, we fixed a few features, and added a few new ones to the GUI engine.<br />
<br />
* dmap command received minor improvements.<br />
Yet another big rewrite happened for T-junctions fixing code, since it took tremendous amount of time on one mission. Also a few precision improvements were made.<br />
<br />
* Other small fixes and additions:<br />
<br />
added script functions getAnimRate / setAnimRate for tweaking animations<br />
added script function setObjectiveNotification for silent objective change<br />
added script function getCurInvItemCount for interaction with inventory<br />
added script variable "AI_ENEMY_TACTILE" to the base AI scriptobject, which is true whenever the AI is in tactile range of an enemy<br />
added spawnarg absence_alert_increase for loot items as a proper substitute for absence_alert, giving control over how much an AI gets alerted if that piece goes missing<br />
added spawnargs allow_idle_anims / allow_random_headturning for customization during a running mission, useful i.e. for cutscenes<br />
AIs notice broken fracture entities<br />
trigger_multiple now works on stationary AIs<br />
almost doubled tracemodel limits, raising the restrictive limits for making collision meshes for moveable items<br />
door movers can now call "used_action_script" whenever something like a key, lockpick or other item is used on them, if they have the spawnarg "call_used_action_script" "1".<br />
<br />
<br />
<br />
{{clear}}<br />
<br />
== '''Coding''' ==<br />
<br />
* Under the hood, we updated third-party libraries, and moved to Visual Studio 2022.<br />
* The "Debug With Inlines" configuration was split into "Debug Editable" (with hot-reload support) and "Debug Fast" (fastest debuggable).<br />
* Marking the final step in transition to tdm_installer, the old tdm_update program is finally removed, with TDM packaging code extracted to standalone program.<br />
* There were a ton of small bugfixes for issues like: bow stuck after load, wrong strafe-walk sound, crash when saving shortly after the death of an elemental, <br>issues with leaning onto doors, missing fracture sounds after loading a save, X-ray glitch in the first frame, toggling solidity/visibility, etc. <br />
<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Assets''' ==<br />
<br />
* Many new assets from capable creators in our community have been incorporated into the core assets. These include:<br />
<br />
Loot assets:<br />
Detailed coins and ingots with accompanying lore. Link<br />
Ancient loot items suitable for museums, collectors and ancient sites, first seen in the Volta series.<br />
A tiling treasure hoard texture for those with unimagineable wealth.<br />
6 detailed book skins including 3 that are lootable, a first for TDM. Link<br />
Security assets<br />
Highly detailed standing and wall safes - with or without an accompanying combination lock. Link<br />
The combination "safe lock" is now part of core assets and can be operated by either scrolling or frobbing. <br />
Mappers no longer need to track down this asset and include it with their FM files as a custom asset.<br />
Wall-mounted locks in the style of those commonly found in the original Thief games.<br />
Camgoyle sentry, a magical stone guardian based on the security camera shooting magical projectiles at the player, first seen in Written in Stone. <br />
The prefab also includes a power source pedestal. Link<br />
Fully useable audiograph for playing recorded sounds, first seen in the Accountant and Shadow of Northdale missions. <br />
A new full-featured scriptobject makes them easy to implement and control via spawnargs. Wiki<br />
Furniture assets<br />
Posh upholstered armchairs and sofas for the wealthiest nobles. Link<br />
A new high-detail grandfather clock with a working scriptobject and a mantle clock. Link<br />
A gothic-style cabinet. Link<br />
Office assets<br />
Including bundled stacks of paper, blueprints, a letter, crumpled paper, waste bins, an end table and an ornate table.<br />
Nautical assets<br />
Full-scale modular ship prefabs with interiors, allowing anyone to assemble a ship for a nautical mission in a matter of seconds. <br />
1 merchant galleon and 2 smaller sailing ships are available. Link Link Link<br />
A large galleon ship wreck in 2 pieces for those sailors who have met an unfortunate end.<br />
Decorative assets<br />
An impressive multi-tiered wall fountain, first seen in the mansion in Noble Affairs.<br />
A new pair of marble lion statues. Link<br />
A standing stone menir with carved symbols on it, ideal for pagan missions. Link<br />
Stone pedestal with purple cloth for presenting valuable items.<br />
Textures<br />
High-resolution cobblestone textures for detailing the streets of TDM. Link<br />
Starry wallpaper.<br />
Lamps<br />
A set of 6 bronze vintage lamps has been added for particulary posh establishments. Link<br />
Thief-style charge post streetlamp.<br />
A new open-top carriage, the barouche. Link<br />
Miscellaneous other models, including: wall planter, 7 small "foliage" herbs, 2 mine carts, 6 shop signs, equippable feather duster and 5 decor plates<br />
<br />
* We fixed all loading warnings on all existing assets.<br />
This became possible after creating an automatic map generator which forces the engine to load all assets from every group. <br />
All the references to missing files are fixed too, which means a variety of assets have become available:<br />
Old noblewoman skin, plain mage robes skin, moor helmet, electrical arcs, stone window decals (5178), yellow banner skin (5563), wine barrel (Link), <br />
grass particles (5689), lampion lights and more graffiti decals.<br />
<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Gameplay''' ==<br />
<br />
* Stealth scoring is greatly improved. The ignore player loop that was used to prevent AI from detecting players<br>at a distance too quickly has been restructured.<br>In addition, AI have been given a tactile response for players touching them in the dark. <br />
* The core mechanics of blackjacking enemies has received subtle, yet helpful improvements (thread).<br />
* Now you can grab many close pieces of loot by holding down the frob button, instead of picking up each item individually.<br />
* There are several improvements to crouching, making it more responsive (thanks to @Daft Mugi).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''GUIs''' ==<br />
<br />
* Mission 1: A New Job now has subtitles ( boissiere and Dragofer )<br />
* Subtitles have been give a slightly larger render window to prevent cutoff characters<br />
* The in-game downloader now supports "sort by release date" ordering.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Sound''' ==<br />
<br />
* Mission 2: Tears of Saint Lucia now has EFX Reverb ( JackFarmer and datiswous )<br />
* Added "looping" keyword to looping clock ticking sounds.<br />
* Avoid sound amplification due to negative sound loss spawnarg (5913).<br />
* Fixed chandelier_gas4 model (6125) <br />
* Improved wooden chest prefab sounds (4206).<br />
* Hardwood materials now use wooden footstep sounds (4988)<br />
* Fixed lean-peeking sound not always stopping when player goes away from door (5899).<br />
* Fixed wrong sounds of func_fracture after save/load (5363).<br />
* Fixed wrong sound on strafe right (5554).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Translation''' ==<br />
<br />
* The Load \ Save and Downloads titles have been converted to a translatable format. Example translations for Spanish and Italian applied<br />
Note: The translated headlines will show up at the wrong size until you restart TDM after changing the language<br />
<br />
{{clear}}<br />
<br><br />
<br />
{{whatsnew|sort=211}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=What%27s_new_in_TDM_2.11&diff=30533What's new in TDM 2.112023-01-14T10:16:28Z<p>Stgatilov: Tile-based optimization fix + removed (thread).</p>
<hr />
<div><!-- keywords whats new --><br />
{{notreleasedyet|2.11}}<br />
See the [http://bugs.thedarkmod.com/roadmap_page.php roadmap] on our bugtracker.<br />
<!-- See the [https://bugs.thedarkmod.com/changelog_page.php?version_id=96 changelog] on our bugtracker. --><br />
<!-- {{released|2.11|XXXX-XX-XX}} --><br />
<br />
<br><br><br />
'''<font size="5">The Dark Mod 2.11</font>'''<br />
<br><br><br />
<br />
<font size="3">TDM 2.11 is a major bugfix release. Longstanding problems with stealth scoring, load\save crashes and<br />
<br>visual glitches when changing loading or menu screens have gotten overdue repairs or improvement.<br />
<br><br />
<br>Dragofer deserves extra credit for fixing hundreds of assets and ensuring that the console is mostly free of useless warning messages<br />
<br>due to these asset bugs. Along the way, hundreds of asset submissions from both team members and forum members that the TDM team <br />
<br>hadn't had time to quality check and\or complete have been added to the project.<br />
<br><br />
<br>In line with the theme of fixing longstanding issues, Obsttorte developed a new Blackjack system that doesn't rely <br />
<br>on physically moving the player arm through a rotation arc and instead uses a trace to the destination target and adaptive animation.<br />
<br><br />
<br>stgatilov performed so many major performance improvements this release it could probably also be considered a "performance release".<br />
<br>Included in the long list of performance improvements is an improvement to the visual quality of the new Volumetric Lights so that players no<br />
<br>longer need to increase the number of samples to an absurd value to get a smooth visual gradient (thus killing performance).<br />
<br><br />
<br>Finally, JackFarmer and datiswous added EFX reverb and other fixes to Tears of Saint Lucia, while boissiere and Dragofer added subtitles to A New Job<br />
<br>Thus making the included intro missions feature complete with regard to audio and accessibility<br />
<br />
<br />
----<br />
<br><br><br />
<br />
== <br><br> <font size="4">'''Important CVARS'''</font> ==<br />
<br />
=== <font size="4">GENERIC</font> ===<br />
<br><br />
<br />
'''r_volumetric*''' --- for tweaking volumetric light algorithm (if defaults are not good enough).<br />
<br />
'''tdm_blackjack_indicate''' --- raise arm up to indicate when blackjacking can result in KO.<br />
<br />
'''pm_mantle_roll_mod''' --- allows to tune down motions during mantling.<br />
<br />
'''tdm_multiloot_min_interval, tdm_multiloot_max_interval''' --- configures timings for multiloot grabbing feature.<br />
<br />
'''teleportArea''' --- command to quickly find a visportal area with specified index.<br />
<br />
{{clear}}<br />
<br />
<br><br />
=== <font size="3">TROUBLESHOOTING</font> ===<br />
<br><br />
<br />
'''r_modelBvh*''' --- configures all BVH-related optimizations. r_modelBvhBuild is the "kill switch".<br />
<br />
'''r_softShadowsMipmaps''' --- enables the new bandwidth optimization for soft stencil shadows.<br />
<br />
'''com_useMinorTics''' --- enables AI interleaving optimization for low FPS.<br />
<br />
'''r_useParallelAddModels''' --- old optimization also known as "Frontend Acceleration", enabled by default in beta211-03.<br />
'''<br />
r_frobDefault*''' --- controls addition of implicit frob-highlight stages.<br />
<br />
'''decl_fix_mission_override, decl_skip_redefine_warning''' --- controls the rules for decl overrides.<br />
<br />
'''dmap_tjunctionsAlgorithm''' --- new dmap optimization in FixGlobalTJunctions function.<br />
<br />
'''dmap_disableCellSnappingTjunc, dmap_aasExpandBrushUseEdgesOnce''' --- enables dmap changes for better numeric stability.<br />
<br />
<br><br />
== '''Graphics''' ==<br />
<br />
'''2.11 is packed with performance optimizations!!!'''<br />
<br><br><br />
* Volumetric Lights are now blurred offscreen leading to a much smoother appearance with less performance impact<br />
* GLSL shaders have been reorganized to take better advantage of shared data and branching.<br />
* Ambient Lighting no longer multiplies some diffuse into the specular so the specular color chosen by the author is fully respected<br />
* The default Ambient World material now uses a cubemap to create the "light from sky" effect. Other ambient lights are direction neutral and better suited for faked Global Illumination<br />
* Soft Stencil Shadows use a tile-based optimization to prevent sampling from being run against every screen pixel<br />
* Shadow Maps now have better mipmap and LOD behavior. They no longer waste as much memory on distant objects<br />
* Renderer should deal with large meshes much faster, thanks to BVH optimizations.<br />
Recall that idTech4 was made for very low-poly models. When renderer frontend sees a "surface" in a model, it always treats this surface as an atomic piece, <br />
doing all computations for all of its vertices and triangles. <br />
This is very good for low-poly models, can heavily drag performance down with large meshes, as several recent missions noticed during beta.<br />
The BVH data structure breaks every surface into smaller chunks, allowing renderer to quickly cull away whole chunks. <br />
This makes a big difference in case of large meshes (e.g. terrain) lit by many small lights.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''AI''' ==<br />
<br />
Thanks to a certain "AI-heavy" mission, the game code has received major optimizations.<br />
It is most noticeable in low performance conditions, when game modelling takes a lot of CPU time. <br />
Previously the game could easily descend into the "spiral of death" with FPS falling below 5, now it is way harder due to better scheduling of AI thinking.<br />
There is a variety of other game code optimizations which make our lives slightly better.<br />
<br />
* AIs notice broken fracture entities<br />
<br />
See the mapping heading for a few other AI related changes<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Mapping''' ==<br />
<br />
* The engine now supports OBJ model format.<br />
This format is much more popular than ASE and LWO. The engine loading code is very lightweight: it will use your model exactly is as, and load it very quickly. <br />
The OBJ format is preferred for large meshes due for faster loading times. <br />
The only possible downside is somewhat larger download size compared to LWO, although not much and not always (thread).<br />
<br />
* You no longer have to write frob-highlight stages in materials, since they are added implicitly.<br />
The problem with these stages was that were very easy to forget, which resulted in no highlight on frobable items. <br />
Also it increased cognitive load and scared mappers away.<br />
While writing frobstages is no longer necessary, the old stages work just fine. So mappers can still customize frob-highlighting if they really want to (thread).<br />
<br />
* It is now legal to override a single decl of core game in your mission.<br />
Recall that "decl" means a material, a skin, an entityDef, a particle, etc.<br />
Note that overriding a whole file from core game always worked as expected, but overriding a single decl from a file did not work reliably before (despite the common belief that it should).<br />
<br />
* The major cleaning of shaders resulted in some changes in lighting model.<br />
The aim was to make TDM lighting closer to the standard Phong model, and make it more logical in general. <br />
The changes should rarely make a big difference, aside from probably stronger specular (thread).<br />
<br />
* Added error-reporting to the GUI scripting engine.<br />
Implementing GUI scripts is very hard, error-prone, and confusing. Aside from surprising differences in Doom 3 GUI behavior compared to e.g. Javascript in DOM, <br />
a lot of confusion was caused by total lack of any error handling whatsoever!<br />
In the new version, all possible errors should result in easy-to-understand console warnings, so writing correct GUI is much easier.<br />
Also, we fixed a few features, and added a few new ones to the GUI engine (thread).<br />
<br />
* dmap command received minor improvements.<br />
Yet another big rewrite happened for T-junctions fixing code, since it took tremendous amount of time on one mission. Also a few precision improvements were made.<br />
<br />
* Other small fixes and additions:<br />
<br />
added script functions getAnimRate / setAnimRate for tweaking animations<br />
added script function setObjectiveNotification for silent objective change<br />
added script function getCurInvItemCount for interaction with inventory<br />
added script variable "AI_ENEMY_TACTILE" to the base AI scriptobject, which is true whenever the AI is in tactile range of an enemy<br />
added spawnarg absence_alert_increase for loot items as a proper substitute for absence_alert, giving control over how much an AI gets alerted if that piece goes missing<br />
added spawnargs allow_idle_anims / allow_random_headturning for customization during a running mission, useful i.e. for cutscenes<br />
AIs notice broken fracture entities<br />
trigger_multiple now works on stationary AIs<br />
almost doubled tracemodel limits, raising the restrictive limits for making collision meshes for moveable items<br />
door movers can now call "used_action_script" whenever something like a key, lockpick or other item is used on them, if they have the spawnarg "call_used_action_script" "1".<br />
<br />
<br />
<br />
{{clear}}<br />
<br />
== '''Coding''' ==<br />
<br />
* Under the hood, we updated third-party libraries, and moved to Visual Studio 2022.<br />
* The "Debug With Inlines" configuration was split into "Debug Editable" (with hot-reload support) and "Debug Fast" (fastest debuggable).<br />
* Marking the final step in transition to tdm_installer, the old tdm_update program is finally removed, with TDM packaging code extracted to standalone program.<br />
* There were a ton of small bugfixes for issues like: bow stuck after load, wrong strafe-walk sound, crash when saving shortly after the death of an elemental, <br>issues with leaning onto doors, missing fracture sounds after loading a save, X-ray glitch in the first frame, toggling solidity/visibility, etc. <br />
<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Assets''' ==<br />
<br />
* Many new assets from capable creators in our community have been incorporated into the core assets. These include:<br />
<br />
Loot assets:<br />
Detailed coins and ingots with accompanying lore. Link<br />
Ancient loot items suitable for museums, collectors and ancient sites, first seen in the Volta series.<br />
A tiling treasure hoard texture for those with unimagineable wealth.<br />
6 detailed book skins including 3 that are lootable, a first for TDM. Link<br />
Security assets<br />
Highly detailed standing and wall safes - with or without an accompanying combination lock. Link<br />
The combination "safe lock" is now part of core assets and can be operated by either scrolling or frobbing. <br />
Mappers no longer need to track down this asset and include it with their FM files as a custom asset.<br />
Wall-mounted locks in the style of those commonly found in the original Thief games.<br />
Camgoyle sentry, a magical stone guardian based on the security camera shooting magical projectiles at the player, first seen in Written in Stone. <br />
The prefab also includes a power source pedestal. Link<br />
Fully useable audiograph for playing recorded sounds, first seen in the Accountant and Shadow of Northdale missions. <br />
A new full-featured scriptobject makes them easy to implement and control via spawnargs. Wiki<br />
Furniture assets<br />
Posh upholstered armchairs and sofas for the wealthiest nobles. Link<br />
A new high-detail grandfather clock with a working scriptobject and a mantle clock. Link<br />
A gothic-style cabinet. Link<br />
Office assets<br />
Including bundled stacks of paper, blueprints, a letter, crumpled paper, waste bins, an end table and an ornate table.<br />
Nautical assets<br />
Full-scale modular ship prefabs with interiors, allowing anyone to assemble a ship for a nautical mission in a matter of seconds. <br />
1 merchant galleon and 2 smaller sailing ships are available. Link Link Link<br />
A large galleon ship wreck in 2 pieces for those sailors who have met an unfortunate end.<br />
Decorative assets<br />
An impressive multi-tiered wall fountain, first seen in the mansion in Noble Affairs.<br />
A new pair of marble lion statues. Link<br />
A standing stone menir with carved symbols on it, ideal for pagan missions. Link<br />
Stone pedestal with purple cloth for presenting valuable items.<br />
Textures<br />
High-resolution cobblestone textures for detailing the streets of TDM. Link<br />
Starry wallpaper.<br />
Lamps<br />
A set of 6 bronze vintage lamps has been added for particulary posh establishments. Link<br />
Thief-style charge post streetlamp.<br />
A new open-top carriage, the barouche. Link<br />
Miscellaneous other models, including: wall planter, 7 small "foliage" herbs, 2 mine carts, 6 shop signs, equippable feather duster and 5 decor plates<br />
<br />
* We fixed all loading warnings on all existing assets.<br />
This became possible after creating an automatic map generator which forces the engine to load all assets from every group. <br />
All the references to missing files are fixed too, which means a variety of assets have become available:<br />
Old noblewoman skin, plain mage robes skin, moor helmet, electrical arcs, stone window decals (5178), yellow banner skin (5563), wine barrel (Link), <br />
grass particles (5689), lampion lights and more graffiti decals.<br />
<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Gameplay''' ==<br />
<br />
* Stealth scoring is greatly improved. The ignore player loop that was used to prevent AI from detecting players<br>at a distance too quickly has been restructured.<br>In addition, AI have been given a tactile response for players touching them in the dark. <br />
* The core mechanics of blackjacking enemies has received subtle, yet helpful improvements (thread).<br />
* Now you can grab many close pieces of loot by holding down the frob button, instead of picking up each item individually.<br />
* There are several improvements to crouching, making it more responsive (thanks to @Daft Mugi).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''GUIs''' ==<br />
<br />
* Mission 1: A New Job now has subtitles ( boissiere and Dragofer )<br />
* Subtitles have been give a slightly larger render window to prevent cutoff characters<br />
* The in-game downloader now supports "sort by release date" ordering.<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Sound''' ==<br />
<br />
* Mission 2: Tears of Saint Lucia now has EFX Reverb ( JackFarmer and datiswous )<br />
* Added "looping" keyword to looping clock ticking sounds.<br />
* Avoid sound amplification due to negative sound loss spawnarg (5913).<br />
* Fixed chandelier_gas4 model (6125) <br />
* Improved wooden chest prefab sounds (4206).<br />
* Hardwood materials now use wooden footstep sounds (4988)<br />
* Fixed lean-peeking sound not always stopping when player goes away from door (5899).<br />
* Fixed wrong sounds of func_fracture after save/load (5363).<br />
* Fixed wrong sound on strafe right (5554).<br />
<br />
{{clear}}<br />
<br><br />
<br />
== '''Translation''' ==<br />
<br />
* The Load \ Save and Downloads titles have been converted to a translatable format. Example translations for Spanish and Italian applied<br />
Note: The translated headlines will show up at the wrong size until you restart TDM after changing the language<br />
<br />
{{clear}}<br />
<br><br />
<br />
{{whatsnew|sort=211}}</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference&diff=30425TDM Script Reference2022-12-01T20:34:41Z<p>Stgatilov: Updated script reference for upcoming 2.11 beta.</p>
<hr />
<div>This page has been generated automatically by the tdm_gen_script_event_doc console command.<br />
<br />
Generated by The Dark Mod 2.11, code revision 10189, last update: 2022-12-01 21:36<br />
<br />
{{tdm-scripting-reference-intro}}<br />
<div class="toclimit-4"><br />
__TOC__<br />
</div><br />
= TDM Script Event Reference =<br />
<br />
== All Events ==<br />
=== Alphabetic List ===<br />
==== scriptEvent void '''accelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover accelerates.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''accelTime'''(float time); ====<br />
<br />
:Sets the acceleration time. Set this acceleration time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''accelTo'''(float speed, float time); ====<br />
<br />
:Initiates an acceleration to the given speed over the given time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''acos'''(float cosine); ====<br />
<br />
:Returns the angle in degrees with the given cosine.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
:Spawnclasses responding to this event: ''CTarget_AddObjectives'', ''CTarget_CallScriptFunction'', ''CTarget_ChangeEntityRelation'', ''CTarget_ChangeLockState'', ''CTarget_ChangeTarget'', ''CTarget_InterMissionTrigger'', ''CTarget_ItemRemove'', ''CTarget_SetEntityRelation'', ''CTarget_SetFrobable'', ''CTarget_SetObjectiveComponentState'', ''CTarget_SetObjectiveState'', ''CTarget_SetObjectiveVisibility'', ''CTarget_SetRelations'', ''CTarget_SetTeam'', ''CTarget_StartConversation'', ''idAFEntity_Generic'', ''idAFEntity_WithAttachedHead'', ''idAI'', ''idActivator'', ''idAnimated'', ''idBeam'', ''idBrittleFracture'', ''idCameraAnim'', ''idCameraView'', ''idCombatNode'', ''idDamagable'', ''idEarthQuake'', ''idEntityFx'', ''idExplodable'', ''idForceField'', ''idFuncAASObstacle'', ''idFuncAASPortal'', ''idFuncPortal'', ''idFuncSmoke'', ''idItem'', ''idLight'', ''idListener'', ''idMoveable'', ''idMover'', ''idMover_Binary'', ''idPhantomObjects'', ''idPlayerStart'', ''idPortalSky'', ''idRiser'', ''idRotater'', ''idShaking'', ''idSound'', ''idStaticEntity'', ''idTarget_CallObjectFunction'', ''idTarget_Damage'', ''idTarget_EnableLevelWeapons'', ''idTarget_EndLevel'', ''idTarget_FadeEntity'', ''idTarget_FadeSoundClass'', ''idTarget_Give'', ''idTarget_LightFadeIn'', ''idTarget_LightFadeOut'', ''idTarget_PostScriptEvent'', ''idTarget_Remove'', ''idTarget_RemoveWeapons'', ''idTarget_SessionCommand'', ''idTarget_SetFov'', ''idTarget_SetGlobalShaderTime'', ''idTarget_SetInfluence'', ''idTarget_SetKeyVal'', ''idTarget_SetModel'', ''idTarget_SetShaderParm'', ''idTarget_SetShaderTime'', ''idTarget_Show'', ''idTarget_WaitForButton'', ''idTrigger_Count'', ''idTrigger_EntityName'', ''idTrigger_Fade'', ''idTrigger_Hurt'', ''idTrigger_Multi'', ''idTrigger_Timer'', ''idTrigger_Touch'', ''idVacuumSeparatorEntity''<br />
==== scriptEvent void '''activateContacts'''(); ====<br />
<br />
:Activate objects sitting on this object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''activateTargets'''(entity activator); ====<br />
<br />
:Causes this entity to activate all it's targets. Similar to how a trigger activates entities.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addDescendant'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''addFrobPeer'''(entity peer); ====<br />
<br />
:Adds the passed entity as frob peer.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addInvItem'''(entity inv_item); ====<br />
<br />
:Adds the given item to the inventory. Depending on the type the passed entity will be removed from the game (as for loot items) or hidden.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addItemToInv'''(entity target); ====<br />
<br />
:Adds the entity to the given entity's inventory. Depending on the type the entity will be removed from the game (as for loot items) or hidden. Example: $book->addItemToInv($player1);<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addTarget'''(entity target); ====<br />
<br />
:Add a target to this entity.<br />
::''target'': the entity to add as target<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addToClip'''(float amount); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''alert'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''alertAI'''(string type, float amount, entity actor); ====<br />
<br />
:internal<br />
::''type'': alert type<br />
::''amount'': alert amount<br />
::''actor'': actor causing alert<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowDamage'''(); ====<br />
<br />
:The AI can take damage again.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowDrop'''(float allow); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''allowHiddenMovement'''(float enable); ====<br />
<br />
:Normally, when hidden, monsters do not run physics. This enables physics when hidden.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowMovement'''(float allow); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''ammoAvailable'''(); ====<br />
<br />
:Number of shots left in inventory<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''ammoInClip'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent vector '''angToForward'''(vector angles); ====<br />
<br />
:Returns a forward vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''angToRight'''(vector angles); ====<br />
<br />
:Returns a right vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''angToUp'''(vector angles); ====<br />
<br />
:Returns an up vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''animDistance'''(float channel, string animName); ====<br />
<br />
:Returns the distance that the anim travels. If the entity has multiple anims with animName, the distance may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animDistance.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''animLength'''(float channel, string animName); ====<br />
<br />
:Returns the length of the anim in seconds. If the entity has multiple anims with animName, length may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animLength.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''animState'''(float channel, string stateFunction, float blendFrame); ====<br />
<br />
:Sets a new animation state script function for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''animTurn'''(float angle); ====<br />
<br />
:Enable/disable animation controlled turning.<br />
::''angle'': Pass in the maximum # of degrees the animation turns. Use an amount of 0 to disable.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''applyImpulse'''(entity source, float bodyid, vector point, vector impulse); ====<br />
<br />
:Applies an impulse to the entity. Example: entity.applyImpulse($player1, 0, entity.getOrigin(), '0 0 2');<br />
::''source'': Pass $null_entity or the entity that applies the impulse<br />
::''bodyid'': For articulated figures, ID of the body, 0 for the first (main) body. Otherwise use 0.<br />
::''point'': Point on the body where the impulse is applied to<br />
::''impulse'': Vector of the impulse<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''asin'''(float sine); ====<br />
<br />
:Returns the angle in degrees with the given sine.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''assert'''(float condition); ====<br />
<br />
:Breaks if the condition is zero. (Only works in debug builds.)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''attach'''(entity ent, string attName); ====<br />
<br />
:Attach an entity to the AI. Entity spawnArgs checked for attachments are: - "origin", "angles", and "joint". These must be set prior to calling attach.<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''attachToPos'''(entity ent, string position, string attName); ====<br />
<br />
:Attach an entity to the AI, using a named attachment position<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''attackBegin'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''attackEnd'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''attackMelee'''(string damageDef); ====<br />
<br />
:Returns true if the attack hit<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''attackMissile'''(string jointName); ====<br />
<br />
:returns projectile fired<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''bark'''(string sound); ====<br />
<br />
:Let the AI bark a certain sound.<br />
::''sound'': sound name, e.g. 'snd_warn_response'<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idMoveable''<br />
==== scriptEvent float '''becomeRagdoll'''(); ====<br />
<br />
:enables the ragdoll if the entity has one<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''becomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''bind'''(entity master); ====<br />
<br />
:Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindPosition'''(entity master); ====<br />
<br />
:Fixes this entity's position (but not orientation) relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindToBody'''(entity master, float bodyID, float orientated); ====<br />
<br />
:Bind to AF body<br />
::''master'': entity to bind to<br />
::''bodyID'': AF body ID to bind to<br />
::''orientated'': binds the orientation as well as position, if set to 1<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindToJoint'''(entity master, string boneName, float rotateWithMaster); ====<br />
<br />
:Fixes this entity's position and orientation relative to a bone on another entity, such that when the master's bone moves, so does this entity.<br />
::''master'': the entity to bind to<br />
::''boneName'': the bone name<br />
::''rotateWithMaster'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bob'''(float speed, float phase, vector distance); ====<br />
<br />
:Initiates a translation back and forth along the given vector with the given speed and phase.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''burn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''callFunction'''(string functionName); ====<br />
<br />
:Calls a function on an entity's script object. See also callGlobalFunction().<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''callGlobalFunction'''(string functionName, entity other); ====<br />
<br />
:calls a global function and passes the other entity along as the first argument calls the function in a new thread, so it continues executing in the current thread right away (unlike entity.callFunction( "blah"))<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''callGui'''(float handle, string namedEvent); ====<br />
<br />
:Calls a named event in a GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canBecomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canBeUsedBy'''(entity ent); ====<br />
<br />
:Returns true if the entity can be used by the argument entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canHitEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canHitEnemyFromAnim'''(string anim); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canHitEnemyFromJoint'''(string jointname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canPlant'''(vector traceStart, vector traceEnd, entity ignore, entity vine); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''canReachEnemy'''(); ====<br />
<br />
:Returns true if character can walk to enemy's position. For walking monsters, enemy should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canReachEntity'''(entity ent); ====<br />
<br />
:Returns true if character can walk to entity's position. For walking monsters, entity should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canReachPosition'''(vector pos); ====<br />
<br />
:Returns true if character can walk to specified position. For walking monsters, position should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idSecurityCamera''<br />
==== scriptEvent float '''canSeeEntity'''(entity target, float useLighting); ====<br />
<br />
:This is a general version of idAI::canSee, that can be used by all entities. It doesn't regard FOV, it just performs a trace to check whether the target is occluded by world geometry. Is probably useful for stim/response as well Pass useLighting = true to take the lighting of the target entity into account. Use "isEntityHidden" as a script event with a threshold. The constant threshold value for useLighting is defined within the SDK in game/entity.h.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canSeeExt'''(entity ent, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSee that can optionally choose to use field of vision and lighting calculations.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If b_useLighting is 0 the entity will be visible in complete darkness. If it is 1, the entity will only be visible if there is light shining on it, but the slightest light is enought. Use "isEntityHidden" as a script event with a threshold instead.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canSeePositionExt'''(vector position, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSeeExt that tests a location rather than an entity. Note that any actor at the position may make it not seeable from a distance.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If 0 the entity will be visible in complete darkness<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canWater'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''ceil'''(float x); ====<br />
<br />
:Returns the smallest integer that is greater than or equal to the given value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''changeEntityRelation'''(entity ent, float relationChange); ====<br />
<br />
:This changes the current relation to an entity by adding the new amount.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvIcon'''(string name, string category, string icon); ====<br />
<br />
:Sets the inventory icon of the given item in the given category to <icon>.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvItemCount'''(string name, string category, float amount); ====<br />
<br />
:Decreases the inventory item stack count by amount. The item is addressed using the name and category of the item. These are usually defined on the inventory item entity ("inv_name", "inv_category") Amount can be both negative and positive.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvLightgemModifier'''(string name, string category, float amount); ====<br />
<br />
:Sets the lightgem modifier value of the given item. Valid arguments are between 0 and 32 (which is the maximum lightgem value).<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''changeLootAmount'''(float type, float amount); ====<br />
<br />
:Changes the loot amount of the given Type (e.g. GOODS) by <amount>. The mission statisic for loot found gets changed too. The new value of the changed type is returned (e.g. the new GOODS value if this has been changed). Note: The LOOT_TOTAL type can't be changed and 0 is returned.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY<br />
::''amount'': can be negative<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeWeaponName'''(string weaponName, string displayName); ====<br />
<br />
:Changes the display name of the given weapon item to something different. Pass an empty string to reset the display name to the definition as found in the weaponDef.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''changeWeaponProjectile'''(string weaponName, string projectileDefName); ====<br />
<br />
:Changes the projectile entityDef name of the given weapon (e.g. "broadhead") to the specified entityDef (e.g. "atdm:projectile_broadhead").<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''chargeAttack'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''checkAAS'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''checkAbsence'''(); ====<br />
<br />
:description missing<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''checkAnim'''(float channel, string animName); ====<br />
<br />
:Ensures that the animation exists and causes an error if it doesn't.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''chooseAnim'''(float channel, string animName); ====<br />
<br />
:Chooses a random anim and returns the name. Useful for doing move tests on anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''clearActiveInventoryMap'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearActiveInventoryMapEnt'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearAllJoints'''(); ====<br />
<br />
:Removes any custom transforms on all joints.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''clearBurn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearController'''(); ====<br />
<br />
:Need separate clearController because scripting doesn't like passing in $null_entity? (greebo: one could remove this function and set the argument type of setController to 'E'.<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent void '''clearEnemy'''(); ====<br />
<br />
:Clears the enemy entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearFlyOffset'''(); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at to the value set in the def file.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearJoint'''(float jointnum); ====<br />
<br />
:Removes any custom transforms on the specified joint.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''clearMouseDeadTime'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearPersistantArgs'''(); ====<br />
<br />
:Clears data that persists between maps.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''clearSignal'''(float signalNum); ====<br />
<br />
:Disables the callback function on the specified signal.<br />
::''signalNum'': signal number<br />
<br />
:Spawnclasses responding to this event: <br />
==== scriptEvent void '''clearSignalThread'''(float signalNum, entity ent); ====<br />
<br />
:Clears the script callback function set for when the given signal is raised on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''clearWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''clipSize'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''Close'''(); ====<br />
<br />
:Closes the frobmover, regardless of its previous state. Mover must be open, otherwise nothing happens.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover'', ''idMover_Binary''<br />
==== scriptEvent entity '''closestEnemyToPoint'''(vector point); ====<br />
<br />
:Returns the enemy closest to the given location.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''closestReachableEnemy'''(); ====<br />
<br />
:Used for determining tactile alert targets<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''closestReachableEnemyOfEntity'''(entity team_mate); ====<br />
<br />
:Finds another character's closest reachable enemy<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''copyBind'''(entity other); ====<br />
<br />
:copy bind information of other to this entity (i.e., bind this entity to the same entity that other is bound to)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''copySpawnArgs'''(entity ent); ====<br />
<br />
:copies the spawn args from an entity<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''cos'''(float degrees); ====<br />
<br />
:Returns the cosine of the given angle in degrees.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''createMissile'''(string jointname); ====<br />
<br />
:returns projectile created<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''createMissileFromDef'''(string defName, string jointName); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''createOverlay'''(string guiFile, float layer); ====<br />
<br />
:Creates a GUI overlay. (must be used on the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''createProjectile'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''CreateTimer'''(float stimId, float hour, float minutes, float seconds, float milliseconds); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''CrossProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the cross product of the two vectors.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''cullAll'''(); ====<br />
<br />
:Cull (remove from world) all entities.<br />
<br />
:Spawnclasses responding to this event: ''Seed''<br />
==== scriptEvent void '''customDeath'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''damage'''(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale); ====<br />
<br />
:Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).<br />
::''inflictor'': the entity causing the damage (maybe a projectile)<br />
::''attacker'': the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)<br />
::''dir'': the direction the attack is coming from.<br />
::''damageDefName'': the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")<br />
::''damageScale'': the scale of the damage (pass 1.0 as default, this should be ok).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''dampenSound'''(float dampen); ====<br />
<br />
:Toggle whether the shattering sound is dampened on the window, e.g., when covered by moss.<br />
::''dampen'': 1 = dampened, 0 = not dampened<br />
<br />
:Spawnclasses responding to this event: ''idBrittleFracture''<br />
==== scriptEvent void '''deathMenu'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''debugArrow'''(vector color, vector start, vector end, float size, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugBounds'''(vector color, vector mins, vector maxs, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugCircle'''(vector color, vector origin, vector dir, float radius, float numSteps, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugLine'''(vector color, vector start, vector end, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''decelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover decelerates.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''decelTime'''(float time); ====<br />
<br />
:Sets the deceleration time. Set this deceleration time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''decelTo'''(float speed, float time); ====<br />
<br />
:Initiates a deceleration to the given speed over the given time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''destroyOverlay'''(float handle); ====<br />
<br />
:Destroys a GUI overlay. (must be used on the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''directDamage'''(entity damageTarget, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
:Spawnclasses responding to this event: ''Seed'', ''idMover_Binary'', ''idTrigger''<br />
==== scriptEvent void '''disableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disableAnimchannel'''(float channel); ====<br />
<br />
:Used to disable a certain animchannel (for example if the ai is dead)<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableClip'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disableEyeFocus'''(); ====<br />
<br />
:Disables eye focus.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableGravity'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''DisableLegIK'''(float num); ====<br />
<br />
:disables leg IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disablePain'''(); ====<br />
<br />
:Disables pain animations.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableSplineAngles'''(); ====<br />
<br />
:Disables aligning the mover with the spline direction.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''DisableWalkIK'''(); ====<br />
<br />
:disables walk IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableWeapon'''(); ====<br />
<br />
:Lowers and disables the player weapon.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''distanceTo'''(entity other); ====<br />
<br />
:Returns the distance of this entity to another entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''distanceToPoint'''(vector point); ====<br />
<br />
:Returns the distance of this entity to a point.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''DotProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the dot product of the two vectors.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''drawText'''(string text, vector origin, float scale, vector color, float align, float lifetime); ====<br />
<br />
:text drawing for debugging. lifetime of 0 == 1 frame.<br />
::''align'': 0 = left, 1 = center, 2 = right<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''dropAttachment'''(string attName); ====<br />
<br />
:Drop the attachment for the given attachment name.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''dropAttachmentInd'''(float index); ====<br />
<br />
:Drop the attachment for the given index.<br />
::''index'': starts at 0<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''dropTorch'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''ejectBrass'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''emitParticle'''(string particle, float startTime, float diversity, vector origin, vector angle); ====<br />
<br />
:Start a particle effect in the world without using an entity emitter. Will emit one quad per particle stage when first called with sys.getTime() as the start time. Designed to be called once per frame with the same startTime each call to achieve a normal particle effect, or on demand with sys.getTime() as the startTime for finer grained control, 1 quad at a time. Returns True (1) if there are more particles to be emitted from the stage, False (0) if the stage has released all its quads.<br />
::''particle'': String: name of particle effect.<br />
::''startTime'': Game seconds since map start: use sys.getTime() for the first call unless you want to back-date the particle so that it starts part way through its cycle.<br />
::''diversity'': Randomizer value between 0 and 1. All particles with the same diversity will have the same path and rotation. Use sys.random(1) for a random path.<br />
::''origin'': Origin of the particle effect.<br />
::''angle'': Axis for the particle effect. Use $<entityname>.getAngles() to align the particle to an entity. use '0 0 0' for an upright (world-aligned) particle effect.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''emitterAddModel'''(string modelName, vector modelOffset); ====<br />
<br />
:Adds a new particle (or regular, if you wish) model to the emitter, located at modelOffset units away from the emitter's origin.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter''<br />
==== scriptEvent float '''emitterGetNumModels'''(); ====<br />
<br />
:Returns the number of models/particles this emitter has. Always >= 1.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter''<br />
==== scriptEvent void '''emptyHand'''(string hand); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
:Spawnclasses responding to this event: ''Seed'', ''idMover_Binary'', ''idTrigger''<br />
==== scriptEvent void '''enableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enableAnim'''(float channel, float blendFrames); ====<br />
<br />
:Enables animation on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableClip'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enableDamage'''(float enable); ====<br />
<br />
:enable/disable damage<br />
<br />
:Spawnclasses responding to this event: ''idMoveable''<br />
==== scriptEvent void '''enableEyeFocus'''(); ====<br />
<br />
:Enables eye focus.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableGravity'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''EnableLegIK'''(float num); ====<br />
<br />
:enables leg IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enablePain'''(); ====<br />
<br />
:Enables pain animations.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableSplineAngles'''(); ====<br />
<br />
:Enables aligning the mover with the spline direction.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''EnableWalkIK'''(); ====<br />
<br />
:enables walk IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableWeapon'''(); ====<br />
<br />
:Enables the player weapon.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''endState'''(); ====<br />
<br />
:Ends the current state with the given name, returns TRUE if more than one state is remaining.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''endZoom'''(float duration); ====<br />
<br />
:Starts the zoom out event, which performs a gradual transition back to the default FOV. May be called during a transition as well to intercept a pending zoom in transition.<br />
::''duration'': duration of the transition in msec<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''enemyInCombatCone'''(entity combatNode, float use_current_enemy_location); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyPositionValid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyRange'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyRange2D'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''entityInAttackCone'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''error'''(string text); ====<br />
<br />
:Issues an error.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''exitTeleporter'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''extinguishLights'''(); ====<br />
<br />
:Extinguishes all lights (i.e. the <self> entity plus all bound lights)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''faceEnemy'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''faceEntity'''(entity ent); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''facingIdeal'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''fadeIn'''(vector color, float time); ====<br />
<br />
:Fades towards the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeInLight'''(float time); ====<br />
<br />
:Turns the light on over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''fadeOut'''(vector color, float time); ====<br />
<br />
:Fades from the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeOutLight'''(float time); ====<br />
<br />
:Turns the light out over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''fadeSound'''(float channel, float newLevel, float fadeTime); ====<br />
<br />
:Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''fadeTo'''(vector color, float alpha, float time); ====<br />
<br />
:Fades to the given color up to the given alpha over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeToLight'''(vector color, float time); ====<br />
<br />
:Fades the light to the given color over a given time.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''findActorsInBounds'''(vector mins, vector maxs); ====<br />
<br />
:Returns an entity within the bounds specified<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemy'''(float onlyInFov); ====<br />
<br />
:Finds enemy player in PVS<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemyAI'''(float onlyInFov); ====<br />
<br />
:Finds enemy monster in PVS<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemyInCombatNodes'''(); ====<br />
<br />
:Finds enemy player in attack cones<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findFriendlyAI'''(float team); ====<br />
<br />
:Use this to find a visible AI friendly to ourselves. It basically iterates over all active entities in the map and looks for friendly actors. The pythagorean distance is taken to evaluate the distance. Don't call this every frame, this might get expensive in larger maps. Returns the nearest visible actor entity or the $null_entity, if none was found.<br />
::''team'': used to constrain the search to a given team. Set this to -1 to let the code ignore this argument<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''finishAction'''(string action); ====<br />
<br />
:Finishes the given wait action.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''finishChannelAction'''(float channel, string animname); ====<br />
<br />
:Overloaded finishAction function for setting the waitstate on each channel separately<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''fireMissileAtTarget'''(string jointname, string targetname); ====<br />
<br />
:Launches a missile at entity specified by 'attack_target'. returns projectile fired<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''firstPerson'''(); ====<br />
<br />
:Returns view control to the player entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''flashlight'''(float enable); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''flee'''(entity entToFleeFrom, float algorithm, float distanceOption); ====<br />
<br />
:Flee from the given entity. Pass the escape point lookup algorithm (e.g. EP_FIND_GUARDED) and the distanceOption (e.g. EP_DIST_NEAREST) to specify how the best escape point can be found. Refer to the tdm_defs.script file to see all the constants. When algorithm is set to EP_FIND_AAS_AREA_FAR_FROM_THREAT, the distanceOption is interpreted as minimum threat distance. Returns FALSE if no escape point could be found.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''floor'''(float x); ====<br />
<br />
:Returns the largest integer that is less than or equal to the given value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated''<br />
==== scriptEvent void '''foundBody'''(entity body); ====<br />
<br />
:Objective callback for when an AI finds a body.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''frob'''(); ====<br />
<br />
:Frobs the entity (i.e. simulates a frob action performed by the player). Returns TRUE if the entity is frobable, FALSE otherwise.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''frobHilight'''(float state); ====<br />
<br />
:ishtvan: Tries to make the entity frobhilight or not<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''frobRidable'''(entity playerController); ====<br />
<br />
:Called when a player directly mounts or dismounts a ridable AI.<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent void '''Gas_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': the entity causing the knockout, can be the $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getActualStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getAcuity'''(string type); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getAlertActor'''(); ====<br />
<br />
:Get the actor that alerted the AI in this frame.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getAlertLevelOfOtherAI'''(entity otherEntity); ====<br />
<br />
:This event gets the alert number of another AI (AI_AlertLevel variable value) Returns the alert number of the other AI, 0.0 if its not an AI or is NULL<br />
::''otherEntity'': the other AI entity who's alert number is being queried<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getAngles'''(); ====<br />
<br />
:Returns the current orientation of this entity (relative to bind parent if any).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getAngularVelocity'''(); ====<br />
<br />
:Gets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getAngularVelocityB'''(float id); ====<br />
<br />
:Get the angular velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent string '''getAnimList'''(float channel); ====<br />
<br />
:Returns a list of all animations and their anim rates.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getAnimRate'''(float channel, string animName); ====<br />
<br />
:Returns the rate for the given animation. Returns -1 if animation cannot be found.<br />
::''animName'': The name of the animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''getAnimState'''(float channel); ====<br />
<br />
:Returns the name of the current animation state script function used for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttachment'''(string attName); ====<br />
<br />
:Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttachmentInd'''(float index); ====<br />
<br />
:Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists<br />
::''index'': starts at 0<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttacker'''(); ====<br />
<br />
:Returns the attacking entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getAttackFlag'''(float combatType); ====<br />
<br />
:Returns 1 if the given attack flag is activated.<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getAudThresh'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getAxialDir'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent entity '''getBindChild'''(float ind); ====<br />
<br />
:Returns the ind_th bind child of this entity or NULL if index is invalid. NOTE: indices start at zero<br />
::''ind'': child index<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getBindMaster'''(); ====<br />
<br />
:Returns the entity's bindmaster<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''getBoolKey'''(string key); ====<br />
<br />
:Retrieves the boolean value of a specific spawn arg, defaulting to false.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getButtons'''(); ====<br />
<br />
:Returns the button state from the current user command.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getCalibratedLightgemValue'''(); ====<br />
<br />
:Returns the calibrated light gem value.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getClipMask'''(); ====<br />
<br />
:Returns the clipmask of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getClosestHiddenTarget'''(string entity_type); ====<br />
<br />
:Finds the closest targeted entity of the specified type.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getColor'''(); ====<br />
<br />
:Gets the color of this entity (shader parms Parm0, Parm1, Parm2).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getCombatNode'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getContents'''(); ====<br />
<br />
:Returns the contents of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvCategory'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory category.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvIcon'''(); ====<br />
<br />
:Returns the icon of the currently highlighted inventory item.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getCurInvItemCount'''(); ====<br />
<br />
:Returns the item count of the currently highlighted inventory Item, if stackable.Returns - 1 if non - stackable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getCurInvItemEntity'''(); ====<br />
<br />
:Returns the currently highlighted inventory item entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvItemId'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_item_id"). Most items will return an empty string, unless the "inv_item_id" is set on purpose.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvItemName'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_name").<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getCurrentMissionNum'''(); ====<br />
<br />
:Returns the number of the current mission (0-based, the first mission has number 0).<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getCurrentWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player is currently holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getCurrentYaw'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getCurWeaponName'''(); ====<br />
<br />
:Returns the name of the current weapon, as defined by "inv_weapon_name" in the weaponDef.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getcvar'''(string name); ====<br />
<br />
:Returns the string for a cvar.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getDifficultyLevel'''(); ====<br />
<br />
:Returns 0 (Easy), 1 (Medium) or 2 (Hard), depending on the difficulty level of the current mission.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getDifficultyName'''(float difficultyLevel); ====<br />
<br />
:Returns the (translated) name of the difficulty level passed as the argument.<br />
::''difficultyLevel'': 0 (Easy), 1 (Medium), 2 (Hard)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''GetDoor'''(); ====<br />
<br />
:Returns the associated door entity for this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoorHandle''<br />
==== scriptEvent entity '''GetDoorhandle'''(); ====<br />
<br />
:Returns the handle entity of this door. Can return NULL (== $null_entity)<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoor''<br />
==== scriptEvent entity '''getDragged'''(); ====<br />
<br />
:Returns the currently dragged body. Returns $null_entity if the body is shouldered, the player has nothing in his hands, or he has a non-AF entity in his hands. See also getShouldered(), getGrabbed() and getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idSecurityCamera''<br />
==== scriptEvent vector '''getEnemyEyePos'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getEnemyPos'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getEntity'''(string name); ====<br />
<br />
:Returns a reference to the entity with the specified name.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getEntityFlag'''(string flagName); ====<br />
<br />
:Returns the value of the specified entity flag.<br />
::''flagName'': Can be one of (case insensitive): notarget: if true never attack or target this entity noknockback: if true no knockback from hits takedamage: if true this entity can be damaged hidden: if true this entity is not visible bindOrientated: if true both the master orientation is used for binding solidForTeam: if true this entity is considered solid when a physics team mate pushes entities forcePhysicsUpdate: if true always update from the physics whether the object moved or not selected: if true the entity is selected for editing neverDormant: if true the entity never goes dormant isDormant: if true the entity is dormant hasAwakened: before a monster has been awakened the first time, use full PVS for dormant instead of area-connected invisible: if true this entity cannot be seen inaudible: if true this entity cannot be heard <br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getEntityKey'''(string key); ====<br />
<br />
:Retrieves the entity specified by the spawn arg.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getEyePos'''(); ====<br />
<br />
:Get eye position of the player and the AI<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent vector '''getFinalAngVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getFinalVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getFloatKey'''(string key); ====<br />
<br />
:Retrieves the floating point value of a specific spawn arg, defaulting to 0.0f.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getFov'''(); ====<br />
<br />
:This returns the current FOV of the player. You can modify the current FOV with startZoom() and endZoom().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''GetFractionalPosition'''(); ====<br />
<br />
:Returns a fraction between 0.00 (closed) and 1.00 (open).<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''getFrameTime'''(); ====<br />
<br />
:returns the length of time between game frames. this is not related to renderer frame rate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getFrobbed'''(); ====<br />
<br />
:Returns the currently frobhilighted entity. This includes entities the player has in his hands. Sets "frob only used by" mode<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getGrabbed'''(); ====<br />
<br />
:Returns the currently entity in the players hands. Returns $null_entity if the player has nothing in his hands Dragging or shouldering a body counts as grabbing it. See also getDragged(), getShouldered(), getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getGui'''(float handle); ====<br />
<br />
:Returns the file currently loaded by a GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getGuiFloat'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getGuiInt'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getGuiString'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getHead'''(); ====<br />
<br />
:Returns the entity used for the character's head, if it has one.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getHealth'''(); ====<br />
<br />
:Returns the current health.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getHinderance'''(string source); ====<br />
<br />
:Used to get hinderance from a source.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getIdealWeapon'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: <br />
==== scriptEvent float '''getImmobilization'''(string source); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getIncidenceAngle'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getIntKey'''(string key); ====<br />
<br />
:Retrieves the integer value of a specific spawn arg, defaulting to 0.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getInventoryOverlay'''(); ====<br />
<br />
:Gets the default inventory overlay for the player. All other entities will return an invalid value.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getJointAngle'''(float jointnum); ====<br />
<br />
:Returns the angular orientation of the joint in world space.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent float '''getJointHandle'''(string jointname); ====<br />
<br />
:Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent vector '''getJointPos'''(float jointnum); ====<br />
<br />
:Returns the position of the joint in world space.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent vector '''getJumpVelocity'''(vector pos, float speed, float max_jump_height); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getKey'''(string key); ====<br />
<br />
:Retrieves the value of a specific spawn arg, defaulting to ''.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getLightInPVS'''(float falloff, float scaling); ====<br />
<br />
:Computes the sum of all light in the PVS of the entity you call this on, and returns a vector with the sum.<br />
::''falloff'': 0: no falloff with distance 0.5: sqrt(linear) falloff (dist 100 => 1/10) 1: linear falloff (dist 100 => 1/100) 2: square falloff (dist 100 => 1/10000) <br />
::''scaling'': factor to scale the distance, can be used to lower/raise distance factor after the linear or square scaling has been used good looking values are approx: sqrt(linear): 0.01, linear: 0.1, square 1.0<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getLightLevel'''(); ====<br />
<br />
:Get level (intensity) of a light, <= 0.0 indicates it is off<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent vector '''getLightOrigin'''(); ====<br />
<br />
:Get the light origin (independent of its visual model)<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent vector '''getLinearVelocity'''(); ====<br />
<br />
:Gets the current linear velocity of this entity. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getLinearVelocityB'''(float id); ====<br />
<br />
:Get the linear velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent vector '''getListenLoc'''(); ====<br />
<br />
:Retrieves the location of the listener when leaning.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getLocation'''(); ====<br />
<br />
:Returns the idLocation entity corresponding to the entity's current location. This was player-specific before, but is now available to all entities.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getLocationPoint'''(vector point); ====<br />
<br />
:Returns the idLocation entity corresponding to the specified point's location.<br />
::''point'': point whose location to check<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''GetLock'''(); ====<br />
<br />
:Returns the associated lock of this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobLockHandle''<br />
==== scriptEvent float '''getLootAmount'''(float type); ====<br />
<br />
:Returns the amount of loot for the given type (e.g. LOOT_GOODS). Pass LOOT_TOTAL to return the sum of all loot types.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY, LOOT_TOTAL<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getMainAmbientLight'''(); ====<br />
<br />
:Returns the entity of the main ambient light.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getMass'''(float body); ====<br />
<br />
:Gets mass of a body for an entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getMaxs'''(); ====<br />
<br />
:Gets the maximum corner of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getMeleeActPhase'''(); ====<br />
<br />
:Returns the current melee action phase (holding,recovering,etc).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeActState'''(); ====<br />
<br />
:Returns the current melee action state (attacking/defending).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeActType'''(); ====<br />
<br />
:Returns the current melee action type (overhead,thrust,etc.).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeLastActTime'''(); ====<br />
<br />
:Returns the melee type of the last attack to hit this actor. Defaults to MELEETYPE_UNBLOCKABLE if we were not hit before.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeLastHitByType'''(); ====<br />
<br />
:Returns the game time that the most recent melee action ended (in ms)<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeResult'''(); ====<br />
<br />
:Get the result of the last melee action Follows MELEERESULT_* enum defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent vector '''getMins'''(); ====<br />
<br />
:Gets the minimum corner of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getMissionStatistic'''(string statisticName); ====<br />
<br />
:Returns current mission statistic.<br />
::''statisticName'': Can be one of (case insensitive): gamePlayTime: gameplay time in seconds damageDealt: damage dealt to enemies damageReceived: damage received by player healthReceived: health received by player pocketsPicked: pockets picked by player foundLoot: loot found by player missionLoot: total loot available in mission totalTimePlayerSeen: total time the player was seen by enemies in seconds. Updates only when AI lose sight of player numberTimesPlayerSeen: number of times player was seen by enemies numberTimesAISuspicious: number of times AI was 'observant' or 'suspicious'. A single AI passing through both alert levels will add 2 to the score. numberTimesAISearched: number of times AI was 'investigating' or 'searching'. A single AI passing through both alert levels will add 2 to the score. sightingScore: sighting score (number of times player was seen * weight) stealthScore: stealth score (sighting score + alerts * weights) killedByPlayer: number of enemies killed by player knockedOutByPlayer: number of enemies knocked out by player bodiesFound: number of times enemies have spotted a body secretsFound: number of secrets found by the player secretsTotal: total number of secrets in the mission <br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getMouseGesture'''(); ====<br />
<br />
:Returns the results of the last mouse gesture in enum form. (see the definition for MOUSEDIR_* for which numbers correspond to which directions)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getMove'''(); ====<br />
<br />
:Returns the movement relative to the player's view angles from the current user command. vector_x = forward, vector_y = right, vector_z = up<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getMoveAnim'''(); ====<br />
<br />
:Returns the name of the player-requested movement anim for a player controlled AI vehicle<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent float '''getMoveSpeed'''(); ====<br />
<br />
:Get the movement speed.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''getMoveTime'''(); ====<br />
<br />
:Gets the movement time.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''getMoveType'''(); ====<br />
<br />
:Returns the current movetype<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getName'''(); ====<br />
<br />
:Returns the name of this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getNextEntity'''(string key, string value, entity lastMatch); ====<br />
<br />
:Discover all entities in the map. Returns $null_entity when no more found.<br />
::''key'': Optional string: prefix for spawnarg key match. E.g. "target" will match "target", "target1" etc.<br />
::''value'': Optional string: spawnarg value to match. Can be used independently of ''key''. If ''key'' is not set, all spawnargs will be checked for the value.<br />
::''lastMatch'': Last match: search will start after this entity. Use $null_entity or pass an uninitialized entity variable to start a new search.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getNextHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get the next hinderance from a source.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getNextIdleAnim'''(); ====<br />
<br />
:This returns the name of the next idle anim to be played on this AI (used by AnimState scripts).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getNextImmobilization'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getNextInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the next inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getNextKey'''(string prefix, string lastMatch); ====<br />
<br />
:Searches for the name of a spawn arg that matches the prefix. For example, passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy", etc. The returned string is the name of the key which can then be passed into functions like getKey() to lookup the value of that spawn arg. This is useful for when you have multiple values to look up, like when you target multiple objects. To find the next matching key, pass in the previous result and the next key returned will be the first one that matches after the previous result. Pass in "" to get the first match. Passing in a non-existent key is the same as passing in "". Returns "" when no more keys match.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getNextTurnHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Get the next hinderance on the view turning from a source<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getNumAttachments'''(); ====<br />
<br />
:Return the number of attachments on an AI. Used to iterate through the attachments if desired.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getNumBodies'''(); ====<br />
<br />
:Returns the number of bodies in the AF. If the AF physics pointer is NULL, it returns 0.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent float '''getNumMeleeWeapons'''(); ====<br />
<br />
:Returns the number of melee weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_melee' set to '1'.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getNumRangedWeapons'''(); ====<br />
<br />
:Returns the number of ranged weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_ranged' set to '1'.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getObjectiveComp'''(float ObjNum, float CompNum); ====<br />
<br />
:Used to get the state of custom objective components<br />
::''ObjNum'': Starts counting at 1<br />
::''CompNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getObjectiveState'''(float ObjNum); ====<br />
<br />
:Returns the current state of the objective with the number ObjNum. State is one of the following: OBJ_INCOMPLETE = 0, OBJ_COMPLETE = 1, OBJ_INVALID = 2, OBJ_FAILED = 3<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getObjectiveVisible'''(float ObjNum); ====<br />
<br />
:Returns the current visibility of the objective with the number ObjNum.<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getObservationPosition'''(vector targetPoint, float visualAcuityZeroToOne); ====<br />
<br />
:This event is used to get a position that the AI can move to observe a given position. It is useful for looking at hiding spots that can't be reached, and performing other investigation functions. Returns a world position from which the observation can take place. Returns the current AI origin if no such point is found. @sideEffect This uses the AI_DEST_UNREACHABLE flag variable to indicate if a point was found. It will be true if none was found, false if one was found.<br />
::''targetPoint'': the world position to be observed<br />
::''visualAcuityZeroToOne'': the visual acuity of the AI on a scale of 0.0 to 1.0 where 0.0 is blind and 1.0 is perfect vision.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getObstacle'''(); ====<br />
<br />
:Gets the obstacle in the character's path<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getOrigin'''(); ====<br />
<br />
:Returns the current position of this entity (relative to bind parent if any).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getOwner'''(); ====<br />
<br />
:Returns the owning entity<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent string '''getPainAnim'''(); ====<br />
<br />
:Returns the name of the pain animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getPersistantFloat'''(string key); ====<br />
<br />
:Returns the floating point value for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getPersistantString'''(string key); ====<br />
<br />
:Returns the string for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getPersistantVector'''(string key); ====<br />
<br />
:Returns the vector for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortAISoundLoss'''(float handle); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortalHandle'''(); ====<br />
<br />
:Returns the portal handle.<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent float '''getPortPlayerSoundLoss'''(float handle); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortSoundLoss'''(float handle); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getPrevInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the previous inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getPreviousWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player was previously holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getPrime'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''getProjectileState'''(); ====<br />
<br />
:Gets the current state of the projectile. States are defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idProjectile''<br />
==== scriptEvent float '''getProjMass'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getRadius'''(); ====<br />
<br />
:Returns the light radius.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''getRandomTarget'''(string entity_type); ====<br />
<br />
:Finds a random targeted entity of the specified type.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getReachableEntityPosition'''(entity ent); ====<br />
<br />
:Returns the position of the entity within the AAS if possible, otherwise just the entity position.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getRelation'''(float team1, float team2); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getRelationEnt'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''GetResponseEntity'''(); ====<br />
<br />
:Returns the entity which should take the response. Some entities like AI heads are not responding themselves to stims, but relay it to another entity (i.e. the bodies they're attached to).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getSecurityCameraState'''(); ====<br />
<br />
:Returns the security camera's state. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = inactive, 5 = destroyed.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent string '''getShader'''(); ====<br />
<br />
:Gets the shader name used by the light.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent float '''getShaderParm'''(float parm); ====<br />
<br />
:Gets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getShouldered'''(); ====<br />
<br />
:Returns the currently shouldered body, otherwise $null_entity. See also getDragged(), getGrabbed() and getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getSize'''(); ====<br />
<br />
:Gets the size of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getSndDir'''(); ====<br />
<br />
:ai hearing of sound <br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getSoundLoss'''(); ====<br />
<br />
:Returns the sound loss value (dB).<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent float '''getSoundVolume'''(string soundName); ====<br />
<br />
:Get the volume of the sound to play.<br />
::''soundName'': the name of the sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getSpotLight'''(); ====<br />
<br />
:Returns the spotlight used by the camera. Returns null_entity if none is used.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent string '''getState'''(); ====<br />
<br />
:Gets the current state.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getSurfNormal'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent string '''getSurfType'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent entity '''getTactEnt'''(); ====<br />
<br />
:ai sense of touch<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getTalkTarget'''(); ====<br />
<br />
:Returns the entity (player) trying to talk to the character<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getTarget'''(float num); ====<br />
<br />
:Returns the requested target entity.<br />
::''num'': The target number. Starts at 0.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getTDMVersion'''(); ====<br />
<br />
:Get the current TDM version as integer. The value will be 108 for v1.08, 109 for v1.09 and 200 for v2.00 etc.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTeam'''(); ====<br />
<br />
:Returns the current team number.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getTicsPerSecond'''(); ====<br />
<br />
:returns the number of game frames per second. this is not related to renderer frame rate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTime'''(); ====<br />
<br />
:Returns the current game time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceBody'''(); ====<br />
<br />
:Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getTraceEndPos'''(); ====<br />
<br />
:Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getTraceEntity'''(); ====<br />
<br />
:Returns a reference to the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTraceFraction'''(); ====<br />
<br />
:Returns the fraction of movement completed during the last call to trace or tracePoint.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceJoint'''(); ====<br />
<br />
:Returns the number of the skeletal joint closest to the location on the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getTraceNormal'''(); ====<br />
<br />
:Returns the normal of the hit plane during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceSurfType'''(); ====<br />
<br />
:Returns the type of the surface (i.e. metal, snow) which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTurnDelta'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getTurnHinderance'''(string source); ====<br />
<br />
:* Get the hinderance on the view turning from a source<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getTurnRate'''(); ====<br />
<br />
:Gets the rate the character turns.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getVectorKey'''(string key); ====<br />
<br />
:Retrieves the vector value of a specific spawn arg, defaulting to '0 0 0'.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVectorToIdealOrigin'''(); ====<br />
<br />
:Returns the vector from where the AI is to where he ideally should be<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getViewAngles'''(); ====<br />
<br />
:Returns the player view angles.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getVinePlantLoc'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVinePlantNormal'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVisDir'''(); ====<br />
<br />
:Returns position of the last visual alert.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getWeaponEntity'''(); ====<br />
<br />
:Returns the entity for the player's weapon<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getWorldModel'''(); ====<br />
<br />
:Returns the entity that controls the world model<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent vector '''getWorldOrigin'''(); ====<br />
<br />
:Returns the current world-space position of this entity (regardless of any bind parent).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Gibbable'', ''idMoveableItem''<br />
==== scriptEvent void '''giveHealthPool'''(float amount); ====<br />
<br />
:This increases/decreases the healthpool of the player by the given amount. The healthpool is gradually decreased over time, healing (damaging?) the player.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''handleMissionEvent'''(entity objEnt, float eventType, string argument); ====<br />
<br />
:Generic interface for passing on mission events from scripts to the SDK. Available since TDM 1.02<br />
::''objEnt'': the entity that triggered this event (e.g. a readable)<br />
::''eventType'': a numeric identifier (enumerated both in MissionData.h and tdm_defs.script) specifying the type of event<br />
::''argument'': an optional string parameter, eventtype-specific.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''hasAnim'''(float channel, string animName); ====<br />
<br />
:Returns true when an entity has a specific animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''hasEnemies'''(); ====<br />
<br />
:Returns true if the actor has one or more enemies.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''hasFunction'''(string functionName); ====<br />
<br />
:checks if an entity's script object has a specific function<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''hasSeenEvidence'''(); ====<br />
<br />
:This returns 1 when the AI has seen evidence of intruders before (an enemy, a body...)<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''heal'''(string healDefName, float healScale); ====<br />
<br />
:Heals the entity this is called on using the specified healing entityDef. Returns 1 if the entity could be healed, 0 otherwise (if the entity is already at full health, for ex.)<br />
::''healDefName'': the name of the entityDef containing the healing information (e.g. "heal_potion")<br />
::''healScale'': the scaling value to be applied to the healAmount found in the healEntityDef<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''heldEntity'''(); ====<br />
<br />
:Returns the entity currently being held, or $null_entity if the player's hands are empty.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''hide'''(); ====<br />
<br />
:Makes this entity invisible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''holdEntity'''(entity entity); ====<br />
<br />
:Forces the player to hold an entity (e.g. puts it into the grabber). Drops whatever is in the player's hands if $null_entity is passed to it. Returns 1 if successful, 0 if not.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''idleAnim'''(float channel, string animName); ====<br />
<br />
:Plays the given idle animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''ignoreDamage'''(); ====<br />
<br />
:The AI can no longer take damage.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''inAnimState'''(float channel, string stateFunc); ====<br />
<br />
:Returns true if the given animation state script function is currently used for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''influenceActive'''(); ====<br />
<br />
:Checks if an influence is active<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''inPVS'''(); ====<br />
<br />
:Returns non-zero if this entity is in PVS. For lights, it will return true when the light's bounding box is in PVS, even though the light may not actually be in PVS. (an unmoved shadowcasting light may not be visible to PVS areas its bounding box intersects with)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isAtRest'''(); ====<br />
<br />
:Returns true if object is not moving<br />
<br />
:Spawnclasses responding to this event: ''idMoveable''<br />
==== scriptEvent float '''isDroppable'''(); ====<br />
<br />
:Get whether an item may be dropped from the inventory<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isEnemy'''(entity ent); ====<br />
<br />
:Returns true if the given entity is an enemy.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isEntityHidden'''(entity ent, float f_sightThreshold); ====<br />
<br />
:This is an alternate version of canSee, using FOV, distance and lighting.<br />
::''f_sightThreshold'': goes from 0.0 (entity visible in complete darkness) to 1.0 (entity only visible if completely lit up).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''isFriend'''(entity ent); ====<br />
<br />
:Returns true if the given entity is a friend.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isFrobable'''(); ====<br />
<br />
:Get whether the entity is frobable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isHidden'''(); ====<br />
<br />
:checks if the entity's model is invisible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isHilighted'''(); ====<br />
<br />
:Returns true if entity is currently frobhilighted.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isInLiquid'''(); ====<br />
<br />
:Returns 1 if the entity is in or touching a liquid.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isInvisible'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''isLeaning'''(); ====<br />
<br />
:Get whether the player is leaning<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''isLight'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''isMoving'''(); ====<br />
<br />
:Returns true if a mover is moving<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''isNeutral'''(entity ent); ====<br />
<br />
:Returns true if the given entity is neutral.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''IsOpen'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is open, which is basically the same as "not closed". A mover is considered closed when it is at its close position.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''isPeekLeaning'''(); ====<br />
<br />
:Get whether the player is peek leaning (against a keyhole or crack)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''isPlayerResponsibleForDeath'''(); ====<br />
<br />
:Returns true if the player was responsible for the AI's caller's death.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''isRotating'''(); ====<br />
<br />
:Returns true if a mover is rotating<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''isType'''(string spawnclass); ====<br />
<br />
:Returns true if this entity is of the given type.<br />
::''spawnclass'': spawn class name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isVineFriendly'''(); ====<br />
<br />
:Vine-arrow event<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent void '''kickObstacles'''(entity kickEnt, float force); ====<br />
<br />
:Kicks any obstacle in the character's path.<br />
::''kickEnt'': pass in $null_entity if you don't have a specific entity to kick<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''kill'''(); ====<br />
<br />
:Kills the monster.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''killthread'''(string threadName); ====<br />
<br />
:Kills all threads with the specified name<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''KO_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': is the entity causing the knockout, can be the $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''launch'''(vector start, vector dir, vector velocity); ====<br />
<br />
:Launches the projectile from <start> in direction <dir> with the given <velocity><br />
<br />
:Spawnclasses responding to this event: ''idProjectile''<br />
==== scriptEvent entity '''launchMissile'''(vector origin, vector angles); ====<br />
<br />
:Returns the projectile entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''launchMissiles'''(string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay); ====<br />
<br />
:Launches a projectile.<br />
<br />
:Spawnclasses responding to this event: ''idAnimated''<br />
==== scriptEvent void '''launchProjectiles'''(float num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated'', ''idTestModel''<br />
==== scriptEvent float '''loadExternalData'''(string declFile, string prefix); ====<br />
<br />
:Load an external xdata declaration.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''locateEnemy'''(); ====<br />
<br />
:Updates the last known position of the enemy independent from whether or not the enemy is visible.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''log'''(float x); ====<br />
<br />
:Returns the log of the given argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''logString'''(float logClass, float logType, string output); ====<br />
<br />
:This is the script counterpart to DM_LOG<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''lookAt'''(entity focusEntity, float duration); ====<br />
<br />
:Aims the character's eyes and head toward an entity for a period of time.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtAngles'''(float yawAngleClockwise, float pitchAngleUp, float rollAngle, float durationInSeconds); ====<br />
<br />
:A look at event that just looks at a set of angles relative to the current body facing of the AI. This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but it looks at the specified angles from the current body facing of the AI.<br />
::''yawAngleClockwise'': Negative angles are to the left of the AIs body and positive angles are to the right.<br />
::''pitchAngleUp'': Negative values are down and positive values are up where down and up are defined by the body axis.<br />
::''rollAngle'': This is currently unused and does nothing.<br />
::''durationInSeconds'': The duration to look in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtEnemy'''(float duration); ====<br />
<br />
:Aims the character's eyes and head toward the current enemy for a period of time.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtPosition'''(vector lookAtWorldPosition, float durationInSeconds); ====<br />
<br />
:This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but instead of looking at an entity, it looks at a position in worldspace. That is, it turns the head of the AI to look at the position.<br />
::''lookAtWorldPosition'': position in space to look at<br />
::''durationInSeconds'': duration to look in seconds<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''lookupReplacementAnim'''(string anim); ====<br />
<br />
:Returns the current replacement animation for "anim". Returns empty if no replacement anim <br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''markUsed'''(); ====<br />
<br />
:Disables the combat node if "use_once" is set on the entity.<br />
<br />
:Spawnclasses responding to this event: ''idCombatNode''<br />
==== scriptEvent float '''melee'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''meleeActionFinished'''(); ====<br />
<br />
:Called when the animation for the melee action has finished.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeActionHeld'''(); ====<br />
<br />
:Called when the melee action reaches the "hold" point.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeActionReleased'''(); ====<br />
<br />
:Called when the melee action is released from the hold point.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeAttackStarted'''(float attType); ====<br />
<br />
:Registers the start of a given melee attack Intended to be called from a script that also starts the animation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''meleeAttackToJoint'''(string joint, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''meleeBestParry'''(); ====<br />
<br />
:Returns the melee type integer of the best parry given the enemy attacks at the time If no attacking enemy is found, returns default of MELEETYPE_RL Follows MELEETYPE_* enum defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''meleeNameForNum'''(float num); ====<br />
<br />
:Converts a melee type integer to a string name suffix Used for finding the right animation for a given type, etc. Possible names are, in order: "Over, LR, RL, Thrust, General" Where general blocks all attacks types except unblockable<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeParryStarted'''(float parType); ====<br />
<br />
:Registers the start of a given melee parry Intended to be called from a script that also starts the animation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''missionFailed'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''missionSuccess'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''mouseGestureFinished'''(); ====<br />
<br />
:Returns true if the player is not currently doing a mouse gesture.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''move'''(float angle, float distance); ====<br />
<br />
:Initiates a translation with the given distance in the given yaw direction. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveOutOfRange'''(entity ent, float range); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the moving.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''moveStatus'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveTo'''(entity targetEntity); ====<br />
<br />
:Initiates a translation to the position of an entity. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveToAttackPosition'''(entity ent, string attack_anim); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToCover'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToCoverFrom'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEnemyHeight'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEntity'''(entity destination); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToPos'''(vector pos); ====<br />
<br />
:Initiates a translation to an absolute position. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveToPosition'''(vector position); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''music'''(string shaderName); ====<br />
<br />
:Starts playing background music.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''muzzleFlash'''(string jointname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''netEndReload'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''netReload'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent entity '''nextEnemy'''(entity lastEnemy); ====<br />
<br />
:Returns the next enemy the actor has acquired.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''nextWeapon'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''noShadows'''(float noShadows); ====<br />
<br />
:Sets the noShadow property on the entity to true/false, turning shadowcasting on or off for this entity.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''noShadowsDelayed'''(float noShadows, float delay); ====<br />
<br />
:Sets the noShadow property on the entity to true/false after delay in ms, turning shadows cast by this entity on or off.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
::''delay'': delay in ms<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''numBindChildren'''(); ====<br />
<br />
:Returns the number of bound entities lower down in the bind chain than this entity, but be sure to give it the topmost bindmaster<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''numSmokeEmitters'''(); ====<br />
<br />
:Returns the # of emitters defined by 'smokeParticleSystem' in the entitydef<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''numTargets'''(); ====<br />
<br />
:Returns the number of entities this entity has targeted.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''objectiveCompUnlatch'''(float ObjNum, float CompNum); ====<br />
<br />
:Unlatch an irreversible objective component that has latched into a state<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''objectiveUnlatch'''(float ObjNum); ====<br />
<br />
:Unlatch an irreversible objective that has latched into a state<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idSecurityCamera'', ''idSound''<br />
==== scriptEvent void '''offsetRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idSecurityCamera'', ''idSound''<br />
==== scriptEvent void '''onSignal'''(float signalNum, entity ent, string functionName); ====<br />
<br />
:Sets a script callback function for when the given signal is raised on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''OpenDoor'''(float master); ====<br />
<br />
:The OpenDoor method is necessary to give the FrobDoorHandles a "low level" open routine. The CFrobDoor::Open() call is re-routed to the FrobDoorHandle::Tap() method, so there must be a way to actually let the door open. Which is what this method does. Note: Shouldn't be called directly by scripters, call handle->Tap() instead. Unless you know what you're doing.<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoor''<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover'', ''idMover_Binary''<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
:Spawnclasses responding to this event: ''CFrobButton'', ''CFrobLever''<br />
==== scriptEvent void '''overrideAnim'''(float channel); ====<br />
<br />
:Disables the animation currently playing on the given channel and syncs the animation with the animation of the nearest animating channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''pause'''(); ====<br />
<br />
:Pauses the current thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''pauseGame'''(); ====<br />
<br />
:Pauses the game. This should only be called for threads that are explicitly maintained by a special SDK method, because ordinary threads won't get executed during g_stopTime == true. Note: This is used by the objective GUI threads. Note: Must be called on the player entity, not the sys entity.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''performRelight'''(); ====<br />
<br />
:Deal with doused lights.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playAndLipSync'''(string soundName, string animName); ====<br />
<br />
:Play the given sound, using the given lipsync animation. The lipsync animation should just be a simple non-loopable animation of the mouth opening in a linear fashion. The code will select individual frames from this to construct a simple lipsyncing effect which is in time with the sound. Returns the length of the played sound in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''playCustomAnim'''(string animName); ====<br />
<br />
:Plays the given animation on legs and torso. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''playStartSound'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''pointInLiquid'''(vector point, entity ignoreEntity); ====<br />
<br />
:Checks if a point is in a liquid, returns 1 if this is the case.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''pointIsInBounds'''(vector point, vector mins, vector maxs); ====<br />
<br />
:Returns true if the point is within the bounds specified.<br />
::''point'': test whether this point is in the bounds<br />
::''mins'': minimal corner of the bounds<br />
::''maxs'': maximal corner of the bounds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''pow'''(float x, float y); ====<br />
<br />
:Returns the power of x to y.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''preBurn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''predictEnemyPos'''(float time); ====<br />
<br />
:Tries to predict the player's movement based on the AAS and his direction of movement.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''preventPain'''(float duration); ====<br />
<br />
:Prevents any pain animation from being played for the given time in seconds.<br />
::''duration'': time in seconds<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''print'''(string text); ====<br />
<br />
:Prints the given string to the console.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''println'''(string text); ====<br />
<br />
:Prints the given line to the console.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''processBlindStim'''(entity stimSource, float skipVisibilityCheck); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''processVisualStim'''(entity stimSource); ====<br />
<br />
:Use this call to let the AI react to a visual stim (coming from the source entity).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''projectDecal'''(vector traceOrigin, vector traceEnd, entity passEntity, string decal, float decalSize, float angle); ====<br />
<br />
:Performs a trace from the specified origin and end positions, then projects a decal in that direction.<br />
::''traceOrigin'': Start of the trace.<br />
::''traceEnd'': End of the trace.<br />
::''passEntity'': This entity will be considered non-solid by the trace.<br />
::''decal'': Decal to be projected.<br />
::''decalSize'': Size of the decal quad.<br />
::''angle'': Angle of the decal quad.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''propagateSound'''(string soundName, float propVolMod, float msgTag); ====<br />
<br />
:Generates a propagated sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''propSound'''(string name); ====<br />
<br />
:Sound propagation scriptfunctions on all entities propagate a sound directly without playing an audible sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''propSoundMod'''(string name, float volMod); ====<br />
<br />
:propagate a sound directly with a volume modifier<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''pushPointIntoAAS'''(vector post); ====<br />
<br />
:Tries to push the point into a valid AAS area<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''pushState'''(string stateName); ====<br />
<br />
:Pushes the state with the given name, current one is postponed.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''radiusDamage'''(vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower); ====<br />
<br />
:damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile).<br />
::''inflictor'': the entity causing the damage<br />
::''ignore'': an entity to not cause damage to<br />
::''dmgPower'': scales the damage (for cases where damage is dependent on time)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''radiusDamageFromJoint'''(string jointname, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''random'''(float range); ====<br />
<br />
:Returns a random value X where 0 <= X < range.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idPathCorner''<br />
==== scriptEvent entity '''randomTarget'''(string ignoreName); ====<br />
<br />
:Returns a random targeted entity. Pass in an entity name to skip that entity.<br />
::''ignoreName'': the name of an entity to ignore<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''rangedThreatTo'''(entity target); ====<br />
<br />
:Could this entity threaten the given (target) entity from a distance?<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''readLightgemModifierFromWorldspawn'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''reAttachToCoords'''(string attName, string joint, vector offset, vector angles); ====<br />
<br />
:Reattach an existing attachment<br />
::''attName'': the name of the attachment we want to reattach. <br />
::''joint'': the name of the joint to attach to<br />
::''offset'': the translation offset from joint<br />
::''angles'': a (pitch, yaw, roll) angle vector that defines the rotation of the attachment relative to the joint's orientation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''reAttachToPos'''(string attName, string position); ====<br />
<br />
:Reattach an existing attachment to a named attachment position. Example: reAttachToPos( melee_weapon, right_hand_held )<br />
::''attName'': the name of the attachment we want to reattach.<br />
::''position'': the new position we want to attach it to.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''reloadTorchReplacementAnims'''(); ====<br />
<br />
:If actor has a torch, reload the torch's replacement anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''remove'''(); ====<br />
<br />
:Removes the entity from the game. For AI, use kill() instead.<br />
<br />
:Spawnclasses responding to this event: ''idClass''<br />
==== scriptEvent void '''removeBinds'''(); ====<br />
<br />
:Removes all attached entities from the game<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeFrobPeer'''(entity peer); ====<br />
<br />
:Removes the passed entity as frob peer.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeInitialSplineAngles'''(); ====<br />
<br />
:Subtracts the initial spline angles to maintain the initial orientation of the mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''removeKey'''(string key); ====<br />
<br />
:Removes a key from an object's spawnargs, so things like getNextKey() don't retrieve it.<br />
::''key'': the spawnarg to remove<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeReplacementAnim'''(string anim); ====<br />
<br />
:Removes the replacement for the given "anim"<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''removeTarget'''(entity target); ====<br />
<br />
:Remove a target from this entity.<br />
::''target'': the entity to remove from the targets<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''replaceInvItem'''(entity oldItem, entity newItem); ====<br />
<br />
:Replaces the entity <oldItem> with <newItem> in the inventory, while keeping <oldItem>'s inventory position intact. Note: The position guarantee only applies if <oldItem> and newItem share the same category. If the categories are different, the position of <newItem> is likely to be different than the one of <oldItem>. Note that <oldItem> will be removed from the inventory. If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens. Returns 1 if the operation was successful, 0 otherwise.<br />
::''newItem'': can be $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResetTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''resetWeaponProjectile'''(string weaponName); ====<br />
<br />
:Reloads the original projectile def name from the weaponDef. Used to revert a change made by the event changeWeaponProjectile().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''resetZoom'''(); ====<br />
<br />
:Cancels any pending zoom transitions and resets the FOV to normal.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''reskinCollisionModel'''(); ====<br />
<br />
:For use after setSkin() on moveables and static models, if the CM needs to be refreshed to update surface properties after a skin change. CM will be regenerated from the original model file with the new skin.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''respawn'''(); ====<br />
<br />
:Respawn<br />
<br />
:Spawnclasses responding to this event: ''idItem''<br />
==== scriptEvent void '''ResponseAdd'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseAllow'''(float type, entity responder); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseIgnore'''(float type, entity responder); ====<br />
<br />
:This functions must be called on the stim entity. It will add the response to the ignore list, so that subsequent stims, should not trigger the stim anymore.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseSetAction'''(float type, string action); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseTrigger'''(entity source, float stimType); ====<br />
<br />
:Fires a response on this entity, without a stim (a stand-alone response, so to say)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''restartPatrol'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''RestartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''restoreAddedEnts'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''restoreMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''restorePosition'''(); ====<br />
<br />
:Returns this entity to the position stored in the "origin" spawn arg. This is the position the entity was spawned in unless the "origin" key is changed. Note that there is no guarantee that the entity won't be stuck in another entity when moved, so care should be taken to make sure that isn't possible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated'', ''idTestModel''<br />
==== scriptEvent void '''ropeRemovalCleanup'''(entity ropeEnt); ====<br />
<br />
:Called when rope arrow ropes are removed, removes stale pointers on the player object.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''rotate'''(vector angleSpeed); ====<br />
<br />
:Initiates a rotation with the given angular speed. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateDownTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by decreasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateOnce'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the current angles plus the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateTo'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateUpTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by increasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''saveConDump'''(string cmd, string cmd); ====<br />
<br />
:Saves condump into FM directory; first argument is appended to dump filename, everything before last occurence of second argument is removed<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''saveGame'''(string filename); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''saveMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''say'''(string text); ====<br />
<br />
:Multiplayer - Print this line on the network<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''scaleVine'''(float factor); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''selectWeapon'''(string weapon); ====<br />
<br />
:Selects the weapon the player is holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''sessionCommand'''(string cmd); ====<br />
<br />
:Sends the sessioncommand to the game<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setActiveInventoryMapEnt'''(entity mapEnt); ====<br />
<br />
:Notify the player about a new active map entity. This clears out any previously active maps.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setAcuity'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAlertGracePeriod'''(float frac, float duration, float count); ====<br />
<br />
:This starts the alert grace period for an AI. Should be called in the same frame as the alert that pushes them into a higher state.<br />
::''frac'': the fraction of the alert below which they should ignore alerts during the grace period.<br />
::''duration'': the duration of the period in seconds<br />
::''count'': the number of alerts ignored above which the grace period is invalid<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAlertLevel'''(float newLevel); ====<br />
<br />
:Set the alert level (AI_AlertLevel). This should always be called instead of setting AI_AlertLevel directly.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAngles'''(vector angles); ====<br />
<br />
:Sets the current orientation of this entity (relative to bind parent if any)<br />
::''angles'': the new orientation<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setAngularVelocity'''(vector velocity); ====<br />
<br />
:Sets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setAngularVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the angular velocity of a particular body<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setAnimPrefix'''(string prefix); ====<br />
<br />
:Sets a string which is placed in front of any animation names.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''setAnimRate'''(float channel, string animName, float animRate); ====<br />
<br />
:Sets the animation rate to the given value. Returns 1 if successful, otherwise -1<br />
::''animName'': The name of the animation.<br />
::''animRate'': The rate to set the animation to.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setAttackFlag'''(float combatType, float enabled); ====<br />
<br />
:Activate or deactivate the given attack flag<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setAudThresh'''(float val); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''setBoneMod'''(float allowBoneMod); ====<br />
<br />
:Enables or disables head looking (may be obsolete).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setCamera'''(entity cameraEnt); ====<br />
<br />
:Turns over view control to the given camera entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setClipMask'''(float clipMask); ====<br />
<br />
:Sets the clipmask of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setColor'''(float parm0, float parm1, float parm2); ====<br />
<br />
:Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''SetConstraintPosition'''(string constraintName, vector position); ====<br />
<br />
:Moves the constraint with the given name that binds this entity to another entity.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setContents'''(float contents); ====<br />
<br />
:Sets the contents of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setController'''(entity playerController); ====<br />
<br />
:Let a player assume movement control of an AI vehicle (may be remote control as in a player on a coach pulled by a horse)<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent float '''setCurInvCategory'''(string categoryName); ====<br />
<br />
:Sets the inventory cursor to the first item of the named category. Returns 1 on success, 0 on failure (e.g. wrong category name)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''setCurInvItem'''(string itemName); ====<br />
<br />
:Sets the inventory cursor to the named item. Returns: the item entity of the newly selected item (can be $null_entity).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setcvar'''(string name, string value); ====<br />
<br />
:Sets a cvar.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setDroppable'''(float droppable); ====<br />
<br />
:Set whether an item may be dropped from the inventory. <br />
::''droppable'': if non-zero the item becomes droppable, when called with 0 the item becomes non-droppable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setEnemy'''(entity enemy); ====<br />
<br />
:Make the given entity an enemy.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setEntityRelation'''(entity ent, float relation); ====<br />
<br />
:Set a relation to another entity, this can be friendly (>0), neutral(0) or hostile (<0)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFlyOffset'''(float offset); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setFlySpeed'''(float speed); ====<br />
<br />
:Set the speed flying creatures move at. Also sets speed for moveTypeSlide.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setFrobable'''(float frobable); ====<br />
<br />
:Set whether the entity is frobable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFrobOnlyUsedByInv'''(float OnOff); ====<br />
<br />
:Engages or disengages a mode where we only frobhilight entities that can be used by our current inventory item. This also disables general frobactions and only allows "used by" frob actions.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setGui'''(float handle, string guiFile); ====<br />
<br />
:Loads a new file into an existing GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiFloat'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiInt'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiString'''(float handle, string key, string val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiStringFromKey'''(float handle, string key, entity src, string srcKey); ====<br />
<br />
:This is a kludge. It is equivelant to: setGuiString( handle, key, src.getKey(srcKey) ) However, it's used to bypass the 127 char size limit on script strings.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setHealth'''(float health); ====<br />
<br />
:Use these to set the health of AI or players (this also updates the AI_DEAD flag)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Used to set hinderance from a source.<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setImmobilization'''(string source, float type); ====<br />
<br />
:Used to set immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setJointAngle'''(float jointnum, float transform_type, vector angles); ====<br />
<br />
:Modifies the orientation of the joint based on the transform type.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''setJointPos'''(float jointnum, float transform_type, vector pos); ====<br />
<br />
:Modifies the position of the joint based on the transform type.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''setKey'''(string key, string value); ====<br />
<br />
:Sets a key on this entity's spawn args. Note that most spawn args are evaluated when this entity spawns in, so this will not change the entity's behavior in most cases. This is chiefly for saving data the script needs in an entity for later retrieval.<br />
::''key'': the spawnarg to set<br />
::''value'': the value to store<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setLightgemModifier'''(string modifierName, float value); ====<br />
<br />
:Sets the named lightgem modifier to a certain value. An example would be the player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers can be set by concurrent script threads.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setLightOrigin'''(vector pos); ====<br />
<br />
:Set origin of lights independent of model origin<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent void '''setLinearVelocity'''(vector velocity); ====<br />
<br />
:Sets the current linear velocity of this entity in units per second. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setLinearVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the linear velocity of a particular body<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setModel'''(string modelName); ====<br />
<br />
:Sets the model this entity uses<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setMoveType'''(float movetype); ====<br />
<br />
:Set the current movetype. movetypes are defined in tdm_ai.script<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setName'''(string name); ====<br />
<br />
:Sets the name of this entity.<br />
::''name'': the new name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setNeverDormant'''(float enable); ====<br />
<br />
:enables or prevents an entity from going dormant<br />
::''enable'': 1 = enable, 0 = disable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setNextState'''(string stateFunc); ====<br />
<br />
:Sets the next state and waits until thread exits, or a frame delay before calling it. Handy for setting the state in the constructor.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setObjectiveComp'''(float ObjNum, float CompNum, float state); ====<br />
<br />
:Used to set the state of custom objective components<br />
::''ObjNum'': objective number. Starts counting at 1<br />
::''CompNum'': component number. Starts counting at 1<br />
::''state'': 1 or 0 for true or false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveEnabling'''(float ObjNum, string strIn); ====<br />
<br />
:Set an objective's enabling objectives (objectives that must be completed before that objective may be completed).<br />
::''strIn'': takes the form of a string that is a space-delimited list of integer objectives representing the new enabling objectives. E.g. : '1 2 3 4'<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveNotification'''(float ObjNote); ====<br />
<br />
:Turns the notifications (sound ++ text) for objectives on/off.<br />
::''ObjNote'': Turn notifications on/off<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveOngoing'''(float ObjNum, float val); ====<br />
<br />
:Sets objective ongoing.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveOptional'''(float ObjNum, float val); ====<br />
<br />
:Sets objective mandatory.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveState'''(float ObjNum, float State); ====<br />
<br />
:Used to set the state of objectives from the script. For example, use this to invalidate an objective when something happens in your mission. The first argument is the numerical index of the objective (taking 'user' objective indices, starting at 1). Choose from the following for the second argument: OBJ_INCOMPLETE, OBJ_COMPLETE, OBJ_INVALID, OBJ_FAILED. Use this on $player1 like $player1.setObjectiveState(1, OBJ_COMPLETE);<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveText'''(float ObjNum, string newText); ====<br />
<br />
:Modify the displayed text for an objective. Can also be a string template like #str_20000<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveVisible'''(float ObjNum, float val); ====<br />
<br />
:Sets objective visibility.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (relative to it's bind parent if any)<br />
::''origin'': the new origin<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setOwner'''(entity owner); ====<br />
<br />
:Sets the owner of this entity. Entities will never collide with their owner.<br />
::''owner'': the entity which will be made owner of this entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setPeekOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for peeking, depending on aspect ratio.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setPeekView'''(float OnOff, vector origin); ====<br />
<br />
:Toggle whether we should use a view from a peek entity as the player's view<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setPersistantArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair that persists between maps<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortAISoundLoss'''(float handle, float value); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortPlayerSoundLoss'''(float handle, float value); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortSoundLoss'''(float handle, float value); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPrime'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''setRadius'''(float radius); ====<br />
<br />
:Sets the size of the bounding box, x=y=z=radius.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setRadiusXYZ'''(float x, float y, float z); ====<br />
<br />
:Sets the width/length/height of the light bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setReplacementAnim'''(string animToReplace, string replacement); ====<br />
<br />
:Replaces the animation "animToReplace" with "replacement"<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setSavePermissions'''(float permission); ====<br />
<br />
:No description<br />
::''permission'': 0<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setSecretsFound'''(float secrets); ====<br />
<br />
:Set how many secrets the player has found. Use getMissionStatistic() for getting the current value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setSecretsTotal'''(float secrets); ====<br />
<br />
:Set how many secrets exist in the map in total. Use getMissionStatistic() for getting the current value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setShader'''(string shader); ====<br />
<br />
:Sets the shader to be used for the light.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''setShaderParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
::''parm3'': alpha<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSightThreshold'''(float sightThreshold); ====<br />
<br />
:Set the sight threshold of the security camera: how lit up the player's lightgem needs to be in order to be seen. 0.0 to 1.0<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''setSize'''(vector min, vector max); ====<br />
<br />
:Sets the size of this entity's bounding box.<br />
::''min'': minimum corner coordinates<br />
::''max'': maximum corner coordinates<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSkin'''(string skinName); ====<br />
<br />
:Sets the skin this entity uses. Set to "" to turn off the skin.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSmokeVisibility'''(float particle_num, float on); ====<br />
<br />
:enables/disables smoke particles on bones. pass in the particle #, or ALL_PARTICLES for turning on/off all particle systems. particles are spawned in the order they appear in the entityDef<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setSolid'''(float solidity); ====<br />
<br />
:Set the solidity of the entity. If the entity has never been solid before it will be assigned solid and opaque contents/clip masks.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSoundLoss'''(float loss); ====<br />
<br />
:Sets the sound loss value (dB).<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent void '''setSoundVolume'''(float newLevel); ====<br />
<br />
:Set the volume of the sound to play, must be issued before startSoundShader.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSpawnArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair to be used when a new entity is spawned.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setSpyglassOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for the spyglass, depending on aspect ratio.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setStartedOff'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setState'''(string stateFunc); ====<br />
<br />
:Sets the next state and goes to it immediately<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setSyncedAnimWeight'''(float channel, float animindex, float weight); ====<br />
<br />
:Sets the blend amount on multi-point anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setTalkState'''(float state); ====<br />
<br />
:Sets whether the player can talk to this character or not.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setTalkTarget'''(entity target); ====<br />
<br />
:Sets the entity (player) trying to talk to the character<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setTeam'''(float newTeam); ====<br />
<br />
:Sets the team number of this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''SetTimerState'''(float stimId, float state); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setTurnHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Set the hinderance on the view turning from a source<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setTurnRate'''(float rate); ====<br />
<br />
:Set the rate the character turns at<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setViewAngles'''(vector angles); ====<br />
<br />
:Sets the player view angles, e.g. make the player facing this direction. 0 0 0 is east (along the X axis in DR), 0 90 0 north (along the Y axis in DR) 0 180 0 west, 0 270 0 south.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''setWorldOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (regardless of any bind parent).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''shooterFireProjectile'''(); ====<br />
<br />
:Fires a projectile.<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent float '''shooterGetAmmo'''(); ====<br />
<br />
:Get the ammonition<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent float '''shooterGetState'''(); ====<br />
<br />
:Returns the current state of this shooter.<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''shooterSetAmmo'''(float newAmmo); ====<br />
<br />
:Set the ammonition<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''shooterSetState'''(float state); ====<br />
<br />
:Activates / deactivates the shooter entity.<br />
::''state'': 1 = active, 0 = inactive<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''show'''(); ====<br />
<br />
:Makes this entity visible if it has a model.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''shrivel'''(float time); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''sin'''(float degrees); ====<br />
<br />
:Returns the sine of the given angle in degrees.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''slideTo'''(vector position, float time); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''smoking'''(float state); ====<br />
<br />
:flame is now smoking (1), or not (0)<br />
::''state'': 1 = smoking, 0 = not smoking<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''spawn'''(string classname); ====<br />
<br />
:Creates an entity of the specified classname and returns a reference to the entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''SpawnFloat'''(string key, float default); ====<br />
<br />
:Returns the floating point value for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''SpawnString'''(string key, string default); ====<br />
<br />
:Returns the string for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''spawnThrowableProjectile'''(string projectileName, string jointName); ====<br />
<br />
:This method spawns a projectile of the type named by the caller and attaches it to the joint given by the caller. The projectile becomes the AI's firable projectile. Returns a pointer to a projectile entity that can be thrown by the AI. You can use AI_LaunchMissle (e* = launchMissle(v,v) ) to throw the stone.<br />
::''projectileName'': The name of the projectile to spawn (as seen in a .def file) Must be descended from idProjectile<br />
::''jointName'': The name of the joint on the model to which the particle should be attached for throwing. If this is NULL or the empty string, then it is attached to the model center.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''SpawnVector'''(string key, vector default); ====<br />
<br />
:Returns the vector for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''speed'''(float speed); ====<br />
<br />
:Sets the movement speed. Set this speed before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''sqrt'''(float square); ====<br />
<br />
:Returns the square root of the given number.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''start'''(); ====<br />
<br />
:Starts a spline or anim camera moving.<br />
<br />
:Spawnclasses responding to this event: ''idCameraAnim''<br />
==== scriptEvent void '''startFx'''(string fx); ====<br />
<br />
:Starts an FX on this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startGamePlayTimer'''(); ====<br />
<br />
:Resets the game play timer to zero and (re)starts it.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''startMouseGesture'''(float key, float thresh, float test, float inverted, float turnHinderance, float decideTime, float deadTime); ====<br />
<br />
:Start tracking a mouse gesture that started when the key impulse was pressed. Discretizes analog mouse movement into a few different gesture possibilities. Impulse arg can also be a button, see the UB_* enum in usercmdgen.h. For now, only one mouse gesture check at a time.<br />
::''thresh'': Waits until the threshold mouse input thresh is reached before deciding.<br />
::''test'': determines which test to do (0 = up/down, 1 = left/right, 2 = 4 directions, 3 = 8 directions).<br />
::''inverted'': inverts the movement if set to 1, does not if 0<br />
::''turnHinderance'': Sets the max player view turn rate when checking this mouse gesture (0 => player view locked, 1.0 => no effect on view turning)<br />
::''decideTime'': time in milliseconds after which the mouse gesture is auto-decided, in the event that the mouse movement threshold was not reached. A DecideTime of -1 means wait forever until the button is released.<br />
::''deadTime'': how long after attack is pressed that mouse control remains dampened by the fraction turnHinderance.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''startRagdoll'''(); ====<br />
<br />
:Switches to a ragdoll taking over the animation.<br />
<br />
:Spawnclasses responding to this event: ''idAnimated''<br />
==== scriptEvent float '''startSound'''(string sound, float channel, float netSync); ====<br />
<br />
:Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound in seconds. This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.<br />
::''sound'': the spawnarg to reference, e.g. 'snd_move'<br />
::''channel'': the channel to play on<br />
::''netSync'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''startSoundShader'''(string shaderName, float channel); ====<br />
<br />
:Plays a specific sound shader on the channel and returns the length of the sound in seconds. This is not the preferred method of playing a sound since you must ensure that the sound is loaded.<br />
::''shaderName'': the sound shader to play<br />
::''channel'': the channel to play the sound on<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startSpline'''(entity spline); ====<br />
<br />
:Starts moving along a spline stored on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''StartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startZoom'''(float duration, float startFOV, float endFOV); ====<br />
<br />
:Call this to start the zoom in event. The player FOV is gradually zoomed in until over the given timespan.<br />
::''duration'': duration of the transition in msec<br />
::''startFOV'': The start FOV, this is clamped to [1..179]<br />
::''endFOV'': The end FOV, this is clamped to [1..179]<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''state_light'''(float set); ====<br />
<br />
:Switches the spotlight on or off. Respects the security camera's power state.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_AI'''(float set); ====<br />
<br />
:Set whether the camera can see AIs.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_animals'''(float set); ====<br />
<br />
:Set whether the camera can see animals. Checked after seeAI or seeBodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_bodies'''(float set); ====<br />
<br />
:Set whether the camera can see bodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_player'''(float set); ====<br />
<br />
:Set whether the camera can see the player.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_sweep'''(float set); ====<br />
<br />
:Enables or disables the camera's sweeping.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''StimAdd'''(float type, float radius); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimClearIgnoreList'''(float type); ====<br />
<br />
:This clears the ignore list for the stim of the given type It can be used if an entity changes state in some way that it would no longer be ignored<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''stop'''(); ====<br />
<br />
:Stops a spline or anim camera moving.<br />
<br />
:Spawnclasses responding to this event: ''idCameraAnim''<br />
==== scriptEvent void '''stopAnim'''(float channel, float frames); ====<br />
<br />
:Stops the animation currently playing on the given channel over the given number of frames.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''stopFxFov'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''stopMouseGesture'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''stopMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopMoving'''(); ====<br />
<br />
:Stops any translational movement.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopPatrol'''(); ====<br />
<br />
:Stops an AI from patrolling<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopRagdoll'''(); ====<br />
<br />
:turns off the ragdoll<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopRotating'''(); ====<br />
<br />
:Stops any rotational movement.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopSound'''(float channel, float netSync); ====<br />
<br />
:Stops a specific sound shader on the channel.<br />
::''channel'': the channel to stop playback on<br />
::''netSync'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''stopSpline'''(); ====<br />
<br />
:Stops moving along a spline.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopThinking'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''StopTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''strFind'''(string text, string find, float casesensitive, float start, float end); ====<br />
<br />
:Return the position of the given substring, counting from 0, or -1 if not found.<br />
::''casesensitive'': 0<br />
::''start'': 0<br />
::''end'': -1<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strLeft'''(string text, float num); ====<br />
<br />
:Returns a string composed of the first num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strLength'''(string text); ====<br />
<br />
:Returns the number of characters in the string<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strMid'''(string text, float start, float num); ====<br />
<br />
:Returns a string composed of the characters from start to start + num<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strRemove'''(string text, string remove); ====<br />
<br />
:Replace all occurances of the given substring with "". Example: StrRemove("abba","bb") results in "aa".<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strReplace'''(string text, string remove, string replace); ====<br />
<br />
:Replace all occurances of the given string with the replacement string. Example: StrRemove("abba","bb","ccc") results in "accca".<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strRight'''(string text, float num); ====<br />
<br />
:Returns a string composed of the last num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strSkip'''(string text, float num); ====<br />
<br />
:Returns the string following the first num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strToFloat'''(string text); ====<br />
<br />
:Returns the numeric value of the given string.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strToInt'''(string text); ====<br />
<br />
:Returns the integer value of the given string.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''sway'''(float speed, float phase, vector angles); ====<br />
<br />
:Initiates a rotation back and forth along the given angles with the given speed and phase.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''Switch'''(float newState); ====<br />
<br />
:Move the lever to the on or off position (0 = off).<br />
<br />
:Spawnclasses responding to this event: ''CFrobLever''<br />
==== scriptEvent void '''switchState'''(string stateName); ====<br />
<br />
:Switches to the state with the given name, current one is ended.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''syncAnimChannels'''(float fromChannel, float toChannel, float blendFrames); ====<br />
<br />
:Synchronises the channels<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''Tap'''(); ====<br />
<br />
:Operates this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobHandle''<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock'', ''idProjectile''<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''teleportTo'''(entity other); ====<br />
<br />
:Teleports the entity to the position of the other entity, plus a possible offset and random offset (defined on the spawnargs of the entity to be teleported)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''terminate'''(float threadNumber); ====<br />
<br />
:Terminates a thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''testAnimAttack'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testAnimMove'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testAnimMoveTowardEnemy'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testChargeAttack'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testEvent1'''(float float_pi, float int_beef, float float_exp, string string_tdm, float float_exp10, float int_food); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''testEvent2'''(float int_prevres, vector vec_123, float int_food, entity ent_player, entity ent_null, float float_pi, float float_exp); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''testEvent3'''(entity ent_prevres, vector vec_123, float float_pi, entity ent_player); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''testMeleeAttack'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testMoveToPosition'''(vector position); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''threadname'''(string name); ====<br />
<br />
:Sets the name of the current thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''throwAF'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''throwMoveable'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''time'''(float time); ====<br />
<br />
:Sets the movement time. Set this time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''Toggle'''(); ====<br />
<br />
:Turns the forcefield on and off.<br />
<br />
:Spawnclasses responding to this event: ''idForceField''<br />
==== scriptEvent void '''toggle_light'''(); ====<br />
<br />
:Toggles the spotlight on/off.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_AI'''(); ====<br />
<br />
:Toggles whether the camera can see AIs.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_animals'''(); ====<br />
<br />
:Toggles whether the camera can see bodies. Checked after seeAI or seeBodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_bodies'''(); ====<br />
<br />
:Toggles whether the camera can see bodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_player'''(); ====<br />
<br />
:Toggles whether the camera can see the player.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_sweep'''(); ====<br />
<br />
:Toggles the camera sweep.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''ToggleOpen'''(); ====<br />
<br />
:Toggles the mover state. Closes when fully open, opens when fully closed. If the mover is "interrupted" (e.g. when the player frobbed the mover in between), the move direction depends on the state of the internal "intent_open" flag. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''totalAmmoCount'''(); ====<br />
<br />
:Amount of ammo in inventory. since each shot may use more than 1 ammo, this is different than ammoAvailable()<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''touches'''(entity other); ====<br />
<br />
:Returns true if this entity touches the other entity.<br />
::''other'': the entity to check against<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''trace'''(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''tracePoint'''(vector start, vector end, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the trace hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''translate'''(string input); ====<br />
<br />
:Translates a string (like #str_12345) into the current language<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''travelDistanceBetweenEntities'''(entity source, entity dest); ====<br />
<br />
:Approximate travel distance between two entities.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceBetweenPoints'''(vector source, vector dest); ====<br />
<br />
:Approximate travel distance between two points.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceToEntity'''(entity destination); ====<br />
<br />
:Approximate travel distance to entity.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceToPoint'''(vector destination); ====<br />
<br />
:Approximate travel distance to point.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''trigger'''(entity entityToTrigger); ====<br />
<br />
:Triggers the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''triggerMissionEnd'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''triggerParticles'''(string jointName); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnTo'''(float yaw); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnToEntity'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnToPos'''(vector pos); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''unbind'''(); ====<br />
<br />
:Detaches this entity from its master.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''unpauseGame'''(); ====<br />
<br />
:Unpauses the game. Most scripts are not executed during g_stopTime == true and won't get into the position of calling this.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''useAmmo'''(float amount); ====<br />
<br />
:Eats the specified amount of ammo<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''vecLength'''(vector vec); ====<br />
<br />
:Returns the length of the given vector.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''vecNormalize'''(vector vec); ====<br />
<br />
:Returns the normalized version of the given vector.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''VecRotate'''(vector vector, vector angles); ====<br />
<br />
:Rotates a vector by the specified angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''VecToAngles'''(vector vec); ====<br />
<br />
:Returns Euler angles for the given direction.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''visScan'''(); ====<br />
<br />
:Checks for enemies or player in the AI's FOV, using light level and distance. For now the check is only done on the player. Returns a reference to the sighted actor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''waitAction'''(string name); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''waitFor'''(entity mover); ====<br />
<br />
:Waits for the given entity to complete its move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitForRender'''(entity e); ====<br />
<br />
:Suspends the current thread until 'e' might have been rendered. It's event based, so it doesn't waste CPU repeatedly checking inPVS(). e.inPVS() will very likely be true when the thread resumes. If e.inPVS() is true, calling waitForRender() will probably just wait a frame, unless D3 can figure out that the entity doesn't need to be rendered. Optimizations regarding shadowcasting lights may not apply to this function - it is based purely off whether or not the entity's bounding box is visible.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitForThread'''(float threadNumber); ====<br />
<br />
:Waits for the given thread to terminate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''waitMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wakeOnFlashlight'''(float enable); ====<br />
<br />
:Tells the monster to activate when flashlight shines on them.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wander'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''warning'''(string text); ====<br />
<br />
:Issues a warning.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''wasDamaged'''(); ====<br />
<br />
:Check if the player was damaged this frame.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''weaponHolstered'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponLowering'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponOutOfAmmo'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponReady'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponReloading'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponRising'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponState'''(string stateFunction, float blendFrames); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
<br />
== Events by Spawnclass / Entity Type ==<br />
=== idClass ===<br />
==== scriptEvent void '''remove'''(); ====<br />
<br />
:Removes the entity from the game. For AI, use kill() instead.<br />
<br />
=== idActor ===<br />
==== scriptEvent float '''animDistance'''(float channel, string animName); ====<br />
<br />
:Returns the distance that the anim travels. If the entity has multiple anims with animName, the distance may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animDistance.<br />
<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
==== scriptEvent float '''animLength'''(float channel, string animName); ====<br />
<br />
:Returns the length of the anim in seconds. If the entity has multiple anims with animName, length may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animLength.<br />
<br />
==== scriptEvent void '''animState'''(float channel, string stateFunction, float blendFrame); ====<br />
<br />
:Sets a new animation state script function for the given channel.<br />
<br />
==== scriptEvent void '''attach'''(entity ent, string attName); ====<br />
<br />
:Attach an entity to the AI. Entity spawnArgs checked for attachments are: - "origin", "angles", and "joint". These must be set prior to calling attach.<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
==== scriptEvent void '''attachToPos'''(entity ent, string position, string attName); ====<br />
<br />
:Attach an entity to the AI, using a named attachment position<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
==== scriptEvent void '''checkAnim'''(float channel, string animName); ====<br />
<br />
:Ensures that the animation exists and causes an error if it doesn't.<br />
<br />
==== scriptEvent string '''chooseAnim'''(float channel, string animName); ====<br />
<br />
:Chooses a random anim and returns the name. Useful for doing move tests on anims.<br />
<br />
==== scriptEvent entity '''closestEnemyToPoint'''(vector point); ====<br />
<br />
:Returns the enemy closest to the given location.<br />
<br />
==== scriptEvent void '''disableAnimchannel'''(float channel); ====<br />
<br />
:Used to disable a certain animchannel (for example if the ai is dead)<br />
<br />
==== scriptEvent void '''disableEyeFocus'''(); ====<br />
<br />
:Disables eye focus.<br />
<br />
==== scriptEvent void '''DisableLegIK'''(float num); ====<br />
<br />
:disables leg IK<br />
<br />
==== scriptEvent void '''disablePain'''(); ====<br />
<br />
:Disables pain animations.<br />
<br />
==== scriptEvent void '''DisableWalkIK'''(); ====<br />
<br />
:disables walk IK<br />
<br />
==== scriptEvent void '''dropAttachment'''(string attName); ====<br />
<br />
:Drop the attachment for the given attachment name.<br />
<br />
==== scriptEvent void '''dropAttachmentInd'''(float index); ====<br />
<br />
:Drop the attachment for the given index.<br />
::''index'': starts at 0<br />
<br />
==== scriptEvent void '''enableAnim'''(float channel, float blendFrames); ====<br />
<br />
:Enables animation on the given channel.<br />
<br />
==== scriptEvent void '''enableEyeFocus'''(); ====<br />
<br />
:Enables eye focus.<br />
<br />
==== scriptEvent void '''EnableLegIK'''(float num); ====<br />
<br />
:enables leg IK<br />
<br />
==== scriptEvent void '''enablePain'''(); ====<br />
<br />
:Enables pain animations.<br />
<br />
==== scriptEvent void '''EnableWalkIK'''(); ====<br />
<br />
:enables walk IK<br />
<br />
==== scriptEvent void '''finishAction'''(string action); ====<br />
<br />
:Finishes the given wait action.<br />
<br />
==== scriptEvent void '''finishChannelAction'''(float channel, string animname); ====<br />
<br />
:Overloaded finishAction function for setting the waitstate on each channel separately<br />
<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
==== scriptEvent string '''getAnimList'''(float channel); ====<br />
<br />
:Returns a list of all animations and their anim rates.<br />
<br />
==== scriptEvent float '''getAnimRate'''(float channel, string animName); ====<br />
<br />
:Returns the rate for the given animation. Returns -1 if animation cannot be found.<br />
::''animName'': The name of the animation.<br />
<br />
==== scriptEvent string '''getAnimState'''(float channel); ====<br />
<br />
:Returns the name of the current animation state script function used for the given channel.<br />
<br />
==== scriptEvent entity '''getAttachment'''(string attName); ====<br />
<br />
:Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists<br />
<br />
==== scriptEvent entity '''getAttachmentInd'''(float index); ====<br />
<br />
:Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists<br />
::''index'': starts at 0<br />
<br />
==== scriptEvent float '''getAttackFlag'''(float combatType); ====<br />
<br />
:Returns 1 if the given attack flag is activated.<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent vector '''getEyePos'''(); ====<br />
<br />
:Get eye position of the player and the AI<br />
<br />
==== scriptEvent entity '''getHead'''(); ====<br />
<br />
:Returns the entity used for the character's head, if it has one.<br />
<br />
==== scriptEvent float '''getMeleeActPhase'''(); ====<br />
<br />
:Returns the current melee action phase (holding,recovering,etc).<br />
<br />
==== scriptEvent float '''getMeleeActState'''(); ====<br />
<br />
:Returns the current melee action state (attacking/defending).<br />
<br />
==== scriptEvent float '''getMeleeActType'''(); ====<br />
<br />
:Returns the current melee action type (overhead,thrust,etc.).<br />
<br />
==== scriptEvent float '''getMeleeLastActTime'''(); ====<br />
<br />
:Returns the melee type of the last attack to hit this actor. Defaults to MELEETYPE_UNBLOCKABLE if we were not hit before.<br />
<br />
==== scriptEvent float '''getMeleeLastHitByType'''(); ====<br />
<br />
:Returns the game time that the most recent melee action ended (in ms)<br />
<br />
==== scriptEvent float '''getMeleeResult'''(); ====<br />
<br />
:Get the result of the last melee action Follows MELEERESULT_* enum defined in tdm_defs.script<br />
<br />
==== scriptEvent float '''getNumAttachments'''(); ====<br />
<br />
:Return the number of attachments on an AI. Used to iterate through the attachments if desired.<br />
<br />
==== scriptEvent float '''getNumMeleeWeapons'''(); ====<br />
<br />
:Returns the number of melee weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_melee' set to '1'.<br />
<br />
==== scriptEvent float '''getNumRangedWeapons'''(); ====<br />
<br />
:Returns the number of ranged weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_ranged' set to '1'.<br />
<br />
==== scriptEvent string '''getPainAnim'''(); ====<br />
<br />
:Returns the name of the pain animation.<br />
<br />
==== scriptEvent string '''getState'''(); ====<br />
<br />
:Gets the current state.<br />
<br />
==== scriptEvent float '''hasAnim'''(float channel, string animName); ====<br />
<br />
:Returns true when an entity has a specific animation.<br />
<br />
==== scriptEvent float '''hasEnemies'''(); ====<br />
<br />
:Returns true if the actor has one or more enemies.<br />
<br />
==== scriptEvent float '''idleAnim'''(float channel, string animName); ====<br />
<br />
:Plays the given idle animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''inAnimState'''(float channel, string stateFunc); ====<br />
<br />
:Returns true if the given animation state script function is currently used for the given channel.<br />
<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent string '''lookupReplacementAnim'''(string anim); ====<br />
<br />
:Returns the current replacement animation for "anim". Returns empty if no replacement anim <br />
<br />
==== scriptEvent void '''meleeActionFinished'''(); ====<br />
<br />
:Called when the animation for the melee action has finished.<br />
<br />
==== scriptEvent void '''meleeActionHeld'''(); ====<br />
<br />
:Called when the melee action reaches the "hold" point.<br />
<br />
==== scriptEvent void '''meleeActionReleased'''(); ====<br />
<br />
:Called when the melee action is released from the hold point.<br />
<br />
==== scriptEvent void '''meleeAttackStarted'''(float attType); ====<br />
<br />
:Registers the start of a given melee attack Intended to be called from a script that also starts the animation<br />
<br />
==== scriptEvent float '''meleeBestParry'''(); ====<br />
<br />
:Returns the melee type integer of the best parry given the enemy attacks at the time If no attacking enemy is found, returns default of MELEETYPE_RL Follows MELEETYPE_* enum defined in tdm_defs.script<br />
<br />
==== scriptEvent string '''meleeNameForNum'''(float num); ====<br />
<br />
:Converts a melee type integer to a string name suffix Used for finding the right animation for a given type, etc. Possible names are, in order: "Over, LR, RL, Thrust, General" Where general blocks all attacks types except unblockable<br />
<br />
==== scriptEvent void '''meleeParryStarted'''(float parType); ====<br />
<br />
:Registers the start of a given melee parry Intended to be called from a script that also starts the animation<br />
<br />
==== scriptEvent entity '''nextEnemy'''(entity lastEnemy); ====<br />
<br />
:Returns the next enemy the actor has acquired.<br />
<br />
==== scriptEvent void '''overrideAnim'''(float channel); ====<br />
<br />
:Disables the animation currently playing on the given channel and syncs the animation with the animation of the nearest animating channel.<br />
<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''preventPain'''(float duration); ====<br />
<br />
:Prevents any pain animation from being played for the given time in seconds.<br />
::''duration'': time in seconds<br />
<br />
==== scriptEvent void '''reAttachToCoords'''(string attName, string joint, vector offset, vector angles); ====<br />
<br />
:Reattach an existing attachment<br />
::''attName'': the name of the attachment we want to reattach. <br />
::''joint'': the name of the joint to attach to<br />
::''offset'': the translation offset from joint<br />
::''angles'': a (pitch, yaw, roll) angle vector that defines the rotation of the attachment relative to the joint's orientation<br />
<br />
==== scriptEvent void '''reAttachToPos'''(string attName, string position); ====<br />
<br />
:Reattach an existing attachment to a named attachment position. Example: reAttachToPos( melee_weapon, right_hand_held )<br />
::''attName'': the name of the attachment we want to reattach.<br />
::''position'': the new position we want to attach it to.<br />
<br />
==== scriptEvent void '''reloadTorchReplacementAnims'''(); ====<br />
<br />
:If actor has a torch, reload the torch's replacement anims.<br />
<br />
==== scriptEvent void '''removeReplacementAnim'''(string anim); ====<br />
<br />
:Removes the replacement for the given "anim"<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''setAnimPrefix'''(string prefix); ====<br />
<br />
:Sets a string which is placed in front of any animation names.<br />
<br />
==== scriptEvent float '''setAnimRate'''(float channel, string animName, float animRate); ====<br />
<br />
:Sets the animation rate to the given value. Returns 1 if successful, otherwise -1<br />
::''animName'': The name of the animation.<br />
::''animRate'': The rate to set the animation to.<br />
<br />
==== scriptEvent void '''setAttackFlag'''(float combatType, float enabled); ====<br />
<br />
:Activate or deactivate the given attack flag<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent void '''setNextState'''(string stateFunc); ====<br />
<br />
:Sets the next state and waits until thread exits, or a frame delay before calling it. Handy for setting the state in the constructor.<br />
<br />
==== scriptEvent void '''setReplacementAnim'''(string animToReplace, string replacement); ====<br />
<br />
:Replaces the animation "animToReplace" with "replacement"<br />
<br />
==== scriptEvent void '''setState'''(string stateFunc); ====<br />
<br />
:Sets the next state and goes to it immediately<br />
<br />
==== scriptEvent void '''setSyncedAnimWeight'''(float channel, float animindex, float weight); ====<br />
<br />
:Sets the blend amount on multi-point anims.<br />
<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''stopAnim'''(float channel, float frames); ====<br />
<br />
:Stops the animation currently playing on the given channel over the given number of frames.<br />
<br />
==== scriptEvent void '''syncAnimChannels'''(float fromChannel, float toChannel, float blendFrames); ====<br />
<br />
:Synchronises the channels<br />
<br />
=== idAFEntity_Base ===<br />
==== scriptEvent vector '''getAngularVelocityB'''(float id); ====<br />
<br />
:Get the angular velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
==== scriptEvent vector '''getLinearVelocityB'''(float id); ====<br />
<br />
:Get the linear velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
==== scriptEvent float '''getNumBodies'''(); ====<br />
<br />
:Returns the number of bodies in the AF. If the AF physics pointer is NULL, it returns 0.<br />
<br />
==== scriptEvent void '''restoreAddedEnts'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setAngularVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the angular velocity of a particular body<br />
<br />
==== scriptEvent void '''SetConstraintPosition'''(string constraintName, vector position); ====<br />
<br />
:Moves the constraint with the given name that binds this entity to another entity.<br />
<br />
==== scriptEvent void '''setLinearVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the linear velocity of a particular body<br />
<br />
=== idAFEntity_Gibbable ===<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
=== idAFEntity_Generic ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idAFEntity_WithAttachedHead ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CAIVehicle ===<br />
==== scriptEvent void '''clearController'''(); ====<br />
<br />
:Need separate clearController because scripting doesn't like passing in $null_entity? (greebo: one could remove this function and set the argument type of setController to 'E'.<br />
<br />
==== scriptEvent void '''frobRidable'''(entity playerController); ====<br />
<br />
:Called when a player directly mounts or dismounts a ridable AI.<br />
<br />
==== scriptEvent string '''getMoveAnim'''(); ====<br />
<br />
:Returns the name of the player-requested movement anim for a player controlled AI vehicle<br />
<br />
==== scriptEvent void '''setController'''(entity playerController); ====<br />
<br />
:Let a player assume movement control of an AI vehicle (may be remote control as in a player on a coach pulled by a horse)<br />
<br />
=== idCombatNode ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''markUsed'''(); ====<br />
<br />
:Disables the combat node if "use_once" is set on the entity.<br />
<br />
=== idAI ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''alert'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent void '''alertAI'''(string type, float amount, entity actor); ====<br />
<br />
:internal<br />
::''type'': alert type<br />
::''amount'': alert amount<br />
::''actor'': actor causing alert<br />
<br />
==== scriptEvent void '''allowDamage'''(); ====<br />
<br />
:The AI can take damage again.<br />
<br />
==== scriptEvent void '''allowHiddenMovement'''(float enable); ====<br />
<br />
:Normally, when hidden, monsters do not run physics. This enables physics when hidden.<br />
<br />
==== scriptEvent void '''allowMovement'''(float allow); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''animTurn'''(float angle); ====<br />
<br />
:Enable/disable animation controlled turning.<br />
::''angle'': Pass in the maximum # of degrees the animation turns. Use an amount of 0 to disable.<br />
<br />
==== scriptEvent void '''attackBegin'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''attackEnd'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''attackMelee'''(string damageDef); ====<br />
<br />
:Returns true if the attack hit<br />
<br />
==== scriptEvent entity '''attackMissile'''(string jointName); ====<br />
<br />
:returns projectile fired<br />
<br />
==== scriptEvent void '''bark'''(string sound); ====<br />
<br />
:Let the AI bark a certain sound.<br />
::''sound'': sound name, e.g. 'snd_warn_response'<br />
<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
==== scriptEvent float '''becomeRagdoll'''(); ====<br />
<br />
:enables the ragdoll if the entity has one<br />
<br />
==== scriptEvent void '''becomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''burn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canBecomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemyFromAnim'''(string anim); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemyFromJoint'''(string jointname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canReachEnemy'''(); ====<br />
<br />
:Returns true if character can walk to enemy's position. For walking monsters, enemy should be near the floor.<br />
<br />
==== scriptEvent float '''canReachEntity'''(entity ent); ====<br />
<br />
:Returns true if character can walk to entity's position. For walking monsters, entity should be near the floor.<br />
<br />
==== scriptEvent float '''canReachPosition'''(vector pos); ====<br />
<br />
:Returns true if character can walk to specified position. For walking monsters, position should be near the floor.<br />
<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canSeeExt'''(entity ent, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSee that can optionally choose to use field of vision and lighting calculations.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If b_useLighting is 0 the entity will be visible in complete darkness. If it is 1, the entity will only be visible if there is light shining on it, but the slightest light is enought. Use "isEntityHidden" as a script event with a threshold instead.<br />
<br />
==== scriptEvent float '''canSeePositionExt'''(vector position, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSeeExt that tests a location rather than an entity. Note that any actor at the position may make it not seeable from a distance.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If 0 the entity will be visible in complete darkness<br />
<br />
==== scriptEvent void '''chargeAttack'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''clearBurn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''clearEnemy'''(); ====<br />
<br />
:Clears the enemy entity<br />
<br />
==== scriptEvent void '''clearFlyOffset'''(); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at to the value set in the def file.<br />
<br />
==== scriptEvent entity '''closestReachableEnemy'''(); ====<br />
<br />
:Used for determining tactile alert targets<br />
<br />
==== scriptEvent entity '''closestReachableEnemyOfEntity'''(entity team_mate); ====<br />
<br />
:Finds another character's closest reachable enemy<br />
<br />
==== scriptEvent entity '''createMissile'''(string jointname); ====<br />
<br />
:returns projectile created<br />
<br />
==== scriptEvent entity '''createMissileFromDef'''(string defName, string jointName); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''directDamage'''(entity damageTarget, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableClip'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableGravity'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''dropTorch'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''emptyHand'''(string hand); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableClip'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableGravity'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''endState'''(); ====<br />
<br />
:Ends the current state with the given name, returns TRUE if more than one state is remaining.<br />
<br />
==== scriptEvent float '''enemyInCombatCone'''(entity combatNode, float use_current_enemy_location); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyPositionValid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyRange'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyRange2D'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''entityInAttackCone'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''faceEnemy'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''faceEntity'''(entity ent); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''facingIdeal'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''findActorsInBounds'''(vector mins, vector maxs); ====<br />
<br />
:Returns an entity within the bounds specified<br />
<br />
==== scriptEvent entity '''findEnemy'''(float onlyInFov); ====<br />
<br />
:Finds enemy player in PVS<br />
<br />
==== scriptEvent entity '''findEnemyAI'''(float onlyInFov); ====<br />
<br />
:Finds enemy monster in PVS<br />
<br />
==== scriptEvent entity '''findEnemyInCombatNodes'''(); ====<br />
<br />
:Finds enemy player in attack cones<br />
<br />
==== scriptEvent entity '''findFriendlyAI'''(float team); ====<br />
<br />
:Use this to find a visible AI friendly to ourselves. It basically iterates over all active entities in the map and looks for friendly actors. The pythagorean distance is taken to evaluate the distance. Don't call this every frame, this might get expensive in larger maps. Returns the nearest visible actor entity or the $null_entity, if none was found.<br />
::''team'': used to constrain the search to a given team. Set this to -1 to let the code ignore this argument<br />
<br />
==== scriptEvent entity '''fireMissileAtTarget'''(string jointname, string targetname); ====<br />
<br />
:Launches a missile at entity specified by 'attack_target'. returns projectile fired<br />
<br />
==== scriptEvent float '''flee'''(entity entToFleeFrom, float algorithm, float distanceOption); ====<br />
<br />
:Flee from the given entity. Pass the escape point lookup algorithm (e.g. EP_FIND_GUARDED) and the distanceOption (e.g. EP_DIST_NEAREST) to specify how the best escape point can be found. Refer to the tdm_defs.script file to see all the constants. When algorithm is set to EP_FIND_AAS_AREA_FAR_FROM_THREAT, the distanceOption is interpreted as minimum threat distance. Returns FALSE if no escape point could be found.<br />
<br />
==== scriptEvent void '''foundBody'''(entity body); ====<br />
<br />
:Objective callback for when an AI finds a body.<br />
<br />
==== scriptEvent void '''Gas_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': the entity causing the knockout, can be the $null_entity<br />
<br />
==== scriptEvent float '''getAcuity'''(string type); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent entity '''getAlertActor'''(); ====<br />
<br />
:Get the actor that alerted the AI in this frame.<br />
<br />
==== scriptEvent float '''getAlertLevelOfOtherAI'''(entity otherEntity); ====<br />
<br />
:This event gets the alert number of another AI (AI_AlertLevel variable value) Returns the alert number of the other AI, 0.0 if its not an AI or is NULL<br />
::''otherEntity'': the other AI entity who's alert number is being queried<br />
<br />
==== scriptEvent entity '''getAttacker'''(); ====<br />
<br />
:Returns the attacking entity<br />
<br />
==== scriptEvent float '''getAudThresh'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getClosestHiddenTarget'''(string entity_type); ====<br />
<br />
:Finds the closest targeted entity of the specified type.<br />
<br />
==== scriptEvent entity '''getCombatNode'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getCurrentYaw'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getEnemyEyePos'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getEnemyPos'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getJumpVelocity'''(vector pos, float speed, float max_jump_height); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getMoveType'''(); ====<br />
<br />
:Returns the current movetype<br />
<br />
==== scriptEvent string '''getNextIdleAnim'''(); ====<br />
<br />
:This returns the name of the next idle anim to be played on this AI (used by AnimState scripts).<br />
<br />
==== scriptEvent vector '''getObservationPosition'''(vector targetPoint, float visualAcuityZeroToOne); ====<br />
<br />
:This event is used to get a position that the AI can move to observe a given position. It is useful for looking at hiding spots that can't be reached, and performing other investigation functions. Returns a world position from which the observation can take place. Returns the current AI origin if no such point is found. @sideEffect This uses the AI_DEST_UNREACHABLE flag variable to indicate if a point was found. It will be true if none was found, false if one was found.<br />
::''targetPoint'': the world position to be observed<br />
::''visualAcuityZeroToOne'': the visual acuity of the AI on a scale of 0.0 to 1.0 where 0.0 is blind and 1.0 is perfect vision.<br />
<br />
==== scriptEvent entity '''getObstacle'''(); ====<br />
<br />
:Gets the obstacle in the character's path<br />
<br />
==== scriptEvent entity '''getRandomTarget'''(string entity_type); ====<br />
<br />
:Finds a random targeted entity of the specified type.<br />
<br />
==== scriptEvent vector '''getReachableEntityPosition'''(entity ent); ====<br />
<br />
:Returns the position of the entity within the AAS if possible, otherwise just the entity position.<br />
<br />
==== scriptEvent float '''getRelationEnt'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getSndDir'''(); ====<br />
<br />
:ai hearing of sound <br />
<br />
==== scriptEvent entity '''getTactEnt'''(); ====<br />
<br />
:ai sense of touch<br />
<br />
==== scriptEvent entity '''getTalkTarget'''(); ====<br />
<br />
:Returns the entity (player) trying to talk to the character<br />
<br />
==== scriptEvent float '''getTurnDelta'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getTurnRate'''(); ====<br />
<br />
:Gets the rate the character turns.<br />
<br />
==== scriptEvent vector '''getVectorToIdealOrigin'''(); ====<br />
<br />
:Returns the vector from where the AI is to where he ideally should be<br />
<br />
==== scriptEvent vector '''getVisDir'''(); ====<br />
<br />
:Returns position of the last visual alert.<br />
<br />
==== scriptEvent float '''hasSeenEvidence'''(); ====<br />
<br />
:This returns 1 when the AI has seen evidence of intruders before (an enemy, a body...)<br />
<br />
==== scriptEvent void '''ignoreDamage'''(); ====<br />
<br />
:The AI can no longer take damage.<br />
<br />
==== scriptEvent float '''isEntityHidden'''(entity ent, float f_sightThreshold); ====<br />
<br />
:This is an alternate version of canSee, using FOV, distance and lighting.<br />
::''f_sightThreshold'': goes from 0.0 (entity visible in complete darkness) to 1.0 (entity only visible if completely lit up).<br />
<br />
==== scriptEvent float '''isPlayerResponsibleForDeath'''(); ====<br />
<br />
:Returns true if the player was responsible for the AI's caller's death.<br />
<br />
==== scriptEvent void '''kickObstacles'''(entity kickEnt, float force); ====<br />
<br />
:Kicks any obstacle in the character's path.<br />
::''kickEnt'': pass in $null_entity if you don't have a specific entity to kick<br />
<br />
==== scriptEvent void '''kill'''(); ====<br />
<br />
:Kills the monster.<br />
<br />
==== scriptEvent void '''KO_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': is the entity causing the knockout, can be the $null_entity<br />
<br />
==== scriptEvent entity '''launchMissile'''(vector origin, vector angles); ====<br />
<br />
:Returns the projectile entity<br />
<br />
==== scriptEvent void '''locateEnemy'''(); ====<br />
<br />
:Updates the last known position of the enemy independent from whether or not the enemy is visible.<br />
<br />
==== scriptEvent void '''lookAt'''(entity focusEntity, float duration); ====<br />
<br />
:Aims the character's eyes and head toward an entity for a period of time.<br />
<br />
==== scriptEvent void '''lookAtAngles'''(float yawAngleClockwise, float pitchAngleUp, float rollAngle, float durationInSeconds); ====<br />
<br />
:A look at event that just looks at a set of angles relative to the current body facing of the AI. This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but it looks at the specified angles from the current body facing of the AI.<br />
::''yawAngleClockwise'': Negative angles are to the left of the AIs body and positive angles are to the right.<br />
::''pitchAngleUp'': Negative values are down and positive values are up where down and up are defined by the body axis.<br />
::''rollAngle'': This is currently unused and does nothing.<br />
::''durationInSeconds'': The duration to look in seconds.<br />
<br />
==== scriptEvent void '''lookAtEnemy'''(float duration); ====<br />
<br />
:Aims the character's eyes and head toward the current enemy for a period of time.<br />
<br />
==== scriptEvent void '''lookAtPosition'''(vector lookAtWorldPosition, float durationInSeconds); ====<br />
<br />
:This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but instead of looking at an entity, it looks at a position in worldspace. That is, it turns the head of the AI to look at the position.<br />
::''lookAtWorldPosition'': position in space to look at<br />
::''durationInSeconds'': duration to look in seconds<br />
<br />
==== scriptEvent float '''meleeAttackToJoint'''(string joint, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveOutOfRange'''(entity ent, float range); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''moveStatus'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToAttackPosition'''(entity ent, string attack_anim); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''moveToCover'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToCoverFrom'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEnemyHeight'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEntity'''(entity destination); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''moveToPosition'''(vector position); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''muzzleFlash'''(string jointname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''numSmokeEmitters'''(); ====<br />
<br />
:Returns the # of emitters defined by 'smokeParticleSystem' in the entitydef<br />
<br />
==== scriptEvent void '''performRelight'''(); ====<br />
<br />
:Deal with doused lights.<br />
<br />
==== scriptEvent float '''playAndLipSync'''(string soundName, string animName); ====<br />
<br />
:Play the given sound, using the given lipsync animation. The lipsync animation should just be a simple non-loopable animation of the mouth opening in a linear fashion. The code will select individual frames from this to construct a simple lipsyncing effect which is in time with the sound. Returns the length of the played sound in seconds.<br />
<br />
==== scriptEvent float '''playCustomAnim'''(string animName); ====<br />
<br />
:Plays the given animation on legs and torso. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''preBurn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''predictEnemyPos'''(float time); ====<br />
<br />
:Tries to predict the player's movement based on the AAS and his direction of movement.<br />
<br />
==== scriptEvent void '''processBlindStim'''(entity stimSource, float skipVisibilityCheck); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''processVisualStim'''(entity stimSource); ====<br />
<br />
:Use this call to let the AI react to a visual stim (coming from the source entity).<br />
<br />
==== scriptEvent vector '''pushPointIntoAAS'''(vector post); ====<br />
<br />
:Tries to push the point into a valid AAS area<br />
<br />
==== scriptEvent void '''pushState'''(string stateName); ====<br />
<br />
:Pushes the state with the given name, current one is postponed.<br />
<br />
==== scriptEvent void '''radiusDamageFromJoint'''(string jointname, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''restartPatrol'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''restoreMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''saveMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''setAcuity'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent void '''setAlertGracePeriod'''(float frac, float duration, float count); ====<br />
<br />
:This starts the alert grace period for an AI. Should be called in the same frame as the alert that pushes them into a higher state.<br />
::''frac'': the fraction of the alert below which they should ignore alerts during the grace period.<br />
::''duration'': the duration of the period in seconds<br />
::''count'': the number of alerts ignored above which the grace period is invalid<br />
<br />
==== scriptEvent void '''setAlertLevel'''(float newLevel); ====<br />
<br />
:Set the alert level (AI_AlertLevel). This should always be called instead of setting AI_AlertLevel directly.<br />
<br />
==== scriptEvent void '''setAudThresh'''(float val); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''setBoneMod'''(float allowBoneMod); ====<br />
<br />
:Enables or disables head looking (may be obsolete).<br />
<br />
==== scriptEvent void '''setEnemy'''(entity enemy); ====<br />
<br />
:Make the given entity an enemy.<br />
<br />
==== scriptEvent void '''setFlyOffset'''(float offset); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at.<br />
<br />
==== scriptEvent void '''setFlySpeed'''(float speed); ====<br />
<br />
:Set the speed flying creatures move at. Also sets speed for moveTypeSlide.<br />
<br />
==== scriptEvent void '''setMoveType'''(float movetype); ====<br />
<br />
:Set the current movetype. movetypes are defined in tdm_ai.script<br />
<br />
==== scriptEvent void '''setSmokeVisibility'''(float particle_num, float on); ====<br />
<br />
:enables/disables smoke particles on bones. pass in the particle #, or ALL_PARTICLES for turning on/off all particle systems. particles are spawned in the order they appear in the entityDef<br />
<br />
==== scriptEvent void '''setTalkState'''(float state); ====<br />
<br />
:Sets whether the player can talk to this character or not.<br />
<br />
==== scriptEvent void '''setTalkTarget'''(entity target); ====<br />
<br />
:Sets the entity (player) trying to talk to the character<br />
<br />
==== scriptEvent void '''setTurnRate'''(float rate); ====<br />
<br />
:Set the rate the character turns at<br />
<br />
==== scriptEvent void '''shrivel'''(float time); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''slideTo'''(vector position, float time); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''spawnThrowableProjectile'''(string projectileName, string jointName); ====<br />
<br />
:This method spawns a projectile of the type named by the caller and attaches it to the joint given by the caller. The projectile becomes the AI's firable projectile. Returns a pointer to a projectile entity that can be thrown by the AI. You can use AI_LaunchMissle (e* = launchMissle(v,v) ) to throw the stone.<br />
::''projectileName'': The name of the projectile to spawn (as seen in a .def file) Must be descended from idProjectile<br />
::''jointName'': The name of the joint on the model to which the particle should be attached for throwing. If this is NULL or the empty string, then it is attached to the model center.<br />
<br />
==== scriptEvent void '''stopMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''stopPatrol'''(); ====<br />
<br />
:Stops an AI from patrolling<br />
<br />
==== scriptEvent void '''stopRagdoll'''(); ====<br />
<br />
:turns off the ragdoll<br />
<br />
==== scriptEvent void '''stopThinking'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''switchState'''(string stateName); ====<br />
<br />
:Switches to the state with the given name, current one is ended.<br />
<br />
==== scriptEvent float '''testAnimAttack'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testAnimMove'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testAnimMoveTowardEnemy'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testChargeAttack'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testMeleeAttack'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testMoveToPosition'''(vector position); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''throwAF'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''throwMoveable'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''travelDistanceBetweenEntities'''(entity source, entity dest); ====<br />
<br />
:Approximate travel distance between two entities.<br />
<br />
==== scriptEvent float '''travelDistanceBetweenPoints'''(vector source, vector dest); ====<br />
<br />
:Approximate travel distance between two points.<br />
<br />
==== scriptEvent float '''travelDistanceToEntity'''(entity destination); ====<br />
<br />
:Approximate travel distance to entity.<br />
<br />
==== scriptEvent float '''travelDistanceToPoint'''(vector destination); ====<br />
<br />
:Approximate travel distance to point.<br />
<br />
==== scriptEvent void '''triggerParticles'''(string jointName); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnTo'''(float yaw); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnToEntity'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnToPos'''(vector pos); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''visScan'''(); ====<br />
<br />
:Checks for enemies or player in the AI's FOV, using light level and distance. For now the check is only done on the player. Returns a reference to the sighted actor.<br />
<br />
==== scriptEvent void '''waitAction'''(string name); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''waitMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''wakeOnFlashlight'''(float enable); ====<br />
<br />
:Tells the monster to activate when flashlight shines on them.<br />
<br />
==== scriptEvent void '''wander'''(); ====<br />
<br />
:no description<br />
<br />
=== idTestModel ===<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
=== CBinaryFrobMover ===<br />
==== scriptEvent void '''Close'''(); ====<br />
<br />
:Closes the frobmover, regardless of its previous state. Mover must be open, otherwise nothing happens.<br />
<br />
==== scriptEvent float '''GetFractionalPosition'''(); ====<br />
<br />
:Returns a fraction between 0.00 (closed) and 1.00 (open).<br />
<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
==== scriptEvent float '''IsOpen'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is open, which is basically the same as "not closed". A mover is considered closed when it is at its close position.<br />
<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
==== scriptEvent void '''ToggleOpen'''(); ====<br />
<br />
:Toggles the mover state. Closes when fully open, opens when fully closed. If the mover is "interrupted" (e.g. when the player frobbed the mover in between), the move direction depends on the state of the internal "intent_open" flag. <br />
<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
=== idBrittleFracture ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''dampenSound'''(float dampen); ====<br />
<br />
:Toggle whether the shattering sound is dampened on the window, e.g., when covered by moss.<br />
::''dampen'': 1 = dampened, 0 = not dampened<br />
<br />
=== idCameraView ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idCameraAnim ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''start'''(); ====<br />
<br />
:Starts a spline or anim camera moving.<br />
<br />
==== scriptEvent void '''stop'''(); ====<br />
<br />
:Stops a spline or anim camera moving.<br />
<br />
=== idFuncEmitter ===<br />
==== scriptEvent void '''emitterAddModel'''(string modelName, vector modelOffset); ====<br />
<br />
:Adds a new particle (or regular, if you wish) model to the emitter, located at modelOffset units away from the emitter's origin.<br />
<br />
==== scriptEvent float '''emitterGetNumModels'''(); ====<br />
<br />
:Returns the number of models/particles this emitter has. Always >= 1.<br />
<br />
=== idEntity ===<br />
==== scriptEvent void '''activateContacts'''(); ====<br />
<br />
:Activate objects sitting on this object.<br />
<br />
==== scriptEvent void '''activateTargets'''(entity activator); ====<br />
<br />
:Causes this entity to activate all it's targets. Similar to how a trigger activates entities.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''addFrobPeer'''(entity peer); ====<br />
<br />
:Adds the passed entity as frob peer.<br />
<br />
==== scriptEvent void '''addInvItem'''(entity inv_item); ====<br />
<br />
:Adds the given item to the inventory. Depending on the type the passed entity will be removed from the game (as for loot items) or hidden.<br />
<br />
==== scriptEvent void '''addItemToInv'''(entity target); ====<br />
<br />
:Adds the entity to the given entity's inventory. Depending on the type the entity will be removed from the game (as for loot items) or hidden. Example: $book->addItemToInv($player1);<br />
<br />
==== scriptEvent void '''addTarget'''(entity target); ====<br />
<br />
:Add a target to this entity.<br />
::''target'': the entity to add as target<br />
<br />
==== scriptEvent void '''applyImpulse'''(entity source, float bodyid, vector point, vector impulse); ====<br />
<br />
:Applies an impulse to the entity. Example: entity.applyImpulse($player1, 0, entity.getOrigin(), '0 0 2');<br />
::''source'': Pass $null_entity or the entity that applies the impulse<br />
::''bodyid'': For articulated figures, ID of the body, 0 for the first (main) body. Otherwise use 0.<br />
::''point'': Point on the body where the impulse is applied to<br />
::''impulse'': Vector of the impulse<br />
<br />
==== scriptEvent void '''bind'''(entity master); ====<br />
<br />
:Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
==== scriptEvent void '''bindPosition'''(entity master); ====<br />
<br />
:Fixes this entity's position (but not orientation) relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
==== scriptEvent void '''bindToBody'''(entity master, float bodyID, float orientated); ====<br />
<br />
:Bind to AF body<br />
::''master'': entity to bind to<br />
::''bodyID'': AF body ID to bind to<br />
::''orientated'': binds the orientation as well as position, if set to 1<br />
<br />
==== scriptEvent void '''bindToJoint'''(entity master, string boneName, float rotateWithMaster); ====<br />
<br />
:Fixes this entity's position and orientation relative to a bone on another entity, such that when the master's bone moves, so does this entity.<br />
::''master'': the entity to bind to<br />
::''boneName'': the bone name<br />
::''rotateWithMaster'': -<br />
<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
==== scriptEvent void '''callFunction'''(string functionName); ====<br />
<br />
:Calls a function on an entity's script object. See also callGlobalFunction().<br />
<br />
==== scriptEvent void '''callGlobalFunction'''(string functionName, entity other); ====<br />
<br />
:calls a global function and passes the other entity along as the first argument calls the function in a new thread, so it continues executing in the current thread right away (unlike entity.callFunction( "blah"))<br />
<br />
==== scriptEvent void '''callGui'''(float handle, string namedEvent); ====<br />
<br />
:Calls a named event in a GUI.<br />
<br />
==== scriptEvent float '''canBeUsedBy'''(entity ent); ====<br />
<br />
:Returns true if the entity can be used by the argument entity<br />
<br />
==== scriptEvent float '''canSeeEntity'''(entity target, float useLighting); ====<br />
<br />
:This is a general version of idAI::canSee, that can be used by all entities. It doesn't regard FOV, it just performs a trace to check whether the target is occluded by world geometry. Is probably useful for stim/response as well Pass useLighting = true to take the lighting of the target entity into account. Use "isEntityHidden" as a script event with a threshold. The constant threshold value for useLighting is defined within the SDK in game/entity.h.<br />
<br />
==== scriptEvent void '''changeEntityRelation'''(entity ent, float relationChange); ====<br />
<br />
:This changes the current relation to an entity by adding the new amount.<br />
<br />
==== scriptEvent void '''changeInvIcon'''(string name, string category, string icon); ====<br />
<br />
:Sets the inventory icon of the given item in the given category to <icon>.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent void '''changeInvItemCount'''(string name, string category, float amount); ====<br />
<br />
:Decreases the inventory item stack count by amount. The item is addressed using the name and category of the item. These are usually defined on the inventory item entity ("inv_name", "inv_category") Amount can be both negative and positive.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent void '''changeInvLightgemModifier'''(string name, string category, float amount); ====<br />
<br />
:Sets the lightgem modifier value of the given item. Valid arguments are between 0 and 32 (which is the maximum lightgem value).<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent float '''changeLootAmount'''(float type, float amount); ====<br />
<br />
:Changes the loot amount of the given Type (e.g. GOODS) by <amount>. The mission statisic for loot found gets changed too. The new value of the changed type is returned (e.g. the new GOODS value if this has been changed). Note: The LOOT_TOTAL type can't be changed and 0 is returned.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY<br />
::''amount'': can be negative<br />
<br />
==== scriptEvent void '''checkAbsence'''(); ====<br />
<br />
:description missing<br />
<br />
==== scriptEvent void '''copyBind'''(entity other); ====<br />
<br />
:copy bind information of other to this entity (i.e., bind this entity to the same entity that other is bound to)<br />
<br />
==== scriptEvent float '''createOverlay'''(string guiFile, float layer); ====<br />
<br />
:Creates a GUI overlay. (must be used on the player)<br />
<br />
==== scriptEvent void '''CreateTimer'''(float stimId, float hour, float minutes, float seconds, float milliseconds); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''damage'''(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale); ====<br />
<br />
:Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).<br />
::''inflictor'': the entity causing the damage (maybe a projectile)<br />
::''attacker'': the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)<br />
::''dir'': the direction the attack is coming from.<br />
::''damageDefName'': the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")<br />
::''damageScale'': the scale of the damage (pass 1.0 as default, this should be ok).<br />
<br />
==== scriptEvent void '''destroyOverlay'''(float handle); ====<br />
<br />
:Destroys a GUI overlay. (must be used on the player)<br />
<br />
==== scriptEvent float '''distanceTo'''(entity other); ====<br />
<br />
:Returns the distance of this entity to another entity.<br />
<br />
==== scriptEvent float '''distanceToPoint'''(vector point); ====<br />
<br />
:Returns the distance of this entity to a point.<br />
<br />
==== scriptEvent void '''extinguishLights'''(); ====<br />
<br />
:Extinguishes all lights (i.e. the <self> entity plus all bound lights)<br />
<br />
==== scriptEvent void '''fadeSound'''(float channel, float newLevel, float fadeTime); ====<br />
<br />
:Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds.<br />
<br />
==== scriptEvent float '''frob'''(); ====<br />
<br />
:Frobs the entity (i.e. simulates a frob action performed by the player). Returns TRUE if the entity is frobable, FALSE otherwise.<br />
<br />
==== scriptEvent void '''frobHilight'''(float state); ====<br />
<br />
:ishtvan: Tries to make the entity frobhilight or not<br />
<br />
==== scriptEvent vector '''getAngles'''(); ====<br />
<br />
:Returns the current orientation of this entity (relative to bind parent if any).<br />
<br />
==== scriptEvent vector '''getAngularVelocity'''(); ====<br />
<br />
:Gets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
==== scriptEvent entity '''getBindChild'''(float ind); ====<br />
<br />
:Returns the ind_th bind child of this entity or NULL if index is invalid. NOTE: indices start at zero<br />
::''ind'': child index<br />
<br />
==== scriptEvent entity '''getBindMaster'''(); ====<br />
<br />
:Returns the entity's bindmaster<br />
<br />
==== scriptEvent float '''getBoolKey'''(string key); ====<br />
<br />
:Retrieves the boolean value of a specific spawn arg, defaulting to false.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent float '''getClipMask'''(); ====<br />
<br />
:Returns the clipmask of the physics object.<br />
<br />
==== scriptEvent vector '''getColor'''(); ====<br />
<br />
:Gets the color of this entity (shader parms Parm0, Parm1, Parm2).<br />
<br />
==== scriptEvent float '''getContents'''(); ====<br />
<br />
:Returns the contents of the physics object.<br />
<br />
==== scriptEvent string '''getCurInvCategory'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory category.<br />
<br />
==== scriptEvent string '''getCurInvIcon'''(); ====<br />
<br />
:Returns the icon of the currently highlighted inventory item.<br />
<br />
==== scriptEvent float '''getCurInvItemCount'''(); ====<br />
<br />
:Returns the item count of the currently highlighted inventory Item, if stackable.Returns - 1 if non - stackable<br />
<br />
==== scriptEvent entity '''getCurInvItemEntity'''(); ====<br />
<br />
:Returns the currently highlighted inventory item entity.<br />
<br />
==== scriptEvent string '''getCurInvItemId'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_item_id"). Most items will return an empty string, unless the "inv_item_id" is set on purpose.<br />
<br />
==== scriptEvent string '''getCurInvItemName'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_name").<br />
<br />
==== scriptEvent float '''getEntityFlag'''(string flagName); ====<br />
<br />
:Returns the value of the specified entity flag.<br />
::''flagName'': Can be one of (case insensitive): notarget: if true never attack or target this entity noknockback: if true no knockback from hits takedamage: if true this entity can be damaged hidden: if true this entity is not visible bindOrientated: if true both the master orientation is used for binding solidForTeam: if true this entity is considered solid when a physics team mate pushes entities forcePhysicsUpdate: if true always update from the physics whether the object moved or not selected: if true the entity is selected for editing neverDormant: if true the entity never goes dormant isDormant: if true the entity is dormant hasAwakened: before a monster has been awakened the first time, use full PVS for dormant instead of area-connected invisible: if true this entity cannot be seen inaudible: if true this entity cannot be heard <br />
<br />
==== scriptEvent entity '''getEntityKey'''(string key); ====<br />
<br />
:Retrieves the entity specified by the spawn arg.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent float '''getFloatKey'''(string key); ====<br />
<br />
:Retrieves the floating point value of a specific spawn arg, defaulting to 0.0f.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent string '''getGui'''(float handle); ====<br />
<br />
:Returns the file currently loaded by a GUI.<br />
<br />
==== scriptEvent float '''getGuiFloat'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent float '''getGuiInt'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent string '''getGuiString'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent float '''getHealth'''(); ====<br />
<br />
:Returns the current health.<br />
<br />
==== scriptEvent float '''getIntKey'''(string key); ====<br />
<br />
:Retrieves the integer value of a specific spawn arg, defaulting to 0.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent string '''getKey'''(string key); ====<br />
<br />
:Retrieves the value of a specific spawn arg, defaulting to ''.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent vector '''getLightInPVS'''(float falloff, float scaling); ====<br />
<br />
:Computes the sum of all light in the PVS of the entity you call this on, and returns a vector with the sum.<br />
::''falloff'': 0: no falloff with distance 0.5: sqrt(linear) falloff (dist 100 => 1/10) 1: linear falloff (dist 100 => 1/100) 2: square falloff (dist 100 => 1/10000) <br />
::''scaling'': factor to scale the distance, can be used to lower/raise distance factor after the linear or square scaling has been used good looking values are approx: sqrt(linear): 0.01, linear: 0.1, square 1.0<br />
<br />
==== scriptEvent vector '''getLinearVelocity'''(); ====<br />
<br />
:Gets the current linear velocity of this entity. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
==== scriptEvent entity '''getLocation'''(); ====<br />
<br />
:Returns the idLocation entity corresponding to the entity's current location. This was player-specific before, but is now available to all entities.<br />
<br />
==== scriptEvent float '''getLootAmount'''(float type); ====<br />
<br />
:Returns the amount of loot for the given type (e.g. LOOT_GOODS). Pass LOOT_TOTAL to return the sum of all loot types.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY, LOOT_TOTAL<br />
<br />
==== scriptEvent float '''getMass'''(float body); ====<br />
<br />
:Gets mass of a body for an entity<br />
<br />
==== scriptEvent vector '''getMaxs'''(); ====<br />
<br />
:Gets the maximum corner of this entity's bounding box.<br />
<br />
==== scriptEvent vector '''getMins'''(); ====<br />
<br />
:Gets the minimum corner of this entity's bounding box.<br />
<br />
==== scriptEvent string '''getName'''(); ====<br />
<br />
:Returns the name of this entity.<br />
<br />
==== scriptEvent entity '''getNextInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the next inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
==== scriptEvent string '''getNextKey'''(string prefix, string lastMatch); ====<br />
<br />
:Searches for the name of a spawn arg that matches the prefix. For example, passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy", etc. The returned string is the name of the key which can then be passed into functions like getKey() to lookup the value of that spawn arg. This is useful for when you have multiple values to look up, like when you target multiple objects. To find the next matching key, pass in the previous result and the next key returned will be the first one that matches after the previous result. Pass in "" to get the first match. Passing in a non-existent key is the same as passing in "". Returns "" when no more keys match.<br />
<br />
==== scriptEvent vector '''getOrigin'''(); ====<br />
<br />
:Returns the current position of this entity (relative to bind parent if any).<br />
<br />
==== scriptEvent entity '''getPrevInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the previous inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
==== scriptEvent entity '''GetResponseEntity'''(); ====<br />
<br />
:Returns the entity which should take the response. Some entities like AI heads are not responding themselves to stims, but relay it to another entity (i.e. the bodies they're attached to).<br />
<br />
==== scriptEvent float '''getShaderParm'''(float parm); ====<br />
<br />
:Gets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
<br />
==== scriptEvent vector '''getSize'''(); ====<br />
<br />
:Gets the size of this entity's bounding box.<br />
<br />
==== scriptEvent float '''getSoundVolume'''(string soundName); ====<br />
<br />
:Get the volume of the sound to play.<br />
::''soundName'': the name of the sound<br />
<br />
==== scriptEvent entity '''getTarget'''(float num); ====<br />
<br />
:Returns the requested target entity.<br />
::''num'': The target number. Starts at 0.<br />
<br />
==== scriptEvent float '''getTeam'''(); ====<br />
<br />
:Returns the current team number.<br />
<br />
==== scriptEvent vector '''getVectorKey'''(string key); ====<br />
<br />
:Retrieves the vector value of a specific spawn arg, defaulting to '0 0 0'.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent vector '''getVinePlantLoc'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
==== scriptEvent vector '''getVinePlantNormal'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
==== scriptEvent vector '''getWorldOrigin'''(); ====<br />
<br />
:Returns the current world-space position of this entity (regardless of any bind parent).<br />
<br />
==== scriptEvent float '''hasFunction'''(string functionName); ====<br />
<br />
:checks if an entity's script object has a specific function<br />
<br />
==== scriptEvent float '''heal'''(string healDefName, float healScale); ====<br />
<br />
:Heals the entity this is called on using the specified healing entityDef. Returns 1 if the entity could be healed, 0 otherwise (if the entity is already at full health, for ex.)<br />
::''healDefName'': the name of the entityDef containing the healing information (e.g. "heal_potion")<br />
::''healScale'': the scaling value to be applied to the healAmount found in the healEntityDef<br />
<br />
==== scriptEvent void '''hide'''(); ====<br />
<br />
:Makes this entity invisible.<br />
<br />
==== scriptEvent float '''inPVS'''(); ====<br />
<br />
:Returns non-zero if this entity is in PVS. For lights, it will return true when the light's bounding box is in PVS, even though the light may not actually be in PVS. (an unmoved shadowcasting light may not be visible to PVS areas its bounding box intersects with)<br />
<br />
==== scriptEvent float '''isDroppable'''(); ====<br />
<br />
:Get whether an item may be dropped from the inventory<br />
<br />
==== scriptEvent float '''isEnemy'''(entity ent); ====<br />
<br />
:Returns true if the given entity is an enemy.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isFriend'''(entity ent); ====<br />
<br />
:Returns true if the given entity is a friend.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isFrobable'''(); ====<br />
<br />
:Get whether the entity is frobable<br />
<br />
==== scriptEvent float '''isHidden'''(); ====<br />
<br />
:checks if the entity's model is invisible.<br />
<br />
==== scriptEvent float '''isHilighted'''(); ====<br />
<br />
:Returns true if entity is currently frobhilighted.<br />
<br />
==== scriptEvent float '''isInLiquid'''(); ====<br />
<br />
:Returns 1 if the entity is in or touching a liquid.<br />
<br />
==== scriptEvent float '''isLight'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''isNeutral'''(entity ent); ====<br />
<br />
:Returns true if the given entity is neutral.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isType'''(string spawnclass); ====<br />
<br />
:Returns true if this entity is of the given type.<br />
::''spawnclass'': spawn class name<br />
<br />
==== scriptEvent float '''loadExternalData'''(string declFile, string prefix); ====<br />
<br />
:Load an external xdata declaration.<br />
<br />
==== scriptEvent void '''noShadows'''(float noShadows); ====<br />
<br />
:Sets the noShadow property on the entity to true/false, turning shadowcasting on or off for this entity.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
<br />
==== scriptEvent void '''noShadowsDelayed'''(float noShadows, float delay); ====<br />
<br />
:Sets the noShadow property on the entity to true/false after delay in ms, turning shadows cast by this entity on or off.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
::''delay'': delay in ms<br />
<br />
==== scriptEvent float '''numBindChildren'''(); ====<br />
<br />
:Returns the number of bound entities lower down in the bind chain than this entity, but be sure to give it the topmost bindmaster<br />
<br />
==== scriptEvent float '''numTargets'''(); ====<br />
<br />
:Returns the number of entities this entity has targeted.<br />
<br />
==== scriptEvent void '''propagateSound'''(string soundName, float propVolMod, float msgTag); ====<br />
<br />
:Generates a propagated sound<br />
<br />
==== scriptEvent void '''propSound'''(string name); ====<br />
<br />
:Sound propagation scriptfunctions on all entities propagate a sound directly without playing an audible sound<br />
<br />
==== scriptEvent void '''propSoundMod'''(string name, float volMod); ====<br />
<br />
:propagate a sound directly with a volume modifier<br />
<br />
==== scriptEvent entity '''randomTarget'''(string ignoreName); ====<br />
<br />
:Returns a random targeted entity. Pass in an entity name to skip that entity.<br />
::''ignoreName'': the name of an entity to ignore<br />
<br />
==== scriptEvent float '''rangedThreatTo'''(entity target); ====<br />
<br />
:Could this entity threaten the given (target) entity from a distance?<br />
<br />
==== scriptEvent void '''removeBinds'''(); ====<br />
<br />
:Removes all attached entities from the game<br />
<br />
==== scriptEvent void '''removeFrobPeer'''(entity peer); ====<br />
<br />
:Removes the passed entity as frob peer.<br />
<br />
==== scriptEvent void '''removeKey'''(string key); ====<br />
<br />
:Removes a key from an object's spawnargs, so things like getNextKey() don't retrieve it.<br />
::''key'': the spawnarg to remove<br />
<br />
==== scriptEvent void '''removeTarget'''(entity target); ====<br />
<br />
:Remove a target from this entity.<br />
::''target'': the entity to remove from the targets<br />
<br />
==== scriptEvent float '''replaceInvItem'''(entity oldItem, entity newItem); ====<br />
<br />
:Replaces the entity <oldItem> with <newItem> in the inventory, while keeping <oldItem>'s inventory position intact. Note: The position guarantee only applies if <oldItem> and newItem share the same category. If the categories are different, the position of <newItem> is likely to be different than the one of <oldItem>. Note that <oldItem> will be removed from the inventory. If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens. Returns 1 if the operation was successful, 0 otherwise.<br />
::''newItem'': can be $null_entity<br />
<br />
==== scriptEvent void '''ResetTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''reskinCollisionModel'''(); ====<br />
<br />
:For use after setSkin() on moveables and static models, if the CM needs to be refreshed to update surface properties after a skin change. CM will be regenerated from the original model file with the new skin.<br />
<br />
==== scriptEvent void '''ResponseAdd'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseAllow'''(float type, entity responder); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
==== scriptEvent void '''ResponseIgnore'''(float type, entity responder); ====<br />
<br />
:This functions must be called on the stim entity. It will add the response to the ignore list, so that subsequent stims, should not trigger the stim anymore.<br />
<br />
==== scriptEvent void '''ResponseRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseSetAction'''(float type, string action); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseTrigger'''(entity source, float stimType); ====<br />
<br />
:Fires a response on this entity, without a stim (a stand-alone response, so to say)<br />
<br />
==== scriptEvent void '''RestartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''restorePosition'''(); ====<br />
<br />
:Returns this entity to the position stored in the "origin" spawn arg. This is the position the entity was spawned in unless the "origin" key is changed. Note that there is no guarantee that the entity won't be stuck in another entity when moved, so care should be taken to make sure that isn't possible.<br />
<br />
==== scriptEvent void '''setAngles'''(vector angles); ====<br />
<br />
:Sets the current orientation of this entity (relative to bind parent if any)<br />
::''angles'': the new orientation<br />
<br />
==== scriptEvent void '''setAngularVelocity'''(vector velocity); ====<br />
<br />
:Sets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
==== scriptEvent void '''setClipMask'''(float clipMask); ====<br />
<br />
:Sets the clipmask of the physics object.<br />
<br />
==== scriptEvent void '''setColor'''(float parm0, float parm1, float parm2); ====<br />
<br />
:Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
<br />
==== scriptEvent void '''setContents'''(float contents); ====<br />
<br />
:Sets the contents of the physics object.<br />
<br />
==== scriptEvent float '''setCurInvCategory'''(string categoryName); ====<br />
<br />
:Sets the inventory cursor to the first item of the named category. Returns 1 on success, 0 on failure (e.g. wrong category name)<br />
<br />
==== scriptEvent entity '''setCurInvItem'''(string itemName); ====<br />
<br />
:Sets the inventory cursor to the named item. Returns: the item entity of the newly selected item (can be $null_entity).<br />
<br />
==== scriptEvent void '''setDroppable'''(float droppable); ====<br />
<br />
:Set whether an item may be dropped from the inventory. <br />
::''droppable'': if non-zero the item becomes droppable, when called with 0 the item becomes non-droppable<br />
<br />
==== scriptEvent void '''setEntityRelation'''(entity ent, float relation); ====<br />
<br />
:Set a relation to another entity, this can be friendly (>0), neutral(0) or hostile (<0)<br />
<br />
==== scriptEvent void '''setFrobable'''(float frobable); ====<br />
<br />
:Set whether the entity is frobable<br />
<br />
==== scriptEvent void '''setGui'''(float handle, string guiFile); ====<br />
<br />
:Loads a new file into an existing GUI.<br />
<br />
==== scriptEvent void '''setGuiFloat'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiInt'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiString'''(float handle, string key, string val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiStringFromKey'''(float handle, string key, entity src, string srcKey); ====<br />
<br />
:This is a kludge. It is equivelant to: setGuiString( handle, key, src.getKey(srcKey) ) However, it's used to bypass the 127 char size limit on script strings.<br />
<br />
==== scriptEvent void '''setHealth'''(float health); ====<br />
<br />
:Use these to set the health of AI or players (this also updates the AI_DEAD flag)<br />
<br />
==== scriptEvent void '''setKey'''(string key, string value); ====<br />
<br />
:Sets a key on this entity's spawn args. Note that most spawn args are evaluated when this entity spawns in, so this will not change the entity's behavior in most cases. This is chiefly for saving data the script needs in an entity for later retrieval.<br />
::''key'': the spawnarg to set<br />
::''value'': the value to store<br />
<br />
==== scriptEvent void '''setLinearVelocity'''(vector velocity); ====<br />
<br />
:Sets the current linear velocity of this entity in units per second. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
==== scriptEvent void '''setModel'''(string modelName); ====<br />
<br />
:Sets the model this entity uses<br />
<br />
==== scriptEvent void '''setName'''(string name); ====<br />
<br />
:Sets the name of this entity.<br />
::''name'': the new name<br />
<br />
==== scriptEvent void '''setNeverDormant'''(float enable); ====<br />
<br />
:enables or prevents an entity from going dormant<br />
::''enable'': 1 = enable, 0 = disable<br />
<br />
==== scriptEvent void '''setOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (relative to it's bind parent if any)<br />
::''origin'': the new origin<br />
<br />
==== scriptEvent void '''setOwner'''(entity owner); ====<br />
<br />
:Sets the owner of this entity. Entities will never collide with their owner.<br />
::''owner'': the entity which will be made owner of this entity<br />
<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
==== scriptEvent void '''setShaderParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
::''parm3'': alpha<br />
<br />
==== scriptEvent void '''setSize'''(vector min, vector max); ====<br />
<br />
:Sets the size of this entity's bounding box.<br />
::''min'': minimum corner coordinates<br />
::''max'': maximum corner coordinates<br />
<br />
==== scriptEvent void '''setSkin'''(string skinName); ====<br />
<br />
:Sets the skin this entity uses. Set to "" to turn off the skin.<br />
<br />
==== scriptEvent void '''setSolid'''(float solidity); ====<br />
<br />
:Set the solidity of the entity. If the entity has never been solid before it will be assigned solid and opaque contents/clip masks.<br />
<br />
==== scriptEvent void '''setSoundVolume'''(float newLevel); ====<br />
<br />
:Set the volume of the sound to play, must be issued before startSoundShader.<br />
<br />
==== scriptEvent void '''setTeam'''(float newTeam); ====<br />
<br />
:Sets the team number of this entity.<br />
<br />
==== scriptEvent void '''SetTimerState'''(float stimId, float state); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setWorldOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (regardless of any bind parent).<br />
<br />
==== scriptEvent void '''show'''(); ====<br />
<br />
:Makes this entity visible if it has a model.<br />
<br />
==== scriptEvent void '''startFx'''(string fx); ====<br />
<br />
:Starts an FX on this entity.<br />
<br />
==== scriptEvent float '''startSound'''(string sound, float channel, float netSync); ====<br />
<br />
:Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound in seconds. This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.<br />
::''sound'': the spawnarg to reference, e.g. 'snd_move'<br />
::''channel'': the channel to play on<br />
::''netSync'': -<br />
<br />
==== scriptEvent float '''startSoundShader'''(string shaderName, float channel); ====<br />
<br />
:Plays a specific sound shader on the channel and returns the length of the sound in seconds. This is not the preferred method of playing a sound since you must ensure that the sound is loaded.<br />
::''shaderName'': the sound shader to play<br />
::''channel'': the channel to play the sound on<br />
<br />
==== scriptEvent void '''StartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''StimAdd'''(float type, float radius); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''StimClearIgnoreList'''(float type); ====<br />
<br />
:This clears the ignore list for the stim of the given type It can be used if an entity changes state in some way that it would no longer be ignored<br />
<br />
==== scriptEvent void '''StimEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
==== scriptEvent void '''StimRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''stopSound'''(float channel, float netSync); ====<br />
<br />
:Stops a specific sound shader on the channel.<br />
::''channel'': the channel to stop playback on<br />
::''netSync'': -<br />
<br />
==== scriptEvent void '''StopTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''teleportTo'''(entity other); ====<br />
<br />
:Teleports the entity to the position of the other entity, plus a possible offset and random offset (defined on the spawnargs of the entity to be teleported)<br />
<br />
==== scriptEvent float '''touches'''(entity other); ====<br />
<br />
:Returns true if this entity touches the other entity.<br />
::''other'': the entity to check against<br />
<br />
==== scriptEvent void '''unbind'''(); ====<br />
<br />
:Detaches this entity from its master.<br />
<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
=== idAnimatedEntity ===<br />
==== scriptEvent void '''clearAllJoints'''(); ====<br />
<br />
:Removes any custom transforms on all joints.<br />
<br />
==== scriptEvent void '''clearJoint'''(float jointnum); ====<br />
<br />
:Removes any custom transforms on the specified joint.<br />
<br />
==== scriptEvent vector '''getJointAngle'''(float jointnum); ====<br />
<br />
:Returns the angular orientation of the joint in world space.<br />
<br />
==== scriptEvent float '''getJointHandle'''(string jointname); ====<br />
<br />
:Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found.<br />
<br />
==== scriptEvent vector '''getJointPos'''(float jointnum); ====<br />
<br />
:Returns the position of the joint in world space.<br />
<br />
==== scriptEvent void '''setJointAngle'''(float jointnum, float transform_type, vector angles); ====<br />
<br />
:Modifies the orientation of the joint based on the transform type.<br />
<br />
==== scriptEvent void '''setJointPos'''(float jointnum, float transform_type, vector pos); ====<br />
<br />
:Modifies the position of the joint based on the transform type.<br />
<br />
=== CFrobButton ===<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
=== CFrobDoor ===<br />
==== scriptEvent entity '''GetDoorhandle'''(); ====<br />
<br />
:Returns the handle entity of this door. Can return NULL (== $null_entity)<br />
<br />
==== scriptEvent void '''OpenDoor'''(float master); ====<br />
<br />
:The OpenDoor method is necessary to give the FrobDoorHandles a "low level" open routine. The CFrobDoor::Open() call is re-routed to the FrobDoorHandle::Tap() method, so there must be a way to actually let the door open. Which is what this method does. Note: Shouldn't be called directly by scripters, call handle->Tap() instead. Unless you know what you're doing.<br />
<br />
=== CFrobDoorHandle ===<br />
==== scriptEvent entity '''GetDoor'''(); ====<br />
<br />
:Returns the associated door entity for this handle.<br />
<br />
=== CFrobHandle ===<br />
==== scriptEvent void '''Tap'''(); ====<br />
<br />
:Operates this handle.<br />
<br />
=== CFrobLever ===<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
==== scriptEvent void '''Switch'''(float newState); ====<br />
<br />
:Move the lever to the on or off position (0 = off).<br />
<br />
=== CFrobLock ===<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
=== CFrobLockHandle ===<br />
==== scriptEvent entity '''GetLock'''(); ====<br />
<br />
:Returns the associated lock of this handle.<br />
<br />
=== tdmFuncShooter ===<br />
==== scriptEvent void '''shooterFireProjectile'''(); ====<br />
<br />
:Fires a projectile.<br />
<br />
==== scriptEvent float '''shooterGetAmmo'''(); ====<br />
<br />
:Get the ammonition<br />
<br />
==== scriptEvent float '''shooterGetState'''(); ====<br />
<br />
:Returns the current state of this shooter.<br />
<br />
==== scriptEvent void '''shooterSetAmmo'''(float newAmmo); ====<br />
<br />
:Set the ammonition<br />
<br />
==== scriptEvent void '''shooterSetState'''(float state); ====<br />
<br />
:Activates / deactivates the shooter entity.<br />
::''state'': 1 = active, 0 = inactive<br />
<br />
=== idEntityFx ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idItem ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''respawn'''(); ====<br />
<br />
:Respawn<br />
<br />
=== idMoveableItem ===<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
=== idLight ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''fadeInLight'''(float time); ====<br />
<br />
:Turns the light on over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeOutLight'''(float time); ====<br />
<br />
:Turns the light out over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeToLight'''(vector color, float time); ====<br />
<br />
:Fades the light to the given color over a given time.<br />
<br />
==== scriptEvent float '''getLightLevel'''(); ====<br />
<br />
:Get level (intensity) of a light, <= 0.0 indicates it is off<br />
<br />
==== scriptEvent vector '''getLightOrigin'''(); ====<br />
<br />
:Get the light origin (independent of its visual model)<br />
<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
==== scriptEvent vector '''getRadius'''(); ====<br />
<br />
:Returns the light radius.<br />
<br />
==== scriptEvent string '''getShader'''(); ====<br />
<br />
:Gets the shader name used by the light.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
==== scriptEvent void '''setLightOrigin'''(vector pos); ====<br />
<br />
:Set origin of lights independent of model origin<br />
<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
==== scriptEvent void '''setRadius'''(float radius); ====<br />
<br />
:Sets the size of the bounding box, x=y=z=radius.<br />
<br />
==== scriptEvent void '''setRadiusXYZ'''(float x, float y, float z); ====<br />
<br />
:Sets the width/length/height of the light bounding box.<br />
<br />
==== scriptEvent void '''setShader'''(string shader); ====<br />
<br />
:Sets the shader to be used for the light.<br />
<br />
==== scriptEvent void '''setStartedOff'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''smoking'''(float state); ====<br />
<br />
:flame is now smoking (1), or not (0)<br />
::''state'': 1 = smoking, 0 = not smoking<br />
<br />
=== idListener ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPlayerStart ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idActivator ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPathCorner ===<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
=== idDamagable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idExplodable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idForceField ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''Toggle'''(); ====<br />
<br />
:Turns the forcefield on and off.<br />
<br />
=== idAnimated ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
==== scriptEvent void '''launchMissiles'''(string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay); ====<br />
<br />
:Launches a projectile.<br />
<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''startRagdoll'''(); ====<br />
<br />
:Switches to a ragdoll taking over the animation.<br />
<br />
=== idStaticEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncSmoke ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idVacuumSeparatorEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPortalEntity ===<br />
==== scriptEvent float '''getPortalHandle'''(); ====<br />
<br />
:Returns the portal handle.<br />
<br />
==== scriptEvent float '''getSoundLoss'''(); ====<br />
<br />
:Returns the sound loss value (dB).<br />
<br />
==== scriptEvent void '''setSoundLoss'''(float loss); ====<br />
<br />
:Sets the sound loss value (dB).<br />
<br />
=== idBeam ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idShaking ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idEarthQuake ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncPortal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncAASPortal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncAASObstacle ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPhantomObjects ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPortalSky ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== tdmVine ===<br />
==== scriptEvent void '''addDescendant'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent float '''canWater'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''clearWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent entity '''getPrime'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''scaleVine'''(float factor); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''setPrime'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''setWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
=== idMoveable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
==== scriptEvent void '''enableDamage'''(float enable); ====<br />
<br />
:enable/disable damage<br />
<br />
==== scriptEvent float '''isAtRest'''(); ====<br />
<br />
:Returns true if object is not moving<br />
<br />
=== idMover ===<br />
==== scriptEvent void '''accelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover accelerates.<br />
<br />
==== scriptEvent void '''accelTime'''(float time); ====<br />
<br />
:Sets the acceleration time. Set this acceleration time before initiating a new move.<br />
<br />
==== scriptEvent void '''accelTo'''(float speed, float time); ====<br />
<br />
:Initiates an acceleration to the given speed over the given time in seconds.<br />
<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''bob'''(float speed, float phase, vector distance); ====<br />
<br />
:Initiates a translation back and forth along the given vector with the given speed and phase.<br />
<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''decelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover decelerates.<br />
<br />
==== scriptEvent void '''decelTime'''(float time); ====<br />
<br />
:Sets the deceleration time. Set this deceleration time before initiating a new move.<br />
<br />
==== scriptEvent void '''decelTo'''(float speed, float time); ====<br />
<br />
:Initiates a deceleration to the given speed over the given time in seconds.<br />
<br />
==== scriptEvent void '''disableSplineAngles'''(); ====<br />
<br />
:Disables aligning the mover with the spline direction.<br />
<br />
==== scriptEvent void '''enableSplineAngles'''(); ====<br />
<br />
:Enables aligning the mover with the spline direction.<br />
<br />
==== scriptEvent float '''getMoveSpeed'''(); ====<br />
<br />
:Get the movement speed.<br />
<br />
==== scriptEvent float '''getMoveTime'''(); ====<br />
<br />
:Gets the movement time.<br />
<br />
==== scriptEvent float '''isMoving'''(); ====<br />
<br />
:Returns true if a mover is moving<br />
<br />
==== scriptEvent float '''isRotating'''(); ====<br />
<br />
:Returns true if a mover is rotating<br />
<br />
==== scriptEvent void '''move'''(float angle, float distance); ====<br />
<br />
:Initiates a translation with the given distance in the given yaw direction. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''moveSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the moving.<br />
<br />
==== scriptEvent void '''moveTo'''(entity targetEntity); ====<br />
<br />
:Initiates a translation to the position of an entity. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''moveToPos'''(vector pos); ====<br />
<br />
:Initiates a translation to an absolute position. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''removeInitialSplineAngles'''(); ====<br />
<br />
:Subtracts the initial spline angles to maintain the initial orientation of the mover.<br />
<br />
==== scriptEvent void '''rotate'''(vector angleSpeed); ====<br />
<br />
:Initiates a rotation with the given angular speed. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateDownTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by decreasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateOnce'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the current angles plus the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateTo'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateUpTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by increasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''speed'''(float speed); ====<br />
<br />
:Sets the movement speed. Set this speed before initiating a new move.<br />
<br />
==== scriptEvent void '''startSpline'''(entity spline); ====<br />
<br />
:Starts moving along a spline stored on the given entity.<br />
<br />
==== scriptEvent void '''stopMoving'''(); ====<br />
<br />
:Stops any translational movement.<br />
<br />
==== scriptEvent void '''stopRotating'''(); ====<br />
<br />
:Stops any rotational movement.<br />
<br />
==== scriptEvent void '''stopSpline'''(); ====<br />
<br />
:Stops moving along a spline.<br />
<br />
==== scriptEvent void '''sway'''(float speed, float phase, vector angles); ====<br />
<br />
:Initiates a rotation back and forth along the given angles with the given speed and phase.<br />
<br />
==== scriptEvent void '''time'''(float time); ====<br />
<br />
:Sets the movement time. Set this time before initiating a new move.<br />
<br />
=== idMover_Binary ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
=== idRotater ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idRiser ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPlayer ===<br />
==== scriptEvent void '''changeWeaponName'''(string weaponName, string displayName); ====<br />
<br />
:Changes the display name of the given weapon item to something different. Pass an empty string to reset the display name to the definition as found in the weaponDef.<br />
<br />
==== scriptEvent void '''changeWeaponProjectile'''(string weaponName, string projectileDefName); ====<br />
<br />
:Changes the projectile entityDef name of the given weapon (e.g. "broadhead") to the specified entityDef (e.g. "atdm:projectile_broadhead").<br />
<br />
==== scriptEvent void '''checkAAS'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''clearActiveInventoryMap'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
==== scriptEvent void '''clearActiveInventoryMapEnt'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
==== scriptEvent void '''clearMouseDeadTime'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''customDeath'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''deathMenu'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''disableWeapon'''(); ====<br />
<br />
:Lowers and disables the player weapon.<br />
<br />
==== scriptEvent void '''enableWeapon'''(); ====<br />
<br />
:Enables the player weapon.<br />
<br />
==== scriptEvent void '''endZoom'''(float duration); ====<br />
<br />
:Starts the zoom out event, which performs a gradual transition back to the default FOV. May be called during a transition as well to intercept a pending zoom in transition.<br />
::''duration'': duration of the transition in msec<br />
<br />
==== scriptEvent void '''exitTeleporter'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getButtons'''(); ====<br />
<br />
:Returns the button state from the current user command.<br />
<br />
==== scriptEvent float '''getCalibratedLightgemValue'''(); ====<br />
<br />
:Returns the calibrated light gem value.<br />
<br />
==== scriptEvent string '''getCurrentWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player is currently holding.<br />
<br />
==== scriptEvent string '''getCurWeaponName'''(); ====<br />
<br />
:Returns the name of the current weapon, as defined by "inv_weapon_name" in the weaponDef.<br />
<br />
==== scriptEvent entity '''getDragged'''(); ====<br />
<br />
:Returns the currently dragged body. Returns $null_entity if the body is shouldered, the player has nothing in his hands, or he has a non-AF entity in his hands. See also getShouldered(), getGrabbed() and getFrobbed().<br />
<br />
==== scriptEvent float '''getFov'''(); ====<br />
<br />
:This returns the current FOV of the player. You can modify the current FOV with startZoom() and endZoom().<br />
<br />
==== scriptEvent entity '''getFrobbed'''(); ====<br />
<br />
:Returns the currently frobhilighted entity. This includes entities the player has in his hands. Sets "frob only used by" mode<br />
<br />
==== scriptEvent entity '''getGrabbed'''(); ====<br />
<br />
:Returns the currently entity in the players hands. Returns $null_entity if the player has nothing in his hands Dragging or shouldering a body counts as grabbing it. See also getDragged(), getShouldered(), getFrobbed().<br />
<br />
==== scriptEvent vector '''getHinderance'''(string source); ====<br />
<br />
:Used to get hinderance from a source.<br />
<br />
==== scriptEvent float '''getImmobilization'''(string source); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent float '''getInventoryOverlay'''(); ====<br />
<br />
:Gets the default inventory overlay for the player. All other entities will return an invalid value.<br />
<br />
==== scriptEvent vector '''getListenLoc'''(); ====<br />
<br />
:Retrieves the location of the listener when leaning.<br />
<br />
==== scriptEvent float '''getMouseGesture'''(); ====<br />
<br />
:Returns the results of the last mouse gesture in enum form. (see the definition for MOUSEDIR_* for which numbers correspond to which directions)<br />
<br />
==== scriptEvent vector '''getMove'''(); ====<br />
<br />
:Returns the movement relative to the player's view angles from the current user command. vector_x = forward, vector_y = right, vector_z = up<br />
<br />
==== scriptEvent string '''getNextHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get the next hinderance from a source.<br />
<br />
==== scriptEvent string '''getNextImmobilization'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent string '''getNextTurnHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Get the next hinderance on the view turning from a source<br />
<br />
==== scriptEvent float '''getObjectiveComp'''(float ObjNum, float CompNum); ====<br />
<br />
:Used to get the state of custom objective components<br />
::''ObjNum'': Starts counting at 1<br />
::''CompNum'': Starts counting at 1<br />
<br />
==== scriptEvent float '''getObjectiveState'''(float ObjNum); ====<br />
<br />
:Returns the current state of the objective with the number ObjNum. State is one of the following: OBJ_INCOMPLETE = 0, OBJ_COMPLETE = 1, OBJ_INVALID = 2, OBJ_FAILED = 3<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent float '''getObjectiveVisible'''(float ObjNum); ====<br />
<br />
:Returns the current visibility of the objective with the number ObjNum.<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent string '''getPreviousWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player was previously holding.<br />
<br />
==== scriptEvent entity '''getShouldered'''(); ====<br />
<br />
:Returns the currently shouldered body, otherwise $null_entity. See also getDragged(), getGrabbed() and getFrobbed().<br />
<br />
==== scriptEvent vector '''getTurnHinderance'''(string source); ====<br />
<br />
:* Get the hinderance on the view turning from a source<br />
<br />
==== scriptEvent vector '''getViewAngles'''(); ====<br />
<br />
:Returns the player view angles.<br />
<br />
==== scriptEvent entity '''getWeaponEntity'''(); ====<br />
<br />
:Returns the entity for the player's weapon<br />
<br />
==== scriptEvent void '''giveHealthPool'''(float amount); ====<br />
<br />
:This increases/decreases the healthpool of the player by the given amount. The healthpool is gradually decreased over time, healing (damaging?) the player.<br />
<br />
==== scriptEvent entity '''heldEntity'''(); ====<br />
<br />
:Returns the entity currently being held, or $null_entity if the player's hands are empty.<br />
<br />
==== scriptEvent float '''holdEntity'''(entity entity); ====<br />
<br />
:Forces the player to hold an entity (e.g. puts it into the grabber). Drops whatever is in the player's hands if $null_entity is passed to it. Returns 1 if successful, 0 if not.<br />
<br />
==== scriptEvent float '''isLeaning'''(); ====<br />
<br />
:Get whether the player is leaning<br />
<br />
==== scriptEvent float '''isPeekLeaning'''(); ====<br />
<br />
:Get whether the player is peek leaning (against a keyhole or crack)<br />
<br />
==== scriptEvent void '''missionFailed'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''missionSuccess'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''mouseGestureFinished'''(); ====<br />
<br />
:Returns true if the player is not currently doing a mouse gesture.<br />
<br />
==== scriptEvent void '''objectiveCompUnlatch'''(float ObjNum, float CompNum); ====<br />
<br />
:Unlatch an irreversible objective component that has latched into a state<br />
<br />
==== scriptEvent void '''objectiveUnlatch'''(float ObjNum); ====<br />
<br />
:Unlatch an irreversible objective that has latched into a state<br />
<br />
==== scriptEvent void '''pauseGame'''(); ====<br />
<br />
:Pauses the game. This should only be called for threads that are explicitly maintained by a special SDK method, because ordinary threads won't get executed during g_stopTime == true. Note: This is used by the objective GUI threads. Note: Must be called on the player entity, not the sys entity.<br />
<br />
==== scriptEvent void '''playStartSound'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''readLightgemModifierFromWorldspawn'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''resetWeaponProjectile'''(string weaponName); ====<br />
<br />
:Reloads the original projectile def name from the weaponDef. Used to revert a change made by the event changeWeaponProjectile().<br />
<br />
==== scriptEvent void '''resetZoom'''(); ====<br />
<br />
:Cancels any pending zoom transitions and resets the FOV to normal.<br />
<br />
==== scriptEvent void '''ropeRemovalCleanup'''(entity ropeEnt); ====<br />
<br />
:Called when rope arrow ropes are removed, removes stale pointers on the player object.<br />
<br />
==== scriptEvent void '''saveGame'''(string filename); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''selectWeapon'''(string weapon); ====<br />
<br />
:Selects the weapon the player is holding.<br />
<br />
==== scriptEvent void '''setActiveInventoryMapEnt'''(entity mapEnt); ====<br />
<br />
:Notify the player about a new active map entity. This clears out any previously active maps.<br />
<br />
==== scriptEvent void '''setFrobOnlyUsedByInv'''(float OnOff); ====<br />
<br />
:Engages or disengages a mode where we only frobhilight entities that can be used by our current inventory item. This also disables general frobactions and only allows "used by" frob actions.<br />
<br />
==== scriptEvent void '''setHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Used to set hinderance from a source.<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
==== scriptEvent void '''setImmobilization'''(string source, float type); ====<br />
<br />
:Used to set immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent void '''setLightgemModifier'''(string modifierName, float value); ====<br />
<br />
:Sets the named lightgem modifier to a certain value. An example would be the player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers can be set by concurrent script threads.<br />
<br />
==== scriptEvent void '''setObjectiveComp'''(float ObjNum, float CompNum, float state); ====<br />
<br />
:Used to set the state of custom objective components<br />
::''ObjNum'': objective number. Starts counting at 1<br />
::''CompNum'': component number. Starts counting at 1<br />
::''state'': 1 or 0 for true or false<br />
<br />
==== scriptEvent void '''setObjectiveEnabling'''(float ObjNum, string strIn); ====<br />
<br />
:Set an objective's enabling objectives (objectives that must be completed before that objective may be completed).<br />
::''strIn'': takes the form of a string that is a space-delimited list of integer objectives representing the new enabling objectives. E.g. : '1 2 3 4'<br />
<br />
==== scriptEvent void '''setObjectiveNotification'''(float ObjNote); ====<br />
<br />
:Turns the notifications (sound ++ text) for objectives on/off.<br />
::''ObjNote'': Turn notifications on/off<br />
<br />
==== scriptEvent void '''setObjectiveOngoing'''(float ObjNum, float val); ====<br />
<br />
:Sets objective ongoing.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setObjectiveOptional'''(float ObjNum, float val); ====<br />
<br />
:Sets objective mandatory.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setObjectiveState'''(float ObjNum, float State); ====<br />
<br />
:Used to set the state of objectives from the script. For example, use this to invalidate an objective when something happens in your mission. The first argument is the numerical index of the objective (taking 'user' objective indices, starting at 1). Choose from the following for the second argument: OBJ_INCOMPLETE, OBJ_COMPLETE, OBJ_INVALID, OBJ_FAILED. Use this on $player1 like $player1.setObjectiveState(1, OBJ_COMPLETE);<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent void '''setObjectiveText'''(float ObjNum, string newText); ====<br />
<br />
:Modify the displayed text for an objective. Can also be a string template like #str_20000<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent void '''setObjectiveVisible'''(float ObjNum, float val); ====<br />
<br />
:Sets objective visibility.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setPeekOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for peeking, depending on aspect ratio.<br />
<br />
==== scriptEvent void '''setPeekView'''(float OnOff, vector origin); ====<br />
<br />
:Toggle whether we should use a view from a peek entity as the player's view<br />
<br />
==== scriptEvent void '''setSavePermissions'''(float permission); ====<br />
<br />
:No description<br />
::''permission'': 0<br />
<br />
==== scriptEvent void '''setSpyglassOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for the spyglass, depending on aspect ratio.<br />
<br />
==== scriptEvent void '''setTurnHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Set the hinderance on the view turning from a source<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
==== scriptEvent void '''setViewAngles'''(vector angles); ====<br />
<br />
:Sets the player view angles, e.g. make the player facing this direction. 0 0 0 is east (along the X axis in DR), 0 90 0 north (along the Y axis in DR) 0 180 0 west, 0 270 0 south.<br />
<br />
==== scriptEvent void '''startGamePlayTimer'''(); ====<br />
<br />
:Resets the game play timer to zero and (re)starts it.<br />
<br />
==== scriptEvent void '''startMouseGesture'''(float key, float thresh, float test, float inverted, float turnHinderance, float decideTime, float deadTime); ====<br />
<br />
:Start tracking a mouse gesture that started when the key impulse was pressed. Discretizes analog mouse movement into a few different gesture possibilities. Impulse arg can also be a button, see the UB_* enum in usercmdgen.h. For now, only one mouse gesture check at a time.<br />
::''thresh'': Waits until the threshold mouse input thresh is reached before deciding.<br />
::''test'': determines which test to do (0 = up/down, 1 = left/right, 2 = 4 directions, 3 = 8 directions).<br />
::''inverted'': inverts the movement if set to 1, does not if 0<br />
::''turnHinderance'': Sets the max player view turn rate when checking this mouse gesture (0 => player view locked, 1.0 => no effect on view turning)<br />
::''decideTime'': time in milliseconds after which the mouse gesture is auto-decided, in the event that the mouse movement threshold was not reached. A DecideTime of -1 means wait forever until the button is released.<br />
::''deadTime'': how long after attack is pressed that mouse control remains dampened by the fraction turnHinderance.<br />
<br />
==== scriptEvent void '''startZoom'''(float duration, float startFOV, float endFOV); ====<br />
<br />
:Call this to start the zoom in event. The player FOV is gradually zoomed in until over the given timespan.<br />
::''duration'': duration of the transition in msec<br />
::''startFOV'': The start FOV, this is clamped to [1..179]<br />
::''endFOV'': The end FOV, this is clamped to [1..179]<br />
<br />
==== scriptEvent void '''stopFxFov'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''stopMouseGesture'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''testEvent1'''(float float_pi, float int_beef, float float_exp, string string_tdm, float float_exp10, float int_food); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''testEvent2'''(float int_prevres, vector vec_123, float int_food, entity ent_player, entity ent_null, float float_pi, float float_exp); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent vector '''testEvent3'''(entity ent_prevres, vector vec_123, float float_pi, entity ent_player); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''triggerMissionEnd'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''unpauseGame'''(); ====<br />
<br />
:Unpauses the game. Most scripts are not executed during g_stopTime == true and won't get into the position of calling this.<br />
<br />
==== scriptEvent float '''wasDamaged'''(); ====<br />
<br />
:Check if the player was damaged this frame.<br />
<br />
=== idProjectile ===<br />
==== scriptEvent float '''getProjectileState'''(); ====<br />
<br />
:Gets the current state of the projectile. States are defined in tdm_defs.script<br />
<br />
==== scriptEvent void '''launch'''(vector start, vector dir, vector velocity); ====<br />
<br />
:Launches the projectile from <start> in direction <dir> with the given <velocity><br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
=== CProjectileResult ===<br />
==== scriptEvent entity '''getActualStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getAxialDir'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getFinalAngVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getFinalVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''getIncidenceAngle'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''getProjMass'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent entity '''getStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getSurfNormal'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent string '''getSurfType'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''isVineFriendly'''(); ====<br />
<br />
:Vine-arrow event<br />
<br />
=== CTarget_SetRelations ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetEntityRelation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeEntityRelation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idThread ===<br />
==== scriptEvent float '''acos'''(float cosine); ====<br />
<br />
:Returns the angle in degrees with the given cosine.<br />
<br />
==== scriptEvent vector '''angToForward'''(vector angles); ====<br />
<br />
:Returns a forward vector for the given Euler angles.<br />
<br />
==== scriptEvent vector '''angToRight'''(vector angles); ====<br />
<br />
:Returns a right vector for the given Euler angles.<br />
<br />
==== scriptEvent vector '''angToUp'''(vector angles); ====<br />
<br />
:Returns an up vector for the given Euler angles.<br />
<br />
==== scriptEvent float '''asin'''(float sine); ====<br />
<br />
:Returns the angle in degrees with the given sine.<br />
<br />
==== scriptEvent void '''assert'''(float condition); ====<br />
<br />
:Breaks if the condition is zero. (Only works in debug builds.)<br />
<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
==== scriptEvent float '''canPlant'''(vector traceStart, vector traceEnd, entity ignore, entity vine); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''ceil'''(float x); ====<br />
<br />
:Returns the smallest integer that is greater than or equal to the given value.<br />
<br />
==== scriptEvent void '''clearPersistantArgs'''(); ====<br />
<br />
:Clears data that persists between maps.<br />
<br />
==== scriptEvent void '''clearSignalThread'''(float signalNum, entity ent); ====<br />
<br />
:Clears the script callback function set for when the given signal is raised on the given entity.<br />
<br />
==== scriptEvent void '''copySpawnArgs'''(entity ent); ====<br />
<br />
:copies the spawn args from an entity<br />
<br />
==== scriptEvent float '''cos'''(float degrees); ====<br />
<br />
:Returns the cosine of the given angle in degrees.<br />
<br />
==== scriptEvent vector '''CrossProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the cross product of the two vectors.<br />
<br />
==== scriptEvent void '''debugArrow'''(vector color, vector start, vector end, float size, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugBounds'''(vector color, vector mins, vector maxs, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugCircle'''(vector color, vector origin, vector dir, float radius, float numSteps, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugLine'''(vector color, vector start, vector end, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent float '''DotProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the dot product of the two vectors.<br />
<br />
==== scriptEvent void '''drawText'''(string text, vector origin, float scale, vector color, float align, float lifetime); ====<br />
<br />
:text drawing for debugging. lifetime of 0 == 1 frame.<br />
::''align'': 0 = left, 1 = center, 2 = right<br />
<br />
==== scriptEvent float '''emitParticle'''(string particle, float startTime, float diversity, vector origin, vector angle); ====<br />
<br />
:Start a particle effect in the world without using an entity emitter. Will emit one quad per particle stage when first called with sys.getTime() as the start time. Designed to be called once per frame with the same startTime each call to achieve a normal particle effect, or on demand with sys.getTime() as the startTime for finer grained control, 1 quad at a time. Returns True (1) if there are more particles to be emitted from the stage, False (0) if the stage has released all its quads.<br />
::''particle'': String: name of particle effect.<br />
::''startTime'': Game seconds since map start: use sys.getTime() for the first call unless you want to back-date the particle so that it starts part way through its cycle.<br />
::''diversity'': Randomizer value between 0 and 1. All particles with the same diversity will have the same path and rotation. Use sys.random(1) for a random path.<br />
::''origin'': Origin of the particle effect.<br />
::''angle'': Axis for the particle effect. Use $<entityname>.getAngles() to align the particle to an entity. use '0 0 0' for an upright (world-aligned) particle effect.<br />
<br />
==== scriptEvent void '''error'''(string text); ====<br />
<br />
:Issues an error.<br />
<br />
==== scriptEvent void '''fadeIn'''(vector color, float time); ====<br />
<br />
:Fades towards the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeOut'''(vector color, float time); ====<br />
<br />
:Fades from the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeTo'''(vector color, float alpha, float time); ====<br />
<br />
:Fades to the given color up to the given alpha over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''firstPerson'''(); ====<br />
<br />
:Returns view control to the player entity.<br />
<br />
==== scriptEvent float '''floor'''(float x); ====<br />
<br />
:Returns the largest integer that is less than or equal to the given value.<br />
<br />
==== scriptEvent float '''getCurrentMissionNum'''(); ====<br />
<br />
:Returns the number of the current mission (0-based, the first mission has number 0).<br />
<br />
==== scriptEvent string '''getcvar'''(string name); ====<br />
<br />
:Returns the string for a cvar.<br />
<br />
==== scriptEvent float '''getDifficultyLevel'''(); ====<br />
<br />
:Returns 0 (Easy), 1 (Medium) or 2 (Hard), depending on the difficulty level of the current mission.<br />
<br />
==== scriptEvent string '''getDifficultyName'''(float difficultyLevel); ====<br />
<br />
:Returns the (translated) name of the difficulty level passed as the argument.<br />
::''difficultyLevel'': 0 (Easy), 1 (Medium), 2 (Hard)<br />
<br />
==== scriptEvent entity '''getEntity'''(string name); ====<br />
<br />
:Returns a reference to the entity with the specified name.<br />
<br />
==== scriptEvent float '''getFrameTime'''(); ====<br />
<br />
:returns the length of time between game frames. this is not related to renderer frame rate.<br />
<br />
==== scriptEvent entity '''getLocationPoint'''(vector point); ====<br />
<br />
:Returns the idLocation entity corresponding to the specified point's location.<br />
::''point'': point whose location to check<br />
<br />
==== scriptEvent entity '''getMainAmbientLight'''(); ====<br />
<br />
:Returns the entity of the main ambient light.<br />
<br />
==== scriptEvent float '''getMissionStatistic'''(string statisticName); ====<br />
<br />
:Returns current mission statistic.<br />
::''statisticName'': Can be one of (case insensitive): gamePlayTime: gameplay time in seconds damageDealt: damage dealt to enemies damageReceived: damage received by player healthReceived: health received by player pocketsPicked: pockets picked by player foundLoot: loot found by player missionLoot: total loot available in mission totalTimePlayerSeen: total time the player was seen by enemies in seconds. Updates only when AI lose sight of player numberTimesPlayerSeen: number of times player was seen by enemies numberTimesAISuspicious: number of times AI was 'observant' or 'suspicious'. A single AI passing through both alert levels will add 2 to the score. numberTimesAISearched: number of times AI was 'investigating' or 'searching'. A single AI passing through both alert levels will add 2 to the score. sightingScore: sighting score (number of times player was seen * weight) stealthScore: stealth score (sighting score + alerts * weights) killedByPlayer: number of enemies killed by player knockedOutByPlayer: number of enemies knocked out by player bodiesFound: number of times enemies have spotted a body secretsFound: number of secrets found by the player secretsTotal: total number of secrets in the mission <br />
<br />
==== scriptEvent entity '''getNextEntity'''(string key, string value, entity lastMatch); ====<br />
<br />
:Discover all entities in the map. Returns $null_entity when no more found.<br />
::''key'': Optional string: prefix for spawnarg key match. E.g. "target" will match "target", "target1" etc.<br />
::''value'': Optional string: spawnarg value to match. Can be used independently of ''key''. If ''key'' is not set, all spawnargs will be checked for the value.<br />
::''lastMatch'': Last match: search will start after this entity. Use $null_entity or pass an uninitialized entity variable to start a new search.<br />
<br />
==== scriptEvent float '''getPersistantFloat'''(string key); ====<br />
<br />
:Returns the floating point value for the given persistent arg<br />
<br />
==== scriptEvent string '''getPersistantString'''(string key); ====<br />
<br />
:Returns the string for the given persistent arg<br />
<br />
==== scriptEvent vector '''getPersistantVector'''(string key); ====<br />
<br />
:Returns the vector for the given persistent arg<br />
<br />
==== scriptEvent float '''getPortAISoundLoss'''(float handle); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getPortPlayerSoundLoss'''(float handle); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getPortSoundLoss'''(float handle); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getRelation'''(float team1, float team2); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getTDMVersion'''(); ====<br />
<br />
:Get the current TDM version as integer. The value will be 108 for v1.08, 109 for v1.09 and 200 for v2.00 etc.<br />
<br />
==== scriptEvent float '''getTicsPerSecond'''(); ====<br />
<br />
:returns the number of game frames per second. this is not related to renderer frame rate.<br />
<br />
==== scriptEvent float '''getTime'''(); ====<br />
<br />
:Returns the current game time in seconds.<br />
<br />
==== scriptEvent string '''getTraceBody'''(); ====<br />
<br />
:Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent vector '''getTraceEndPos'''(); ====<br />
<br />
:Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint<br />
<br />
==== scriptEvent entity '''getTraceEntity'''(); ====<br />
<br />
:Returns a reference to the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent float '''getTraceFraction'''(); ====<br />
<br />
:Returns the fraction of movement completed during the last call to trace or tracePoint.<br />
<br />
==== scriptEvent string '''getTraceJoint'''(); ====<br />
<br />
:Returns the number of the skeletal joint closest to the location on the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent vector '''getTraceNormal'''(); ====<br />
<br />
:Returns the normal of the hit plane during the last call to trace or tracePoint<br />
<br />
==== scriptEvent string '''getTraceSurfType'''(); ====<br />
<br />
:Returns the type of the surface (i.e. metal, snow) which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent void '''handleMissionEvent'''(entity objEnt, float eventType, string argument); ====<br />
<br />
:Generic interface for passing on mission events from scripts to the SDK. Available since TDM 1.02<br />
::''objEnt'': the entity that triggered this event (e.g. a readable)<br />
::''eventType'': a numeric identifier (enumerated both in MissionData.h and tdm_defs.script) specifying the type of event<br />
::''argument'': an optional string parameter, eventtype-specific.<br />
<br />
==== scriptEvent float '''influenceActive'''(); ====<br />
<br />
:Checks if an influence is active<br />
<br />
==== scriptEvent void '''killthread'''(string threadName); ====<br />
<br />
:Kills all threads with the specified name<br />
<br />
==== scriptEvent float '''log'''(float x); ====<br />
<br />
:Returns the log of the given argument.<br />
<br />
==== scriptEvent void '''logString'''(float logClass, float logType, string output); ====<br />
<br />
:This is the script counterpart to DM_LOG<br />
<br />
==== scriptEvent void '''music'''(string shaderName); ====<br />
<br />
:Starts playing background music.<br />
<br />
==== scriptEvent void '''offsetRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''onSignal'''(float signalNum, entity ent, string functionName); ====<br />
<br />
:Sets a script callback function for when the given signal is raised on the given entity.<br />
<br />
==== scriptEvent void '''pause'''(); ====<br />
<br />
:Pauses the current thread.<br />
<br />
==== scriptEvent float '''pointInLiquid'''(vector point, entity ignoreEntity); ====<br />
<br />
:Checks if a point is in a liquid, returns 1 if this is the case.<br />
<br />
==== scriptEvent float '''pointIsInBounds'''(vector point, vector mins, vector maxs); ====<br />
<br />
:Returns true if the point is within the bounds specified.<br />
::''point'': test whether this point is in the bounds<br />
::''mins'': minimal corner of the bounds<br />
::''maxs'': maximal corner of the bounds<br />
<br />
==== scriptEvent float '''pow'''(float x, float y); ====<br />
<br />
:Returns the power of x to y.<br />
<br />
==== scriptEvent void '''print'''(string text); ====<br />
<br />
:Prints the given string to the console.<br />
<br />
==== scriptEvent void '''println'''(string text); ====<br />
<br />
:Prints the given line to the console.<br />
<br />
==== scriptEvent void '''projectDecal'''(vector traceOrigin, vector traceEnd, entity passEntity, string decal, float decalSize, float angle); ====<br />
<br />
:Performs a trace from the specified origin and end positions, then projects a decal in that direction.<br />
::''traceOrigin'': Start of the trace.<br />
::''traceEnd'': End of the trace.<br />
::''passEntity'': This entity will be considered non-solid by the trace.<br />
::''decal'': Decal to be projected.<br />
::''decalSize'': Size of the decal quad.<br />
::''angle'': Angle of the decal quad.<br />
<br />
==== scriptEvent void '''radiusDamage'''(vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower); ====<br />
<br />
:damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile).<br />
::''inflictor'': the entity causing the damage<br />
::''ignore'': an entity to not cause damage to<br />
::''dmgPower'': scales the damage (for cases where damage is dependent on time)<br />
<br />
==== scriptEvent float '''random'''(float range); ====<br />
<br />
:Returns a random value X where 0 <= X < range.<br />
<br />
==== scriptEvent void '''saveConDump'''(string cmd, string cmd); ====<br />
<br />
:Saves condump into FM directory; first argument is appended to dump filename, everything before last occurence of second argument is removed<br />
<br />
==== scriptEvent void '''say'''(string text); ====<br />
<br />
:Multiplayer - Print this line on the network<br />
<br />
==== scriptEvent void '''sessionCommand'''(string cmd); ====<br />
<br />
:Sends the sessioncommand to the game<br />
<br />
==== scriptEvent void '''setCamera'''(entity cameraEnt); ====<br />
<br />
:Turns over view control to the given camera entity.<br />
<br />
==== scriptEvent void '''setcvar'''(string name, string value); ====<br />
<br />
:Sets a cvar.<br />
<br />
==== scriptEvent void '''setPersistantArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair that persists between maps<br />
<br />
==== scriptEvent void '''setPortAISoundLoss'''(float handle, float value); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setPortPlayerSoundLoss'''(float handle, float value); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setPortSoundLoss'''(float handle, float value); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setSecretsFound'''(float secrets); ====<br />
<br />
:Set how many secrets the player has found. Use getMissionStatistic() for getting the current value.<br />
<br />
==== scriptEvent void '''setSecretsTotal'''(float secrets); ====<br />
<br />
:Set how many secrets exist in the map in total. Use getMissionStatistic() for getting the current value.<br />
<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
==== scriptEvent void '''setSpawnArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair to be used when a new entity is spawned.<br />
<br />
==== scriptEvent float '''sin'''(float degrees); ====<br />
<br />
:Returns the sine of the given angle in degrees.<br />
<br />
==== scriptEvent entity '''spawn'''(string classname); ====<br />
<br />
:Creates an entity of the specified classname and returns a reference to the entity.<br />
<br />
==== scriptEvent float '''SpawnFloat'''(string key, float default); ====<br />
<br />
:Returns the floating point value for the given spawn argument.<br />
<br />
==== scriptEvent string '''SpawnString'''(string key, string default); ====<br />
<br />
:Returns the string for the given spawn argument.<br />
<br />
==== scriptEvent vector '''SpawnVector'''(string key, vector default); ====<br />
<br />
:Returns the vector for the given spawn argument.<br />
<br />
==== scriptEvent float '''sqrt'''(float square); ====<br />
<br />
:Returns the square root of the given number.<br />
<br />
==== scriptEvent float '''strFind'''(string text, string find, float casesensitive, float start, float end); ====<br />
<br />
:Return the position of the given substring, counting from 0, or -1 if not found.<br />
::''casesensitive'': 0<br />
::''start'': 0<br />
::''end'': -1<br />
<br />
==== scriptEvent string '''strLeft'''(string text, float num); ====<br />
<br />
:Returns a string composed of the first num characters<br />
<br />
==== scriptEvent float '''strLength'''(string text); ====<br />
<br />
:Returns the number of characters in the string<br />
<br />
==== scriptEvent string '''strMid'''(string text, float start, float num); ====<br />
<br />
:Returns a string composed of the characters from start to start + num<br />
<br />
==== scriptEvent string '''strRemove'''(string text, string remove); ====<br />
<br />
:Replace all occurances of the given substring with "". Example: StrRemove("abba","bb") results in "aa".<br />
<br />
==== scriptEvent string '''strReplace'''(string text, string remove, string replace); ====<br />
<br />
:Replace all occurances of the given string with the replacement string. Example: StrRemove("abba","bb","ccc") results in "accca".<br />
<br />
==== scriptEvent string '''strRight'''(string text, float num); ====<br />
<br />
:Returns a string composed of the last num characters<br />
<br />
==== scriptEvent string '''strSkip'''(string text, float num); ====<br />
<br />
:Returns the string following the first num characters<br />
<br />
==== scriptEvent float '''strToFloat'''(string text); ====<br />
<br />
:Returns the numeric value of the given string.<br />
<br />
==== scriptEvent float '''strToInt'''(string text); ====<br />
<br />
:Returns the integer value of the given string.<br />
<br />
==== scriptEvent void '''terminate'''(float threadNumber); ====<br />
<br />
:Terminates a thread.<br />
<br />
==== scriptEvent void '''threadname'''(string name); ====<br />
<br />
:Sets the name of the current thread.<br />
<br />
==== scriptEvent float '''trace'''(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
==== scriptEvent float '''tracePoint'''(vector start, vector end, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the trace hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
==== scriptEvent string '''translate'''(string input); ====<br />
<br />
:Translates a string (like #str_12345) into the current language<br />
<br />
==== scriptEvent void '''trigger'''(entity entityToTrigger); ====<br />
<br />
:Triggers the given entity.<br />
<br />
==== scriptEvent float '''vecLength'''(vector vec); ====<br />
<br />
:Returns the length of the given vector.<br />
<br />
==== scriptEvent vector '''vecNormalize'''(vector vec); ====<br />
<br />
:Returns the normalized version of the given vector.<br />
<br />
==== scriptEvent vector '''VecRotate'''(vector vector, vector angles); ====<br />
<br />
:Rotates a vector by the specified angles.<br />
<br />
==== scriptEvent vector '''VecToAngles'''(vector vec); ====<br />
<br />
:Returns Euler angles for the given direction.<br />
<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
==== scriptEvent void '''waitFor'''(entity mover); ====<br />
<br />
:Waits for the given entity to complete its move.<br />
<br />
==== scriptEvent void '''waitForRender'''(entity e); ====<br />
<br />
:Suspends the current thread until 'e' might have been rendered. It's event based, so it doesn't waste CPU repeatedly checking inPVS(). e.inPVS() will very likely be true when the thread resumes. If e.inPVS() is true, calling waitForRender() will probably just wait a frame, unless D3 can figure out that the entity doesn't need to be rendered. Optimizations regarding shadowcasting lights may not apply to this function - it is based purely off whether or not the entity's bounding box is visible.<br />
<br />
==== scriptEvent void '''waitForThread'''(float threadNumber); ====<br />
<br />
:Waits for the given thread to terminate.<br />
<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
==== scriptEvent void '''warning'''(string text); ====<br />
<br />
:Issues a warning.<br />
<br />
=== idSecurityCamera ===<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getSecurityCameraState'''(); ====<br />
<br />
:Returns the security camera's state. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = inactive, 5 = destroyed.<br />
<br />
==== scriptEvent entity '''getSpotLight'''(); ====<br />
<br />
:Returns the spotlight used by the camera. Returns null_entity if none is used.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
==== scriptEvent void '''setSightThreshold'''(float sightThreshold); ====<br />
<br />
:Set the sight threshold of the security camera: how lit up the player's lightgem needs to be in order to be seen. 0.0 to 1.0<br />
<br />
==== scriptEvent void '''state_light'''(float set); ====<br />
<br />
:Switches the spotlight on or off. Respects the security camera's power state.<br />
<br />
==== scriptEvent void '''state_see_AI'''(float set); ====<br />
<br />
:Set whether the camera can see AIs.<br />
<br />
==== scriptEvent void '''state_see_animals'''(float set); ====<br />
<br />
:Set whether the camera can see animals. Checked after seeAI or seeBodies.<br />
<br />
==== scriptEvent void '''state_see_bodies'''(float set); ====<br />
<br />
:Set whether the camera can see bodies.<br />
<br />
==== scriptEvent void '''state_see_player'''(float set); ====<br />
<br />
:Set whether the camera can see the player.<br />
<br />
==== scriptEvent void '''state_sweep'''(float set); ====<br />
<br />
:Enables or disables the camera's sweeping.<br />
<br />
==== scriptEvent void '''toggle_light'''(); ====<br />
<br />
:Toggles the spotlight on/off.<br />
<br />
==== scriptEvent void '''toggle_see_AI'''(); ====<br />
<br />
:Toggles whether the camera can see AIs.<br />
<br />
==== scriptEvent void '''toggle_see_animals'''(); ====<br />
<br />
:Toggles whether the camera can see bodies. Checked after seeAI or seeBodies.<br />
<br />
==== scriptEvent void '''toggle_see_bodies'''(); ====<br />
<br />
:Toggles whether the camera can see bodies.<br />
<br />
==== scriptEvent void '''toggle_see_player'''(); ====<br />
<br />
:Toggles whether the camera can see the player.<br />
<br />
==== scriptEvent void '''toggle_sweep'''(); ====<br />
<br />
:Toggles the camera sweep.<br />
<br />
=== Seed ===<br />
==== scriptEvent void '''cullAll'''(); ====<br />
<br />
:Cull (remove from world) all entities.<br />
<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
=== idSound ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
=== idTarget_Remove ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Show ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Damage ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SessionCommand ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_EndLevel ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_WaitForButton ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetGlobalShaderTime ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetShaderParm ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetShaderTime ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_FadeEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_LightFadeIn ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_LightFadeOut ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Give ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetModel ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetInfluence ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetKeyVal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetFov ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_CallObjectFunction ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_PostScriptEvent ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_EnableLevelWeapons ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_RemoveWeapons ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_FadeSoundClass ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_AddObjectives ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveVisibility ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveComponentState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_StartConversation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetFrobable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_CallScriptFunction ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeLockState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeTarget ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_InterMissionTrigger ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetTeam ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ItemRemove ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger ===<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
=== idTrigger_Multi ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_EntityName ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Timer ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Count ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Hurt ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Fade ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Touch ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idWeapon ===<br />
==== scriptEvent void '''addToClip'''(float amount); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''allowDrop'''(float allow); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''ammoAvailable'''(); ====<br />
<br />
:Number of shots left in inventory<br />
<br />
==== scriptEvent float '''ammoInClip'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
==== scriptEvent float '''clipSize'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''createProjectile'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''ejectBrass'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''flashlight'''(float enable); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
==== scriptEvent entity '''getOwner'''(); ====<br />
<br />
:Returns the owning entity<br />
<br />
==== scriptEvent entity '''getWorldModel'''(); ====<br />
<br />
:Returns the entity that controls the world model<br />
<br />
==== scriptEvent float '''isInvisible'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''launchProjectiles'''(float num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''melee'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''netEndReload'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''netReload'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''nextWeapon'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent float '''totalAmmoCount'''(); ====<br />
<br />
:Amount of ammo in inventory. since each shot may use more than 1 ammo, this is different than ammoAvailable()<br />
<br />
==== scriptEvent void '''useAmmo'''(float amount); ====<br />
<br />
:Eats the specified amount of ammo<br />
<br />
==== scriptEvent void '''weaponHolstered'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponLowering'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponOutOfAmmo'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponReady'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponReloading'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponRising'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponState'''(string stateFunction, float blendFrames); ====<br />
<br />
:no description<br />
<br />
[[Category:Scripting]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_If_Statements&diff=30061GUI Scripting: If Statements2022-11-03T21:24:19Z<p>Stgatilov: bold NOT</p>
<hr />
<div>''This page is part of a series. See [[GUI Scripting Language]] for overview.''<br />
==Introduction==<br />
The term "if statement" here is an abbreviated name for "if ... else if ... else ... statement".<br />
Its nature in GUI scripting is just enough like that of C-family languages to get you into trouble. In a nutshell, here’s guidance on problem areas:<br />
* Curly brackets are '''not''' optional.<br />
* A closing curly bracket is never followed by ";"<br />
* Each commands within curly brackets should be terminated by ";"<br />
* In if-conditions, within the parentheses:<br />
** wrap variables in double-quotes.<br />
** preferably surround any #defined macros with spaces.<br />
** be aware that non-numeric string comparison has an odd syntax.<br />
<br />
==Overall Structure and Syntax==<br />
GUI scripting "if statements" are found in an event block (i.e., body of an event handler like onTime). The general form is:<br />
if (''boolean condition'')<br />
{<br />
1 or more valid statements terminated by ";" and executed only if ''condition'' was true.<br />
}<br />
else if (''boolean conditionN'')<br />
{<br />
1 or more valid statements, each terminated by ";" and executed if all preceding conditions were false and ''conditionN'' is true.<br />
}<br />
else<br />
{<br />
1 or more valid statements, each terminated by ";" and executed if all conditions were false.<br />
}<br />
<br />
where the "else if" and "else" substructures are optional, and the "else if" substructure can be repeated any number of times.<br />
<br />
The curly brackets can be on the same line as the "if", "else if", and "else", or separate. The degree of white space indentation doesn’t matter. It is a convention to use whitespace (i.e., space or newline) to separate the keywords ("if", "else if", "else) from the punctuation (parentheses and curly brackets).<br />
<br />
There is NO semi-colon after any closing bracket "}".<br />
<br />
'''CURLY BRACKETS ARE REQUIRED! So this is NOT OK:'''<br />
if (boolean condition)<br />
command1;<br />
else<br />
command2;<br />
==If-Condition==<br />
This must resolve to a boolean value. This could come directly from a variable that only has 0 or non-zero (interpreted as 1) as values, or by a comparison, or by a conjunction of these separated by "&&" (i.e., logical AND) or "||" (i.e., logical OR) as in C.<br />
<br />
===Common Cases===<br />
All variables names MUST be in double quotes, e.g.:<br />
if ("gui::lang_danish") {....<br />
if ("gui::lang_spanish" == 0) {....<br />
if ("gui::av_screenshot_download_in_progress" == "0" && "exit" == 0) {....<br />
<br />
Most if-conditions in TDM are used to test gui:: parameters, as shown. The last example, from mainmenu_download.gui, also tests a user variable defined locally in the guiDef.<br />
<br />
Tested variables are routinely of type float (representing boolean as above, or integer or real), and comparisons use numeric operators, e.g.:<br />
if ("gui::curPage" < "gui::numPages") {<br />
By convention, numeric literal values are UNQUOTED, although quotes are tolerated. Unquoted examples with various operators:<br />
if ("gui::diffSelect" != 2) {....<br />
if ("gui::numPages" > 1) {....<br />
if ("gui::flashbomb_halfblind_enum" >= 0.8) {....<br />
if ("gui::player_health" <= 0) {....<br />
<br />
===String Comparison===<br />
Text comparisons are generally avoided, but you can check with a special QUOTED form of not-equal operator, e.g., here for the empty string:<br />
if ("LSGSaveGameNameEntry::text" "!=" "") {<br />
This also shows a rare example of an if-condition referring to a property declared in a different guiDef from that of the if statement.<br />
<br />
===With #Defined Values===<br />
If you don’t see double quotes, e.g., <br />
if ( MM_BRIEFING_VIDEO_LENGTH_1 > 0 && MM_BRIEFING_VIDEO_LENGTH_2 == 0 )<br />
...it means a #define statement either incorporates the quotes around a variable name, or uses a numeric literal, where quotes are optional, e.g.:<br />
#define MM_BRIEFING_VIDEO_LENGTH_1 10000 // In mainmenu_custom_defaults.gui & mainmenu_custom_defs.gui<br />
Also, if you have a #defined item in your condition, the preprocessor parser will probably thank you if you surround it with spaces, e.g.:<br />
if ( MM_BRIEFING_VIDEO_LENGTH_1 > 0 && MM_BRIEFING_VIDEO_LENGTH_2 == 0 )<br />
NOT:<br />
if (MM_BRIEFING_VIDEO_LENGTH_1>0&&MM_BRIEFING_VIDEO_LENGTH_2==0)<br />
===Precedence & Arithmetic Operations?===<br />
No example of an if-condition in TDM using parenthetical grouping or simple arithmetic operators {+,-,*,/} was seen. It is presumed those are possible; such arithmetic is deployed elsewhere.<br />
<br />
For example, arithmetic is used to initialize vector values of the "rect" property, to position a button. First, in tdm_gui01.pk4\guis\mainmenu_defs.gui, boolean MM_POS_HASMOD_SHIFT is #defined:<br />
#define MM_POS_HASMOD_SHIFT ("gui::hasCurrentMod" || "gui::inGame")<br />
This in turn affects where the "New Mission" button is positioned vertically, by calculation:<br />
#define MM_POS_NEW_MISSION_BUTTON MM_POS_X, MM_POS_Y + MM_POS_Y_STEP*(0+2*MM_POS_HASMOD_SHIFT), MM_POS_W, MM_POS_H<br />
Then in tdm_gui01\guis\mainmenu_main.gui:<br />
rect MM_POS_NEW_MISSION_BUTTON<br />
<br />
==Multiple If Statements==<br />
Within an event block, it is perfectly fine to have multiple if statements sequentially, perhaps interspersed with commands.<br />
<br />
Can if statements be nested? You would think so, given that's the case with most C-style languages. However, no example of that was seen with TDM. Perhaps the need simply didn't arise?</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&diff=29823Tracy: timeline profiler2022-08-28T11:42:32Z<p>Stgatilov: Removed centering of images</p>
<hr />
<div>The typical developer's approach for analyzing performance is using the builtin '''sampling profiler''' in Visual C++.<br />
It provides the overall statistics for all the functions in C++ code, without requiring any markup.<br />
However, sampling profiler only collects average/cumulative information: it cannot reveal that one frame in 10 is 3x slower, or that a particular entity takes too much time thinking.<br />
<br />
Since version 2.10, TDM ships with Tracy library integrated, which provides '''timeline profiling'''.<br />
It relies on manual instrumentation of C++ code, and shows exactly all the activities that developer wanted to see when he was doing the markup.<br />
It is very good at showing individual issues, like which single entity or area out of thousands takes too much time.<br />
Tracy profiling can be easily used by non-developers: you don't need to install Visual C++, and don't need debug information.<br />
<br />
<br />
=== Preparation ===<br />
<br />
Start TDM executable and set cvar '''com_enableTracing''' to '''1'''.<br />
<br />
When you first turn it on, it should print back the version of Tracy viewer that you need.<br />
Go to [https://github.com/wolfpld/tracy/releases GitHub page of Tracy releases] and download the main archive of the suggested version. The Tracy viewer inside is called simply <tt>Tracy.exe</tt>.<br />
<br />
If TDM does not print version of Tracy for you, then you need either 0.7.8 (TDM 2.10) or 0.8.1 (TDM 2.11 dev builds).<br />
If you use Linux, then you'll have to build Tracy yourself.<br />
<br />
<br />
=== Recording ===<br />
<br />
[[File:Tracy_Connect.png|150px|thumb|Connect button]]<br />
[[File:Tracy_Stop.png|150px|thumb|Stop button]]<br />
<br />
Here are the steps to record a trace:<br />
<br />
# Start TDM.<br />
# Start Tracy viewer.<br />
# In Tracy viewer, click <tt>Connect</tt> button.<br />
# In TDM, set com_enableTracing to 1.<br />
# Do whatever you want to analyze in TDM.<br />
# Switch to Tracy and click <tt>Stop</tt> button.<br />
<br />
Here is your trace, ready for analysis.<br />
If you want to see the connection window again, click the "wifi" icon.<br />
From there you can <tt>Save trace</tt> on disk, or <tt>Discard</tt> + <tt>Reconnect</tt> to record a new trace.<br />
<br />
Note that if you run TheDarkMod as administrator, you'll get a lot of additional low-level information, which you probably don't need.<br />
<br />
<br />
=== Analysis ===<br />
<br />
[[File:Tracy Activities.png|thumb|Activities]]<br />
<br />
You see timeline: the sequence of all events happened during recording, and all activities executed during that.<br />
You can zoom timeline by mouse wheel and pan by dragging with right mouse button.<br />
<br />
Every activity is represented as a colored interval on the timeline, its type is written inside the interval is you zoom to it.<br />
Activities are properly nested, for instance <tt>RunGameTic</tt> activity has <tt>ThinkAllEntities</tt> as a child, which in turns contains <tt>Think</tt> for individual active entities.<br />
Nesting is represented vertically: child activities are just below the parent activity.<br />
Also, the game has several threads, which are separated vertically: you can collapse and expand display of activities for every thread.<br />
<br />
You can hover over an activity to see more info about it, and click it to see even more in a separate <tt>Zone info</tt> window.<br />
From this window, you can click <tt>Statistics</tt> button to open <tt>Find zone</tt> window.<br />
This window shows total/average/count/median/whatever time for all activities of the same type.<br />
Some activities have "User text" attached by programmer (like e.g. name of entity), which is displayed in yellow when you hover over activity.<br />
A useful feature is to click <tt>Group by User text</tt> and <tt>Sort by time</tt> in radio buttons.<br />
<br />
Read the Tracy manual to learn more. It can be downloaded from Tracy releases page.<br />
<br />
<br />
Typical workloads for analysis are:<br />
* Gameplay: in this case you should record for at least a few seconds to get meaningful stats.<br />
* Map load.<br />
* Dmap compilation.<br />
<br />
<br />
==== Gameplay ====<br />
<br />
[[File:Tracy Frames.png|150px|thumb|Frames]]<br />
<br />
It is easy to see periodic structure of frames in the timeline.<br />
Tracy draws vertical lines where each frame ends, so you can easily see how much every frame took, what's current FPS. You can also see spikes in frame processing time on the "minimap" at the top.<br />
<br />
Now let's take a closer look at a single frame.<br />
<br />
[[File:Tracy Gameplay.png|960px]]<br />
<br />
One important thing to understand regarding performance is that some things work in parallel.<br />
Suppose that task A takes 10 ms per frame, and task B takes 6 ms per frame, and you managed to optimize task B down to 3 ms.<br />
If the tasks are run one after the other, then you have optimized your frame from 16 ms to 13 ms. But if they work in parallel, the overall frame time remains 10 ms.<br />
The game would become visibly faster only if you optimized something on a thread which takes the most time (roughly speaking). This is usually called "bottleneck", "limited by frontend", "critical path", etc.<br />
<br />
Tracy displays every thread as a separate vertical stripe, with the thread name displayed on the left.<br />
Parallel threads often need to wait for each other, doing nothing useful: such waiting activities are colored grey.<br />
<br />
<br />
Here is description of the main threads and workloads (as of TDM 2.10):<br />
* '''Frontend''': runs a tic of gameplay modeling (<tt>RunGameTic</tt>), then renderer frontend (<tt>R_RenderView</tt>).<br />
* '''Main thread''': runs renderer backend (<tt>R_IssueRenderCommands</tt>), which interacts with OpenGL driver on CPU side.<br />
* '''OpenGL context''': GPU thread which actually executes OpenGL commands.<br />
* '''JobListProcessor''': some work is off-loaded to these worker threads.<br />
<br />
Notice that rendering is split into three parallel tasks. Most of the work is done in frontend, which includes culling, particles, shadow volumes, animation, etc. Backend simply executes OpenGL API calls, letting OpenGL driver to do its stuff. Strictly speaking, OpenGL context is not a thread: it is the approximate view in what happens on the actual GPU device. For that reason, its activities are very special and not all Tracy features work for them.<br />
<br />
The rule of thumb is: if you see <tt>WaitForFrontend</tt> at <tt>Main thread</tt>, then frontend thread is the bottleneck. If you see <tt>Frontend::Wait</tt> on <tt>Frontend</tt> thread, then backend thread is the bottleneck.<br />
<br />
<br />
Here are a few other details which greatly influence performance:<br />
* Some gameplay work is done only once in several frames. The most prominent example is AI thinking (see [[Interleaved Thinking optimization]]). While such work is randomly scattered across frames, the gameplay modeling time still varies a lot.<br />
* When FPS drops below 60, frontend thread executes <tt>RunGameTic</tt> several times per frame, further reducing performance. However, all additional calls are cheaper because they almost totally exclude AI thinking ([https://bugs.thedarkmod.com/view.php?id=5992 #5992]).<br />
<br />
Settings which greatly affect the timeline:<br />
* '''Uncapped FPS''' menu setting switches between two different ways of time management (see [[Time, frames and ticks]]).<br />
* '''com_smp''' allows to separate/merge <tt>Frontend</tt> and <tt>Main thread</tt>.<br />
* '''Frontend Acceleration''' menu setting controls off-loading some frontend work to worker threads.<br />
* '''Vertical Sync''' and '''r_finish''' changes the way backend/GPU synchronize with all the rest.<br />
* '''com_useMinorTics''', '''com_maxTicTimestep''', '''com_maxTicsPerFrame''' control game modeling split behavior.<br />
<br />
<br />
<br />
==== Map load ====<br />
<br />
[[File:Tracy Mapload.png|960px]]<br />
<br />
Loading every assets constitutes an individual activity on the timeline.<br />
Usually all the referenced subassets are loaded recursively, so they become nested/children activities.<br />
The major exception to this rule is images, which are loaded at the very end of the map loading, and in separate threads.<br />
<br />
<br />
<br />
==== Dmap compilation ====<br />
<br />
[[File:Tracy Dmap.png|960px]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&diff=29822Tracy: timeline profiler2022-08-28T11:41:20Z<p>Stgatilov: Initial commit</p>
<hr />
<div>The typical developer's approach for analyzing performance is using the builtin '''sampling profiler''' in Visual C++.<br />
It provides the overall statistics for all the functions in C++ code, without requiring any markup.<br />
However, sampling profiler only collects average/cumulative information: it cannot reveal that one frame in 10 is 3x slower, or that a particular entity takes too much time thinking.<br />
<br />
Since version 2.10, TDM ships with Tracy library integrated, which provides '''timeline profiling'''.<br />
It relies on manual instrumentation of C++ code, and shows exactly all the activities that developer wanted to see when he was doing the markup.<br />
It is very good at showing individual issues, like which single entity or area out of thousands takes too much time.<br />
Tracy profiling can be easily used by non-developers: you don't need to install Visual C++, and don't need debug information.<br />
<br />
<br />
=== Preparation ===<br />
<br />
Start TDM executable and set cvar '''com_enableTracing''' to '''1'''.<br />
<br />
When you first turn it on, it should print back the version of Tracy viewer that you need.<br />
Go to [https://github.com/wolfpld/tracy/releases GitHub page of Tracy releases] and download the main archive of the suggested version. The Tracy viewer inside is called simply <tt>Tracy.exe</tt>.<br />
<br />
If TDM does not print version of Tracy for you, then you need either 0.7.8 (TDM 2.10) or 0.8.1 (TDM 2.11 dev builds).<br />
If you use Linux, then you'll have to build Tracy yourself.<br />
<br />
<br />
=== Recording ===<br />
<br />
[[File:Tracy_Connect.png|150px|thumb|Connect button]]<br />
[[File:Tracy_Stop.png|150px|thumb|Stop button]]<br />
<br />
Here are the steps to record a trace:<br />
<br />
# Start TDM.<br />
# Start Tracy viewer.<br />
# In Tracy viewer, click <tt>Connect</tt> button.<br />
# In TDM, set com_enableTracing to 1.<br />
# Do whatever you want to analyze in TDM.<br />
# Switch to Tracy and click <tt>Stop</tt> button.<br />
<br />
Here is your trace, ready for analysis.<br />
If you want to see the connection window again, click the "wifi" icon.<br />
From there you can <tt>Save trace</tt> on disk, or <tt>Discard</tt> + <tt>Reconnect</tt> to record a new trace.<br />
<br />
Note that if you run TheDarkMod as administrator, you'll get a lot of additional low-level information, which you probably don't need.<br />
<br />
<br />
=== Analysis ===<br />
<br />
[[File:Tracy Activities.png|thumb|Activities]]<br />
<br />
You see timeline: the sequence of all events happened during recording, and all activities executed during that.<br />
You can zoom timeline by mouse wheel and pan by dragging with right mouse button.<br />
<br />
Every activity is represented as a colored interval on the timeline, its type is written inside the interval is you zoom to it.<br />
Activities are properly nested, for instance <tt>RunGameTic</tt> activity has <tt>ThinkAllEntities</tt> as a child, which in turns contains <tt>Think</tt> for individual active entities.<br />
Nesting is represented vertically: child activities are just below the parent activity.<br />
Also, the game has several threads, which are separated vertically: you can collapse and expand display of activities for every thread.<br />
<br />
You can hover over an activity to see more info about it, and click it to see even more in a separate <tt>Zone info</tt> window.<br />
From this window, you can click <tt>Statistics</tt> button to open <tt>Find zone</tt> window.<br />
This window shows total/average/count/median/whatever time for all activities of the same type.<br />
Some activities have "User text" attached by programmer (like e.g. name of entity), which is displayed in yellow when you hover over activity.<br />
A useful feature is to click <tt>Group by User text</tt> and <tt>Sort by time</tt> in radio buttons.<br />
<br />
Read the Tracy manual to learn more. It can be downloaded from Tracy releases page.<br />
<br />
<br />
Typical workloads for analysis are:<br />
* Gameplay: in this case you should record for at least a few seconds to get meaningful stats.<br />
* Map load.<br />
* Dmap compilation.<br />
<br />
<br />
==== Gameplay ====<br />
<br />
[[File:Tracy Frames.png|150px|thumb|Frames]]<br />
<br />
It is easy to see periodic structure of frames in the timeline.<br />
Tracy draws vertical lines where each frame ends, so you can easily see how much every frame took, what's current FPS. You can also see spikes in frame processing time on the "minimap" at the top.<br />
<br />
Now let's take a closer look at a single frame.<br />
<br />
[[File:Tracy Gameplay.png|960px|center]]<br />
<br />
One important thing to understand regarding performance is that some things work in parallel.<br />
Suppose that task A takes 10 ms per frame, and task B takes 6 ms per frame, and you managed to optimize task B down to 3 ms.<br />
If the tasks are run one after the other, then you have optimized your frame from 16 ms to 13 ms. But if they work in parallel, the overall frame time remains 10 ms.<br />
The game would become visibly faster only if you optimized something on a thread which takes the most time (roughly speaking). This is usually called "bottleneck", "limited by frontend", "critical path", etc.<br />
<br />
Tracy displays every thread as a separate vertical stripe, with the thread name displayed on the left.<br />
Parallel threads often need to wait for each other, doing nothing useful: such waiting activities are colored grey.<br />
<br />
<br />
Here is description of the main threads and workloads (as of TDM 2.10):<br />
* '''Frontend''': runs a tic of gameplay modeling (<tt>RunGameTic</tt>), then renderer frontend (<tt>R_RenderView</tt>).<br />
* '''Main thread''': runs renderer backend (<tt>R_IssueRenderCommands</tt>), which interacts with OpenGL driver on CPU side.<br />
* '''OpenGL context''': GPU thread which actually executes OpenGL commands.<br />
* '''JobListProcessor''': some work is off-loaded to these worker threads.<br />
<br />
Notice that rendering is split into three parallel tasks. Most of the work is done in frontend, which includes culling, particles, shadow volumes, animation, etc. Backend simply executes OpenGL API calls, letting OpenGL driver to do its stuff. Strictly speaking, OpenGL context is not a thread: it is the approximate view in what happens on the actual GPU device. For that reason, its activities are very special and not all Tracy features work for them.<br />
<br />
The rule of thumb is: if you see <tt>WaitForFrontend</tt> at <tt>Main thread</tt>, then frontend thread is the bottleneck. If you see <tt>Frontend::Wait</tt> on <tt>Frontend</tt> thread, then backend thread is the bottleneck.<br />
<br />
<br />
Here are a few other details which greatly influence performance:<br />
* Some gameplay work is done only once in several frames. The most prominent example is AI thinking (see [[Interleaved Thinking optimization]]). While such work is randomly scattered across frames, the gameplay modeling time still varies a lot.<br />
* When FPS drops below 60, frontend thread executes <tt>RunGameTic</tt> several times per frame, further reducing performance. However, all additional calls are cheaper because they almost totally exclude AI thinking ([https://bugs.thedarkmod.com/view.php?id=5992 #5992]).<br />
<br />
Settings which greatly affect the timeline:<br />
* '''Uncapped FPS''' menu setting switches between two different ways of time management (see [[Time, frames and ticks]]).<br />
* '''com_smp''' allows to separate/merge <tt>Frontend</tt> and <tt>Main thread</tt>.<br />
* '''Frontend Acceleration''' menu setting controls off-loading some frontend work to worker threads.<br />
* '''Vertical Sync''' and '''r_finish''' changes the way backend/GPU synchronize with all the rest.<br />
* '''com_useMinorTics''', '''com_maxTicTimestep''', '''com_maxTicsPerFrame''' control game modeling split behavior.<br />
<br />
<br />
<br />
==== Map load ====<br />
<br />
[[File:Tracy Mapload.png|960px|center]]<br />
<br />
Loading every assets constitutes an individual activity on the timeline.<br />
Usually all the referenced subassets are loaded recursively, so they become nested/children activities.<br />
The major exception to this rule is images, which are loaded at the very end of the map loading, and in separate threads.<br />
<br />
<br />
<br />
==== Dmap compilation ====<br />
<br />
[[File:Tracy Dmap.png|960px|center]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Dmap.png&diff=29821File:Tracy Dmap.png2022-08-28T11:40:35Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Mapload.png&diff=29820File:Tracy Mapload.png2022-08-28T11:39:26Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Gameplay.png&diff=29819File:Tracy Gameplay.png2022-08-28T11:33:42Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Frames.png&diff=29818File:Tracy Frames.png2022-08-28T11:32:38Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Activities.png&diff=29817File:Tracy Activities.png2022-08-28T11:30:31Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Stop.png&diff=29816File:Tracy Stop.png2022-08-28T11:25:36Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=File:Tracy_Connect.png&diff=29815File:Tracy Connect.png2022-08-28T11:24:37Z<p>Stgatilov: </p>
<hr />
<div></div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=Light_Properties&diff=29779Light Properties2022-08-13T11:06:33Z<p>Stgatilov: volumetric_noshadows not needed in TDM 2.11</p>
<hr />
<div><br />
== Introduction == <br />
<br />
For Doom 3 (and subsequently, The Dark Mod), there are 4 different types of lights at our disposal. Each has their own advantages and drawbacks, and hopefully this article will help to familiarize The Dark Mod hopefuls with their use. For information on creating lights and a lot of other useful information, see [[A - Z Beginner Full Guide Start Here!]]<br />
<br />
<br />
__TOC__<br />
<br />
<br />
==Light Volume Properties==<br />
<br />
=== Point Light ===<br />
<br />
A point light is the default light (also the default for fog). No option must be checked to make a light a point light. A point light casts light, and subsequently shadows in all directions evenly, falling off after a distance defined by the light texture. This works best for most small indoor and outdoor lighting, like lamps, candles, fireplaces etc. For this reason, it is going to be the most used type.<br />
<br />
* Note, a misconception about Point Light is that they project spherically. The box shaped bounding volume in Dark Radiant is no mere simplification, it is the literal area affected by the light for calculation purposes. Point Light volumes should be perceived as cylindrical prisms that on one axis are shaped by the silhouette of the [[Light_Properties#Lighting_Textures | projection texture]] (think of a stack of cheese cut with a cookie cutter) and the other axis (z-axis) traditionally determines the distance from origin brightness (usually vertical... or how tall you make your cheese stack) with the LightFalloffImage.<br />
<br />
* Note 2, as of TDM 2.05 cubicLight lights offer true spherical falloff.<br />
<br />
<br />
=== Projected Light ===<br />
<br />
Projected light is just as the name suggests. It is probably more intuitive and easier to use than a parallel light and is better for things like projecting a window-shaped light on the floor of a room or a spotlight on a wall. To make one, select projected instead of the default omni option at the top of the light inspector. <br />
<br />
This creates a triangular prism as the bounding box for the light (instead of a rectangular prism like a regular light), with the point ending right at the entity itself. This can be rotated using any of the XYZ rotation buttons or manually using DarkRadiant’s rotation tool (shortcut R). <br />
<br />
You can also manipulate the projected light via the vertices (shortcut V to enable vertices dragging). By dragging the vertices in the center of the projected square, you can lengthen and change the angle of the projection while keeping the projected square the same size. To resize the projection, use the two side vertices in the correct XYZ grid view. Making the bounding box flat against a surface (like a floor) is usually unnecessary (for example, making a moonlight window light on a floor or wall), because with shadows enabled and making the projection long enough to intersect the plane on which the shadow is to be cast, the full shadow will be cast (its simple geometry and just requires minor toying). <br />
<br />
As with all the lights, projected lights have a full range of color and texture options to let the mapper find just the effect they need, allowing you to create a great atmosphere for your map.<br />
<br />
* As of TDM 2.06, cubicLight entities do not work properly with Projected lights. Please only use cubicLight with Point lights.<br />
<br />
=== Parallel Light ===<br />
<br />
A light is said to be parallel when the parallel checkbox is checked in the light inspector. It is subject to all the same options as a point light, but it has a few distinct differences. A parallel light tends to not care exactly where the entity itself is placed. The most important thing is where the light_center vertex is placed and where the light entities bounding box intersects with elements in your map. <br />
<br />
The light_center vertex starts right in the middle of the entity. The main difference between the parallel and point lights is that a parallel light does not radiate from the origin around the entity itself. What controls the direction that shadows are cast is the placement of the light_center vertex. Shadows will run parallel (hence the name) to a line between this vertex and the light entity itself. This makes it an excellent choice for sunlight or moonlight. As such, it has some of the elements of a point light and a projected light, it can seem to radiate in a circle (if you use the appropriate texture) whilst casting a shadow in any direction preferred.<br />
<br />
Switch to Vertex mode in [[DarkRadiant]] to drag the light_center vertex of your selected light entity.<br />
<br />
Posted by Greebo: Also, note that a parallel light will only light surfaces "matching" the direction of the "light vector" <br>(origin minus light_center). All other surfaces will stay completely unlit, therefore it should be combined with an ambient light to <br>achieve good lighting effects. [https://forums.thedarkmod.com/index.php?/topic/8091-parallel-lights-vs-point-lights/&tab=comments#comment-159842]<br />
<br />
==== Parallel-sky light ====<br />
<br />
The main problem with parallel light is that: while it does not radiate light rays from the light origin, the origin still matters when engine flows light rays through visportals. An ordinary parallel light always works properly in the visleaf where its origin is located. In addition to that, it takes effect in all the other visleafs which can be reached from the starting visleaf through visportals by travelling along the direction of the light. So in order to create a global moon/sun light which will light many outdoor areas, one has to create a separate visleaf above the outdoor areas, which would contain the light and have portals leading down to every outdoor area below. It is quite complicated.<br />
<br />
In TDM 2.08, a new spawnarg '''parallelSky''' was added. If you add it to a parallel light and set value "1", then the light will emanate from every visleaf containing surfaces with textures/smf/portal_sky material. This usually includes all outdoors area automatically. Note that other (i.e. indoors) areas are also included if they can be reached from outdoors areas through open visportals, so the light should work correctly indoors if someone opens a door.<br />
<br />
==== Troubleshooting Parallel Lights ====<br />
<br />
''I added a parallel light but I can’t see any light at all!''<br />
<br />
Parallel lights can have some quirks. The light seems to fail and do nothing when intersecting multiple walls that are parallel to the face the light is actually casting on. It seems the light will work as long as it doesn’t intersect a face parallel to the one it is casting light on. <br />
<br />
''I have a parallel light but it casts a jagged light on my floor!''<br />
<br />
Similar to above, a parallel light can sometimes have anomalies when intersecting multiple walls and a floor. Since having the light intersect multiple walls when it can only cast on one of them, having a massive bounding box is pointless anyways so pay attention to what the light is touching and you should be fine.<br />
<br />
==Light Interaction Properties==<br />
<br />
=== Normal Light ===<br />
<br />
This is the default light type. It performs all the surface interaction stages and shadow calculations. It has the heaviest performance impact.<br />
<br />
=== cubicLight ===<br />
<br />
New as of TDM 2.05, it is similar to Normal Light but accepts a cubemap as the projection image and uses a spherical z-falloff pattern rather than a falloff image. <br />
<br />
The shader was originally developed by Sikkpin the author of the soft shadows mod for Doom 3 "Sikkmod". Duzenko ported portions of it to GLSL.<br />
<br />
CubicLight projection is used in many 3D engines with the most common parlance being "Cookie Lights". Unity "Cookie Lights" can be used as a reference. <br />
<br>(For comparison, I am not aware of any 3D engine other than id Tech 4 that used the 1D + 2D projection images.)<br />
<br />
As of TDM 2.06, GLSL versions of this shader will only perform Point light (omni) operations. Projected is broken.<br />
<br />
=== Ambient Light ===<br />
<br />
Ambient light is really just a lighting texture, but it is also a specific item that is needed in practically every map, so for those purposes it will be treated as if it were its own subset of lights.<br />
<br />
Properties: No shadows, No specular, Bumpmapping or Directionality (Note: The "Enhance Ambient" does add Bumpmapping )<br />
<br />
Use the ambientLight keyword.<br />
<br />
An ambient light can be any form: it can be a point, parallel or even projected (though projected would probably be useless). <br />
<br />
The only requirement of an ambient light is to use one of the available ambient light textures, accessible by opening the light inspector (with the shortcut L in DarkRadiant, and get used to using it), and selecting ambientlightnfo from the list.<br />
<br />
<br />
* Ambient Light is covered in more detail in [[A_-_Z_Beginner_Full_Guide_Page_2#Ambient_Light:_Gloom_not_Doom| Ambient Light: Gloom not Doom]]<br />
<br />
* To understand The Dark Mod's unique ambient light detection system see: [[Virtual Darkness]]<br />
<br />
* Ambient Light can be set to automatically adjust color and brightness per "location" see: [[Location Settings]] and [[Dynamic ambient light]]<br />
<br />
<br />
<br />
=== ambientCubicLight ===<br />
<br />
New as of TDM 2.05. This is intended to provide an effect similar to Valve's "Precomputed Radiance Transfer" lighting in Half Life 2.<br />
It was originally developed by Sikkpin the author of the soft shadows mod for Doom 3 "Sikkmod".<br />
<br />
In TDM 2.06, the new GLSL version of the shader (developed by Duzenko) accepts (industry standard) irradiance cubemap images. <br />
<br />
* A new image program "makeIrradiance" was also created to use existing skybox cubemap images.<br />
<br />
=== Fog Light ===<br />
<br />
This applies Doom 3's style distance fog to a light volume. The texture applied will become more opaque with distance away from the viewer. There is a variant called No Portal Fog which will not apply opaque fog to Portal areas in view. ( [[A_-_Z_Beginner_Full_Guide_Page_3#Fog|Beginner Tutorial: Fog]] )<br />
<br />
In rare cases, you may wish for some surface inside a fog-volume to be fog-free. You can use the "noFog" keyword in the material definition for the texture applied to this surface to keep it from being "fogged".<br />
<br />
Very thin fog (or BlendLight ) can also be used to soften the apparent light interactions near surfaces in a similar manner to the Post Process shader effect but with more mapper control. You can fake certain radiosity effects simply by amplifying small ambient light with small thin fog volumes. <br />
<br />
Use the fogLight keyword.<br />
<br />
==== noFogBoundary ====<br />
<br />
Fog lights don't actually paint mist in the air, which would slow down performance quite a bit. They achieve their effect by fogging out the colour of the surfaces that they hit, proportionate to the depth of fog that lies between the player and the surface. In addition, if there is no surface between the player and the edge of the fog volume, they paint fog on the invisible walls of their own bounding volume. That's needed for a large open scene, for example, where there might be no surface between the player and the edge of the fog volume. If you're in a misty forest, and there happened to be no tree visible in a certain direction, you'd expect to see grey fog rather than clear space between the fogged trees.<br />
<br />
Sometimes you don't want that to happen, for example if you're using a very large but very light fog to simulate atmospheric perspective in a town. You want the colour and detail of buildings to fade with distance, but you don't want heavy fog blocking the view of the sky in the gaps between buildings where you see to the very edge of the big fog light. You can use spawnarg "noFogBoundary" for that. It lets fog paint on solid surfaces, while leaving empty space and caulk sky free of fog effects.<br />
<br />
==== noFog ( new 2.07 ) ====<br />
<br />
As of TDM 2.07, you can apply a noFog global material flag to the material def or the noFog entity spawnarg to the entity def and this will prevent fogging on these surfaces or entities.<br />
<br>Most visual fog issues are in cases where fog is "not" applied somewhere. Therefore, this is mostly a performance related argument or can be used as a special effects.<br />
<br />
=== Blend Light ===<br />
<br />
Blend lights can be considered to be like volumetric decals. They do not perform most of the interaction shader operations and merely apply a texture to a volume using an [https://modwiki.dhewm3.org/Blend_(Material_stage_keyword) OpenGL Blend Mode]. Blend lights have the least performance impact. Blend lights can also be used to create [http://www.doom3world.org/phpbb2/viewtopic.php?f=1&t=12256&start=0&st=0&sk=t&sd=a "negative light"]. <br />
<br />
Example negative light shader:<br />
<br />
<pre><br />
lights/bdog_testBlendLight2<br />
{<br />
blendLight<br />
lightFalloffImage makeintensity( textures/blackdog/blendlight_falloff_inverse.tga )<br />
{<br />
blend gl_zero, gl_one_minus_src_color<br />
map textures/blackdog/blackdog_icon_inverse.tga<br />
zeroclamp<br />
//alphazeroclamp<br />
colored<br />
} <br />
}<br />
</pre><br />
<br />
Use the blendLight keyword.<br />
<br />
=== Spectrum ===<br />
<br />
You may use the "spectrum" keyword to isolate specific lights to specific materials which have the same spectrum value in their material definition.<br />
[https://modwiki.dhewm3.org/Spectrum_(Material_global_keyword) Spectrum Keyword at Modwiki]<br />
<br>Note: Currently spectrum light is exclusive. This means that anywhere the the spectrum light does not touch (shadowed surfaces) will be completely black.<br />
<br>To avoid this issue, you would need to create an ambient light (basically a duplicate of ambient_world) with the same spectrum value as the target surface(s).<br />
<br />
== Light Settings ==<br />
<br />
There are several settings with which to customize your lights. These settings allow the mapper to customize the look of a light (or a combination of lights) into a near infinity of looks. All are accessed through the light inspector (shortcut of L in DarkRadiant)<br />
<br />
<br />
=== Color ===<br />
<br />
The color palette allows the mapper to pick the color of the light emitted, arguably one of the most useful controls the mapper has over a light. To access it, click the button under the “Colour” heading. From there, adjust the settings until you find a correct color (can take some trial and error). In a game like The Dark Mod or Doom 3, where darkness is often more prevalent than light, the color picked often needs to be darker than expected. Without a direct brightness option, the color takes on this task. For a low level ambient light, the color picked would be almost pitch black. A pitch black light would not cast any light, but anything less than pitch black will cast a faint light. As such, it can take some trial and error to find the correct light for a situation, as initially, one is likely to pick a seemingly correct color only to find it is far too bright. <br />
<br />
Remember: changing light settings or adding lights (and models) does not require re-compiling the map!<br />
<br />
<br />
=== Radius ===<br />
<br />
The 'radius' of your light can be changed by dragging its corners around in the 2d windows. Doom 3 lights do not have an actual radius, they are actually square lights and will light up everything they touch inside their bounding box in the editor. They will evenly light everything to their edges. While square lights might seem fairly odd there are options to make them more believable and have a nice fade, namely the 'texture' applied.<br />
<br />
Tip: you can rotate a light so only one corner will touch a wall and make a triangular shaped light. <br />
<br />
Or rotate it so 2 corners touch a wall and make a line of light.<br />
<br />
'''Changing Radius of Light Entity:'''<br />
<br />
If you put a premade light entity into your map, the radius of the light won't be visible. <br />
<br />
To change it, use the following syntax (and whichever value you wish):<br />
<br />
<pre><br />
<br />
"set _color on flame" "0.9 0.8 0.7"<br />
"set light_radius on flame" "250 250 250"<br />
<br />
</pre><br />
<br />
With lanterns and such use 'light' and with torches and candles etc use 'flame'.<br />
<br />
<pre><br />
<br />
"set _color on light" "0.9 0.8 0.7"<br />
"set light_radius on light" "250 250 250"<br />
<br />
</pre><br />
<br />
(Copied from Baddcog's old "Lighting A to Z" article)<br />
<br />
<br />
=== Parallel === <br />
<br />
Selecting this option turns the light into a parallel light (as opposed to a point or projected light). See [[Light Properties#Parallel Light|Parallel Light]]<br />
<br />
<br />
=== Do not cast shadows (fast) ===<br />
<br />
As the name suggests, this setting causes the light to not cast shadows on any object. This can cause the light itself to not be confined by walls, which can sometimes be beneficial and sometimes not. The main purpose of enabling this option is performance. Shadows are processor intensive and are not needed in some cases, so removing them wherever not beneficial to gameplay can vastly improve performance. Note that ambient lights never cast any shadows. Another way to improve performance similarly is to set the entity property on a model or func_static (this doesn’t work on worldspawn) <tt>noshadows</tt> to 1.<br />
<br />
* '''Further details''': [[Turning Shadows Off]] , [[Noselfshadows]]<br />
<br />
<br />
=== Volumetric light ===<br />
<br />
Volumetric light makes the whole light volume slightly visible to the player (added in TDM 2.10).<br />
The related spawnargs are:<br />
<br />
* '''volumetric_light''' = 0: Set to 1 to enable volumetric light.<br />
* '''volumetric_dust''' = 0.002: How strong the volumetric effect is (reduce it if too bright).<br />
* '''volumetric_noshadows''': How volumetric light handles shadows (see below) --- useless in TDM 2.11.<br />
<br />
The spawnarg <tt>volumetric_noshadows</tt> only affects the volumetric effect, and has three different values (default value is taken from <tt>noshadows</tt> spawnarg):<br />
* '''= 0''': Shadows must be respected. If that's not possible, then the whole volumetric effect must be disabled.<br />
* '''= 1''': Shadows must be ignored.<br />
* '''= -1''': Shadows should be respected. But if that's not possible, then shadows can be ignored as well.<br />
<br />
There are several reasons why engine can fail to support shadows in volumetric light:<br />
# Player <s>uses stencil shadows (<tt>r_shadows 1</tt>) or </s>([https://bugs.thedarkmod.com/view.php?id=5880#c15076 fixed in TDM 2.11]) disabled volumetric light sampling (<tt>r_volumetricSamples 0</tt>).<br />
# Shadow maps are not yet supported for the particular light. This happens for large lights, for instance.<br />
# Shadows were disabled on the light itself (<tt>noshadows</tt>).<br />
<br />
=== Skip Specular Lighting ===<br />
<br />
Specular Lighting refers to a texture's specular map, wherein a flat surface (such as a wall) is painted with a texture that has a specular component. This causes a surface to have shinier and duller parts on a flat surface based on the darkness of the corresponding location on the specular map. Not all textures have specular maps. Checking this option could improve performance or remove the effect if it is not wanted. [https://modwiki.dhewm3.org/Texturing#specular-maps]<br />
<br />
=== Skip Diffuse Lighting ===<br />
<br />
Like Specular lighting, diffuse lighting also references an attribute of a texture, the Diffuse Map. Diffuse Maps determine the intensity and color of the light reflected off of the different elements of a texture (an example being the difference between bricks and the mortar in between, as well as different bricks having different properties as well giving a less bland appearance). <br />
[https://modwiki.dhewm3.org/Texturing#diffuse-maps]<br />
<br />
== Other light settings ==<br />
<br />
=== AI sight ===<br />
<br />
Spawnarg '''ai_see''' controls whether the light is visible to AI. It defaults to "1", i.e. the light does help AI to see. You can set this spawnarg to "0" to make accent lights that will (1) not affect the player's lightgem, and (2) won't make suspicious objects like rope arrows more visible to AI. <br />
<br />
<br />
== Chandeliers ==<br />
<br />
Typically chandeliers are setup with multiple particle flames, but just one light entity (for better performance). Bind the candles to the chandelier, then if one is doused, all will extinguish. (See the prefab for an example.)<br />
<br />
<br />
== Lighting Textures ==<br />
<br />
[[Image:LT_Projectedlight.png|400px|thumb|Rich_is_Bored's Example]]<br />
<br />
The lighting textures are also accessed in the light inspector. <br />
<br />
<br />
Lights can be modified by two different texture types:<br />
<br />
* Projection Image - This is the texture that is projected on the surface<br />
* LightFalloffImage - This texture varies the intensity of the light through the volume along the Z Axis <br />
* (Notes: While the Falloff Image is a 2D texture it is rendered as 1D (one dimensional). You will notice that almost all Falloff Images are thin strips with perpendicular stripes. Traditionally, Falloff will be used to diminish the light with distance to the source but you can violate the physics of real lights and have the intensity increase with distance or vary intensity from bright to dim to bright... etc. )<br />
<br />
These textures allow the mapper to change the intensity and falloff of a light. <br />
<br />
Light textures with the addition of material keywords like [https://modwiki.dhewm3.org/Scroll_(Material_stage_keyword) scroll],[https://modwiki.dhewm3.org/Rotate_(Material_stage_keyword) rotate], etc. will grant lights the ability to animate and produce special effects such as; <br />
<br />
* A moving light for a fireplace <br />
* A candle or torch<br />
* A light flickering along with sound volume. <br />
<br />
One can also apply a fog texture to the light (the only way built into Doom 3 to create fog). Color is of a similar concern when [[A_-_Z_Beginner_Full_Guide_Page_3#Fog|creating fog]], as noted in [[Light Properties#Color|Color]]<br />
<br />
* A typical "Light Shader" [https://iddevnet.dhewm3.org/doom3/materials.html material] definition<br />
<br />
<pre><br />
<br />
lights/My_Custom_Light1<br />
{<br />
<br />
lightFalloffImage makeIntensity( textures/My_Custom_Light1_Z ) // Falloff Image<br />
<br />
{ <br />
forceHighQuality<br />
map textures/My_Custom_Light1_XY // Z-Projection Image<br />
zeroClamp<br />
}<br />
<br />
}<br />
<br />
</pre> <br />
<br />
(For advanced detail and techniques see [[Light Textures and Falloff Images]] )<br />
<br />
== Further reading == <br />
<br />
* [[Performance:_Essential_Must-Knows#Lighting_Performance_Options|Lighting Performance Options]]<br />
* [[Relighting Lights]]<br />
* A great tutorial on outdoor lighting can be found here: [https://www.katsbits.com/tutorials/idtech/dynamic-outdoor-lighting-techniques.php Dynamic outdoor lighting techniques]<br />
* Modwiki's summarized Doom 3 lighting article: [https://modwiki.dhewm3.org/Light Light]<br />
<br />
<br />
{{tutorial-editing}}<br />
[[Category:Lighting]]<br />
[[Category:Ambient Light]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=The_Dark_Mod_-_Compilation_Guide&diff=29485The Dark Mod - Compilation Guide2022-04-15T11:18:51Z<p>Stgatilov: Updated instructions for 2.11+</p>
<hr />
<div>'''Intended article audience:''' engine coders<br />
<br />
This guide should provide you with enough information to compile The Dark Mod's game code from source.<br />
It applies to version 2.09 or later version of TDM. If you want to compile older version, see the history of this wiki page.<br />
Brief compilation instructions are also included in <tt>COMPILING.txt</tt> file in the source code package.<br />
<br />
<br />
== Get the sources ==<br />
<br />
The sources are available through "snapshots", i.e. whenever the Dark Mod team is releasing a new update (e.g. TDM 2.09) the corresponding sources are released as well.<br />
* You can download a source code archive from the Downloads page: http://www.thedarkmod.com/downloads/<br />
The executables built from these sources are compatible with the latest official release of TDM.<br />
<br />
<br />
Also you can get the very latest source code directly from SVN:<br />
* Public read-only access: https://svn.thedarkmod.com/publicsvn/darkmod_src/trunk/<br />
* Team members only: https://svn.thedarkmod.com/svn/darkmod_src/trunk <br />
<br />
Be warned though that these sources '''might be incompatible with your local darkmod installation'''.<br />
To minimize the problem, developer builds of the game are available in tdm_installer.<br />
Each developer build is named like <tt>devXXXXX-YYYY</tt>, where YYYY is the SVN revision number which this version was built from.<br />
If you checkout this exact revision from the source code SVN and build executable from it, it will surely be compatible with the corresponding dev. build of TDM.<br />
<br />
== Directory structure ==<br />
<br />
Put the source code directory next to your game directory, such that the directory structure looks like this:<br />
<br />
C:\Games\darkmod <-- your darkmod installation<br />
C:\Games\darkmod_src <-- your source folder (containing the solution)<br />
<br />
This directory structure is recommended for both Windows and Linux.<br />
<br />
For windows users (this may also apply to linux users) - Install tortoise SVN and then right click on the \darkmod_src folder and select checkout. Then in the url field put 'https://svn.thedarkmod.com/publicsvn/darkmod_src/trunk/' then click ok (see screenshot below)<br />
<br />
[[File:Darkmod src.jpg|thumb]]<br />
{{clear}}<br />
<br />
== Windows ==<br />
<br />
Since TDM 2.11 you'll need Visual Studio 2022 to compile the project (VS2017 was used before that).<br />
The free Community Edition works fine, it can be downloaded [https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15 approximately here]. Additionally, you have to:<br />
* Make sure "Visual C++ MFC for x86 and x64" is being installed by MSVC installer, along with "Desktop development with C++" workflow (see screenshot below).<br />
<br />
[[File:Unknown.png|thumb]]{{clear}}<br />
<br />
You'll find a <tt>TheDarkMod.sln</tt> solution file in the source code folder, which you can double-click to open in Visual Studio. The solution is designed to put the compiled binaries into the ../darkmod folder nearby, that's why we recommend using the directory layout shown above. (You can change the output paths in the property sheets, in case you know how to do that).<br />
<br />
Once the solution is opened, select the Configuration in the topmost toolbar (either "release" or "debug", depending on what you want to do) and Platform (either Win32 or x64). Then hit "Build Solution" ({{Ctrl}}-{{Shift}}-{{key|B}} or {{F7}}). The compilation usually takes a minute or two, watch the output window at the bottom of Visual Studio. After completion you'll find the compiled binary in your darkmod/ folder. It would be either <tt>TheDarkMod.exe</tt> or <tt>TheDarkModx64.exe</tt>, depending on the configuration used.<br />
<br />
=== Debugging the Engine/Game ===<br />
To debug your custom built code, you need to attach Visual Studio's debugger to the TheDarkMod.exe process. There are two ways to accomplish that:<br />
<br />
The quick one:<br />
# Go to Visual Studio and open the TheDarkMod solution<br />
# Make sure the "DarkModTools" project is marked bold (as "Startup project") <br />
# Compile and hit run (F5), Studio will start your TheDarkMod.exe and attach automatically<br />
<br />
The manual way:<br />
# Start your custom TheDarkMod.exe through Windows Explorer or shortcuts<br />
# Once the game is up and running, Alt-Tab back to Visual Studio<br />
# Go to menu "Debug" > "Attach to Process..." and select the TheDarkMod.exe process from the list in that dialog popping up.<br />
# The debugger will now attach to TDM and you can now place breakpoints or intercept game crashes.<br />
<br />
=== Troubleshooting ===<br />
;My breakpoints don't work (they are hollow circles instead of full ones)<br />
:Make sure you're attached to the correct TheDarkMod.exe binary. If you're attaching to an older version (e.g. from an outdated compilation process) or one you haven't built in Studio yourself, VC++ won't be able to load the symbols from the .pdb files. Make sure that the configuration type (release or debug build) is matching as well.<br />
<br />
;I cannot inspect all the variables / The instruction pointer is skipping code<br />
:You are probably running a release build, which comes with some optimisations. When debugging a release build, you'll notice that your instruction pointer (the yellow arrow) is sometimes skipping statements, which have most likely been optimised out of the binary during compilation/linking. You'll also have troubles when trying to inspect temporary variables or inlined functions. Use a debug build if this prevents you from figuring out things during debugging.<br />
<br />
;Debugging works well, but the game plays too slowly<br />
:You are running debug build, which is much slower than release. There are several ways to make life easier. First, you can get to the place where problem happens in release build and save your game there, then run debug build and load the game to do debugging. Second, you can try the "Debug with inlines" configuration, which is faster than full debug build, but is still very convenient to debug. If this is not fast enough for you, you can also debug the release build directly, but be aware that breakpoints and watches do not always work due to optimizations. Note that even release build is slower with debugger than without it because of debug heap. You can disable it by setting environment variable [https://ofekshilon.com/2014/09/20/accelerating-debug-runs-part-1-_no_debug_heap-2/ _NO_DEBUG_HEAP=1]. If you do it properly, then your release build should run with full speed.<br />
<br />
== Linux ==<br />
<br />
You need GCC 5 or newer to build TDM on Linux.<br />
Anything older than GCC 4.7 surely won't work.<br />
CMake >= 3.14 is required starting from TDM 2.08.<br />
<br />
You first need to create a build directory. Easiest option is to create a subdirectory in the source code<br />
root directory ("darkmod_src"):<br />
mkdir build && cd build<br />
From your build directory, call CMake:<br />
cmake -DCMAKE_BUILD_TYPE="Release" ..<br />
The '..' indicate the path to the source directory. If you chose a different location for your build directory<br />
instead of the suggested subdirectory, you have to adjust this parameter accordingly. Finally, build TDM by calling<br />
make -j<br />
where the '-j' parameter instructs make to build the project in parallel for faster compile times.<br />
<br />
For newer Ubuntu and Linux Mint versions, it may be better to use:<br />
make -j$(nproc)<br />
to ensure that the number of processes is limited to available cores.<br />
<br />
<br />
If you wish to compile a debug executable, pass '-DCMAKE_BUILD_TYPE="Debug"' to the CMake call.<br />
<br />
=== Ubuntu 16.04: native ===<br />
<br />
The simplest approach is to do a native build, i.e. produce 64-bit binaries on 64-bit OS, or 32-bit binaries on 32-bit OS.<br />
Starting from a clean Ubuntu installation, here is the list of packages you need to install:<br />
<br />
sudo apt-get install subversion //svnversion: not found<br />
sudo apt-get install mesa-common-dev //no such file: "Gl/gl.h", <=2.07<br />
sudo apt-get install libxxf86vm-dev //no such file: "X11/extensions/xf86vmode.h"<br />
sudo apt-get install libopenal-dev //no such file: "AL/al.h"<br />
sudo apt-get install libxext-dev //no such file: "X11/extensions/Xext.h"<br />
sudo snap install cmake //we need a recent version of CMake, so install from snap instead of apt<br />
<br />
Now run CMake as instructed above.<br />
<br />
=== Ubuntu 16.04: 32-bit version on 64-bit OS ===<br />
<br />
If you have 64-bit Linux, you can also build and run 32-bit TDM.<br />
Note that this approach is slightly more complicated.<br />
<br />
You have to install the following packages in addition to the ones listed above:<br />
<br />
sudo apt-get install g++-multilib //no such file: 'sys/cdefs.h'<br />
sudo apt-get install libx11-dev:i386 //cannot find "-lX11"<br />
sudo apt-get install libxxf86vm-dev:i386 //cannot find "-lXxf86vm"<br />
sudo apt-get install libopenal-dev:i386 //cannot find "-lopenal"<br />
sudo apt-get install libxext-dev:i386 //cannot find "-lXext"<br />
<br />
Then you need to call CMake with a toolchain file to target 32-bit:<br />
<br />
cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_TOOLCHAIN_FILE="../sys/cmake/gcc_32bit.cmake" ..<br />
<br />
The 64-bit and 32-bit versions can be built independently on a single 64-bit Linux, but you need to use different<br />
build directories for each version.<br />
<br />
=== Other distros ===<br />
<br />
Even if you have a Linux distro different from Ubuntu, the instructions above will most likely help you.<br />
If you still have problems with your build, please report to the forums.<br />
<br />
E.g. for Kali Linux<br />
<br />
sudo apt-get update<br />
sudo apt-get install build-essential manpages-dev <br />
sudo apt-get install cmake<br />
sudo apt install libx11-dev <br />
sudo apt-get install libxxf86vm-dev <br />
sudo apt-get install libxext-dev<br />
<br />
== I have a bugfix for the team ==<br />
<br />
In case you figured out a problem in the TDM game code and you maybe even have a fix available, please drop by at our forums to tell the coding staff. Your fix might be incorporated in the main development branch.<br />
<br />
See also [[Reporting Problem]] article.<br />
<br />
== Working in SVN ==<br />
<br />
If you work directly with [https://svn.thedarkmod.com/svn/darkmod_src/trunk SVN], make sure that [http://svnbook.red-bean.com/en/1.7/svn.ref.svnversion.re.html svnversion] command works properly in OS console:<br />
* ''Windows'': install TortoiseSVN '''with "command line client tools" included'''.<br />
* ''Linux'': install "subversion" package.<br />
To check that it works, build TDM yourself, run it, and then open TDM console. You should see the correct SVN revision number in the lower-right corner.<br />
<br />
<br />
[[Category:Tutorial]]<br />
[[Category:Coding]]</div>Stgatilovhttps://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference&diff=29407TDM Script Reference2022-03-20T01:59:16Z<p>Stgatilov: Regenerated script reference (2.10 released).</p>
<hr />
<div>This page has been generated automatically by the tdm_gen_script_event_doc console command.<br />
<br />
Generated by The Dark Mod 2.10, code revision 9853, last update: 2022-03-20 09:00<br />
<br />
{{tdm-scripting-reference-intro}}<br />
<div class="toclimit-4"><br />
__TOC__<br />
</div><br />
= TDM Script Event Reference =<br />
<br />
== All Events ==<br />
=== Alphabetic List ===<br />
==== scriptEvent void '''accelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover accelerates.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''accelTime'''(float time); ====<br />
<br />
:Sets the acceleration time. Set this acceleration time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''accelTo'''(float speed, float time); ====<br />
<br />
:Initiates an acceleration to the given speed over the given time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''acos'''(float cosine); ====<br />
<br />
:Returns the angle in degrees with the given cosine.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
:Spawnclasses responding to this event: ''CTarget_AddObjectives'', ''CTarget_CallScriptFunction'', ''CTarget_ChangeEntityRelation'', ''CTarget_ChangeLockState'', ''CTarget_ChangeTarget'', ''CTarget_InterMissionTrigger'', ''CTarget_ItemRemove'', ''CTarget_SetEntityRelation'', ''CTarget_SetFrobable'', ''CTarget_SetObjectiveComponentState'', ''CTarget_SetObjectiveState'', ''CTarget_SetObjectiveVisibility'', ''CTarget_SetRelations'', ''CTarget_SetTeam'', ''CTarget_StartConversation'', ''idAFEntity_Generic'', ''idAFEntity_WithAttachedHead'', ''idAI'', ''idActivator'', ''idAnimated'', ''idBeam'', ''idBrittleFracture'', ''idCameraAnim'', ''idCameraView'', ''idCombatNode'', ''idDamagable'', ''idEarthQuake'', ''idEntityFx'', ''idExplodable'', ''idForceField'', ''idFuncAASObstacle'', ''idFuncAASPortal'', ''idFuncPortal'', ''idFuncSmoke'', ''idItem'', ''idLight'', ''idListener'', ''idMoveable'', ''idMover'', ''idMover_Binary'', ''idPhantomObjects'', ''idPlayerStart'', ''idPortalSky'', ''idRiser'', ''idRotater'', ''idShaking'', ''idSound'', ''idStaticEntity'', ''idTarget_CallObjectFunction'', ''idTarget_Damage'', ''idTarget_EnableLevelWeapons'', ''idTarget_EndLevel'', ''idTarget_FadeEntity'', ''idTarget_FadeSoundClass'', ''idTarget_Give'', ''idTarget_LightFadeIn'', ''idTarget_LightFadeOut'', ''idTarget_PostScriptEvent'', ''idTarget_Remove'', ''idTarget_RemoveWeapons'', ''idTarget_SessionCommand'', ''idTarget_SetFov'', ''idTarget_SetGlobalShaderTime'', ''idTarget_SetInfluence'', ''idTarget_SetKeyVal'', ''idTarget_SetModel'', ''idTarget_SetShaderParm'', ''idTarget_SetShaderTime'', ''idTarget_Show'', ''idTarget_WaitForButton'', ''idTrigger_Count'', ''idTrigger_EntityName'', ''idTrigger_Fade'', ''idTrigger_Hurt'', ''idTrigger_Multi'', ''idTrigger_Timer'', ''idTrigger_Touch'', ''idVacuumSeparatorEntity''<br />
==== scriptEvent void '''activateContacts'''(); ====<br />
<br />
:Activate objects sitting on this object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''activateTargets'''(entity activator); ====<br />
<br />
:Causes this entity to activate all it's targets. Similar to how a trigger activates entities.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addDescendant'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''addInvItem'''(entity inv_item); ====<br />
<br />
:Adds the given item to the inventory. Depending on the type the passed entity will be removed from the game (as for loot items) or hidden.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addItemToInv'''(entity target); ====<br />
<br />
:Adds the entity to the given entity's inventory. Depending on the type the entity will be removed from the game (as for loot items) or hidden. Example: $book->addItemToInv($player1);<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addTarget'''(entity target); ====<br />
<br />
:Add a target to this entity.<br />
::''target'': the entity to add as target<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''addToClip'''(float amount); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''alert'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''alertAI'''(string type, float amount, entity actor); ====<br />
<br />
:internal<br />
::''type'': alert type<br />
::''amount'': alert amount<br />
::''actor'': actor causing alert<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowDamage'''(); ====<br />
<br />
:The AI can take damage again.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowDrop'''(float allow); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''allowHiddenMovement'''(float enable); ====<br />
<br />
:Normally, when hidden, monsters do not run physics. This enables physics when hidden.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''allowMovement'''(float allow); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''ammoAvailable'''(); ====<br />
<br />
:Number of shots left in inventory<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''ammoInClip'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent vector '''angToForward'''(vector angles); ====<br />
<br />
:Returns a forward vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''angToRight'''(vector angles); ====<br />
<br />
:Returns a right vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''angToUp'''(vector angles); ====<br />
<br />
:Returns an up vector for the given Euler angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''animDistance'''(float channel, string animName); ====<br />
<br />
:Returns the distance that the anim travels. If the entity has multiple anims with animName, the distance may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animDistance.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''animLength'''(float channel, string animName); ====<br />
<br />
:Returns the length of the anim in seconds. If the entity has multiple anims with animName, length may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animLength.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''animState'''(float channel, string stateFunction, float blendFrame); ====<br />
<br />
:Sets a new animation state script function for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''animTurn'''(float angle); ====<br />
<br />
:Enable/disable animation controlled turning.<br />
::''angle'': Pass in the maximum # of degrees the animation turns. Use an amount of 0 to disable.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''applyImpulse'''(entity source, float bodyid, vector point, vector impulse); ====<br />
<br />
:Applies an impulse to the entity. Example: entity.applyImpulse($player1, 0, entity.getOrigin(), '0 0 2');<br />
::''source'': Pass $null_entity or the entity that applies the impulse<br />
::''bodyid'': For articulated figures, ID of the body, 0 for the first (main) body. Otherwise use 0.<br />
::''point'': Point on the body where the impulse is applied to<br />
::''impulse'': Vector of the impulse<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''asin'''(float sine); ====<br />
<br />
:Returns the angle in degrees with the given sine.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''assert'''(float condition); ====<br />
<br />
:Breaks if the condition is zero. (Only works in debug builds.)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''attach'''(entity ent, string attName); ====<br />
<br />
:Attach an entity to the AI. Entity spawnArgs checked for attachments are: - "origin", "angles", and "joint". These must be set prior to calling attach.<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''attachToPos'''(entity ent, string position, string attName); ====<br />
<br />
:Attach an entity to the AI, using a named attachment position<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''attackBegin'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''attackEnd'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''attackMelee'''(string damageDef); ====<br />
<br />
:Returns true if the attack hit<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''attackMissile'''(string jointName); ====<br />
<br />
:returns projectile fired<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''bark'''(string sound); ====<br />
<br />
:Let the AI bark a certain sound.<br />
::''sound'': sound name, e.g. 'snd_warn_response'<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idMoveable''<br />
==== scriptEvent float '''becomeRagdoll'''(); ====<br />
<br />
:enables the ragdoll if the entity has one<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''becomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''bind'''(entity master); ====<br />
<br />
:Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindPosition'''(entity master); ====<br />
<br />
:Fixes this entity's position (but not orientation) relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindToBody'''(entity master, float bodyID, float orientated); ====<br />
<br />
:Bind to AF body<br />
::''master'': entity to bind to<br />
::''bodyID'': AF body ID to bind to<br />
::''orientated'': binds the orientation as well as position, if set to 1<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bindToJoint'''(entity master, string boneName, float rotateWithMaster); ====<br />
<br />
:Fixes this entity's position and orientation relative to a bone on another entity, such that when the master's bone moves, so does this entity.<br />
::''master'': the entity to bind to<br />
::''boneName'': the bone name<br />
::''rotateWithMaster'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''bob'''(float speed, float phase, vector distance); ====<br />
<br />
:Initiates a translation back and forth along the given vector with the given speed and phase.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''burn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''callFunction'''(string functionName); ====<br />
<br />
:Calls a function on an entity's script object. See also callGlobalFunction().<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''callGlobalFunction'''(string functionName, entity other); ====<br />
<br />
:calls a global function and passes the other entity along as the first argument calls the function in a new thread, so it continues executing in the current thread right away (unlike entity.callFunction( "blah"))<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''callGui'''(float handle, string namedEvent); ====<br />
<br />
:Calls a named event in a GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canBecomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canBeUsedBy'''(entity ent); ====<br />
<br />
:Returns true if the entity can be used by the argument entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canHitEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canHitEnemyFromAnim'''(string anim); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canHitEnemyFromJoint'''(string jointname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canPlant'''(vector traceStart, vector traceEnd, entity ignore, entity vine); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''canReachEnemy'''(); ====<br />
<br />
:Returns true if character can walk to enemy's position. For walking monsters, enemy should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canReachEntity'''(entity ent); ====<br />
<br />
:Returns true if character can walk to entity's position. For walking monsters, entity should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canReachPosition'''(vector pos); ====<br />
<br />
:Returns true if character can walk to specified position. For walking monsters, position should be near the floor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idSecurityCamera''<br />
==== scriptEvent float '''canSeeEntity'''(entity target, float useLighting); ====<br />
<br />
:This is a general version of idAI::canSee, that can be used by all entities. It doesn't regard FOV, it just performs a trace to check whether the target is occluded by world geometry. Is probably useful for stim/response as well Pass useLighting = true to take the lighting of the target entity into account. Use "isEntityHidden" as a script event with a threshold. The constant threshold value for useLighting is defined within the SDK in game/entity.h.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''canSeeExt'''(entity ent, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSee that can optionally choose to use field of vision and lighting calculations.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If b_useLighting is 0 the entity will be visible in complete darkness. If it is 1, the entity will only be visible if there is light shining on it, but the slightest light is enought. Use "isEntityHidden" as a script event with a threshold instead.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canSeePositionExt'''(vector position, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSeeExt that tests a location rather than an entity. Note that any actor at the position may make it not seeable from a distance.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If 0 the entity will be visible in complete darkness<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''canWater'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''ceil'''(float x); ====<br />
<br />
:Returns the smallest integer that is greater than or equal to the given value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''changeEntityRelation'''(entity ent, float relationChange); ====<br />
<br />
:This changes the current relation to an entity by adding the new amount.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvIcon'''(string name, string category, string icon); ====<br />
<br />
:Sets the inventory icon of the given item in the given category to <icon>.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvItemCount'''(string name, string category, float amount); ====<br />
<br />
:Decreases the inventory item stack count by amount. The item is addressed using the name and category of the item. These are usually defined on the inventory item entity ("inv_name", "inv_category") Amount can be both negative and positive.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeInvLightgemModifier'''(string name, string category, float amount); ====<br />
<br />
:Sets the lightgem modifier value of the given item. Valid arguments are between 0 and 32 (which is the maximum lightgem value).<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''changeLootAmount'''(float type, float amount); ====<br />
<br />
:Changes the loot amount of the given Type (e.g. GOODS) by <amount>. The mission statisic for loot found gets changed too. The new value of the changed type is returned (e.g. the new GOODS value if this has been changed). Note: The LOOT_TOTAL type can't be changed and 0 is returned.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY<br />
::''amount'': can be negative<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''changeWeaponName'''(string weaponName, string displayName); ====<br />
<br />
:Changes the display name of the given weapon item to something different. Pass an empty string to reset the display name to the definition as found in the weaponDef.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''changeWeaponProjectile'''(string weaponName, string projectileDefName); ====<br />
<br />
:Changes the projectile entityDef name of the given weapon (e.g. "broadhead") to the specified entityDef (e.g. "atdm:projectile_broadhead").<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''chargeAttack'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''checkAAS'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''checkAbsence'''(); ====<br />
<br />
:description missing<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''checkAnim'''(float channel, string animName); ====<br />
<br />
:Ensures that the animation exists and causes an error if it doesn't.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''chooseAnim'''(float channel, string animName); ====<br />
<br />
:Chooses a random anim and returns the name. Useful for doing move tests on anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''clearActiveInventoryMap'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearActiveInventoryMapEnt'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearAllJoints'''(); ====<br />
<br />
:Removes any custom transforms on all joints.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''clearBurn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearController'''(); ====<br />
<br />
:Need separate clearController because scripting doesn't like passing in $null_entity? (greebo: one could remove this function and set the argument type of setController to 'E'.<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent void '''clearEnemy'''(); ====<br />
<br />
:Clears the enemy entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearFlyOffset'''(); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at to the value set in the def file.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''clearJoint'''(float jointnum); ====<br />
<br />
:Removes any custom transforms on the specified joint.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''clearMouseDeadTime'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''clearPersistantArgs'''(); ====<br />
<br />
:Clears data that persists between maps.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''clearSignal'''(float signalNum); ====<br />
<br />
:Disables the callback function on the specified signal.<br />
::''signalNum'': signal number<br />
<br />
:Spawnclasses responding to this event: <br />
==== scriptEvent void '''clearSignalThread'''(float signalNum, entity ent); ====<br />
<br />
:Clears the script callback function set for when the given signal is raised on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''clearWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''clipSize'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''Close'''(); ====<br />
<br />
:Closes the frobmover, regardless of its previous state. Mover must be open, otherwise nothing happens.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover'', ''idMover_Binary''<br />
==== scriptEvent entity '''closestEnemyToPoint'''(vector point); ====<br />
<br />
:Returns the enemy closest to the given location.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''closestReachableEnemy'''(); ====<br />
<br />
:Used for determining tactile alert targets<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''closestReachableEnemyOfEntity'''(entity team_mate); ====<br />
<br />
:Finds another character's closest reachable enemy<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''copyBind'''(entity other); ====<br />
<br />
:copy bind information of other to this entity (i.e., bind this entity to the same entity that other is bound to)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''copySpawnArgs'''(entity ent); ====<br />
<br />
:copies the spawn args from an entity<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''cos'''(float degrees); ====<br />
<br />
:Returns the cosine of the given angle in degrees.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''createMissile'''(string jointname); ====<br />
<br />
:returns projectile created<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''createMissileFromDef'''(string defName, string jointName); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''createOverlay'''(string guiFile, float layer); ====<br />
<br />
:Creates a GUI overlay. (must be used on the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''createProjectile'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''CreateTimer'''(float stimId, float hour, float minutes, float seconds, float milliseconds); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''CrossProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the cross product of the two vectors.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''cullAll'''(); ====<br />
<br />
:Cull (remove from world) all entities.<br />
<br />
:Spawnclasses responding to this event: ''Seed''<br />
==== scriptEvent void '''customDeath'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''damage'''(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale); ====<br />
<br />
:Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).<br />
::''inflictor'': the entity causing the damage (maybe a projectile)<br />
::''attacker'': the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)<br />
::''dir'': the direction the attack is coming from.<br />
::''damageDefName'': the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")<br />
::''damageScale'': the scale of the damage (pass 1.0 as default, this should be ok).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''dampenSound'''(float dampen); ====<br />
<br />
:Toggle whether the shattering sound is dampened on the window, e.g., when covered by moss.<br />
::''dampen'': 1 = dampened, 0 = not dampened<br />
<br />
:Spawnclasses responding to this event: ''idBrittleFracture''<br />
==== scriptEvent void '''deathMenu'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''debug_tdm_material'''(string file); ====<br />
<br />
:For temporary debuging purposes only. Should be removed eventually.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugArrow'''(vector color, vector start, vector end, float size, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugBounds'''(vector color, vector mins, vector maxs, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugCircle'''(vector color, vector origin, vector dir, float radius, float numSteps, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''debugLine'''(vector color, vector start, vector end, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''decelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover decelerates.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''decelTime'''(float time); ====<br />
<br />
:Sets the deceleration time. Set this deceleration time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''decelTo'''(float speed, float time); ====<br />
<br />
:Initiates a deceleration to the given speed over the given time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''destroyOverlay'''(float handle); ====<br />
<br />
:Destroys a GUI overlay. (must be used on the player)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''directDamage'''(entity damageTarget, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
:Spawnclasses responding to this event: ''Seed'', ''idMover_Binary'', ''idTrigger''<br />
==== scriptEvent void '''disableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disableAnimchannel'''(float channel); ====<br />
<br />
:Used to disable a certain animchannel (for example if the ai is dead)<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableClip'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''disableEyeFocus'''(); ====<br />
<br />
:Disables eye focus.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableGravity'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''DisableLegIK'''(float num); ====<br />
<br />
:disables leg IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disablePain'''(); ====<br />
<br />
:Disables pain animations.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableSplineAngles'''(); ====<br />
<br />
:Disables aligning the mover with the spline direction.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''DisableWalkIK'''(); ====<br />
<br />
:disables walk IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''disableWeapon'''(); ====<br />
<br />
:Lowers and disables the player weapon.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''distanceTo'''(entity other); ====<br />
<br />
:Returns the distance of this entity to another entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''distanceToPoint'''(vector point); ====<br />
<br />
:Returns the distance of this entity to a point.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''DotProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the dot product of the two vectors.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''drawText'''(string text, vector origin, float scale, vector color, float align, float lifetime); ====<br />
<br />
:text drawing for debugging. lifetime of 0 == 1 frame.<br />
::''align'': 0 = left, 1 = center, 2 = right<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''dropAttachment'''(string attName); ====<br />
<br />
:Drop the attachment for the given attachment name.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''dropAttachmentInd'''(float index); ====<br />
<br />
:Drop the attachment for the given index.<br />
::''index'': starts at 0<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''dropTorch'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''ejectBrass'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''emitParticle'''(string particle, float startTime, float diversity, vector origin, vector angle); ====<br />
<br />
:Start a particle effect in the world without using an entity emitter. Will emit one quad per particle stage when first called with sys.getTime() as the start time. Designed to be called once per frame with the same startTime each call to achieve a normal particle effect, or on demand with sys.getTime() as the startTime for finer grained control, 1 quad at a time. Returns True (1) if there are more particles to be emitted from the stage, False (0) if the stage has released all its quads.<br />
::''particle'': String: name of particle effect.<br />
::''startTime'': Game seconds since map start: use sys.getTime() for the first call unless you want to back-date the particle so that it starts part way through its cycle.<br />
::''diversity'': Randomizer value between 0 and 1. All particles with the same diversity will have the same path and rotation. Use sys.random(1) for a random path.<br />
::''origin'': Origin of the particle effect.<br />
::''angle'': Axis for the particle effect. Use $<entityname>.getAngles() to align the particle to an entity. use '0 0 0' for an upright (world-aligned) particle effect.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''emitterAddModel'''(string modelName, vector modelOffset); ====<br />
<br />
:Adds a new particle (or regular, if you wish) model to the emitter, located at modelOffset units away from the emitter's origin.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter''<br />
==== scriptEvent float '''emitterGetNumModels'''(); ====<br />
<br />
:Returns the number of models/particles this emitter has. Always >= 1.<br />
<br />
:Spawnclasses responding to this event: ''idFuncEmitter''<br />
==== scriptEvent void '''emptyHand'''(string hand); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
:Spawnclasses responding to this event: ''Seed'', ''idMover_Binary'', ''idTrigger''<br />
==== scriptEvent void '''enableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enableAnim'''(float channel, float blendFrames); ====<br />
<br />
:Enables animation on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableClip'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''enableDamage'''(float enable); ====<br />
<br />
:enable/disable damage<br />
<br />
:Spawnclasses responding to this event: ''idMoveable''<br />
==== scriptEvent void '''enableEyeFocus'''(); ====<br />
<br />
:Enables eye focus.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableGravity'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''EnableLegIK'''(float num); ====<br />
<br />
:enables leg IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enablePain'''(); ====<br />
<br />
:Enables pain animations.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableSplineAngles'''(); ====<br />
<br />
:Enables aligning the mover with the spline direction.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''EnableWalkIK'''(); ====<br />
<br />
:enables walk IK<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''enableWeapon'''(); ====<br />
<br />
:Enables the player weapon.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''endState'''(); ====<br />
<br />
:Ends the current state with the given name, returns TRUE if more than one state is remaining.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''endZoom'''(float duration); ====<br />
<br />
:Starts the zoom out event, which performs a gradual transition back to the default FOV. May be called during a transition as well to intercept a pending zoom in transition.<br />
::''duration'': duration of the transition in msec<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''enemyInCombatCone'''(entity combatNode, float use_current_enemy_location); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyPositionValid'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyRange'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''enemyRange2D'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''entityInAttackCone'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''error'''(string text); ====<br />
<br />
:Issues an error.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''exitTeleporter'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''extinguishLights'''(); ====<br />
<br />
:Extinguishes all lights (i.e. the <self> entity plus all bound lights)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''faceEnemy'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''faceEntity'''(entity ent); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''facingIdeal'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''fadeIn'''(vector color, float time); ====<br />
<br />
:Fades towards the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeInLight'''(float time); ====<br />
<br />
:Turns the light on over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''fadeOut'''(vector color, float time); ====<br />
<br />
:Fades from the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeOutLight'''(float time); ====<br />
<br />
:Turns the light out over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''fadeSound'''(float channel, float newLevel, float fadeTime); ====<br />
<br />
:Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''fadeTo'''(vector color, float alpha, float time); ====<br />
<br />
:Fades to the given color up to the given alpha over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''fadeToLight'''(vector color, float time); ====<br />
<br />
:Fades the light to the given color over a given time.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''findActorsInBounds'''(vector mins, vector maxs); ====<br />
<br />
:Returns an entity within the bounds specified<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemy'''(float onlyInFov); ====<br />
<br />
:Finds enemy player in PVS<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemyAI'''(float onlyInFov); ====<br />
<br />
:Finds enemy monster in PVS<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findEnemyInCombatNodes'''(); ====<br />
<br />
:Finds enemy player in attack cones<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''findFriendlyAI'''(float team); ====<br />
<br />
:Use this to find a visible AI friendly to ourselves. It basically iterates over all active entities in the map and looks for friendly actors. The pythagorean distance is taken to evaluate the distance. Don't call this every frame, this might get expensive in larger maps. Returns the nearest visible actor entity or the $null_entity, if none was found.<br />
::''team'': used to constrain the search to a given team. Set this to -1 to let the code ignore this argument<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''finishAction'''(string action); ====<br />
<br />
:Finishes the given wait action.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''finishChannelAction'''(float channel, string animname); ====<br />
<br />
:Overloaded finishAction function for setting the waitstate on each channel separately<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''fireMissileAtTarget'''(string jointname, string targetname); ====<br />
<br />
:Launches a missile at entity specified by 'attack_target'. returns projectile fired<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''firstPerson'''(); ====<br />
<br />
:Returns view control to the player entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''flashlight'''(float enable); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''flee'''(entity entToFleeFrom, float algorithm, float distanceOption); ====<br />
<br />
:Flee from the given entity. Pass the escape point lookup algorithm (e.g. EP_FIND_GUARDED) and the distanceOption (e.g. EP_DIST_NEAREST) to specify how the best escape point can be found. Refer to the tdm_defs.script file to see all the constants. When algorithm is set to EP_FIND_AAS_AREA_FAR_FROM_THREAT, the distanceOption is interpreted as minimum threat distance. Returns FALSE if no escape point could be found.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''floor'''(float x); ====<br />
<br />
:Returns the largest integer that is less than or equal to the given value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated''<br />
==== scriptEvent void '''foundBody'''(entity body); ====<br />
<br />
:Objective callback for when an AI finds a body.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''frob'''(); ====<br />
<br />
:Frobs the entity (i.e. simulates a frob action performed by the player). Returns TRUE if the entity is frobable, FALSE otherwise.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''frobHilight'''(float state); ====<br />
<br />
:ishtvan: Tries to make the entity frobhilight or not<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''frobRidable'''(entity playerController); ====<br />
<br />
:Called when a player directly mounts or dismounts a ridable AI.<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent void '''Gas_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': the entity causing the knockout, can be the $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getActualStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getAcuity'''(string type); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getAlertActor'''(); ====<br />
<br />
:Get the actor that alerted the AI in this frame.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getAlertLevelOfOtherAI'''(entity otherEntity); ====<br />
<br />
:This event gets the alert number of another AI (AI_AlertLevel variable value) Returns the alert number of the other AI, 0.0 if its not an AI or is NULL<br />
::''otherEntity'': the other AI entity who's alert number is being queried<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getAngles'''(); ====<br />
<br />
:Returns the current orientation of this entity (relative to bind parent if any).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getAngularVelocity'''(); ====<br />
<br />
:Gets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getAngularVelocityB'''(float id); ====<br />
<br />
:Get the angular velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent string '''getAnimState'''(float channel); ====<br />
<br />
:Returns the name of the current animation state script function used for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttachment'''(string attName); ====<br />
<br />
:Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttachmentInd'''(float index); ====<br />
<br />
:Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists<br />
::''index'': starts at 0<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getAttacker'''(); ====<br />
<br />
:Returns the attacking entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getAttackFlag'''(float combatType); ====<br />
<br />
:Returns 1 if the given attack flag is activated.<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getAudThresh'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getAxialDir'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent entity '''getBindChild'''(float ind); ====<br />
<br />
:Returns the ind_th bind child of this entity or NULL if index is invalid. NOTE: indices start at zero<br />
::''ind'': child index<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getBindMaster'''(); ====<br />
<br />
:Returns the entity's bindmaster<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''getBoolKey'''(string key); ====<br />
<br />
:Retrieves the boolean value of a specific spawn arg, defaulting to false.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getButtons'''(); ====<br />
<br />
:Returns the button state from the current user command.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getCalibratedLightgemValue'''(); ====<br />
<br />
:Returns the calibrated light gem value.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getClipMask'''(); ====<br />
<br />
:Returns the clipmask of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getClosestHiddenTarget'''(string entity_type); ====<br />
<br />
:Finds the closest targeted entity of the specified type.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getColor'''(); ====<br />
<br />
:Gets the color of this entity (shader parms Parm0, Parm1, Parm2).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getCombatNode'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getContents'''(); ====<br />
<br />
:Returns the contents of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvCategory'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory category.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvIcon'''(); ====<br />
<br />
:Returns the icon of the currently highlighted inventory item.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getCurInvItemEntity'''(); ====<br />
<br />
:Returns the currently highlighted inventory item entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvItemId'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_item_id"). Most items will return an empty string, unless the "inv_item_id" is set on purpose.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getCurInvItemName'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_name").<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getCurrentMissionNum'''(); ====<br />
<br />
:Returns the number of the current mission (0-based, the first mission has number 0).<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getCurrentWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player is currently holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getCurrentYaw'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getCurWeaponName'''(); ====<br />
<br />
:Returns the name of the current weapon, as defined by "inv_weapon_name" in the weaponDef.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getcvar'''(string name); ====<br />
<br />
:Returns the string for a cvar.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getDifficultyLevel'''(); ====<br />
<br />
:Returns 0 (Easy), 1 (Medium) or 2 (Hard), depending on the difficulty level of the current mission.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getDifficultyName'''(float difficultyLevel); ====<br />
<br />
:Returns the (translated) name of the difficulty level passed as the argument.<br />
::''difficultyLevel'': 0 (Easy), 1 (Medium), 2 (Hard)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''GetDoor'''(); ====<br />
<br />
:Returns the associated door entity for this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoorHandle''<br />
==== scriptEvent entity '''GetDoorhandle'''(); ====<br />
<br />
:Returns the handle entity of this door. Can return NULL (== $null_entity)<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoor''<br />
==== scriptEvent entity '''getDragged'''(); ====<br />
<br />
:Returns the currently dragged body. Returns $null_entity if the body is shouldered, the player has nothing in his hands, or he has a non-AF entity in his hands. See also getShouldered(), getGrabbed() and getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idSecurityCamera''<br />
==== scriptEvent vector '''getEnemyEyePos'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getEnemyPos'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getEntity'''(string name); ====<br />
<br />
:Returns a reference to the entity with the specified name.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getEntityFlag'''(string flagName); ====<br />
<br />
:Returns the value of the specified entity flag.<br />
::''flagName'': Can be one of (case insensitive): notarget: if true never attack or target this entity noknockback: if true no knockback from hits takedamage: if true this entity can be damaged hidden: if true this entity is not visible bindOrientated: if true both the master orientation is used for binding solidForTeam: if true this entity is considered solid when a physics team mate pushes entities forcePhysicsUpdate: if true always update from the physics whether the object moved or not selected: if true the entity is selected for editing neverDormant: if true the entity never goes dormant isDormant: if true the entity is dormant hasAwakened: before a monster has been awakened the first time, use full PVS for dormant instead of area-connected invisible: if true this entity cannot be seen inaudible: if true this entity cannot be heard <br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getEntityKey'''(string key); ====<br />
<br />
:Retrieves the entity specified by the spawn arg.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getEyePos'''(); ====<br />
<br />
:Get eye position of the player and the AI<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent vector '''getFinalAngVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getFinalVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getFloatKey'''(string key); ====<br />
<br />
:Retrieves the floating point value of a specific spawn arg, defaulting to 0.0f.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getFov'''(); ====<br />
<br />
:This returns the current FOV of the player. You can modify the current FOV with startZoom() and endZoom().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''GetFractionalPosition'''(); ====<br />
<br />
:Returns a fraction between 0.00 (closed) and 1.00 (open).<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''getFrameTime'''(); ====<br />
<br />
:returns the length of time between game frames. this is not related to renderer frame rate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getFrobbed'''(); ====<br />
<br />
:Returns the currently frobhilighted entity. This includes entities the player has in his hands. Sets "frob only used by" mode<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getGrabbed'''(); ====<br />
<br />
:Returns the currently entity in the players hands. Returns $null_entity if the player has nothing in his hands Dragging or shouldering a body counts as grabbing it. See also getDragged(), getShouldered(), getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getGui'''(float handle); ====<br />
<br />
:Returns the file currently loaded by a GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getGuiFloat'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getGuiInt'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getGuiString'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getHead'''(); ====<br />
<br />
:Returns the entity used for the character's head, if it has one.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getHealth'''(); ====<br />
<br />
:Returns the current health.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getHinderance'''(string source); ====<br />
<br />
:Used to get hinderance from a source.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getIdealWeapon'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: <br />
==== scriptEvent float '''getImmobilization'''(string source); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getIncidenceAngle'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent float '''getIntKey'''(string key); ====<br />
<br />
:Retrieves the integer value of a specific spawn arg, defaulting to 0.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getInventoryOverlay'''(); ====<br />
<br />
:Gets the default inventory overlay for the player. All other entities will return an invalid value.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getJointAngle'''(float jointnum); ====<br />
<br />
:Returns the angular orientation of the joint in world space.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent float '''getJointHandle'''(string jointname); ====<br />
<br />
:Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent vector '''getJointPos'''(float jointnum); ====<br />
<br />
:Returns the position of the joint in world space.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent vector '''getJumpVelocity'''(vector pos, float speed, float max_jump_height); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getKey'''(string key); ====<br />
<br />
:Retrieves the value of a specific spawn arg, defaulting to ''.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getLightInPVS'''(float falloff, float scaling); ====<br />
<br />
:Computes the sum of all light in the PVS of the entity you call this on, and returns a vector with the sum.<br />
::''falloff'': 0: no falloff with distance 0.5: sqrt(linear) falloff (dist 100 => 1/10) 1: linear falloff (dist 100 => 1/100) 2: square falloff (dist 100 => 1/10000) <br />
::''scaling'': factor to scale the distance, can be used to lower/raise distance factor after the linear or square scaling has been used good looking values are approx: sqrt(linear): 0.01, linear: 0.1, square 1.0<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getLightLevel'''(); ====<br />
<br />
:Get level (intensity) of a light, <= 0.0 indicates it is off<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent vector '''getLightOrigin'''(); ====<br />
<br />
:Get the light origin (independent of its visual model)<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent vector '''getLinearVelocity'''(); ====<br />
<br />
:Gets the current linear velocity of this entity. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getLinearVelocityB'''(float id); ====<br />
<br />
:Get the linear velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent entity '''getLocation'''(); ====<br />
<br />
:Returns the idLocation entity corresponding to the entity's current location. This was player-specific before, but is now available to all entities.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getLocationPoint'''(vector point); ====<br />
<br />
:Returns the idLocation entity corresponding to the specified point's location.<br />
::''point'': point whose location to check<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''GetLock'''(); ====<br />
<br />
:Returns the associated lock of this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobLockHandle''<br />
==== scriptEvent float '''getLootAmount'''(float type); ====<br />
<br />
:Returns the amount of loot for the given type (e.g. LOOT_GOODS). Pass LOOT_TOTAL to return the sum of all loot types.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY, LOOT_TOTAL<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getMainAmbientLight'''(); ====<br />
<br />
:Returns the entity of the main ambient light.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getMass'''(float body); ====<br />
<br />
:Gets mass of a body for an entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getMaxs'''(); ====<br />
<br />
:Gets the maximum corner of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getMeleeActPhase'''(); ====<br />
<br />
:Returns the current melee action phase (holding,recovering,etc).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeActState'''(); ====<br />
<br />
:Returns the current melee action state (attacking/defending).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeActType'''(); ====<br />
<br />
:Returns the current melee action type (overhead,thrust,etc.).<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeLastActTime'''(); ====<br />
<br />
:Returns the melee type of the last attack to hit this actor. Defaults to MELEETYPE_UNBLOCKABLE if we were not hit before.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeLastHitByType'''(); ====<br />
<br />
:Returns the game time that the most recent melee action ended (in ms)<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getMeleeResult'''(); ====<br />
<br />
:Get the result of the last melee action Follows MELEERESULT_* enum defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent vector '''getMins'''(); ====<br />
<br />
:Gets the minimum corner of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getMissionStatistic'''(string statisticName); ====<br />
<br />
:Returns current mission statistic.<br />
::''statisticName'': Can be one of (case insensitive): gamePlayTime: gameplay time in seconds damageDealt: damage dealt to enemies damageReceived: damage received by player healthReceived: health received by player pocketsPicked: pockets picked by player foundLoot: loot found by player missionLoot: total loot available in mission totalTimePlayerSeen: total time the player was seen by enemies in seconds. Updates only when AI lose sight of player numberTimesPlayerSeen: number of times player was seen by enemies numberTimesAISuspicious: number of times AI was 'observant' or 'suspicious'. A single AI passing through both alert levels will add 2 to the score. numberTimesAISearched: number of times AI was 'investigating' or 'searching'. A single AI passing through both alert levels will add 2 to the score. sightingScore: sighting score (number of times player was seen * weight) stealthScore: stealth score (sighting score + alerts * weights) killedByPlayer: number of enemies killed by player knockedOutByPlayer: number of enemies knocked out by player bodiesFound: number of times enemies have spotted a body secretsFound: number of secrets found by the player secretsTotal: total number of secrets in the mission <br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getMouseGesture'''(); ====<br />
<br />
:Returns the results of the last mouse gesture in enum form. (see the definition for MOUSEDIR_* for which numbers correspond to which directions)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getMove'''(); ====<br />
<br />
:Returns the movement relative to the player's view angles from the current user command. vector_x = forward, vector_y = right, vector_z = up<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getMoveAnim'''(); ====<br />
<br />
:Returns the name of the player-requested movement anim for a player controlled AI vehicle<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent float '''getMoveSpeed'''(); ====<br />
<br />
:Get the movement speed.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''getMoveTime'''(); ====<br />
<br />
:Gets the movement time.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''getMoveType'''(); ====<br />
<br />
:Returns the current movetype<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getName'''(); ====<br />
<br />
:Returns the name of this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getNextEntity'''(string key, string value, entity lastMatch); ====<br />
<br />
:Discover all entities in the map. Returns $null_entity when no more found.<br />
::''key'': Optional string: prefix for spawnarg key match. E.g. "target" will match "target", "target1" etc.<br />
::''value'': Optional string: spawnarg value to match. Can be used independently of ''key''. If ''key'' is not set, all spawnargs will be checked for the value.<br />
::''lastMatch'': Last match: search will start after this entity. Use $null_entity or pass an uninitialized entity variable to start a new search.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getNextHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get the next hinderance from a source.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent string '''getNextIdleAnim'''(); ====<br />
<br />
:This returns the name of the next idle anim to be played on this AI (used by AnimState scripts).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''getNextImmobilization'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getNextInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the next inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getNextKey'''(string prefix, string lastMatch); ====<br />
<br />
:Searches for the name of a spawn arg that matches the prefix. For example, passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy", etc. The returned string is the name of the key which can then be passed into functions like getKey() to lookup the value of that spawn arg. This is useful for when you have multiple values to look up, like when you target multiple objects. To find the next matching key, pass in the previous result and the next key returned will be the first one that matches after the previous result. Pass in "" to get the first match. Passing in a non-existent key is the same as passing in "". Returns "" when no more keys match.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getNextTurnHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Get the next hinderance on the view turning from a source<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getNumAttachments'''(); ====<br />
<br />
:Return the number of attachments on an AI. Used to iterate through the attachments if desired.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getNumBodies'''(); ====<br />
<br />
:Returns the number of bodies in the AF. If the AF physics pointer is NULL, it returns 0.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent float '''getNumMeleeWeapons'''(); ====<br />
<br />
:Returns the number of melee weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_melee' set to '1'.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getNumRangedWeapons'''(); ====<br />
<br />
:Returns the number of ranged weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_ranged' set to '1'.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getObjectiveComp'''(float ObjNum, float CompNum); ====<br />
<br />
:Used to get the state of custom objective components<br />
::''ObjNum'': Starts counting at 1<br />
::''CompNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getObjectiveState'''(float ObjNum); ====<br />
<br />
:Returns the current state of the objective with the number ObjNum. State is one of the following: OBJ_INCOMPLETE = 0, OBJ_COMPLETE = 1, OBJ_INVALID = 2, OBJ_FAILED = 3<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getObjectiveVisible'''(float ObjNum); ====<br />
<br />
:Returns the current visibility of the objective with the number ObjNum.<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getObservationPosition'''(vector targetPoint, float visualAcuityZeroToOne); ====<br />
<br />
:This event is used to get a position that the AI can move to observe a given position. It is useful for looking at hiding spots that can't be reached, and performing other investigation functions. Returns a world position from which the observation can take place. Returns the current AI origin if no such point is found. @sideEffect This uses the AI_DEST_UNREACHABLE flag variable to indicate if a point was found. It will be true if none was found, false if one was found.<br />
::''targetPoint'': the world position to be observed<br />
::''visualAcuityZeroToOne'': the visual acuity of the AI on a scale of 0.0 to 1.0 where 0.0 is blind and 1.0 is perfect vision.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getObstacle'''(); ====<br />
<br />
:Gets the obstacle in the character's path<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getOrigin'''(); ====<br />
<br />
:Returns the current position of this entity (relative to bind parent if any).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getOwner'''(); ====<br />
<br />
:Returns the owning entity<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent string '''getPainAnim'''(); ====<br />
<br />
:Returns the name of the pain animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''getPersistantFloat'''(string key); ====<br />
<br />
:Returns the floating point value for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getPersistantString'''(string key); ====<br />
<br />
:Returns the string for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getPersistantVector'''(string key); ====<br />
<br />
:Returns the vector for the given persistent arg<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortAISoundLoss'''(float handle); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortalHandle'''(); ====<br />
<br />
:Returns the portal handle.<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent float '''getPortPlayerSoundLoss'''(float handle); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getPortSoundLoss'''(float handle); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getPrevInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the previous inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent string '''getPreviousWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player was previously holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getPrime'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent float '''getProjectileState'''(); ====<br />
<br />
:Gets the current state of the projectile. States are defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idProjectile''<br />
==== scriptEvent float '''getProjMass'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getRadius'''(); ====<br />
<br />
:Returns the light radius.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''getRandomTarget'''(string entity_type); ====<br />
<br />
:Finds a random targeted entity of the specified type.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getReachableEntityPosition'''(entity ent); ====<br />
<br />
:Returns the position of the entity within the AAS if possible, otherwise just the entity position.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getRelation'''(float team1, float team2); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getRelationEnt'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''GetResponseEntity'''(); ====<br />
<br />
:Returns the entity which should take the response. Some entities like AI heads are not responding themselves to stims, but relay it to another entity (i.e. the bodies they're attached to).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getSecurityCameraState'''(); ====<br />
<br />
:Returns the security camera's state. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = inactive, 5 = destroyed.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent string '''getShader'''(); ====<br />
<br />
:Gets the shader name used by the light.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent float '''getShaderParm'''(float parm); ====<br />
<br />
:Gets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getShouldered'''(); ====<br />
<br />
:Returns the currently shouldered body, otherwise $null_entity. See also getDragged(), getGrabbed() and getFrobbed().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getSize'''(); ====<br />
<br />
:Gets the size of this entity's bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getSndDir'''(); ====<br />
<br />
:ai hearing of sound <br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''getSoundLoss'''(); ====<br />
<br />
:Returns the sound loss value (dB).<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent float '''getSoundVolume'''(string soundName); ====<br />
<br />
:Get the volume of the sound to play.<br />
::''soundName'': the name of the sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''getSpotLight'''(); ====<br />
<br />
:Returns the spotlight used by the camera. Returns null_entity if none is used.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent string '''getState'''(); ====<br />
<br />
:Gets the current state.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent entity '''getStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent vector '''getSurfNormal'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent string '''getSurfType'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent entity '''getTactEnt'''(); ====<br />
<br />
:ai sense of touch<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getTalkTarget'''(); ====<br />
<br />
:Returns the entity (player) trying to talk to the character<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getTarget'''(float num); ====<br />
<br />
:Returns the requested target entity.<br />
::''num'': The target number. Starts at 0.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getTDMVersion'''(); ====<br />
<br />
:Get the current TDM version as integer. The value will be 108 for v1.08, 109 for v1.09 and 200 for v2.00 etc.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTeam'''(); ====<br />
<br />
:Returns the current team number.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''getTicsPerSecond'''(); ====<br />
<br />
:returns the number of game frames per second. this is not related to renderer frame rate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTime'''(); ====<br />
<br />
:Returns the current game time in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceBody'''(); ====<br />
<br />
:Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getTraceEndPos'''(); ====<br />
<br />
:Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''getTraceEntity'''(); ====<br />
<br />
:Returns a reference to the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTraceFraction'''(); ====<br />
<br />
:Returns the fraction of movement completed during the last call to trace or tracePoint.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceJoint'''(); ====<br />
<br />
:Returns the number of the skeletal joint closest to the location on the entity which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''getTraceNormal'''(); ====<br />
<br />
:Returns the normal of the hit plane during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''getTraceSurfType'''(); ====<br />
<br />
:Returns the type of the surface (i.e. metal, snow) which was hit during the last call to trace or tracePoint<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''getTurnDelta'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getTurnHinderance'''(string source); ====<br />
<br />
:* Get the hinderance on the view turning from a source<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''getTurnRate'''(); ====<br />
<br />
:Gets the rate the character turns.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getVectorKey'''(string key); ====<br />
<br />
:Retrieves the vector value of a specific spawn arg, defaulting to '0 0 0'.<br />
::''key'': spawnarg name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVectorToIdealOrigin'''(); ====<br />
<br />
:Returns the vector from where the AI is to where he ideally should be<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''getViewAngles'''(); ====<br />
<br />
:Returns the player view angles.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''getVinePlantLoc'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVinePlantNormal'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''getVisDir'''(); ====<br />
<br />
:Returns position of the last visual alert.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent entity '''getWeaponEntity'''(); ====<br />
<br />
:Returns the entity for the player's weapon<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''getWorldModel'''(); ====<br />
<br />
:Returns the entity that controls the world model<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent vector '''getWorldOrigin'''(); ====<br />
<br />
:Returns the current world-space position of this entity (regardless of any bind parent).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Gibbable'', ''idMoveableItem''<br />
==== scriptEvent void '''giveHealthPool'''(float amount); ====<br />
<br />
:This increases/decreases the healthpool of the player by the given amount. The healthpool is gradually decreased over time, healing (damaging?) the player.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''handleMissionEvent'''(entity objEnt, float eventType, string argument); ====<br />
<br />
:Generic interface for passing on mission events from scripts to the SDK. Available since TDM 1.02<br />
::''objEnt'': the entity that triggered this event (e.g. a readable)<br />
::''eventType'': a numeric identifier (enumerated both in MissionData.h and tdm_defs.script) specifying the type of event<br />
::''argument'': an optional string parameter, eventtype-specific.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''hasAnim'''(float channel, string animName); ====<br />
<br />
:Returns true when an entity has a specific animation.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''hasEnemies'''(); ====<br />
<br />
:Returns true if the actor has one or more enemies.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''hasFunction'''(string functionName); ====<br />
<br />
:checks if an entity's script object has a specific function<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''hasSeenEvidence'''(); ====<br />
<br />
:This returns 1 when the AI has seen evidence of intruders before (an enemy, a body...)<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''heal'''(string healDefName, float healScale); ====<br />
<br />
:Heals the entity this is called on using the specified healing entityDef. Returns 1 if the entity could be healed, 0 otherwise (if the entity is already at full health, for ex.)<br />
::''healDefName'': the name of the entityDef containing the healing information (e.g. "heal_potion")<br />
::''healScale'': the scaling value to be applied to the healAmount found in the healEntityDef<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''heldEntity'''(); ====<br />
<br />
:Returns the entity currently being held, or $null_entity if the player's hands are empty.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''hide'''(); ====<br />
<br />
:Makes this entity invisible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''hideByLODBias'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''holdEntity'''(entity entity); ====<br />
<br />
:Forces the player to hold an entity (e.g. puts it into the grabber). Drops whatever is in the player's hands if $null_entity is passed to it. Returns 1 if successful, 0 if not.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''idleAnim'''(float channel, string animName); ====<br />
<br />
:Plays the given idle animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''ignoreDamage'''(); ====<br />
<br />
:The AI can no longer take damage.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''inAnimState'''(float channel, string stateFunc); ====<br />
<br />
:Returns true if the given animation state script function is currently used for the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''influenceActive'''(); ====<br />
<br />
:Checks if an influence is active<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''inPVS'''(); ====<br />
<br />
:Returns non-zero if this entity is in PVS. For lights, it will return true when the light's bounding box is in PVS, even though the light may not actually be in PVS. (an unmoved shadowcasting light may not be visible to PVS areas its bounding box intersects with)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isAtRest'''(); ====<br />
<br />
:Returns true if object is not moving<br />
<br />
:Spawnclasses responding to this event: ''idMoveable''<br />
==== scriptEvent float '''isDroppable'''(); ====<br />
<br />
:Get whether an item may be dropped from the inventory<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isEnemy'''(entity ent); ====<br />
<br />
:Returns true if the given entity is an enemy.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isEntityHidden'''(entity ent, float f_sightThreshold); ====<br />
<br />
:This is an alternate version of canSee, using FOV, distance and lighting.<br />
::''f_sightThreshold'': goes from 0.0 (entity visible in complete darkness) to 1.0 (entity only visible if completely lit up).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''isFriend'''(entity ent); ====<br />
<br />
:Returns true if the given entity is a friend.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isFrobable'''(); ====<br />
<br />
:Get whether the entity is frobable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isHidden'''(); ====<br />
<br />
:checks if the entity's model is invisible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isHilighted'''(); ====<br />
<br />
:Returns true if entity is currently frobhilighted.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isInLiquid'''(); ====<br />
<br />
:Returns 1 if the entity is in or touching a liquid.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isInvisible'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''isLeaning'''(); ====<br />
<br />
:Get whether the player is leaning<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''isLight'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''isMoving'''(); ====<br />
<br />
:Returns true if a mover is moving<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''isNeutral'''(entity ent); ====<br />
<br />
:Returns true if the given entity is neutral.<br />
::''ent'': The entity in question<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''IsOpen'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is open, which is basically the same as "not closed". A mover is considered closed when it is at its close position.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''isPlayerResponsibleForDeath'''(); ====<br />
<br />
:Returns true if the player was responsible for the AI's caller's death.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''isRotating'''(); ====<br />
<br />
:Returns true if a mover is rotating<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''isType'''(string spawnclass); ====<br />
<br />
:Returns true if this entity is of the given type.<br />
::''spawnclass'': spawn class name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''isVineFriendly'''(); ====<br />
<br />
:Vine-arrow event<br />
<br />
:Spawnclasses responding to this event: ''CProjectileResult''<br />
==== scriptEvent void '''kickObstacles'''(entity kickEnt, float force); ====<br />
<br />
:Kicks any obstacle in the character's path.<br />
::''kickEnt'': pass in $null_entity if you don't have a specific entity to kick<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''kill'''(); ====<br />
<br />
:Kills the monster.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''killthread'''(string threadName); ====<br />
<br />
:Kills all threads with the specified name<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''KO_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': is the entity causing the knockout, can be the $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''launch'''(vector start, vector dir, vector velocity); ====<br />
<br />
:Launches the projectile from <start> in direction <dir> with the given <velocity><br />
<br />
:Spawnclasses responding to this event: ''idProjectile''<br />
==== scriptEvent entity '''launchMissile'''(vector origin, vector angles); ====<br />
<br />
:Returns the projectile entity<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''launchMissiles'''(string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay); ====<br />
<br />
:Launches a projectile.<br />
<br />
:Spawnclasses responding to this event: ''idAnimated''<br />
==== scriptEvent void '''launchProjectiles'''(float num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated'', ''idTestModel''<br />
==== scriptEvent float '''loadExternalData'''(string declFile, string prefix); ====<br />
<br />
:Load an external xdata declaration.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''locateEnemy'''(); ====<br />
<br />
:Updates the last known position of the enemy independent from whether or not the enemy is visible.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''log'''(float x); ====<br />
<br />
:Returns the log of the given argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''logString'''(float logClass, float logType, string output); ====<br />
<br />
:This is the script counterpart to DM_LOG<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''lookAt'''(entity focusEntity, float duration); ====<br />
<br />
:Aims the character's eyes and head toward an entity for a period of time.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtAngles'''(float yawAngleClockwise, float pitchAngleUp, float rollAngle, float durationInSeconds); ====<br />
<br />
:A look at event that just looks at a set of angles relative to the current body facing of the AI. This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but it looks at the specified angles from the current body facing of the AI.<br />
::''yawAngleClockwise'': Negative angles are to the left of the AIs body and positive angles are to the right.<br />
::''pitchAngleUp'': Negative values are down and positive values are up where down and up are defined by the body axis.<br />
::''rollAngle'': This is currently unused and does nothing.<br />
::''durationInSeconds'': The duration to look in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtEnemy'''(float duration); ====<br />
<br />
:Aims the character's eyes and head toward the current enemy for a period of time.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''lookAtPosition'''(vector lookAtWorldPosition, float durationInSeconds); ====<br />
<br />
:This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but instead of looking at an entity, it looks at a position in worldspace. That is, it turns the head of the AI to look at the position.<br />
::''lookAtWorldPosition'': position in space to look at<br />
::''durationInSeconds'': duration to look in seconds<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent string '''lookupReplacementAnim'''(string anim); ====<br />
<br />
:Returns the current replacement animation for "anim". Returns empty if no replacement anim <br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''markUsed'''(); ====<br />
<br />
:Disables the combat node if "use_once" is set on the entity.<br />
<br />
:Spawnclasses responding to this event: ''idCombatNode''<br />
==== scriptEvent float '''melee'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''meleeActionFinished'''(); ====<br />
<br />
:Called when the animation for the melee action has finished.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeActionHeld'''(); ====<br />
<br />
:Called when the melee action reaches the "hold" point.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeActionReleased'''(); ====<br />
<br />
:Called when the melee action is released from the hold point.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeAttackStarted'''(float attType); ====<br />
<br />
:Registers the start of a given melee attack Intended to be called from a script that also starts the animation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent float '''meleeAttackToJoint'''(string joint, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''meleeBestParry'''(); ====<br />
<br />
:Returns the melee type integer of the best parry given the enemy attacks at the time If no attacking enemy is found, returns default of MELEETYPE_RL Follows MELEETYPE_* enum defined in tdm_defs.script<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent string '''meleeNameForNum'''(float num); ====<br />
<br />
:Converts a melee type integer to a string name suffix Used for finding the right animation for a given type, etc. Possible names are, in order: "Over, LR, RL, Thrust, General" Where general blocks all attacks types except unblockable<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''meleeParryStarted'''(float parType); ====<br />
<br />
:Registers the start of a given melee parry Intended to be called from a script that also starts the animation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''missionFailed'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''missionSuccess'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''mouseGestureFinished'''(); ====<br />
<br />
:Returns true if the player is not currently doing a mouse gesture.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''move'''(float angle, float distance); ====<br />
<br />
:Initiates a translation with the given distance in the given yaw direction. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveOutOfRange'''(entity ent, float range); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the moving.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''moveStatus'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveTo'''(entity targetEntity); ====<br />
<br />
:Initiates a translation to the position of an entity. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveToAttackPosition'''(entity ent, string attack_anim); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToCover'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToCoverFrom'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEnemy'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEnemyHeight'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToEntity'''(entity destination); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''moveToPos'''(vector pos); ====<br />
<br />
:Initiates a translation to an absolute position. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''moveToPosition'''(vector position); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''music'''(string shaderName); ====<br />
<br />
:Starts playing background music.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''muzzleFlash'''(string jointname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''netEndReload'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''netReload'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent entity '''nextEnemy'''(entity lastEnemy); ====<br />
<br />
:Returns the next enemy the actor has acquired.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''nextWeapon'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''noShadows'''(float noShadows); ====<br />
<br />
:Sets the noShadow property on the entity to true/false, turning shadowcasting on or off for this entity.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''noShadowsDelayed'''(float noShadows, float delay); ====<br />
<br />
:Sets the noShadow property on the entity to true/false after delay in ms, turning shadows cast by this entity on or off.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
::''delay'': delay in ms<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''numBindChildren'''(); ====<br />
<br />
:Returns the number of bound entities lower down in the bind chain than this entity, but be sure to give it the topmost bindmaster<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''numSmokeEmitters'''(); ====<br />
<br />
:Returns the # of emitters defined by 'smokeParticleSystem' in the entitydef<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''numTargets'''(); ====<br />
<br />
:Returns the number of entities this entity has targeted.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''objectiveCompUnlatch'''(float ObjNum, float CompNum); ====<br />
<br />
:Unlatch an irreversible objective component that has latched into a state<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''objectiveUnlatch'''(float ObjNum); ====<br />
<br />
:Unlatch an irreversible objective that has latched into a state<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idSecurityCamera'', ''idSound''<br />
==== scriptEvent void '''offsetRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idSecurityCamera'', ''idSound''<br />
==== scriptEvent void '''onSignal'''(float signalNum, entity ent, string functionName); ====<br />
<br />
:Sets a script callback function for when the given signal is raised on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''OpenDoor'''(float master); ====<br />
<br />
:The OpenDoor method is necessary to give the FrobDoorHandles a "low level" open routine. The CFrobDoor::Open() call is re-routed to the FrobDoorHandle::Tap() method, so there must be a way to actually let the door open. Which is what this method does. Note: Shouldn't be called directly by scripters, call handle->Tap() instead. Unless you know what you're doing.<br />
<br />
:Spawnclasses responding to this event: ''CFrobDoor''<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover'', ''idMover_Binary''<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
:Spawnclasses responding to this event: ''CFrobButton'', ''CFrobLever''<br />
==== scriptEvent void '''overrideAnim'''(float channel); ====<br />
<br />
:Disables the animation currently playing on the given channel and syncs the animation with the animation of the nearest animating channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''pause'''(); ====<br />
<br />
:Pauses the current thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''pauseGame'''(); ====<br />
<br />
:Pauses the game. This should only be called for threads that are explicitly maintained by a special SDK method, because ordinary threads won't get executed during g_stopTime == true. Note: This is used by the objective GUI threads. Note: Must be called on the player entity, not the sys entity.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''performRelight'''(); ====<br />
<br />
:Deal with doused lights.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playAndLipSync'''(string soundName, string animName); ====<br />
<br />
:Play the given sound, using the given lipsync animation. The lipsync animation should just be a simple non-loopable animation of the mouth opening in a linear fashion. The code will select individual frames from this to construct a simple lipsyncing effect which is in time with the sound. Returns the length of the played sound in seconds.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent float '''playCustomAnim'''(string animName); ====<br />
<br />
:Plays the given animation on legs and torso. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''playStartSound'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''pointInLiquid'''(vector point, entity ignoreEntity); ====<br />
<br />
:Checks if a point is in a liquid, returns 1 if this is the case.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''pointIsInBounds'''(vector point, vector mins, vector maxs); ====<br />
<br />
:Returns true if the point is within the bounds specified.<br />
::''point'': test whether this point is in the bounds<br />
::''mins'': minimal corner of the bounds<br />
::''maxs'': maximal corner of the bounds<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''pow'''(float x, float y); ====<br />
<br />
:Returns the power of x to y.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''preBurn'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''predictEnemyPos'''(float time); ====<br />
<br />
:Tries to predict the player's movement based on the AAS and his direction of movement.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''preventPain'''(float duration); ====<br />
<br />
:Prevents any pain animation from being played for the given time in seconds.<br />
::''duration'': time in seconds<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''print'''(string text); ====<br />
<br />
:Prints the given string to the console.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''println'''(string text); ====<br />
<br />
:Prints the given line to the console.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''processBlindStim'''(entity stimSource, float skipVisibilityCheck); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''processVisualStim'''(entity stimSource); ====<br />
<br />
:Use this call to let the AI react to a visual stim (coming from the source entity).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''projectDecal'''(vector traceOrigin, vector traceEnd, entity passEntity, string decal, float decalSize, float angle); ====<br />
<br />
:Performs a trace from the specified origin and end positions, then projects a decal in that direction.<br />
::''traceOrigin'': Start of the trace.<br />
::''traceEnd'': End of the trace.<br />
::''passEntity'': This entity will be considered non-solid by the trace.<br />
::''decal'': Decal to be projected.<br />
::''decalSize'': Size of the decal quad.<br />
::''angle'': Angle of the decal quad.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''propagateSound'''(string soundName, float propVolMod, float msgTag); ====<br />
<br />
:Generates a propagated sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''propSound'''(string name); ====<br />
<br />
:Sound propagation scriptfunctions on all entities propagate a sound directly without playing an audible sound<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''propSoundMod'''(string name, float volMod); ====<br />
<br />
:propagate a sound directly with a volume modifier<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent vector '''pushPointIntoAAS'''(vector post); ====<br />
<br />
:Tries to push the point into a valid AAS area<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''pushState'''(string stateName); ====<br />
<br />
:Pushes the state with the given name, current one is postponed.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''radiusDamage'''(vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower); ====<br />
<br />
:damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile).<br />
::''inflictor'': the entity causing the damage<br />
::''ignore'': an entity to not cause damage to<br />
::''dmgPower'': scales the damage (for cases where damage is dependent on time)<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''radiusDamageFromJoint'''(string jointname, string damageDef); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''random'''(float range); ====<br />
<br />
:Returns a random value X where 0 <= X < range.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI'', ''idPathCorner''<br />
==== scriptEvent entity '''randomTarget'''(string ignoreName); ====<br />
<br />
:Returns a random targeted entity. Pass in an entity name to skip that entity.<br />
::''ignoreName'': the name of an entity to ignore<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''rangedThreatTo'''(entity target); ====<br />
<br />
:Could this entity threaten the given (target) entity from a distance?<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''readLightgemModifierFromWorldspawn'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''reAttachToCoords'''(string attName, string joint, vector offset, vector angles); ====<br />
<br />
:Reattach an existing attachment<br />
::''attName'': the name of the attachment we want to reattach. <br />
::''joint'': the name of the joint to attach to<br />
::''offset'': the translation offset from joint<br />
::''angles'': a (pitch, yaw, roll) angle vector that defines the rotation of the attachment relative to the joint's orientation<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''reAttachToPos'''(string attName, string position); ====<br />
<br />
:Reattach an existing attachment to a named attachment position. Example: reAttachToPos( melee_weapon, right_hand_held )<br />
::''attName'': the name of the attachment we want to reattach.<br />
::''position'': the new position we want to attach it to.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''reloadTorchReplacementAnims'''(); ====<br />
<br />
:If actor has a torch, reload the torch's replacement anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''remove'''(); ====<br />
<br />
:Removes the entity from the game. For AI, use kill() instead.<br />
<br />
:Spawnclasses responding to this event: ''idClass''<br />
==== scriptEvent void '''removeBinds'''(); ====<br />
<br />
:Removes all attached entities from the game<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeInitialSplineAngles'''(); ====<br />
<br />
:Subtracts the initial spline angles to maintain the initial orientation of the mover.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''removeKey'''(string key); ====<br />
<br />
:Removes a key from an object's spawnargs, so things like getNextKey() don't retrieve it.<br />
::''key'': the spawnarg to remove<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''removeReplacementAnim'''(string anim); ====<br />
<br />
:Removes the replacement for the given "anim"<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''removeTarget'''(entity target); ====<br />
<br />
:Remove a target from this entity.<br />
::''target'': the entity to remove from the targets<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''replaceInvItem'''(entity oldItem, entity newItem); ====<br />
<br />
:Replaces the entity <oldItem> with <newItem> in the inventory, while keeping <oldItem>'s inventory position intact. Note: The position guarantee only applies if <oldItem> and newItem share the same category. If the categories are different, the position of <newItem> is likely to be different than the one of <oldItem>. Note that <oldItem> will be removed from the inventory. If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens. Returns 1 if the operation was successful, 0 otherwise.<br />
::''newItem'': can be $null_entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResetTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''resetWeaponProjectile'''(string weaponName); ====<br />
<br />
:Reloads the original projectile def name from the weaponDef. Used to revert a change made by the event changeWeaponProjectile().<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''resetZoom'''(); ====<br />
<br />
:Cancels any pending zoom transitions and resets the FOV to normal.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''reskinCollisionModel'''(); ====<br />
<br />
:For use after setSkin() on moveables and static models, if the CM needs to be refreshed to update surface properties after a skin change. CM will be regenerated from the original model file with the new skin.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''respawn'''(); ====<br />
<br />
:Respawn<br />
<br />
:Spawnclasses responding to this event: ''idItem''<br />
==== scriptEvent void '''ResponseAdd'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseAllow'''(float type, entity responder); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseIgnore'''(float type, entity responder); ====<br />
<br />
:This functions must be called on the stim entity. It will add the response to the ignore list, so that subsequent stims, should not trigger the stim anymore.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseSetAction'''(float type, string action); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''ResponseTrigger'''(entity source, float stimType); ====<br />
<br />
:Fires a response on this entity, without a stim (a stand-alone response, so to say)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''restartPatrol'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''RestartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''restoreAddedEnts'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''restoreMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''restorePosition'''(); ====<br />
<br />
:Returns this entity to the position stored in the "origin" spawn arg. This is the position the entity was spawned in unless the "origin" key is changed. Note that there is no guarantee that the entity won't be stuck in another entity when moved, so care should be taken to make sure that isn't possible.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idAnimated'', ''idTestModel''<br />
==== scriptEvent void '''ropeRemovalCleanup'''(entity ropeEnt); ====<br />
<br />
:Called when rope arrow ropes are removed, removes stale pointers on the player object.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''rotate'''(vector angleSpeed); ====<br />
<br />
:Initiates a rotation with the given angular speed. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateDownTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by decreasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateOnce'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the current angles plus the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateTo'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''rotateUpTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by increasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''saveConDump'''(string cmd, string cmd); ====<br />
<br />
:Saves condump into FM directory; first argument is appended to dump filename, everything before last occurence of second argument is removed<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''saveGame'''(string filename); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''saveMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''say'''(string text); ====<br />
<br />
:Multiplayer - Print this line on the network<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''scaleVine'''(float factor); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''selectWeapon'''(string weapon); ====<br />
<br />
:Selects the weapon the player is holding.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''sessionCommand'''(string cmd); ====<br />
<br />
:Sends the sessioncommand to the game<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setActiveInventoryMapEnt'''(entity mapEnt); ====<br />
<br />
:Notify the player about a new active map entity. This clears out any previously active maps.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setAcuity'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAlertGracePeriod'''(float frac, float duration, float count); ====<br />
<br />
:This starts the alert grace period for an AI. Should be called in the same frame as the alert that pushes them into a higher state.<br />
::''frac'': the fraction of the alert below which they should ignore alerts during the grace period.<br />
::''duration'': the duration of the period in seconds<br />
::''count'': the number of alerts ignored above which the grace period is invalid<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAlertLevel'''(float newLevel); ====<br />
<br />
:Set the alert level (AI_AlertLevel). This should always be called instead of setting AI_AlertLevel directly.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setAngles'''(vector angles); ====<br />
<br />
:Sets the current orientation of this entity (relative to bind parent if any)<br />
::''angles'': the new orientation<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setAngularVelocity'''(vector velocity); ====<br />
<br />
:Sets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setAngularVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the angular velocity of a particular body<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setAnimPrefix'''(string prefix); ====<br />
<br />
:Sets a string which is placed in front of any animation names.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setAttackFlag'''(float combatType, float enabled); ====<br />
<br />
:Activate or deactivate the given attack flag<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setAudThresh'''(float val); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''setBoneMod'''(float allowBoneMod); ====<br />
<br />
:Enables or disables head looking (may be obsolete).<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setCamera'''(entity cameraEnt); ====<br />
<br />
:Turns over view control to the given camera entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setClipMask'''(float clipMask); ====<br />
<br />
:Sets the clipmask of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setColor'''(float parm0, float parm1, float parm2); ====<br />
<br />
:Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''SetConstraintPosition'''(string constraintName, vector position); ====<br />
<br />
:Moves the constraint with the given name that binds this entity to another entity.<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setContents'''(float contents); ====<br />
<br />
:Sets the contents of the physics object.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setController'''(entity playerController); ====<br />
<br />
:Let a player assume movement control of an AI vehicle (may be remote control as in a player on a coach pulled by a horse)<br />
<br />
:Spawnclasses responding to this event: ''CAIVehicle''<br />
==== scriptEvent float '''setCurInvCategory'''(string categoryName); ====<br />
<br />
:Sets the inventory cursor to the first item of the named category. Returns 1 on success, 0 on failure (e.g. wrong category name)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent entity '''setCurInvItem'''(string itemName); ====<br />
<br />
:Sets the inventory cursor to the named item. Returns: the item entity of the newly selected item (can be $null_entity).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setcvar'''(string name, string value); ====<br />
<br />
:Sets a cvar.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setDroppable'''(float droppable); ====<br />
<br />
:Set whether an item may be dropped from the inventory. <br />
::''droppable'': if non-zero the item becomes droppable, when called with 0 the item becomes non-droppable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setEnemy'''(entity enemy); ====<br />
<br />
:Make the given entity an enemy.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setEntityRelation'''(entity ent, float relation); ====<br />
<br />
:Set a relation to another entity, this can be friendly (>0), neutral(0) or hostile (<0)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFlyOffset'''(float offset); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setFlySpeed'''(float speed); ====<br />
<br />
:Set the speed flying creatures move at. Also sets speed for moveTypeSlide.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setFrobable'''(float frobable); ====<br />
<br />
:Set whether the entity is frobable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setFrobOnlyUsedByInv'''(float OnOff); ====<br />
<br />
:Engages or disengages a mode where we only frobhilight entities that can be used by our current inventory item. This also disables general frobactions and only allows "used by" frob actions.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setGui'''(float handle, string guiFile); ====<br />
<br />
:Loads a new file into an existing GUI.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiFloat'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiInt'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiString'''(float handle, string key, string val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setGuiStringFromKey'''(float handle, string key, entity src, string srcKey); ====<br />
<br />
:This is a kludge. It is equivelant to: setGuiString( handle, key, src.getKey(srcKey) ) However, it's used to bypass the 127 char size limit on script strings.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setHealth'''(float health); ====<br />
<br />
:Use these to set the health of AI or players (this also updates the AI_DEAD flag)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Used to set hinderance from a source.<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setImmobilization'''(string source, float type); ====<br />
<br />
:Used to set immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setJointAngle'''(float jointnum, float transform_type, vector angles); ====<br />
<br />
:Modifies the orientation of the joint based on the transform type.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''setJointPos'''(float jointnum, float transform_type, vector pos); ====<br />
<br />
:Modifies the position of the joint based on the transform type.<br />
<br />
:Spawnclasses responding to this event: ''idAnimatedEntity''<br />
==== scriptEvent void '''setKey'''(string key, string value); ====<br />
<br />
:Sets a key on this entity's spawn args. Note that most spawn args are evaluated when this entity spawns in, so this will not change the entity's behavior in most cases. This is chiefly for saving data the script needs in an entity for later retrieval.<br />
::''key'': the spawnarg to set<br />
::''value'': the value to store<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setLightgemModifier'''(string modifierName, float value); ====<br />
<br />
:Sets the named lightgem modifier to a certain value. An example would be the player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers can be set by concurrent script threads.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setLightOrigin'''(vector pos); ====<br />
<br />
:Set origin of lights independent of model origin<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
:Spawnclasses responding to this event: ''idLight'', ''idWeapon''<br />
==== scriptEvent void '''setLinearVelocity'''(vector velocity); ====<br />
<br />
:Sets the current linear velocity of this entity in units per second. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setLinearVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the linear velocity of a particular body<br />
<br />
:Spawnclasses responding to this event: ''idAFEntity_Base''<br />
==== scriptEvent void '''setModel'''(string modelName); ====<br />
<br />
:Sets the model this entity uses<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setMoveType'''(float movetype); ====<br />
<br />
:Set the current movetype. movetypes are defined in tdm_ai.script<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setName'''(string name); ====<br />
<br />
:Sets the name of this entity.<br />
::''name'': the new name<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setNeverDormant'''(float enable); ====<br />
<br />
:enables or prevents an entity from going dormant<br />
::''enable'': 1 = enable, 0 = disable<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setNextState'''(string stateFunc); ====<br />
<br />
:Sets the next state and waits until thread exits, or a frame delay before calling it. Handy for setting the state in the constructor.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setObjectiveComp'''(float ObjNum, float CompNum, float state); ====<br />
<br />
:Used to set the state of custom objective components<br />
::''ObjNum'': objective number. Starts counting at 1<br />
::''CompNum'': component number. Starts counting at 1<br />
::''state'': 1 or 0 for true or false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveEnabling'''(float ObjNum, string strIn); ====<br />
<br />
:Set an objective's enabling objectives (objectives that must be completed before that objective may be completed).<br />
::''strIn'': takes the form of a string that is a space-delimited list of integer objectives representing the new enabling objectives. E.g. : '1 2 3 4'<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveOngoing'''(float ObjNum, float val); ====<br />
<br />
:Sets objective ongoing.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveOptional'''(float ObjNum, float val); ====<br />
<br />
:Sets objective mandatory.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveState'''(float ObjNum, float State); ====<br />
<br />
:Used to set the state of objectives from the script. For example, use this to invalidate an objective when something happens in your mission. The first argument is the numerical index of the objective (taking 'user' objective indices, starting at 1). Choose from the following for the second argument: OBJ_INCOMPLETE, OBJ_COMPLETE, OBJ_INVALID, OBJ_FAILED. Use this on $player1 like $player1.setObjectiveState(1, OBJ_COMPLETE);<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveText'''(float ObjNum, string newText); ====<br />
<br />
:Modify the displayed text for an objective. Can also be a string template like #str_20000<br />
::''ObjNum'': Starts counting at 1<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setObjectiveVisible'''(float ObjNum, float val); ====<br />
<br />
:Sets objective visibility.<br />
::''val'': 1 for true, 0 for false<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (relative to it's bind parent if any)<br />
::''origin'': the new origin<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setOwner'''(entity owner); ====<br />
<br />
:Sets the owner of this entity. Entities will never collide with their owner.<br />
::''owner'': the entity which will be made owner of this entity<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setPeekOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for peeking, depending on aspect ratio.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setPeekView'''(float OnOff, vector origin); ====<br />
<br />
:Toggle whether we should use a view from a peek entity as the player's view<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setPersistantArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair that persists between maps<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortAISoundLoss'''(float handle, float value); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortPlayerSoundLoss'''(float handle, float value); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPortSoundLoss'''(float handle, float value); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setPrime'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''setRadius'''(float radius); ====<br />
<br />
:Sets the size of the bounding box, x=y=z=radius.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setRadiusXYZ'''(float x, float y, float z); ====<br />
<br />
:Sets the width/length/height of the light bounding box.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setReplacementAnim'''(string animToReplace, string replacement); ====<br />
<br />
:Replaces the animation "animToReplace" with "replacement"<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setSavePermissions'''(float permission); ====<br />
<br />
:No description<br />
::''permission'': 0<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setSecretsFound'''(float secrets); ====<br />
<br />
:Set how many secrets the player has found. Use getMissionStatistic() for getting the current value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setSecretsTotal'''(float secrets); ====<br />
<br />
:Set how many secrets exist in the map in total. Use getMissionStatistic() for getting the current value.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setShader'''(string shader); ====<br />
<br />
:Sets the shader to be used for the light.<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''setShaderParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
::''parm3'': alpha<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSightThreshold'''(float sightThreshold); ====<br />
<br />
:Set the sight threshold of the security camera: how lit up the player's lightgem needs to be in order to be seen. 0.0 to 1.0<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''setSize'''(vector min, vector max); ====<br />
<br />
:Sets the size of this entity's bounding box.<br />
::''min'': minimum corner coordinates<br />
::''max'': maximum corner coordinates<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSkin'''(string skinName); ====<br />
<br />
:Sets the skin this entity uses. Set to "" to turn off the skin.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSmokeVisibility'''(float particle_num, float on); ====<br />
<br />
:enables/disables smoke particles on bones. pass in the particle #, or ALL_PARTICLES for turning on/off all particle systems. particles are spawned in the order they appear in the entityDef<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setSolid'''(float solidity); ====<br />
<br />
:Set the solidity of the entity. If the entity has never been solid before it will be assigned solid and opaque contents/clip masks.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSoundLoss'''(float loss); ====<br />
<br />
:Sets the sound loss value (dB).<br />
<br />
:Spawnclasses responding to this event: ''idPortalEntity''<br />
==== scriptEvent void '''setSoundVolume'''(float newLevel); ====<br />
<br />
:Set the volume of the sound to play, must be issued before startSoundShader.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setSpawnArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair to be used when a new entity is spawned.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''setSpyglassOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for the spyglass, depending on aspect ratio.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setStartedOff'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent void '''setState'''(string stateFunc); ====<br />
<br />
:Sets the next state and goes to it immediately<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setSyncedAnimWeight'''(float channel, float animindex, float weight); ====<br />
<br />
:Sets the blend amount on multi-point anims.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''setTalkState'''(float state); ====<br />
<br />
:Sets whether the player can talk to this character or not.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setTalkTarget'''(entity target); ====<br />
<br />
:Sets the entity (player) trying to talk to the character<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setTeam'''(float newTeam); ====<br />
<br />
:Sets the team number of this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''SetTimerState'''(float stimId, float state); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''setTurnHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Set the hinderance on the view turning from a source<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setTurnRate'''(float rate); ====<br />
<br />
:Set the rate the character turns at<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''setViewAngles'''(vector angles); ====<br />
<br />
:Sets the player view angles, e.g. make the player facing this direction. 0 0 0 is east (along the X axis in DR), 0 90 0 north (along the Y axis in DR) 0 180 0 west, 0 270 0 south.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''setWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
:Spawnclasses responding to this event: ''tdmVine''<br />
==== scriptEvent void '''setWorldOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (regardless of any bind parent).<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''shooterFireProjectile'''(); ====<br />
<br />
:Fires a projectile.<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent float '''shooterGetAmmo'''(); ====<br />
<br />
:Get the ammonition<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent float '''shooterGetState'''(); ====<br />
<br />
:Returns the current state of this shooter.<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''shooterSetAmmo'''(float newAmmo); ====<br />
<br />
:Set the ammonition<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''shooterSetState'''(float state); ====<br />
<br />
:Activates / deactivates the shooter entity.<br />
::''state'': 1 = active, 0 = inactive<br />
<br />
:Spawnclasses responding to this event: ''tdmFuncShooter''<br />
==== scriptEvent void '''show'''(); ====<br />
<br />
:Makes this entity visible if it has a model.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
:Spawnclasses responding to this event: ''idActor'', ''idWeapon''<br />
==== scriptEvent void '''shrivel'''(float time); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''sin'''(float degrees); ====<br />
<br />
:Returns the sine of the given angle in degrees.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''slideTo'''(vector position, float time); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''smoking'''(float state); ====<br />
<br />
:flame is now smoking (1), or not (0)<br />
::''state'': 1 = smoking, 0 = not smoking<br />
<br />
:Spawnclasses responding to this event: ''idLight''<br />
==== scriptEvent entity '''spawn'''(string classname); ====<br />
<br />
:Creates an entity of the specified classname and returns a reference to the entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''SpawnFloat'''(string key, float default); ====<br />
<br />
:Returns the floating point value for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''SpawnString'''(string key, string default); ====<br />
<br />
:Returns the string for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''spawnThrowableProjectile'''(string projectileName, string jointName); ====<br />
<br />
:This method spawns a projectile of the type named by the caller and attaches it to the joint given by the caller. The projectile becomes the AI's firable projectile. Returns a pointer to a projectile entity that can be thrown by the AI. You can use AI_LaunchMissle (e* = launchMissle(v,v) ) to throw the stone.<br />
::''projectileName'': The name of the projectile to spawn (as seen in a .def file) Must be descended from idProjectile<br />
::''jointName'': The name of the joint on the model to which the particle should be attached for throwing. If this is NULL or the empty string, then it is attached to the model center.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent vector '''SpawnVector'''(string key, vector default); ====<br />
<br />
:Returns the vector for the given spawn argument.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''speed'''(float speed); ====<br />
<br />
:Sets the movement speed. Set this speed before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent float '''sqrt'''(float square); ====<br />
<br />
:Returns the square root of the given number.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''start'''(); ====<br />
<br />
:Starts a spline or anim camera moving.<br />
<br />
:Spawnclasses responding to this event: ''idCameraAnim''<br />
==== scriptEvent void '''startFx'''(string fx); ====<br />
<br />
:Starts an FX on this entity.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startGamePlayTimer'''(); ====<br />
<br />
:Resets the game play timer to zero and (re)starts it.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''startMouseGesture'''(float key, float thresh, float test, float inverted, float turnHinderance, float decideTime, float deadTime); ====<br />
<br />
:Start tracking a mouse gesture that started when the key impulse was pressed. Discretizes analog mouse movement into a few different gesture possibilities. Impulse arg can also be a button, see the UB_* enum in usercmdgen.h. For now, only one mouse gesture check at a time.<br />
::''thresh'': Waits until the threshold mouse input thresh is reached before deciding.<br />
::''test'': determines which test to do (0 = up/down, 1 = left/right, 2 = 4 directions, 3 = 8 directions).<br />
::''inverted'': inverts the movement if set to 1, does not if 0<br />
::''turnHinderance'': Sets the max player view turn rate when checking this mouse gesture (0 => player view locked, 1.0 => no effect on view turning)<br />
::''decideTime'': time in milliseconds after which the mouse gesture is auto-decided, in the event that the mouse movement threshold was not reached. A DecideTime of -1 means wait forever until the button is released.<br />
::''deadTime'': how long after attack is pressed that mouse control remains dampened by the fraction turnHinderance.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''startRagdoll'''(); ====<br />
<br />
:Switches to a ragdoll taking over the animation.<br />
<br />
:Spawnclasses responding to this event: ''idAnimated''<br />
==== scriptEvent float '''startSound'''(string sound, float channel, float netSync); ====<br />
<br />
:Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound in seconds. This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.<br />
::''sound'': the spawnarg to reference, e.g. 'snd_move'<br />
::''channel'': the channel to play on<br />
::''netSync'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''startSoundShader'''(string shaderName, float channel); ====<br />
<br />
:Plays a specific sound shader on the channel and returns the length of the sound in seconds. This is not the preferred method of playing a sound since you must ensure that the sound is loaded.<br />
::''shaderName'': the sound shader to play<br />
::''channel'': the channel to play the sound on<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startSpline'''(entity spline); ====<br />
<br />
:Starts moving along a spline stored on the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''StartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''startZoom'''(float duration, float startFOV, float endFOV); ====<br />
<br />
:Call this to start the zoom in event. The player FOV is gradually zoomed in until over the given timespan.<br />
::''duration'': duration of the transition in msec<br />
::''startFOV'': The start FOV, this is clamped to [1..179]<br />
::''endFOV'': The end FOV, this is clamped to [1..179]<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''state_light'''(float set); ====<br />
<br />
:Switches the spotlight on or off. Respects the security camera's power state.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_AI'''(float set); ====<br />
<br />
:Set whether the camera can see AIs.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_animals'''(float set); ====<br />
<br />
:Set whether the camera can see animals. Checked after seeAI or seeBodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_bodies'''(float set); ====<br />
<br />
:Set whether the camera can see bodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_see_player'''(float set); ====<br />
<br />
:Set whether the camera can see the player.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''state_sweep'''(float set); ====<br />
<br />
:Enables or disables the camera's sweeping.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''StimAdd'''(float type, float radius); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimClearIgnoreList'''(float type); ====<br />
<br />
:This clears the ignore list for the stim of the given type It can be used if an entity changes state in some way that it would no longer be ignored<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''StimRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''stop'''(); ====<br />
<br />
:Stops a spline or anim camera moving.<br />
<br />
:Spawnclasses responding to this event: ''idCameraAnim''<br />
==== scriptEvent void '''stopAnim'''(float channel, float frames); ====<br />
<br />
:Stops the animation currently playing on the given channel over the given number of frames.<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''stopFxFov'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''stopMouseGesture'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''stopMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopMoving'''(); ====<br />
<br />
:Stops any translational movement.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopPatrol'''(); ====<br />
<br />
:Stops an AI from patrolling<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopRagdoll'''(); ====<br />
<br />
:turns off the ragdoll<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''stopRotating'''(); ====<br />
<br />
:Stops any rotational movement.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopSound'''(float channel, float netSync); ====<br />
<br />
:Stops a specific sound shader on the channel.<br />
::''channel'': the channel to stop playback on<br />
::''netSync'': -<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''stopSpline'''(); ====<br />
<br />
:Stops moving along a spline.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''stopThinking'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''StopTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''strFind'''(string text, string find, float casesensitive, float start, float end); ====<br />
<br />
:Return the position of the given substring, counting from 0, or -1 if not found.<br />
::''casesensitive'': 0<br />
::''start'': 0<br />
::''end'': -1<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strLeft'''(string text, float num); ====<br />
<br />
:Returns a string composed of the first num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strLength'''(string text); ====<br />
<br />
:Returns the number of characters in the string<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strMid'''(string text, float start, float num); ====<br />
<br />
:Returns a string composed of the characters from start to start + num<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strRemove'''(string text, string remove); ====<br />
<br />
:Replace all occurances of the given substring with "". Example: StrRemove("abba","bb") results in "aa".<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strReplace'''(string text, string remove, string replace); ====<br />
<br />
:Replace all occurances of the given string with the replacement string. Example: StrRemove("abba","bb","ccc") results in "accca".<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strRight'''(string text, float num); ====<br />
<br />
:Returns a string composed of the last num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''strSkip'''(string text, float num); ====<br />
<br />
:Returns the string following the first num characters<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strToFloat'''(string text); ====<br />
<br />
:Returns the numeric value of the given string.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''strToInt'''(string text); ====<br />
<br />
:Returns the integer value of the given string.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''sway'''(float speed, float phase, vector angles); ====<br />
<br />
:Initiates a rotation back and forth along the given angles with the given speed and phase.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''Switch'''(float newState); ====<br />
<br />
:Move the lever to the on or off position (0 = off).<br />
<br />
:Spawnclasses responding to this event: ''CFrobLever''<br />
==== scriptEvent void '''switchState'''(string stateName); ====<br />
<br />
:Switches to the state with the given name, current one is ended.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''syncAnimChannels'''(float fromChannel, float toChannel, float blendFrames); ====<br />
<br />
:Synchronises the channels<br />
<br />
:Spawnclasses responding to this event: ''idActor''<br />
==== scriptEvent void '''Tap'''(); ====<br />
<br />
:Operates this handle.<br />
<br />
:Spawnclasses responding to this event: ''CFrobHandle''<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock'', ''idProjectile''<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover'', ''CFrobLock''<br />
==== scriptEvent void '''teleportTo'''(entity other); ====<br />
<br />
:Teleports the entity to the position of the other entity, plus a possible offset and random offset (defined on the spawnargs of the entity to be teleported)<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''terminate'''(float threadNumber); ====<br />
<br />
:Terminates a thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''testAnimAttack'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testAnimMove'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testAnimMoveTowardEnemy'''(string animname); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testChargeAttack'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testEvent1'''(float float_pi, float int_beef, float float_exp, string string_tdm, float float_exp10, float int_food); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent entity '''testEvent2'''(float int_prevres, vector vec_123, float int_food, entity ent_player, entity ent_null, float float_pi, float float_exp); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent vector '''testEvent3'''(entity ent_prevres, vector vec_123, float float_pi, entity ent_player); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent float '''testMeleeAttack'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''testMoveToPosition'''(vector position); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''threadname'''(string name); ====<br />
<br />
:Sets the name of the current thread.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''throwAF'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''throwMoveable'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''time'''(float time); ====<br />
<br />
:Sets the movement time. Set this time before initiating a new move.<br />
<br />
:Spawnclasses responding to this event: ''idMover''<br />
==== scriptEvent void '''Toggle'''(); ====<br />
<br />
:Turns the forcefield on and off.<br />
<br />
:Spawnclasses responding to this event: ''idForceField''<br />
==== scriptEvent void '''toggle_light'''(); ====<br />
<br />
:Toggles the spotlight on/off.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_AI'''(); ====<br />
<br />
:Toggles whether the camera can see AIs.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_animals'''(); ====<br />
<br />
:Toggles whether the camera can see bodies. Checked after seeAI or seeBodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_bodies'''(); ====<br />
<br />
:Toggles whether the camera can see bodies.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_see_player'''(); ====<br />
<br />
:Toggles whether the camera can see the player.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''toggle_sweep'''(); ====<br />
<br />
:Toggles the camera sweep.<br />
<br />
:Spawnclasses responding to this event: ''idSecurityCamera''<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''ToggleOpen'''(); ====<br />
<br />
:Toggles the mover state. Closes when fully open, opens when fully closed. If the mover is "interrupted" (e.g. when the player frobbed the mover in between), the move direction depends on the state of the internal "intent_open" flag. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent float '''totalAmmoCount'''(); ====<br />
<br />
:Amount of ammo in inventory. since each shot may use more than 1 ammo, this is different than ammoAvailable()<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''touches'''(entity other); ====<br />
<br />
:Returns true if this entity touches the other entity.<br />
::''other'': the entity to check against<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent float '''trace'''(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''tracePoint'''(vector start, vector end, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the trace hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent string '''translate'''(string input); ====<br />
<br />
:Translates a string (like #str_12345) into the current language<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''travelDistanceBetweenEntities'''(entity source, entity dest); ====<br />
<br />
:Approximate travel distance between two entities.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceBetweenPoints'''(vector source, vector dest); ====<br />
<br />
:Approximate travel distance between two points.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceToEntity'''(entity destination); ====<br />
<br />
:Approximate travel distance to entity.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent float '''travelDistanceToPoint'''(vector destination); ====<br />
<br />
:Approximate travel distance to point.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''trigger'''(entity entityToTrigger); ====<br />
<br />
:Triggers the given entity.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''triggerMissionEnd'''(); ====<br />
<br />
:No description<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''triggerParticles'''(string jointName); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnTo'''(float yaw); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnToEntity'''(entity ent); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''turnToPos'''(vector pos); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''unbind'''(); ====<br />
<br />
:Detaches this entity from its master.<br />
<br />
:Spawnclasses responding to this event: ''idEntity''<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
:Spawnclasses responding to this event: ''CBinaryFrobMover''<br />
==== scriptEvent void '''unpauseGame'''(); ====<br />
<br />
:Unpauses the game. Most scripts are not executed during g_stopTime == true and won't get into the position of calling this.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''useAmmo'''(float amount); ====<br />
<br />
:Eats the specified amount of ammo<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent float '''vecLength'''(vector vec); ====<br />
<br />
:Returns the length of the given vector.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''vecNormalize'''(vector vec); ====<br />
<br />
:Returns the normalized version of the given vector.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''VecRotate'''(vector vector, vector angles); ====<br />
<br />
:Rotates a vector by the specified angles.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent vector '''VecToAngles'''(vector vec); ====<br />
<br />
:Returns Euler angles for the given direction.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent entity '''visScan'''(); ====<br />
<br />
:Checks for enemies or player in the AI's FOV, using light level and distance. For now the check is only done on the player. Returns a reference to the sighted actor.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''waitAction'''(string name); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''waitFor'''(entity mover); ====<br />
<br />
:Waits for the given entity to complete its move.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitForRender'''(entity e); ====<br />
<br />
:Suspends the current thread until 'e' might have been rendered. It's event based, so it doesn't waste CPU repeatedly checking inPVS(). e.inPVS() will very likely be true when the thread resumes. If e.inPVS() is true, calling waitForRender() will probably just wait a frame, unless D3 can figure out that the entity doesn't need to be rendered. Optimizations regarding shadowcasting lights may not apply to this function - it is based purely off whether or not the entity's bounding box is visible.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitForThread'''(float threadNumber); ====<br />
<br />
:Waits for the given thread to terminate.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
:Spawnclasses responding to this event: ''idEntity'', ''idThread''<br />
==== scriptEvent void '''waitMove'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wakeOnFlashlight'''(float enable); ====<br />
<br />
:Tells the monster to activate when flashlight shines on them.<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''wander'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idAI''<br />
==== scriptEvent void '''warning'''(string text); ====<br />
<br />
:Issues a warning.<br />
<br />
:Spawnclasses responding to this event: ''idThread''<br />
==== scriptEvent float '''wasDamaged'''(); ====<br />
<br />
:Check if the player was damaged this frame.<br />
<br />
:Spawnclasses responding to this event: ''idPlayer''<br />
==== scriptEvent void '''weaponHolstered'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponLowering'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponOutOfAmmo'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponReady'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponReloading'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponRising'''(); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
==== scriptEvent void '''weaponState'''(string stateFunction, float blendFrames); ====<br />
<br />
:no description<br />
<br />
:Spawnclasses responding to this event: ''idWeapon''<br />
<br />
== Events by Spawnclass / Entity Type ==<br />
=== idClass ===<br />
==== scriptEvent void '''remove'''(); ====<br />
<br />
:Removes the entity from the game. For AI, use kill() instead.<br />
<br />
=== idActor ===<br />
==== scriptEvent float '''animDistance'''(float channel, string animName); ====<br />
<br />
:Returns the distance that the anim travels. If the entity has multiple anims with animName, the distance may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animDistance.<br />
<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
==== scriptEvent float '''animLength'''(float channel, string animName); ====<br />
<br />
:Returns the length of the anim in seconds. If the entity has multiple anims with animName, length may not match the anim that is played. Use chooseAnim to get a non-random anim and pass that string into animLength.<br />
<br />
==== scriptEvent void '''animState'''(float channel, string stateFunction, float blendFrame); ====<br />
<br />
:Sets a new animation state script function for the given channel.<br />
<br />
==== scriptEvent void '''attach'''(entity ent, string attName); ====<br />
<br />
:Attach an entity to the AI. Entity spawnArgs checked for attachments are: - "origin", "angles", and "joint". These must be set prior to calling attach.<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
==== scriptEvent void '''attachToPos'''(entity ent, string position, string attName); ====<br />
<br />
:Attach an entity to the AI, using a named attachment position<br />
::''attName'': the desired name of the attachment, e.g., 'melee_weapon'<br />
<br />
==== scriptEvent void '''checkAnim'''(float channel, string animName); ====<br />
<br />
:Ensures that the animation exists and causes an error if it doesn't.<br />
<br />
==== scriptEvent string '''chooseAnim'''(float channel, string animName); ====<br />
<br />
:Chooses a random anim and returns the name. Useful for doing move tests on anims.<br />
<br />
==== scriptEvent entity '''closestEnemyToPoint'''(vector point); ====<br />
<br />
:Returns the enemy closest to the given location.<br />
<br />
==== scriptEvent void '''disableAnimchannel'''(float channel); ====<br />
<br />
:Used to disable a certain animchannel (for example if the ai is dead)<br />
<br />
==== scriptEvent void '''disableEyeFocus'''(); ====<br />
<br />
:Disables eye focus.<br />
<br />
==== scriptEvent void '''DisableLegIK'''(float num); ====<br />
<br />
:disables leg IK<br />
<br />
==== scriptEvent void '''disablePain'''(); ====<br />
<br />
:Disables pain animations.<br />
<br />
==== scriptEvent void '''DisableWalkIK'''(); ====<br />
<br />
:disables walk IK<br />
<br />
==== scriptEvent void '''dropAttachment'''(string attName); ====<br />
<br />
:Drop the attachment for the given attachment name.<br />
<br />
==== scriptEvent void '''dropAttachmentInd'''(float index); ====<br />
<br />
:Drop the attachment for the given index.<br />
::''index'': starts at 0<br />
<br />
==== scriptEvent void '''enableAnim'''(float channel, float blendFrames); ====<br />
<br />
:Enables animation on the given channel.<br />
<br />
==== scriptEvent void '''enableEyeFocus'''(); ====<br />
<br />
:Enables eye focus.<br />
<br />
==== scriptEvent void '''EnableLegIK'''(float num); ====<br />
<br />
:enables leg IK<br />
<br />
==== scriptEvent void '''enablePain'''(); ====<br />
<br />
:Enables pain animations.<br />
<br />
==== scriptEvent void '''EnableWalkIK'''(); ====<br />
<br />
:enables walk IK<br />
<br />
==== scriptEvent void '''finishAction'''(string action); ====<br />
<br />
:Finishes the given wait action.<br />
<br />
==== scriptEvent void '''finishChannelAction'''(float channel, string animname); ====<br />
<br />
:Overloaded finishAction function for setting the waitstate on each channel separately<br />
<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
==== scriptEvent string '''getAnimState'''(float channel); ====<br />
<br />
:Returns the name of the current animation state script function used for the given channel.<br />
<br />
==== scriptEvent entity '''getAttachment'''(string attName); ====<br />
<br />
:Get the attached entity with the given attachment name Will be NULL if the name is invalid or if the entity no longer exists<br />
<br />
==== scriptEvent entity '''getAttachmentInd'''(float index); ====<br />
<br />
:Get the attached entity at the given index. Will be NULL if the index is invalid or the entity no longer exists<br />
::''index'': starts at 0<br />
<br />
==== scriptEvent float '''getAttackFlag'''(float combatType); ====<br />
<br />
:Returns 1 if the given attack flag is activated.<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent vector '''getEyePos'''(); ====<br />
<br />
:Get eye position of the player and the AI<br />
<br />
==== scriptEvent entity '''getHead'''(); ====<br />
<br />
:Returns the entity used for the character's head, if it has one.<br />
<br />
==== scriptEvent float '''getMeleeActPhase'''(); ====<br />
<br />
:Returns the current melee action phase (holding,recovering,etc).<br />
<br />
==== scriptEvent float '''getMeleeActState'''(); ====<br />
<br />
:Returns the current melee action state (attacking/defending).<br />
<br />
==== scriptEvent float '''getMeleeActType'''(); ====<br />
<br />
:Returns the current melee action type (overhead,thrust,etc.).<br />
<br />
==== scriptEvent float '''getMeleeLastActTime'''(); ====<br />
<br />
:Returns the melee type of the last attack to hit this actor. Defaults to MELEETYPE_UNBLOCKABLE if we were not hit before.<br />
<br />
==== scriptEvent float '''getMeleeLastHitByType'''(); ====<br />
<br />
:Returns the game time that the most recent melee action ended (in ms)<br />
<br />
==== scriptEvent float '''getMeleeResult'''(); ====<br />
<br />
:Get the result of the last melee action Follows MELEERESULT_* enum defined in tdm_defs.script<br />
<br />
==== scriptEvent float '''getNumAttachments'''(); ====<br />
<br />
:Return the number of attachments on an AI. Used to iterate through the attachments if desired.<br />
<br />
==== scriptEvent float '''getNumMeleeWeapons'''(); ====<br />
<br />
:Returns the number of melee weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_melee' set to '1'.<br />
<br />
==== scriptEvent float '''getNumRangedWeapons'''(); ====<br />
<br />
:Returns the number of ranged weapons attached to an actor. This refers to the TDM-style attachments with the spawnarg 'is_weapon_ranged' set to '1'.<br />
<br />
==== scriptEvent string '''getPainAnim'''(); ====<br />
<br />
:Returns the name of the pain animation.<br />
<br />
==== scriptEvent string '''getState'''(); ====<br />
<br />
:Gets the current state.<br />
<br />
==== scriptEvent float '''hasAnim'''(float channel, string animName); ====<br />
<br />
:Returns true when an entity has a specific animation.<br />
<br />
==== scriptEvent float '''hasEnemies'''(); ====<br />
<br />
:Returns true if the actor has one or more enemies.<br />
<br />
==== scriptEvent float '''idleAnim'''(float channel, string animName); ====<br />
<br />
:Plays the given idle animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''inAnimState'''(float channel, string stateFunc); ====<br />
<br />
:Returns true if the given animation state script function is currently used for the given channel.<br />
<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent string '''lookupReplacementAnim'''(string anim); ====<br />
<br />
:Returns the current replacement animation for "anim". Returns empty if no replacement anim <br />
<br />
==== scriptEvent void '''meleeActionFinished'''(); ====<br />
<br />
:Called when the animation for the melee action has finished.<br />
<br />
==== scriptEvent void '''meleeActionHeld'''(); ====<br />
<br />
:Called when the melee action reaches the "hold" point.<br />
<br />
==== scriptEvent void '''meleeActionReleased'''(); ====<br />
<br />
:Called when the melee action is released from the hold point.<br />
<br />
==== scriptEvent void '''meleeAttackStarted'''(float attType); ====<br />
<br />
:Registers the start of a given melee attack Intended to be called from a script that also starts the animation<br />
<br />
==== scriptEvent float '''meleeBestParry'''(); ====<br />
<br />
:Returns the melee type integer of the best parry given the enemy attacks at the time If no attacking enemy is found, returns default of MELEETYPE_RL Follows MELEETYPE_* enum defined in tdm_defs.script<br />
<br />
==== scriptEvent string '''meleeNameForNum'''(float num); ====<br />
<br />
:Converts a melee type integer to a string name suffix Used for finding the right animation for a given type, etc. Possible names are, in order: "Over, LR, RL, Thrust, General" Where general blocks all attacks types except unblockable<br />
<br />
==== scriptEvent void '''meleeParryStarted'''(float parType); ====<br />
<br />
:Registers the start of a given melee parry Intended to be called from a script that also starts the animation<br />
<br />
==== scriptEvent entity '''nextEnemy'''(entity lastEnemy); ====<br />
<br />
:Returns the next enemy the actor has acquired.<br />
<br />
==== scriptEvent void '''overrideAnim'''(float channel); ====<br />
<br />
:Disables the animation currently playing on the given channel and syncs the animation with the animation of the nearest animating channel.<br />
<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''preventPain'''(float duration); ====<br />
<br />
:Prevents any pain animation from being played for the given time in seconds.<br />
::''duration'': time in seconds<br />
<br />
==== scriptEvent void '''reAttachToCoords'''(string attName, string joint, vector offset, vector angles); ====<br />
<br />
:Reattach an existing attachment<br />
::''attName'': the name of the attachment we want to reattach. <br />
::''joint'': the name of the joint to attach to<br />
::''offset'': the translation offset from joint<br />
::''angles'': a (pitch, yaw, roll) angle vector that defines the rotation of the attachment relative to the joint's orientation<br />
<br />
==== scriptEvent void '''reAttachToPos'''(string attName, string position); ====<br />
<br />
:Reattach an existing attachment to a named attachment position. Example: reAttachToPos( melee_weapon, right_hand_held )<br />
::''attName'': the name of the attachment we want to reattach.<br />
::''position'': the new position we want to attach it to.<br />
<br />
==== scriptEvent void '''reloadTorchReplacementAnims'''(); ====<br />
<br />
:If actor has a torch, reload the torch's replacement anims.<br />
<br />
==== scriptEvent void '''removeReplacementAnim'''(string anim); ====<br />
<br />
:Removes the replacement for the given "anim"<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''setAnimPrefix'''(string prefix); ====<br />
<br />
:Sets a string which is placed in front of any animation names.<br />
<br />
==== scriptEvent void '''setAttackFlag'''(float combatType, float enabled); ====<br />
<br />
:Activate or deactivate the given attack flag<br />
::''combatType'': see tdm_defs.script for possible enum values<br />
<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent void '''setNextState'''(string stateFunc); ====<br />
<br />
:Sets the next state and waits until thread exits, or a frame delay before calling it. Handy for setting the state in the constructor.<br />
<br />
==== scriptEvent void '''setReplacementAnim'''(string animToReplace, string replacement); ====<br />
<br />
:Replaces the animation "animToReplace" with "replacement"<br />
<br />
==== scriptEvent void '''setState'''(string stateFunc); ====<br />
<br />
:Sets the next state and goes to it immediately<br />
<br />
==== scriptEvent void '''setSyncedAnimWeight'''(float channel, float animindex, float weight); ====<br />
<br />
:Sets the blend amount on multi-point anims.<br />
<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''stopAnim'''(float channel, float frames); ====<br />
<br />
:Stops the animation currently playing on the given channel over the given number of frames.<br />
<br />
==== scriptEvent void '''syncAnimChannels'''(float fromChannel, float toChannel, float blendFrames); ====<br />
<br />
:Synchronises the channels<br />
<br />
=== idAFEntity_Base ===<br />
==== scriptEvent vector '''getAngularVelocityB'''(float id); ====<br />
<br />
:Get the angular velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
==== scriptEvent vector '''getLinearVelocityB'''(float id); ====<br />
<br />
:Get the linear velocitiy of a particular body Returns (0,0,0) if the body ID is invalid.<br />
<br />
==== scriptEvent float '''getNumBodies'''(); ====<br />
<br />
:Returns the number of bodies in the AF. If the AF physics pointer is NULL, it returns 0.<br />
<br />
==== scriptEvent void '''restoreAddedEnts'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setAngularVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the angular velocity of a particular body<br />
<br />
==== scriptEvent void '''SetConstraintPosition'''(string constraintName, vector position); ====<br />
<br />
:Moves the constraint with the given name that binds this entity to another entity.<br />
<br />
==== scriptEvent void '''setLinearVelocityB'''(vector velocity, float id); ====<br />
<br />
:Set the linear velocity of a particular body<br />
<br />
=== idAFEntity_Gibbable ===<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
=== idAFEntity_Generic ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idAFEntity_WithAttachedHead ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CAIVehicle ===<br />
==== scriptEvent void '''clearController'''(); ====<br />
<br />
:Need separate clearController because scripting doesn't like passing in $null_entity? (greebo: one could remove this function and set the argument type of setController to 'E'.<br />
<br />
==== scriptEvent void '''frobRidable'''(entity playerController); ====<br />
<br />
:Called when a player directly mounts or dismounts a ridable AI.<br />
<br />
==== scriptEvent string '''getMoveAnim'''(); ====<br />
<br />
:Returns the name of the player-requested movement anim for a player controlled AI vehicle<br />
<br />
==== scriptEvent void '''setController'''(entity playerController); ====<br />
<br />
:Let a player assume movement control of an AI vehicle (may be remote control as in a player on a coach pulled by a horse)<br />
<br />
=== idCombatNode ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''markUsed'''(); ====<br />
<br />
:Disables the combat node if "use_once" is set on the entity.<br />
<br />
=== idAI ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''alert'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent void '''alertAI'''(string type, float amount, entity actor); ====<br />
<br />
:internal<br />
::''type'': alert type<br />
::''amount'': alert amount<br />
::''actor'': actor causing alert<br />
<br />
==== scriptEvent void '''allowDamage'''(); ====<br />
<br />
:The AI can take damage again.<br />
<br />
==== scriptEvent void '''allowHiddenMovement'''(float enable); ====<br />
<br />
:Normally, when hidden, monsters do not run physics. This enables physics when hidden.<br />
<br />
==== scriptEvent void '''allowMovement'''(float allow); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''animTurn'''(float angle); ====<br />
<br />
:Enable/disable animation controlled turning.<br />
::''angle'': Pass in the maximum # of degrees the animation turns. Use an amount of 0 to disable.<br />
<br />
==== scriptEvent void '''attackBegin'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''attackEnd'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''attackMelee'''(string damageDef); ====<br />
<br />
:Returns true if the attack hit<br />
<br />
==== scriptEvent entity '''attackMissile'''(string jointName); ====<br />
<br />
:returns projectile fired<br />
<br />
==== scriptEvent void '''bark'''(string sound); ====<br />
<br />
:Let the AI bark a certain sound.<br />
::''sound'': sound name, e.g. 'snd_warn_response'<br />
<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
==== scriptEvent float '''becomeRagdoll'''(); ====<br />
<br />
:enables the ragdoll if the entity has one<br />
<br />
==== scriptEvent void '''becomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''burn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canBecomeSolid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemyFromAnim'''(string anim); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canHitEnemyFromJoint'''(string jointname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canReachEnemy'''(); ====<br />
<br />
:Returns true if character can walk to enemy's position. For walking monsters, enemy should be near the floor.<br />
<br />
==== scriptEvent float '''canReachEntity'''(entity ent); ====<br />
<br />
:Returns true if character can walk to entity's position. For walking monsters, entity should be near the floor.<br />
<br />
==== scriptEvent float '''canReachPosition'''(vector pos); ====<br />
<br />
:Returns true if character can walk to specified position. For walking monsters, position should be near the floor.<br />
<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''canSeeExt'''(entity ent, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSee that can optionally choose to use field of vision and lighting calculations.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If b_useLighting is 0 the entity will be visible in complete darkness. If it is 1, the entity will only be visible if there is light shining on it, but the slightest light is enought. Use "isEntityHidden" as a script event with a threshold instead.<br />
<br />
==== scriptEvent float '''canSeePositionExt'''(vector position, float b_useFOV, float b_useLighting); ====<br />
<br />
:This is an alternate version of canSeeExt that tests a location rather than an entity. Note that any actor at the position may make it not seeable from a distance.<br />
::''b_useFOV'': If 0 the entity will be visible even if the AI's back is turned to it<br />
::''b_useLighting'': If 0 the entity will be visible in complete darkness<br />
<br />
==== scriptEvent void '''chargeAttack'''(string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''clearBurn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''clearEnemy'''(); ====<br />
<br />
:Clears the enemy entity<br />
<br />
==== scriptEvent void '''clearFlyOffset'''(); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at to the value set in the def file.<br />
<br />
==== scriptEvent entity '''closestReachableEnemy'''(); ====<br />
<br />
:Used for determining tactile alert targets<br />
<br />
==== scriptEvent entity '''closestReachableEnemyOfEntity'''(entity team_mate); ====<br />
<br />
:Finds another character's closest reachable enemy<br />
<br />
==== scriptEvent entity '''createMissile'''(string jointname); ====<br />
<br />
:returns projectile created<br />
<br />
==== scriptEvent entity '''createMissileFromDef'''(string defName, string jointName); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''directDamage'''(entity damageTarget, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableClip'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''disableGravity'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''dropTorch'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''emptyHand'''(string hand); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableAFPush'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableClip'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''enableGravity'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''endState'''(); ====<br />
<br />
:Ends the current state with the given name, returns TRUE if more than one state is remaining.<br />
<br />
==== scriptEvent float '''enemyInCombatCone'''(entity combatNode, float use_current_enemy_location); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyPositionValid'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyRange'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''enemyRange2D'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''entityInAttackCone'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''faceEnemy'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''faceEntity'''(entity ent); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''facingIdeal'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''findActorsInBounds'''(vector mins, vector maxs); ====<br />
<br />
:Returns an entity within the bounds specified<br />
<br />
==== scriptEvent entity '''findEnemy'''(float onlyInFov); ====<br />
<br />
:Finds enemy player in PVS<br />
<br />
==== scriptEvent entity '''findEnemyAI'''(float onlyInFov); ====<br />
<br />
:Finds enemy monster in PVS<br />
<br />
==== scriptEvent entity '''findEnemyInCombatNodes'''(); ====<br />
<br />
:Finds enemy player in attack cones<br />
<br />
==== scriptEvent entity '''findFriendlyAI'''(float team); ====<br />
<br />
:Use this to find a visible AI friendly to ourselves. It basically iterates over all active entities in the map and looks for friendly actors. The pythagorean distance is taken to evaluate the distance. Don't call this every frame, this might get expensive in larger maps. Returns the nearest visible actor entity or the $null_entity, if none was found.<br />
::''team'': used to constrain the search to a given team. Set this to -1 to let the code ignore this argument<br />
<br />
==== scriptEvent entity '''fireMissileAtTarget'''(string jointname, string targetname); ====<br />
<br />
:Launches a missile at entity specified by 'attack_target'. returns projectile fired<br />
<br />
==== scriptEvent float '''flee'''(entity entToFleeFrom, float algorithm, float distanceOption); ====<br />
<br />
:Flee from the given entity. Pass the escape point lookup algorithm (e.g. EP_FIND_GUARDED) and the distanceOption (e.g. EP_DIST_NEAREST) to specify how the best escape point can be found. Refer to the tdm_defs.script file to see all the constants. When algorithm is set to EP_FIND_AAS_AREA_FAR_FROM_THREAT, the distanceOption is interpreted as minimum threat distance. Returns FALSE if no escape point could be found.<br />
<br />
==== scriptEvent void '''foundBody'''(entity body); ====<br />
<br />
:Objective callback for when an AI finds a body.<br />
<br />
==== scriptEvent void '''Gas_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': the entity causing the knockout, can be the $null_entity<br />
<br />
==== scriptEvent float '''getAcuity'''(string type); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent entity '''getAlertActor'''(); ====<br />
<br />
:Get the actor that alerted the AI in this frame.<br />
<br />
==== scriptEvent float '''getAlertLevelOfOtherAI'''(entity otherEntity); ====<br />
<br />
:This event gets the alert number of another AI (AI_AlertLevel variable value) Returns the alert number of the other AI, 0.0 if its not an AI or is NULL<br />
::''otherEntity'': the other AI entity who's alert number is being queried<br />
<br />
==== scriptEvent entity '''getAttacker'''(); ====<br />
<br />
:Returns the attacking entity<br />
<br />
==== scriptEvent float '''getAudThresh'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getClosestHiddenTarget'''(string entity_type); ====<br />
<br />
:Finds the closest targeted entity of the specified type.<br />
<br />
==== scriptEvent entity '''getCombatNode'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getCurrentYaw'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getEnemyEyePos'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getEnemyPos'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getJumpVelocity'''(vector pos, float speed, float max_jump_height); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getMoveType'''(); ====<br />
<br />
:Returns the current movetype<br />
<br />
==== scriptEvent string '''getNextIdleAnim'''(); ====<br />
<br />
:This returns the name of the next idle anim to be played on this AI (used by AnimState scripts).<br />
<br />
==== scriptEvent vector '''getObservationPosition'''(vector targetPoint, float visualAcuityZeroToOne); ====<br />
<br />
:This event is used to get a position that the AI can move to observe a given position. It is useful for looking at hiding spots that can't be reached, and performing other investigation functions. Returns a world position from which the observation can take place. Returns the current AI origin if no such point is found. @sideEffect This uses the AI_DEST_UNREACHABLE flag variable to indicate if a point was found. It will be true if none was found, false if one was found.<br />
::''targetPoint'': the world position to be observed<br />
::''visualAcuityZeroToOne'': the visual acuity of the AI on a scale of 0.0 to 1.0 where 0.0 is blind and 1.0 is perfect vision.<br />
<br />
==== scriptEvent entity '''getObstacle'''(); ====<br />
<br />
:Gets the obstacle in the character's path<br />
<br />
==== scriptEvent entity '''getRandomTarget'''(string entity_type); ====<br />
<br />
:Finds a random targeted entity of the specified type.<br />
<br />
==== scriptEvent vector '''getReachableEntityPosition'''(entity ent); ====<br />
<br />
:Returns the position of the entity within the AAS if possible, otherwise just the entity position.<br />
<br />
==== scriptEvent float '''getRelationEnt'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''getSndDir'''(); ====<br />
<br />
:ai hearing of sound <br />
<br />
==== scriptEvent entity '''getTactEnt'''(); ====<br />
<br />
:ai sense of touch<br />
<br />
==== scriptEvent entity '''getTalkTarget'''(); ====<br />
<br />
:Returns the entity (player) trying to talk to the character<br />
<br />
==== scriptEvent float '''getTurnDelta'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getTurnRate'''(); ====<br />
<br />
:Gets the rate the character turns.<br />
<br />
==== scriptEvent vector '''getVectorToIdealOrigin'''(); ====<br />
<br />
:Returns the vector from where the AI is to where he ideally should be<br />
<br />
==== scriptEvent vector '''getVisDir'''(); ====<br />
<br />
:Returns position of the last visual alert.<br />
<br />
==== scriptEvent float '''hasSeenEvidence'''(); ====<br />
<br />
:This returns 1 when the AI has seen evidence of intruders before (an enemy, a body...)<br />
<br />
==== scriptEvent void '''ignoreDamage'''(); ====<br />
<br />
:The AI can no longer take damage.<br />
<br />
==== scriptEvent float '''isEntityHidden'''(entity ent, float f_sightThreshold); ====<br />
<br />
:This is an alternate version of canSee, using FOV, distance and lighting.<br />
::''f_sightThreshold'': goes from 0.0 (entity visible in complete darkness) to 1.0 (entity only visible if completely lit up).<br />
<br />
==== scriptEvent float '''isPlayerResponsibleForDeath'''(); ====<br />
<br />
:Returns true if the player was responsible for the AI's caller's death.<br />
<br />
==== scriptEvent void '''kickObstacles'''(entity kickEnt, float force); ====<br />
<br />
:Kicks any obstacle in the character's path.<br />
::''kickEnt'': pass in $null_entity if you don't have a specific entity to kick<br />
<br />
==== scriptEvent void '''kill'''(); ====<br />
<br />
:Kills the monster.<br />
<br />
==== scriptEvent void '''KO_Knockout'''(entity inflictor); ====<br />
<br />
:AI knockout<br />
::''inflictor'': is the entity causing the knockout, can be the $null_entity<br />
<br />
==== scriptEvent entity '''launchMissile'''(vector origin, vector angles); ====<br />
<br />
:Returns the projectile entity<br />
<br />
==== scriptEvent void '''locateEnemy'''(); ====<br />
<br />
:Updates the last known position of the enemy independent from whether or not the enemy is visible.<br />
<br />
==== scriptEvent void '''lookAt'''(entity focusEntity, float duration); ====<br />
<br />
:Aims the character's eyes and head toward an entity for a period of time.<br />
<br />
==== scriptEvent void '''lookAtAngles'''(float yawAngleClockwise, float pitchAngleUp, float rollAngle, float durationInSeconds); ====<br />
<br />
:A look at event that just looks at a set of angles relative to the current body facing of the AI. This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but it looks at the specified angles from the current body facing of the AI.<br />
::''yawAngleClockwise'': Negative angles are to the left of the AIs body and positive angles are to the right.<br />
::''pitchAngleUp'': Negative values are down and positive values are up where down and up are defined by the body axis.<br />
::''rollAngle'': This is currently unused and does nothing.<br />
::''durationInSeconds'': The duration to look in seconds.<br />
<br />
==== scriptEvent void '''lookAtEnemy'''(float duration); ====<br />
<br />
:Aims the character's eyes and head toward the current enemy for a period of time.<br />
<br />
==== scriptEvent void '''lookAtPosition'''(vector lookAtWorldPosition, float durationInSeconds); ====<br />
<br />
:This method is just like the vanilla Doom3 lookAt and lookAtEnemy methods, but instead of looking at an entity, it looks at a position in worldspace. That is, it turns the head of the AI to look at the position.<br />
::''lookAtWorldPosition'': position in space to look at<br />
::''durationInSeconds'': duration to look in seconds<br />
<br />
==== scriptEvent float '''meleeAttackToJoint'''(string joint, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveOutOfRange'''(entity ent, float range); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''moveStatus'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToAttackPosition'''(entity ent, string attack_anim); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''moveToCover'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToCoverFrom'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEnemyHeight'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''moveToEntity'''(entity destination); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''moveToPosition'''(vector position); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''muzzleFlash'''(string jointname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''numSmokeEmitters'''(); ====<br />
<br />
:Returns the # of emitters defined by 'smokeParticleSystem' in the entitydef<br />
<br />
==== scriptEvent void '''performRelight'''(); ====<br />
<br />
:Deal with doused lights.<br />
<br />
==== scriptEvent float '''playAndLipSync'''(string soundName, string animName); ====<br />
<br />
:Play the given sound, using the given lipsync animation. The lipsync animation should just be a simple non-loopable animation of the mouth opening in a linear fashion. The code will select individual frames from this to construct a simple lipsyncing effect which is in time with the sound. Returns the length of the played sound in seconds.<br />
<br />
==== scriptEvent float '''playCustomAnim'''(string animName); ====<br />
<br />
:Plays the given animation on legs and torso. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''preBurn'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent vector '''predictEnemyPos'''(float time); ====<br />
<br />
:Tries to predict the player's movement based on the AAS and his direction of movement.<br />
<br />
==== scriptEvent void '''processBlindStim'''(entity stimSource, float skipVisibilityCheck); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''processVisualStim'''(entity stimSource); ====<br />
<br />
:Use this call to let the AI react to a visual stim (coming from the source entity).<br />
<br />
==== scriptEvent vector '''pushPointIntoAAS'''(vector post); ====<br />
<br />
:Tries to push the point into a valid AAS area<br />
<br />
==== scriptEvent void '''pushState'''(string stateName); ====<br />
<br />
:Pushes the state with the given name, current one is postponed.<br />
<br />
==== scriptEvent void '''radiusDamageFromJoint'''(string jointname, string damageDef); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''restartPatrol'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''restoreMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''saveMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''setAcuity'''(string type, float val); ====<br />
<br />
:ai generalized alerts<br />
<br />
==== scriptEvent void '''setAlertGracePeriod'''(float frac, float duration, float count); ====<br />
<br />
:This starts the alert grace period for an AI. Should be called in the same frame as the alert that pushes them into a higher state.<br />
::''frac'': the fraction of the alert below which they should ignore alerts during the grace period.<br />
::''duration'': the duration of the period in seconds<br />
::''count'': the number of alerts ignored above which the grace period is invalid<br />
<br />
==== scriptEvent void '''setAlertLevel'''(float newLevel); ====<br />
<br />
:Set the alert level (AI_AlertLevel). This should always be called instead of setting AI_AlertLevel directly.<br />
<br />
==== scriptEvent void '''setAudThresh'''(float val); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''setBoneMod'''(float allowBoneMod); ====<br />
<br />
:Enables or disables head looking (may be obsolete).<br />
<br />
==== scriptEvent void '''setEnemy'''(entity enemy); ====<br />
<br />
:Make the given entity an enemy.<br />
<br />
==== scriptEvent void '''setFlyOffset'''(float offset); ====<br />
<br />
:Sets the preferred height relative to the player's view height to fly at.<br />
<br />
==== scriptEvent void '''setFlySpeed'''(float speed); ====<br />
<br />
:Set the speed flying creatures move at. Also sets speed for moveTypeSlide.<br />
<br />
==== scriptEvent void '''setMoveType'''(float movetype); ====<br />
<br />
:Set the current movetype. movetypes are defined in tdm_ai.script<br />
<br />
==== scriptEvent void '''setSmokeVisibility'''(float particle_num, float on); ====<br />
<br />
:enables/disables smoke particles on bones. pass in the particle #, or ALL_PARTICLES for turning on/off all particle systems. particles are spawned in the order they appear in the entityDef<br />
<br />
==== scriptEvent void '''setTalkState'''(float state); ====<br />
<br />
:Sets whether the player can talk to this character or not.<br />
<br />
==== scriptEvent void '''setTalkTarget'''(entity target); ====<br />
<br />
:Sets the entity (player) trying to talk to the character<br />
<br />
==== scriptEvent void '''setTurnRate'''(float rate); ====<br />
<br />
:Set the rate the character turns at<br />
<br />
==== scriptEvent void '''shrivel'''(float time); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''slideTo'''(vector position, float time); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''spawnThrowableProjectile'''(string projectileName, string jointName); ====<br />
<br />
:This method spawns a projectile of the type named by the caller and attaches it to the joint given by the caller. The projectile becomes the AI's firable projectile. Returns a pointer to a projectile entity that can be thrown by the AI. You can use AI_LaunchMissle (e* = launchMissle(v,v) ) to throw the stone.<br />
::''projectileName'': The name of the projectile to spawn (as seen in a .def file) Must be descended from idProjectile<br />
::''jointName'': The name of the joint on the model to which the particle should be attached for throwing. If this is NULL or the empty string, then it is attached to the model center.<br />
<br />
==== scriptEvent void '''stopMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''stopPatrol'''(); ====<br />
<br />
:Stops an AI from patrolling<br />
<br />
==== scriptEvent void '''stopRagdoll'''(); ====<br />
<br />
:turns off the ragdoll<br />
<br />
==== scriptEvent void '''stopThinking'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''switchState'''(string stateName); ====<br />
<br />
:Switches to the state with the given name, current one is ended.<br />
<br />
==== scriptEvent float '''testAnimAttack'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testAnimMove'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testAnimMoveTowardEnemy'''(string animname); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testChargeAttack'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testMeleeAttack'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''testMoveToPosition'''(vector position); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''throwAF'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''throwMoveable'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''travelDistanceBetweenEntities'''(entity source, entity dest); ====<br />
<br />
:Approximate travel distance between two entities.<br />
<br />
==== scriptEvent float '''travelDistanceBetweenPoints'''(vector source, vector dest); ====<br />
<br />
:Approximate travel distance between two points.<br />
<br />
==== scriptEvent float '''travelDistanceToEntity'''(entity destination); ====<br />
<br />
:Approximate travel distance to entity.<br />
<br />
==== scriptEvent float '''travelDistanceToPoint'''(vector destination); ====<br />
<br />
:Approximate travel distance to point.<br />
<br />
==== scriptEvent void '''triggerParticles'''(string jointName); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnTo'''(float yaw); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnToEntity'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''turnToPos'''(vector pos); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''visScan'''(); ====<br />
<br />
:Checks for enemies or player in the AI's FOV, using light level and distance. For now the check is only done on the player. Returns a reference to the sighted actor.<br />
<br />
==== scriptEvent void '''waitAction'''(string name); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''waitMove'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''wakeOnFlashlight'''(float enable); ====<br />
<br />
:Tells the monster to activate when flashlight shines on them.<br />
<br />
==== scriptEvent void '''wander'''(); ====<br />
<br />
:no description<br />
<br />
=== idTestModel ===<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
=== CBinaryFrobMover ===<br />
==== scriptEvent void '''Close'''(); ====<br />
<br />
:Closes the frobmover, regardless of its previous state. Mover must be open, otherwise nothing happens.<br />
<br />
==== scriptEvent float '''GetFractionalPosition'''(); ====<br />
<br />
:Returns a fraction between 0.00 (closed) and 1.00 (open).<br />
<br />
==== scriptEvent float '''IsLocked'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is currently locked.<br />
<br />
==== scriptEvent float '''IsOpen'''(); ====<br />
<br />
:Returns true (nonzero) if the mover is open, which is basically the same as "not closed". A mover is considered closed when it is at its close position.<br />
<br />
==== scriptEvent float '''IsPickable'''(); ====<br />
<br />
:Returns true (nonzero) if this frobmover is pickable.<br />
<br />
==== scriptEvent void '''Lock'''(); ====<br />
<br />
:Locks the mover. Calls to Open() will not succeed after this call. <br />
<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''ToggleLock'''(); ====<br />
<br />
:Toggles the lock state. Unlocked movers will be locked and vice versa. The notes above concerning Unlock() still apply if this call unlocks the mover. <br />
<br />
==== scriptEvent void '''ToggleOpen'''(); ====<br />
<br />
:Toggles the mover state. Closes when fully open, opens when fully closed. If the mover is "interrupted" (e.g. when the player frobbed the mover in between), the move direction depends on the state of the internal "intent_open" flag. <br />
<br />
==== scriptEvent void '''Unlock'''(); ====<br />
<br />
:Unlocks the mover. Calls to Open() will succeed after this call. Depending on the value of the spawnarg "open_on_unlock" the mover might automatically open after this call. <br />
<br />
=== idBrittleFracture ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''dampenSound'''(float dampen); ====<br />
<br />
:Toggle whether the shattering sound is dampened on the window, e.g., when covered by moss.<br />
::''dampen'': 1 = dampened, 0 = not dampened<br />
<br />
=== idCameraView ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idCameraAnim ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''start'''(); ====<br />
<br />
:Starts a spline or anim camera moving.<br />
<br />
==== scriptEvent void '''stop'''(); ====<br />
<br />
:Stops a spline or anim camera moving.<br />
<br />
=== idFuncEmitter ===<br />
==== scriptEvent void '''emitterAddModel'''(string modelName, vector modelOffset); ====<br />
<br />
:Adds a new particle (or regular, if you wish) model to the emitter, located at modelOffset units away from the emitter's origin.<br />
<br />
==== scriptEvent float '''emitterGetNumModels'''(); ====<br />
<br />
:Returns the number of models/particles this emitter has. Always >= 1.<br />
<br />
=== idEntity ===<br />
==== scriptEvent void '''activateContacts'''(); ====<br />
<br />
:Activate objects sitting on this object.<br />
<br />
==== scriptEvent void '''activateTargets'''(entity activator); ====<br />
<br />
:Causes this entity to activate all it's targets. Similar to how a trigger activates entities.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''addInvItem'''(entity inv_item); ====<br />
<br />
:Adds the given item to the inventory. Depending on the type the passed entity will be removed from the game (as for loot items) or hidden.<br />
<br />
==== scriptEvent void '''addItemToInv'''(entity target); ====<br />
<br />
:Adds the entity to the given entity's inventory. Depending on the type the entity will be removed from the game (as for loot items) or hidden. Example: $book->addItemToInv($player1);<br />
<br />
==== scriptEvent void '''addTarget'''(entity target); ====<br />
<br />
:Add a target to this entity.<br />
::''target'': the entity to add as target<br />
<br />
==== scriptEvent void '''applyImpulse'''(entity source, float bodyid, vector point, vector impulse); ====<br />
<br />
:Applies an impulse to the entity. Example: entity.applyImpulse($player1, 0, entity.getOrigin(), '0 0 2');<br />
::''source'': Pass $null_entity or the entity that applies the impulse<br />
::''bodyid'': For articulated figures, ID of the body, 0 for the first (main) body. Otherwise use 0.<br />
::''point'': Point on the body where the impulse is applied to<br />
::''impulse'': Vector of the impulse<br />
<br />
==== scriptEvent void '''bind'''(entity master); ====<br />
<br />
:Fixes this entity's position and orientation relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
==== scriptEvent void '''bindPosition'''(entity master); ====<br />
<br />
:Fixes this entity's position (but not orientation) relative to another entity, such that when the master entity moves, so does this entity.<br />
::''master'': the entity to bind to<br />
<br />
==== scriptEvent void '''bindToBody'''(entity master, float bodyID, float orientated); ====<br />
<br />
:Bind to AF body<br />
::''master'': entity to bind to<br />
::''bodyID'': AF body ID to bind to<br />
::''orientated'': binds the orientation as well as position, if set to 1<br />
<br />
==== scriptEvent void '''bindToJoint'''(entity master, string boneName, float rotateWithMaster); ====<br />
<br />
:Fixes this entity's position and orientation relative to a bone on another entity, such that when the master's bone moves, so does this entity.<br />
::''master'': the entity to bind to<br />
::''boneName'': the bone name<br />
::''rotateWithMaster'': -<br />
<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
==== scriptEvent void '''callFunction'''(string functionName); ====<br />
<br />
:Calls a function on an entity's script object. See also callGlobalFunction().<br />
<br />
==== scriptEvent void '''callGlobalFunction'''(string functionName, entity other); ====<br />
<br />
:calls a global function and passes the other entity along as the first argument calls the function in a new thread, so it continues executing in the current thread right away (unlike entity.callFunction( "blah"))<br />
<br />
==== scriptEvent void '''callGui'''(float handle, string namedEvent); ====<br />
<br />
:Calls a named event in a GUI.<br />
<br />
==== scriptEvent float '''canBeUsedBy'''(entity ent); ====<br />
<br />
:Returns true if the entity can be used by the argument entity<br />
<br />
==== scriptEvent float '''canSeeEntity'''(entity target, float useLighting); ====<br />
<br />
:This is a general version of idAI::canSee, that can be used by all entities. It doesn't regard FOV, it just performs a trace to check whether the target is occluded by world geometry. Is probably useful for stim/response as well Pass useLighting = true to take the lighting of the target entity into account. Use "isEntityHidden" as a script event with a threshold. The constant threshold value for useLighting is defined within the SDK in game/entity.h.<br />
<br />
==== scriptEvent void '''changeEntityRelation'''(entity ent, float relationChange); ====<br />
<br />
:This changes the current relation to an entity by adding the new amount.<br />
<br />
==== scriptEvent void '''changeInvIcon'''(string name, string category, string icon); ====<br />
<br />
:Sets the inventory icon of the given item in the given category to <icon>.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent void '''changeInvItemCount'''(string name, string category, float amount); ====<br />
<br />
:Decreases the inventory item stack count by amount. The item is addressed using the name and category of the item. These are usually defined on the inventory item entity ("inv_name", "inv_category") Amount can be both negative and positive.<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent void '''changeInvLightgemModifier'''(string name, string category, float amount); ====<br />
<br />
:Sets the lightgem modifier value of the given item. Valid arguments are between 0 and 32 (which is the maximum lightgem value).<br />
::''name'': name of the item<br />
::''category'': the item's category<br />
<br />
==== scriptEvent float '''changeLootAmount'''(float type, float amount); ====<br />
<br />
:Changes the loot amount of the given Type (e.g. GOODS) by <amount>. The mission statisic for loot found gets changed too. The new value of the changed type is returned (e.g. the new GOODS value if this has been changed). Note: The LOOT_TOTAL type can't be changed and 0 is returned.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY<br />
::''amount'': can be negative<br />
<br />
==== scriptEvent void '''checkAbsence'''(); ====<br />
<br />
:description missing<br />
<br />
==== scriptEvent void '''copyBind'''(entity other); ====<br />
<br />
:copy bind information of other to this entity (i.e., bind this entity to the same entity that other is bound to)<br />
<br />
==== scriptEvent float '''createOverlay'''(string guiFile, float layer); ====<br />
<br />
:Creates a GUI overlay. (must be used on the player)<br />
<br />
==== scriptEvent void '''CreateTimer'''(float stimId, float hour, float minutes, float seconds, float milliseconds); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''damage'''(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale); ====<br />
<br />
:Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).<br />
::''inflictor'': the entity causing the damage (maybe a projectile)<br />
::''attacker'': the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)<br />
::''dir'': the direction the attack is coming from.<br />
::''damageDefName'': the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")<br />
::''damageScale'': the scale of the damage (pass 1.0 as default, this should be ok).<br />
<br />
==== scriptEvent void '''destroyOverlay'''(float handle); ====<br />
<br />
:Destroys a GUI overlay. (must be used on the player)<br />
<br />
==== scriptEvent float '''distanceTo'''(entity other); ====<br />
<br />
:Returns the distance of this entity to another entity.<br />
<br />
==== scriptEvent float '''distanceToPoint'''(vector point); ====<br />
<br />
:Returns the distance of this entity to a point.<br />
<br />
==== scriptEvent void '''extinguishLights'''(); ====<br />
<br />
:Extinguishes all lights (i.e. the <self> entity plus all bound lights)<br />
<br />
==== scriptEvent void '''fadeSound'''(float channel, float newLevel, float fadeTime); ====<br />
<br />
:Fades the sound on this entity to a new level over a period of time. Use SND_CHANNEL_ANY for all currently playing sounds.<br />
<br />
==== scriptEvent float '''frob'''(); ====<br />
<br />
:Frobs the entity (i.e. simulates a frob action performed by the player). Returns TRUE if the entity is frobable, FALSE otherwise.<br />
<br />
==== scriptEvent void '''frobHilight'''(float state); ====<br />
<br />
:ishtvan: Tries to make the entity frobhilight or not<br />
<br />
==== scriptEvent vector '''getAngles'''(); ====<br />
<br />
:Returns the current orientation of this entity (relative to bind parent if any).<br />
<br />
==== scriptEvent vector '''getAngularVelocity'''(); ====<br />
<br />
:Gets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
==== scriptEvent entity '''getBindChild'''(float ind); ====<br />
<br />
:Returns the ind_th bind child of this entity or NULL if index is invalid. NOTE: indices start at zero<br />
::''ind'': child index<br />
<br />
==== scriptEvent entity '''getBindMaster'''(); ====<br />
<br />
:Returns the entity's bindmaster<br />
<br />
==== scriptEvent float '''getBoolKey'''(string key); ====<br />
<br />
:Retrieves the boolean value of a specific spawn arg, defaulting to false.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent float '''getClipMask'''(); ====<br />
<br />
:Returns the clipmask of the physics object.<br />
<br />
==== scriptEvent vector '''getColor'''(); ====<br />
<br />
:Gets the color of this entity (shader parms Parm0, Parm1, Parm2).<br />
<br />
==== scriptEvent float '''getContents'''(); ====<br />
<br />
:Returns the contents of the physics object.<br />
<br />
==== scriptEvent string '''getCurInvCategory'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory category.<br />
<br />
==== scriptEvent string '''getCurInvIcon'''(); ====<br />
<br />
:Returns the icon of the currently highlighted inventory item.<br />
<br />
==== scriptEvent entity '''getCurInvItemEntity'''(); ====<br />
<br />
:Returns the currently highlighted inventory item entity.<br />
<br />
==== scriptEvent string '''getCurInvItemId'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_item_id"). Most items will return an empty string, unless the "inv_item_id" is set on purpose.<br />
<br />
==== scriptEvent string '''getCurInvItemName'''(); ====<br />
<br />
:Returns the name of the currently highlighted inventory item (the one defined in "inv_name").<br />
<br />
==== scriptEvent float '''getEntityFlag'''(string flagName); ====<br />
<br />
:Returns the value of the specified entity flag.<br />
::''flagName'': Can be one of (case insensitive): notarget: if true never attack or target this entity noknockback: if true no knockback from hits takedamage: if true this entity can be damaged hidden: if true this entity is not visible bindOrientated: if true both the master orientation is used for binding solidForTeam: if true this entity is considered solid when a physics team mate pushes entities forcePhysicsUpdate: if true always update from the physics whether the object moved or not selected: if true the entity is selected for editing neverDormant: if true the entity never goes dormant isDormant: if true the entity is dormant hasAwakened: before a monster has been awakened the first time, use full PVS for dormant instead of area-connected invisible: if true this entity cannot be seen inaudible: if true this entity cannot be heard <br />
<br />
==== scriptEvent entity '''getEntityKey'''(string key); ====<br />
<br />
:Retrieves the entity specified by the spawn arg.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent float '''getFloatKey'''(string key); ====<br />
<br />
:Retrieves the floating point value of a specific spawn arg, defaulting to 0.0f.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent string '''getGui'''(float handle); ====<br />
<br />
:Returns the file currently loaded by a GUI.<br />
<br />
==== scriptEvent float '''getGuiFloat'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent float '''getGuiInt'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent string '''getGuiString'''(float handle, string key); ====<br />
<br />
:Returns a GUI parameter.<br />
<br />
==== scriptEvent float '''getHealth'''(); ====<br />
<br />
:Returns the current health.<br />
<br />
==== scriptEvent float '''getIntKey'''(string key); ====<br />
<br />
:Retrieves the integer value of a specific spawn arg, defaulting to 0.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent string '''getKey'''(string key); ====<br />
<br />
:Retrieves the value of a specific spawn arg, defaulting to ''.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent vector '''getLightInPVS'''(float falloff, float scaling); ====<br />
<br />
:Computes the sum of all light in the PVS of the entity you call this on, and returns a vector with the sum.<br />
::''falloff'': 0: no falloff with distance 0.5: sqrt(linear) falloff (dist 100 => 1/10) 1: linear falloff (dist 100 => 1/100) 2: square falloff (dist 100 => 1/10000) <br />
::''scaling'': factor to scale the distance, can be used to lower/raise distance factor after the linear or square scaling has been used good looking values are approx: sqrt(linear): 0.01, linear: 0.1, square 1.0<br />
<br />
==== scriptEvent vector '''getLinearVelocity'''(); ====<br />
<br />
:Gets the current linear velocity of this entity. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
==== scriptEvent entity '''getLocation'''(); ====<br />
<br />
:Returns the idLocation entity corresponding to the entity's current location. This was player-specific before, but is now available to all entities.<br />
<br />
==== scriptEvent float '''getLootAmount'''(float type); ====<br />
<br />
:Returns the amount of loot for the given type (e.g. LOOT_GOODS). Pass LOOT_TOTAL to return the sum of all loot types.<br />
::''type'': one of: LOOT_GOLD, LOOT_GOODS, LOOT_JEWELRY, LOOT_TOTAL<br />
<br />
==== scriptEvent float '''getMass'''(float body); ====<br />
<br />
:Gets mass of a body for an entity<br />
<br />
==== scriptEvent vector '''getMaxs'''(); ====<br />
<br />
:Gets the maximum corner of this entity's bounding box.<br />
<br />
==== scriptEvent vector '''getMins'''(); ====<br />
<br />
:Gets the minimum corner of this entity's bounding box.<br />
<br />
==== scriptEvent string '''getName'''(); ====<br />
<br />
:Returns the name of this entity.<br />
<br />
==== scriptEvent entity '''getNextInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the next inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
==== scriptEvent string '''getNextKey'''(string prefix, string lastMatch); ====<br />
<br />
:Searches for the name of a spawn arg that matches the prefix. For example, passing in "attack_target" matches "attack_target1", "attack_targetx", "attack_target_enemy", etc. The returned string is the name of the key which can then be passed into functions like getKey() to lookup the value of that spawn arg. This is useful for when you have multiple values to look up, like when you target multiple objects. To find the next matching key, pass in the previous result and the next key returned will be the first one that matches after the previous result. Pass in "" to get the first match. Passing in a non-existent key is the same as passing in "". Returns "" when no more keys match.<br />
<br />
==== scriptEvent vector '''getOrigin'''(); ====<br />
<br />
:Returns the current position of this entity (relative to bind parent if any).<br />
<br />
==== scriptEvent entity '''getPrevInvItem'''(); ====<br />
<br />
:Cycles the standard cursor to the previous inventory item. Returns the item entity pointed to after the operation is complete.<br />
<br />
==== scriptEvent entity '''GetResponseEntity'''(); ====<br />
<br />
:Returns the entity which should take the response. Some entities like AI heads are not responding themselves to stims, but relay it to another entity (i.e. the bodies they're attached to).<br />
<br />
==== scriptEvent float '''getShaderParm'''(float parm); ====<br />
<br />
:Gets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
<br />
==== scriptEvent vector '''getSize'''(); ====<br />
<br />
:Gets the size of this entity's bounding box.<br />
<br />
==== scriptEvent float '''getSoundVolume'''(string soundName); ====<br />
<br />
:Get the volume of the sound to play.<br />
::''soundName'': the name of the sound<br />
<br />
==== scriptEvent entity '''getTarget'''(float num); ====<br />
<br />
:Returns the requested target entity.<br />
::''num'': The target number. Starts at 0.<br />
<br />
==== scriptEvent float '''getTeam'''(); ====<br />
<br />
:Returns the current team number.<br />
<br />
==== scriptEvent vector '''getVectorKey'''(string key); ====<br />
<br />
:Retrieves the vector value of a specific spawn arg, defaulting to '0 0 0'.<br />
::''key'': spawnarg name<br />
<br />
==== scriptEvent vector '''getVinePlantLoc'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
==== scriptEvent vector '''getVinePlantNormal'''(); ====<br />
<br />
:Event important to the growing of vines from vine arrows<br />
<br />
==== scriptEvent vector '''getWorldOrigin'''(); ====<br />
<br />
:Returns the current world-space position of this entity (regardless of any bind parent).<br />
<br />
==== scriptEvent float '''hasFunction'''(string functionName); ====<br />
<br />
:checks if an entity's script object has a specific function<br />
<br />
==== scriptEvent float '''heal'''(string healDefName, float healScale); ====<br />
<br />
:Heals the entity this is called on using the specified healing entityDef. Returns 1 if the entity could be healed, 0 otherwise (if the entity is already at full health, for ex.)<br />
::''healDefName'': the name of the entityDef containing the healing information (e.g. "heal_potion")<br />
::''healScale'': the scaling value to be applied to the healAmount found in the healEntityDef<br />
<br />
==== scriptEvent void '''hide'''(); ====<br />
<br />
:Makes this entity invisible.<br />
<br />
==== scriptEvent void '''hideByLODBias'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent float '''inPVS'''(); ====<br />
<br />
:Returns non-zero if this entity is in PVS. For lights, it will return true when the light's bounding box is in PVS, even though the light may not actually be in PVS. (an unmoved shadowcasting light may not be visible to PVS areas its bounding box intersects with)<br />
<br />
==== scriptEvent float '''isDroppable'''(); ====<br />
<br />
:Get whether an item may be dropped from the inventory<br />
<br />
==== scriptEvent float '''isEnemy'''(entity ent); ====<br />
<br />
:Returns true if the given entity is an enemy.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isFriend'''(entity ent); ====<br />
<br />
:Returns true if the given entity is a friend.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isFrobable'''(); ====<br />
<br />
:Get whether the entity is frobable<br />
<br />
==== scriptEvent float '''isHidden'''(); ====<br />
<br />
:checks if the entity's model is invisible.<br />
<br />
==== scriptEvent float '''isHilighted'''(); ====<br />
<br />
:Returns true if entity is currently frobhilighted.<br />
<br />
==== scriptEvent float '''isInLiquid'''(); ====<br />
<br />
:Returns 1 if the entity is in or touching a liquid.<br />
<br />
==== scriptEvent float '''isLight'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''isNeutral'''(entity ent); ====<br />
<br />
:Returns true if the given entity is neutral.<br />
::''ent'': The entity in question<br />
<br />
==== scriptEvent float '''isType'''(string spawnclass); ====<br />
<br />
:Returns true if this entity is of the given type.<br />
::''spawnclass'': spawn class name<br />
<br />
==== scriptEvent float '''loadExternalData'''(string declFile, string prefix); ====<br />
<br />
:Load an external xdata declaration.<br />
<br />
==== scriptEvent void '''noShadows'''(float noShadows); ====<br />
<br />
:Sets the noShadow property on the entity to true/false, turning shadowcasting on or off for this entity.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
<br />
==== scriptEvent void '''noShadowsDelayed'''(float noShadows, float delay); ====<br />
<br />
:Sets the noShadow property on the entity to true/false after delay in ms, turning shadows cast by this entity on or off.<br />
::''noShadows'': 1 = disable shadows, 0 = enable shadows<br />
::''delay'': delay in ms<br />
<br />
==== scriptEvent float '''numBindChildren'''(); ====<br />
<br />
:Returns the number of bound entities lower down in the bind chain than this entity, but be sure to give it the topmost bindmaster<br />
<br />
==== scriptEvent float '''numTargets'''(); ====<br />
<br />
:Returns the number of entities this entity has targeted.<br />
<br />
==== scriptEvent void '''propagateSound'''(string soundName, float propVolMod, float msgTag); ====<br />
<br />
:Generates a propagated sound<br />
<br />
==== scriptEvent void '''propSound'''(string name); ====<br />
<br />
:Sound propagation scriptfunctions on all entities propagate a sound directly without playing an audible sound<br />
<br />
==== scriptEvent void '''propSoundMod'''(string name, float volMod); ====<br />
<br />
:propagate a sound directly with a volume modifier<br />
<br />
==== scriptEvent entity '''randomTarget'''(string ignoreName); ====<br />
<br />
:Returns a random targeted entity. Pass in an entity name to skip that entity.<br />
::''ignoreName'': the name of an entity to ignore<br />
<br />
==== scriptEvent float '''rangedThreatTo'''(entity target); ====<br />
<br />
:Could this entity threaten the given (target) entity from a distance?<br />
<br />
==== scriptEvent void '''removeBinds'''(); ====<br />
<br />
:Removes all attached entities from the game<br />
<br />
==== scriptEvent void '''removeKey'''(string key); ====<br />
<br />
:Removes a key from an object's spawnargs, so things like getNextKey() don't retrieve it.<br />
::''key'': the spawnarg to remove<br />
<br />
==== scriptEvent void '''removeTarget'''(entity target); ====<br />
<br />
:Remove a target from this entity.<br />
::''target'': the entity to remove from the targets<br />
<br />
==== scriptEvent float '''replaceInvItem'''(entity oldItem, entity newItem); ====<br />
<br />
:Replaces the entity <oldItem> with <newItem> in the inventory, while keeping <oldItem>'s inventory position intact. Note: The position guarantee only applies if <oldItem> and newItem share the same category. If the categories are different, the position of <newItem> is likely to be different than the one of <oldItem>. Note that <oldItem> will be removed from the inventory. If <newItem> is the $null_entity, <oldItem> is just removed and no replacement happens. Returns 1 if the operation was successful, 0 otherwise.<br />
::''newItem'': can be $null_entity<br />
<br />
==== scriptEvent void '''ResetTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''reskinCollisionModel'''(); ====<br />
<br />
:For use after setSkin() on moveables and static models, if the CM needs to be refreshed to update surface properties after a skin change. CM will be regenerated from the original model file with the new skin.<br />
<br />
==== scriptEvent void '''ResponseAdd'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseAllow'''(float type, entity responder); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
==== scriptEvent void '''ResponseIgnore'''(float type, entity responder); ====<br />
<br />
:This functions must be called on the stim entity. It will add the response to the ignore list, so that subsequent stims, should not trigger the stim anymore.<br />
<br />
==== scriptEvent void '''ResponseRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseSetAction'''(float type, string action); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''ResponseTrigger'''(entity source, float stimType); ====<br />
<br />
:Fires a response on this entity, without a stim (a stand-alone response, so to say)<br />
<br />
==== scriptEvent void '''RestartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''restorePosition'''(); ====<br />
<br />
:Returns this entity to the position stored in the "origin" spawn arg. This is the position the entity was spawned in unless the "origin" key is changed. Note that there is no guarantee that the entity won't be stuck in another entity when moved, so care should be taken to make sure that isn't possible.<br />
<br />
==== scriptEvent void '''setAngles'''(vector angles); ====<br />
<br />
:Sets the current orientation of this entity (relative to bind parent if any)<br />
::''angles'': the new orientation<br />
<br />
==== scriptEvent void '''setAngularVelocity'''(vector velocity); ====<br />
<br />
:Sets the current angular velocity of this entity. The angular velocity of a physics object is a vector that passes through the center of mass. The direction of this vector defines the axis of rotation and the magnitude defines the rate of rotation about the axis in radians per second.<br />
<br />
==== scriptEvent void '''setClipMask'''(float clipMask); ====<br />
<br />
:Sets the clipmask of the physics object.<br />
<br />
==== scriptEvent void '''setColor'''(float parm0, float parm1, float parm2); ====<br />
<br />
:Sets the RGB color of this entity (shader parms Parm0, Parm1, Parm2).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
<br />
==== scriptEvent void '''setContents'''(float contents); ====<br />
<br />
:Sets the contents of the physics object.<br />
<br />
==== scriptEvent float '''setCurInvCategory'''(string categoryName); ====<br />
<br />
:Sets the inventory cursor to the first item of the named category. Returns 1 on success, 0 on failure (e.g. wrong category name)<br />
<br />
==== scriptEvent entity '''setCurInvItem'''(string itemName); ====<br />
<br />
:Sets the inventory cursor to the named item. Returns: the item entity of the newly selected item (can be $null_entity).<br />
<br />
==== scriptEvent void '''setDroppable'''(float droppable); ====<br />
<br />
:Set whether an item may be dropped from the inventory. <br />
::''droppable'': if non-zero the item becomes droppable, when called with 0 the item becomes non-droppable<br />
<br />
==== scriptEvent void '''setEntityRelation'''(entity ent, float relation); ====<br />
<br />
:Set a relation to another entity, this can be friendly (>0), neutral(0) or hostile (<0)<br />
<br />
==== scriptEvent void '''setFrobable'''(float frobable); ====<br />
<br />
:Set whether the entity is frobable<br />
<br />
==== scriptEvent void '''setGui'''(float handle, string guiFile); ====<br />
<br />
:Loads a new file into an existing GUI.<br />
<br />
==== scriptEvent void '''setGuiFloat'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiInt'''(float handle, string key, float val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiString'''(float handle, string key, string val); ====<br />
<br />
:Sets a GUI parameter.<br />
<br />
==== scriptEvent void '''setGuiStringFromKey'''(float handle, string key, entity src, string srcKey); ====<br />
<br />
:This is a kludge. It is equivelant to: setGuiString( handle, key, src.getKey(srcKey) ) However, it's used to bypass the 127 char size limit on script strings.<br />
<br />
==== scriptEvent void '''setHealth'''(float health); ====<br />
<br />
:Use these to set the health of AI or players (this also updates the AI_DEAD flag)<br />
<br />
==== scriptEvent void '''setKey'''(string key, string value); ====<br />
<br />
:Sets a key on this entity's spawn args. Note that most spawn args are evaluated when this entity spawns in, so this will not change the entity's behavior in most cases. This is chiefly for saving data the script needs in an entity for later retrieval.<br />
::''key'': the spawnarg to set<br />
::''value'': the value to store<br />
<br />
==== scriptEvent void '''setLinearVelocity'''(vector velocity); ====<br />
<br />
:Sets the current linear velocity of this entity in units per second. The linear velocity of a physics object is a vector that defines the translation of the center of mass in units per second.<br />
<br />
==== scriptEvent void '''setModel'''(string modelName); ====<br />
<br />
:Sets the model this entity uses<br />
<br />
==== scriptEvent void '''setName'''(string name); ====<br />
<br />
:Sets the name of this entity.<br />
::''name'': the new name<br />
<br />
==== scriptEvent void '''setNeverDormant'''(float enable); ====<br />
<br />
:enables or prevents an entity from going dormant<br />
::''enable'': 1 = enable, 0 = disable<br />
<br />
==== scriptEvent void '''setOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (relative to it's bind parent if any)<br />
::''origin'': the new origin<br />
<br />
==== scriptEvent void '''setOwner'''(entity owner); ====<br />
<br />
:Sets the owner of this entity. Entities will never collide with their owner.<br />
::''owner'': the entity which will be made owner of this entity<br />
<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
==== scriptEvent void '''setShaderParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets shader parms Parm0, Parm1, Parm2, and Parm3 (red, green, blue, and alpha respectively).<br />
::''parm0'': red<br />
::''parm1'': green<br />
::''parm2'': blue<br />
::''parm3'': alpha<br />
<br />
==== scriptEvent void '''setSize'''(vector min, vector max); ====<br />
<br />
:Sets the size of this entity's bounding box.<br />
::''min'': minimum corner coordinates<br />
::''max'': maximum corner coordinates<br />
<br />
==== scriptEvent void '''setSkin'''(string skinName); ====<br />
<br />
:Sets the skin this entity uses. Set to "" to turn off the skin.<br />
<br />
==== scriptEvent void '''setSolid'''(float solidity); ====<br />
<br />
:Set the solidity of the entity. If the entity has never been solid before it will be assigned solid and opaque contents/clip masks.<br />
<br />
==== scriptEvent void '''setSoundVolume'''(float newLevel); ====<br />
<br />
:Set the volume of the sound to play, must be issued before startSoundShader.<br />
<br />
==== scriptEvent void '''setTeam'''(float newTeam); ====<br />
<br />
:Sets the team number of this entity.<br />
<br />
==== scriptEvent void '''SetTimerState'''(float stimId, float state); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setWorldOrigin'''(vector origin); ====<br />
<br />
:Sets the current position of this entity (regardless of any bind parent).<br />
<br />
==== scriptEvent void '''show'''(); ====<br />
<br />
:Makes this entity visible if it has a model.<br />
<br />
==== scriptEvent void '''startFx'''(string fx); ====<br />
<br />
:Starts an FX on this entity.<br />
<br />
==== scriptEvent float '''startSound'''(string sound, float channel, float netSync); ====<br />
<br />
:Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound in seconds. This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.<br />
::''sound'': the spawnarg to reference, e.g. 'snd_move'<br />
::''channel'': the channel to play on<br />
::''netSync'': -<br />
<br />
==== scriptEvent float '''startSoundShader'''(string shaderName, float channel); ====<br />
<br />
:Plays a specific sound shader on the channel and returns the length of the sound in seconds. This is not the preferred method of playing a sound since you must ensure that the sound is loaded.<br />
::''shaderName'': the sound shader to play<br />
::''channel'': the channel to play the sound on<br />
<br />
==== scriptEvent void '''StartTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''StimAdd'''(float type, float radius); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''StimClearIgnoreList'''(float type); ====<br />
<br />
:This clears the ignore list for the stim of the given type It can be used if an entity changes state in some way that it would no longer be ignored<br />
<br />
==== scriptEvent void '''StimEnable'''(float type, float state); ====<br />
<br />
:No description<br />
::''state'': 0 = disabled, 1 = enabled<br />
<br />
==== scriptEvent void '''StimRemove'''(float type); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''stopSound'''(float channel, float netSync); ====<br />
<br />
:Stops a specific sound shader on the channel.<br />
::''channel'': the channel to stop playback on<br />
::''netSync'': -<br />
<br />
==== scriptEvent void '''StopTimer'''(float stimId); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''teleportTo'''(entity other); ====<br />
<br />
:Teleports the entity to the position of the other entity, plus a possible offset and random offset (defined on the spawnargs of the entity to be teleported)<br />
<br />
==== scriptEvent float '''touches'''(entity other); ====<br />
<br />
:Returns true if this entity touches the other entity.<br />
::''other'': the entity to check against<br />
<br />
==== scriptEvent void '''unbind'''(); ====<br />
<br />
:Detaches this entity from its master.<br />
<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
=== idAnimatedEntity ===<br />
==== scriptEvent void '''clearAllJoints'''(); ====<br />
<br />
:Removes any custom transforms on all joints.<br />
<br />
==== scriptEvent void '''clearJoint'''(float jointnum); ====<br />
<br />
:Removes any custom transforms on the specified joint.<br />
<br />
==== scriptEvent vector '''getJointAngle'''(float jointnum); ====<br />
<br />
:Returns the angular orientation of the joint in world space.<br />
<br />
==== scriptEvent float '''getJointHandle'''(string jointname); ====<br />
<br />
:Looks up the number of the specified joint. Returns INVALID_JOINT if the joint is not found.<br />
<br />
==== scriptEvent vector '''getJointPos'''(float jointnum); ====<br />
<br />
:Returns the position of the joint in world space.<br />
<br />
==== scriptEvent void '''setJointAngle'''(float jointnum, float transform_type, vector angles); ====<br />
<br />
:Modifies the orientation of the joint based on the transform type.<br />
<br />
==== scriptEvent void '''setJointPos'''(float jointnum, float transform_type, vector pos); ====<br />
<br />
:Modifies the position of the joint based on the transform type.<br />
<br />
=== CFrobButton ===<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
=== CFrobDoor ===<br />
==== scriptEvent entity '''GetDoorhandle'''(); ====<br />
<br />
:Returns the handle entity of this door. Can return NULL (== $null_entity)<br />
<br />
==== scriptEvent void '''OpenDoor'''(float master); ====<br />
<br />
:The OpenDoor method is necessary to give the FrobDoorHandles a "low level" open routine. The CFrobDoor::Open() call is re-routed to the FrobDoorHandle::Tap() method, so there must be a way to actually let the door open. Which is what this method does. Note: Shouldn't be called directly by scripters, call handle->Tap() instead. Unless you know what you're doing.<br />
<br />
=== CFrobDoorHandle ===<br />
==== scriptEvent entity '''GetDoor'''(); ====<br />
<br />
:Returns the associated door entity for this handle.<br />
<br />
=== CFrobHandle ===<br />
==== scriptEvent void '''Tap'''(); ====<br />
<br />
:Operates this handle.<br />
<br />
=== CFrobLever ===<br />
==== scriptEvent void '''Operate'''(); ====<br />
<br />
:Call this to operate this entity.<br />
<br />
==== scriptEvent void '''Switch'''(float newState); ====<br />
<br />
:Move the lever to the on or off position (0 = off).<br />
<br />
=== CFrobLock ===<br />
==== scriptEvent void '''Open'''(); ====<br />
<br />
:Opens the frobmover, regardless of its previous state. The mover will not move when it's locked. <br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
==== scriptEvent void '''TDM_Lock_StatusUpdate'''(); ====<br />
<br />
:internal<br />
<br />
=== CFrobLockHandle ===<br />
==== scriptEvent entity '''GetLock'''(); ====<br />
<br />
:Returns the associated lock of this handle.<br />
<br />
=== tdmFuncShooter ===<br />
==== scriptEvent void '''shooterFireProjectile'''(); ====<br />
<br />
:Fires a projectile.<br />
<br />
==== scriptEvent float '''shooterGetAmmo'''(); ====<br />
<br />
:Get the ammonition<br />
<br />
==== scriptEvent float '''shooterGetState'''(); ====<br />
<br />
:Returns the current state of this shooter.<br />
<br />
==== scriptEvent void '''shooterSetAmmo'''(float newAmmo); ====<br />
<br />
:Set the ammonition<br />
<br />
==== scriptEvent void '''shooterSetState'''(float state); ====<br />
<br />
:Activates / deactivates the shooter entity.<br />
::''state'': 1 = active, 0 = inactive<br />
<br />
=== idEntityFx ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idItem ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''respawn'''(); ====<br />
<br />
:Respawn<br />
<br />
=== idMoveableItem ===<br />
==== scriptEvent void '''gib'''(string damageDefName); ====<br />
<br />
:No description<br />
<br />
=== idLight ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''fadeInLight'''(float time); ====<br />
<br />
:Turns the light on over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeOutLight'''(float time); ====<br />
<br />
:Turns the light out over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeToLight'''(vector color, float time); ====<br />
<br />
:Fades the light to the given color over a given time.<br />
<br />
==== scriptEvent float '''getLightLevel'''(); ====<br />
<br />
:Get level (intensity) of a light, <= 0.0 indicates it is off<br />
<br />
==== scriptEvent vector '''getLightOrigin'''(); ====<br />
<br />
:Get the light origin (independent of its visual model)<br />
<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
==== scriptEvent vector '''getRadius'''(); ====<br />
<br />
:Returns the light radius.<br />
<br />
==== scriptEvent string '''getShader'''(); ====<br />
<br />
:Gets the shader name used by the light.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
==== scriptEvent void '''setLightOrigin'''(vector pos); ====<br />
<br />
:Set origin of lights independent of model origin<br />
<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
==== scriptEvent void '''setRadius'''(float radius); ====<br />
<br />
:Sets the size of the bounding box, x=y=z=radius.<br />
<br />
==== scriptEvent void '''setRadiusXYZ'''(float x, float y, float z); ====<br />
<br />
:Sets the width/length/height of the light bounding box.<br />
<br />
==== scriptEvent void '''setShader'''(string shader); ====<br />
<br />
:Sets the shader to be used for the light.<br />
<br />
==== scriptEvent void '''setStartedOff'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''smoking'''(float state); ====<br />
<br />
:flame is now smoking (1), or not (0)<br />
::''state'': 1 = smoking, 0 = not smoking<br />
<br />
=== idListener ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPlayerStart ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idActivator ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPathCorner ===<br />
==== scriptEvent entity '''randomPath'''(); ====<br />
<br />
:no description<br />
<br />
=== idDamagable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idExplodable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idForceField ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''Toggle'''(); ====<br />
<br />
:Turns the forcefield on and off.<br />
<br />
=== idAnimated ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''footstep'''(); ====<br />
<br />
:Plays footstep sound.<br />
<br />
==== scriptEvent void '''launchMissiles'''(string projectilename, string sound, string launchbone, string targetbone, float numshots, float framedelay); ====<br />
<br />
:Launches a projectile.<br />
<br />
==== scriptEvent void '''leftFoot'''(); ====<br />
<br />
:Changes to left foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''rightFoot'''(); ====<br />
<br />
:Changes to right foot and plays footstep sound.<br />
<br />
==== scriptEvent void '''startRagdoll'''(); ====<br />
<br />
:Switches to a ragdoll taking over the animation.<br />
<br />
=== idStaticEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncSmoke ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idVacuumSeparatorEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPortalEntity ===<br />
==== scriptEvent float '''getPortalHandle'''(); ====<br />
<br />
:Returns the portal handle.<br />
<br />
==== scriptEvent float '''getSoundLoss'''(); ====<br />
<br />
:Returns the sound loss value (dB).<br />
<br />
==== scriptEvent void '''setSoundLoss'''(float loss); ====<br />
<br />
:Sets the sound loss value (dB).<br />
<br />
=== idBeam ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idShaking ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idEarthQuake ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncPortal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncAASPortal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idFuncAASObstacle ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPhantomObjects ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPortalSky ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== tdmVine ===<br />
==== scriptEvent void '''addDescendant'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent float '''canWater'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''clearWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent entity '''getPrime'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''scaleVine'''(float factor); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''setPrime'''(entity vine); ====<br />
<br />
:Event called using vine.*()<br />
<br />
==== scriptEvent void '''setWatered'''(); ====<br />
<br />
:Event called using vine.*()<br />
<br />
=== idMoveable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''becomeNonSolid'''(); ====<br />
<br />
:Makes the moveable non-solid for other entities.<br />
<br />
==== scriptEvent void '''enableDamage'''(float enable); ====<br />
<br />
:enable/disable damage<br />
<br />
==== scriptEvent float '''isAtRest'''(); ====<br />
<br />
:Returns true if object is not moving<br />
<br />
=== idMover ===<br />
==== scriptEvent void '''accelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover accelerates.<br />
<br />
==== scriptEvent void '''accelTime'''(float time); ====<br />
<br />
:Sets the acceleration time. Set this acceleration time before initiating a new move.<br />
<br />
==== scriptEvent void '''accelTo'''(float speed, float time); ====<br />
<br />
:Initiates an acceleration to the given speed over the given time in seconds.<br />
<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''bob'''(float speed, float phase, vector distance); ====<br />
<br />
:Initiates a translation back and forth along the given vector with the given speed and phase.<br />
<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''decelSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the mover decelerates.<br />
<br />
==== scriptEvent void '''decelTime'''(float time); ====<br />
<br />
:Sets the deceleration time. Set this deceleration time before initiating a new move.<br />
<br />
==== scriptEvent void '''decelTo'''(float speed, float time); ====<br />
<br />
:Initiates a deceleration to the given speed over the given time in seconds.<br />
<br />
==== scriptEvent void '''disableSplineAngles'''(); ====<br />
<br />
:Disables aligning the mover with the spline direction.<br />
<br />
==== scriptEvent void '''enableSplineAngles'''(); ====<br />
<br />
:Enables aligning the mover with the spline direction.<br />
<br />
==== scriptEvent float '''getMoveSpeed'''(); ====<br />
<br />
:Get the movement speed.<br />
<br />
==== scriptEvent float '''getMoveTime'''(); ====<br />
<br />
:Gets the movement time.<br />
<br />
==== scriptEvent float '''isMoving'''(); ====<br />
<br />
:Returns true if a mover is moving<br />
<br />
==== scriptEvent float '''isRotating'''(); ====<br />
<br />
:Returns true if a mover is rotating<br />
<br />
==== scriptEvent void '''move'''(float angle, float distance); ====<br />
<br />
:Initiates a translation with the given distance in the given yaw direction. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''moveSound'''(string sound); ====<br />
<br />
:Sets the sound to be played when the moving.<br />
<br />
==== scriptEvent void '''moveTo'''(entity targetEntity); ====<br />
<br />
:Initiates a translation to the position of an entity. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''moveToPos'''(vector pos); ====<br />
<br />
:Initiates a translation to an absolute position. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''removeInitialSplineAngles'''(); ====<br />
<br />
:Subtracts the initial spline angles to maintain the initial orientation of the mover.<br />
<br />
==== scriptEvent void '''rotate'''(vector angleSpeed); ====<br />
<br />
:Initiates a rotation with the given angular speed. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateDownTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by decreasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateOnce'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the current angles plus the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateTo'''(vector angles); ====<br />
<br />
:Initiates a rotation towards the given Euler angles. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''rotateUpTo'''(float axis, float angle); ====<br />
<br />
:Initiates a rotation about the given axis by increasing the current angle towards the given angle. Uses the current speed/time and acceleration and deceleration settings.<br />
<br />
==== scriptEvent void '''speed'''(float speed); ====<br />
<br />
:Sets the movement speed. Set this speed before initiating a new move.<br />
<br />
==== scriptEvent void '''startSpline'''(entity spline); ====<br />
<br />
:Starts moving along a spline stored on the given entity.<br />
<br />
==== scriptEvent void '''stopMoving'''(); ====<br />
<br />
:Stops any translational movement.<br />
<br />
==== scriptEvent void '''stopRotating'''(); ====<br />
<br />
:Stops any rotational movement.<br />
<br />
==== scriptEvent void '''stopSpline'''(); ====<br />
<br />
:Stops moving along a spline.<br />
<br />
==== scriptEvent void '''sway'''(float speed, float phase, vector angles); ====<br />
<br />
:Initiates a rotation back and forth along the given angles with the given speed and phase.<br />
<br />
==== scriptEvent void '''time'''(float time); ====<br />
<br />
:Sets the movement time. Set this time before initiating a new move.<br />
<br />
=== idMover_Binary ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''closePortal'''(); ====<br />
<br />
:Closes the renderer portal associated with this mover.<br />
<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
==== scriptEvent void '''openPortal'''(); ====<br />
<br />
:Opens the renderer portal associated with this mover.<br />
<br />
=== idRotater ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idRiser ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idPlayer ===<br />
==== scriptEvent void '''changeWeaponName'''(string weaponName, string displayName); ====<br />
<br />
:Changes the display name of the given weapon item to something different. Pass an empty string to reset the display name to the definition as found in the weaponDef.<br />
<br />
==== scriptEvent void '''changeWeaponProjectile'''(string weaponName, string projectileDefName); ====<br />
<br />
:Changes the projectile entityDef name of the given weapon (e.g. "broadhead") to the specified entityDef (e.g. "atdm:projectile_broadhead").<br />
<br />
==== scriptEvent void '''checkAAS'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''clearActiveInventoryMap'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
==== scriptEvent void '''clearActiveInventoryMapEnt'''(); ====<br />
<br />
:Clear the active inventory map entity<br />
<br />
==== scriptEvent void '''clearMouseDeadTime'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''customDeath'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''deathMenu'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''disableWeapon'''(); ====<br />
<br />
:Lowers and disables the player weapon.<br />
<br />
==== scriptEvent void '''enableWeapon'''(); ====<br />
<br />
:Enables the player weapon.<br />
<br />
==== scriptEvent void '''endZoom'''(float duration); ====<br />
<br />
:Starts the zoom out event, which performs a gradual transition back to the default FOV. May be called during a transition as well to intercept a pending zoom in transition.<br />
::''duration'': duration of the transition in msec<br />
<br />
==== scriptEvent void '''exitTeleporter'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getButtons'''(); ====<br />
<br />
:Returns the button state from the current user command.<br />
<br />
==== scriptEvent float '''getCalibratedLightgemValue'''(); ====<br />
<br />
:Returns the calibrated light gem value.<br />
<br />
==== scriptEvent string '''getCurrentWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player is currently holding.<br />
<br />
==== scriptEvent string '''getCurWeaponName'''(); ====<br />
<br />
:Returns the name of the current weapon, as defined by "inv_weapon_name" in the weaponDef.<br />
<br />
==== scriptEvent entity '''getDragged'''(); ====<br />
<br />
:Returns the currently dragged body. Returns $null_entity if the body is shouldered, the player has nothing in his hands, or he has a non-AF entity in his hands. See also getShouldered(), getGrabbed() and getFrobbed().<br />
<br />
==== scriptEvent float '''getFov'''(); ====<br />
<br />
:This returns the current FOV of the player. You can modify the current FOV with startZoom() and endZoom().<br />
<br />
==== scriptEvent entity '''getFrobbed'''(); ====<br />
<br />
:Returns the currently frobhilighted entity. This includes entities the player has in his hands. Sets "frob only used by" mode<br />
<br />
==== scriptEvent entity '''getGrabbed'''(); ====<br />
<br />
:Returns the currently entity in the players hands. Returns $null_entity if the player has nothing in his hands Dragging or shouldering a body counts as grabbing it. See also getDragged(), getShouldered(), getFrobbed().<br />
<br />
==== scriptEvent vector '''getHinderance'''(string source); ====<br />
<br />
:Used to get hinderance from a source.<br />
<br />
==== scriptEvent float '''getImmobilization'''(string source); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent float '''getInventoryOverlay'''(); ====<br />
<br />
:Gets the default inventory overlay for the player. All other entities will return an invalid value.<br />
<br />
==== scriptEvent float '''getMouseGesture'''(); ====<br />
<br />
:Returns the results of the last mouse gesture in enum form. (see the definition for MOUSEDIR_* for which numbers correspond to which directions)<br />
<br />
==== scriptEvent vector '''getMove'''(); ====<br />
<br />
:Returns the movement relative to the player's view angles from the current user command. vector_x = forward, vector_y = right, vector_z = up<br />
<br />
==== scriptEvent string '''getNextHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get the next hinderance from a source.<br />
<br />
==== scriptEvent string '''getNextImmobilization'''(string prefix, string lastMatch); ====<br />
<br />
:Used to get immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent string '''getNextTurnHinderance'''(string prefix, string lastMatch); ====<br />
<br />
:Get the next hinderance on the view turning from a source<br />
<br />
==== scriptEvent float '''getObjectiveComp'''(float ObjNum, float CompNum); ====<br />
<br />
:Used to get the state of custom objective components<br />
::''ObjNum'': Starts counting at 1<br />
::''CompNum'': Starts counting at 1<br />
<br />
==== scriptEvent float '''getObjectiveState'''(float ObjNum); ====<br />
<br />
:Returns the current state of the objective with the number ObjNum. State is one of the following: OBJ_INCOMPLETE = 0, OBJ_COMPLETE = 1, OBJ_INVALID = 2, OBJ_FAILED = 3<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent float '''getObjectiveVisible'''(float ObjNum); ====<br />
<br />
:Returns the current visibility of the objective with the number ObjNum.<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent string '''getPreviousWeapon'''(); ====<br />
<br />
:Returns weaponX where X is the number of the weapon the player was previously holding.<br />
<br />
==== scriptEvent entity '''getShouldered'''(); ====<br />
<br />
:Returns the currently shouldered body, otherwise $null_entity. See also getDragged(), getGrabbed() and getFrobbed().<br />
<br />
==== scriptEvent vector '''getTurnHinderance'''(string source); ====<br />
<br />
:* Get the hinderance on the view turning from a source<br />
<br />
==== scriptEvent vector '''getViewAngles'''(); ====<br />
<br />
:Returns the player view angles.<br />
<br />
==== scriptEvent entity '''getWeaponEntity'''(); ====<br />
<br />
:Returns the entity for the player's weapon<br />
<br />
==== scriptEvent void '''giveHealthPool'''(float amount); ====<br />
<br />
:This increases/decreases the healthpool of the player by the given amount. The healthpool is gradually decreased over time, healing (damaging?) the player.<br />
<br />
==== scriptEvent entity '''heldEntity'''(); ====<br />
<br />
:Returns the entity currently being held, or $null_entity if the player's hands are empty.<br />
<br />
==== scriptEvent float '''holdEntity'''(entity entity); ====<br />
<br />
:Forces the player to hold an entity (e.g. puts it into the grabber). Drops whatever is in the player's hands if $null_entity is passed to it. Returns 1 if successful, 0 if not.<br />
<br />
==== scriptEvent float '''isLeaning'''(); ====<br />
<br />
:Get whether the player is leaning<br />
<br />
==== scriptEvent void '''missionFailed'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''missionSuccess'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''mouseGestureFinished'''(); ====<br />
<br />
:Returns true if the player is not currently doing a mouse gesture.<br />
<br />
==== scriptEvent void '''objectiveCompUnlatch'''(float ObjNum, float CompNum); ====<br />
<br />
:Unlatch an irreversible objective component that has latched into a state<br />
<br />
==== scriptEvent void '''objectiveUnlatch'''(float ObjNum); ====<br />
<br />
:Unlatch an irreversible objective that has latched into a state<br />
<br />
==== scriptEvent void '''pauseGame'''(); ====<br />
<br />
:Pauses the game. This should only be called for threads that are explicitly maintained by a special SDK method, because ordinary threads won't get executed during g_stopTime == true. Note: This is used by the objective GUI threads. Note: Must be called on the player entity, not the sys entity.<br />
<br />
==== scriptEvent void '''playStartSound'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''readLightgemModifierFromWorldspawn'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''resetWeaponProjectile'''(string weaponName); ====<br />
<br />
:Reloads the original projectile def name from the weaponDef. Used to revert a change made by the event changeWeaponProjectile().<br />
<br />
==== scriptEvent void '''resetZoom'''(); ====<br />
<br />
:Cancels any pending zoom transitions and resets the FOV to normal.<br />
<br />
==== scriptEvent void '''ropeRemovalCleanup'''(entity ropeEnt); ====<br />
<br />
:Called when rope arrow ropes are removed, removes stale pointers on the player object.<br />
<br />
==== scriptEvent void '''saveGame'''(string filename); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''selectWeapon'''(string weapon); ====<br />
<br />
:Selects the weapon the player is holding.<br />
<br />
==== scriptEvent void '''setActiveInventoryMapEnt'''(entity mapEnt); ====<br />
<br />
:Notify the player about a new active map entity. This clears out any previously active maps.<br />
<br />
==== scriptEvent void '''setFrobOnlyUsedByInv'''(float OnOff); ====<br />
<br />
:Engages or disengages a mode where we only frobhilight entities that can be used by our current inventory item. This also disables general frobactions and only allows "used by" frob actions.<br />
<br />
==== scriptEvent void '''setHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Used to set hinderance from a source.<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
==== scriptEvent void '''setImmobilization'''(string source, float type); ====<br />
<br />
:Used to set immobilization from a source. Warning: Not a finalized version. It's subject to change, so use it at your own risk.)<br />
<br />
==== scriptEvent void '''setLightgemModifier'''(string modifierName, float value); ====<br />
<br />
:Sets the named lightgem modifier to a certain value. An example would be the player lantern: setLightgemModifier("lantern", 32). This way multiple modifiers can be set by concurrent script threads.<br />
<br />
==== scriptEvent void '''setObjectiveComp'''(float ObjNum, float CompNum, float state); ====<br />
<br />
:Used to set the state of custom objective components<br />
::''ObjNum'': objective number. Starts counting at 1<br />
::''CompNum'': component number. Starts counting at 1<br />
::''state'': 1 or 0 for true or false<br />
<br />
==== scriptEvent void '''setObjectiveEnabling'''(float ObjNum, string strIn); ====<br />
<br />
:Set an objective's enabling objectives (objectives that must be completed before that objective may be completed).<br />
::''strIn'': takes the form of a string that is a space-delimited list of integer objectives representing the new enabling objectives. E.g. : '1 2 3 4'<br />
<br />
==== scriptEvent void '''setObjectiveOngoing'''(float ObjNum, float val); ====<br />
<br />
:Sets objective ongoing.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setObjectiveOptional'''(float ObjNum, float val); ====<br />
<br />
:Sets objective mandatory.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setObjectiveState'''(float ObjNum, float State); ====<br />
<br />
:Used to set the state of objectives from the script. For example, use this to invalidate an objective when something happens in your mission. The first argument is the numerical index of the objective (taking 'user' objective indices, starting at 1). Choose from the following for the second argument: OBJ_INCOMPLETE, OBJ_COMPLETE, OBJ_INVALID, OBJ_FAILED. Use this on $player1 like $player1.setObjectiveState(1, OBJ_COMPLETE);<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent void '''setObjectiveText'''(float ObjNum, string newText); ====<br />
<br />
:Modify the displayed text for an objective. Can also be a string template like #str_20000<br />
::''ObjNum'': Starts counting at 1<br />
<br />
==== scriptEvent void '''setObjectiveVisible'''(float ObjNum, float val); ====<br />
<br />
:Sets objective visibility.<br />
::''val'': 1 for true, 0 for false<br />
<br />
==== scriptEvent void '''setPeekOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for peeking, depending on aspect ratio.<br />
<br />
==== scriptEvent void '''setPeekView'''(float OnOff, vector origin); ====<br />
<br />
:Toggle whether we should use a view from a peek entity as the player's view<br />
<br />
==== scriptEvent void '''setSavePermissions'''(float permission); ====<br />
<br />
:No description<br />
::''permission'': 0<br />
<br />
==== scriptEvent void '''setSpyglassOverlayBackground'''(); ====<br />
<br />
:Sets the background overlay for the spyglass, depending on aspect ratio.<br />
<br />
==== scriptEvent void '''setTurnHinderance'''(string source, float mCap, float fCap); ====<br />
<br />
:Set the hinderance on the view turning from a source<br />
::''mCap'': mCap values from all sources are multiplied together to define a cap<br />
::''fCap'': fCap values are not additive, the smallest one among all the sources is used<br />
<br />
==== scriptEvent void '''setViewAngles'''(vector angles); ====<br />
<br />
:Sets the player view angles, e.g. make the player facing this direction. 0 0 0 is east (along the X axis in DR), 0 90 0 north (along the Y axis in DR) 0 180 0 west, 0 270 0 south.<br />
<br />
==== scriptEvent void '''startGamePlayTimer'''(); ====<br />
<br />
:Resets the game play timer to zero and (re)starts it.<br />
<br />
==== scriptEvent void '''startMouseGesture'''(float key, float thresh, float test, float inverted, float turnHinderance, float decideTime, float deadTime); ====<br />
<br />
:Start tracking a mouse gesture that started when the key impulse was pressed. Discretizes analog mouse movement into a few different gesture possibilities. Impulse arg can also be a button, see the UB_* enum in usercmdgen.h. For now, only one mouse gesture check at a time.<br />
::''thresh'': Waits until the threshold mouse input thresh is reached before deciding.<br />
::''test'': determines which test to do (0 = up/down, 1 = left/right, 2 = 4 directions, 3 = 8 directions).<br />
::''inverted'': inverts the movement if set to 1, does not if 0<br />
::''turnHinderance'': Sets the max player view turn rate when checking this mouse gesture (0 => player view locked, 1.0 => no effect on view turning)<br />
::''decideTime'': time in milliseconds after which the mouse gesture is auto-decided, in the event that the mouse movement threshold was not reached. A DecideTime of -1 means wait forever until the button is released.<br />
::''deadTime'': how long after attack is pressed that mouse control remains dampened by the fraction turnHinderance.<br />
<br />
==== scriptEvent void '''startZoom'''(float duration, float startFOV, float endFOV); ====<br />
<br />
:Call this to start the zoom in event. The player FOV is gradually zoomed in until over the given timespan.<br />
::''duration'': duration of the transition in msec<br />
::''startFOV'': The start FOV, this is clamped to [1..179]<br />
::''endFOV'': The end FOV, this is clamped to [1..179]<br />
<br />
==== scriptEvent void '''stopFxFov'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''stopMouseGesture'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''testEvent1'''(float float_pi, float int_beef, float float_exp, string string_tdm, float float_exp10, float int_food); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''testEvent2'''(float int_prevres, vector vec_123, float int_food, entity ent_player, entity ent_null, float float_pi, float float_exp); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent vector '''testEvent3'''(entity ent_prevres, vector vec_123, float float_pi, entity ent_player); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''triggerMissionEnd'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''unpauseGame'''(); ====<br />
<br />
:Unpauses the game. Most scripts are not executed during g_stopTime == true and won't get into the position of calling this.<br />
<br />
==== scriptEvent float '''wasDamaged'''(); ====<br />
<br />
:Check if the player was damaged this frame.<br />
<br />
=== idProjectile ===<br />
==== scriptEvent float '''getProjectileState'''(); ====<br />
<br />
:Gets the current state of the projectile. States are defined in tdm_defs.script<br />
<br />
==== scriptEvent void '''launch'''(vector start, vector dir, vector velocity); ====<br />
<br />
:Launches the projectile from <start> in direction <dir> with the given <velocity><br />
<br />
==== scriptEvent void '''TDM_Lock_OnLockPicked'''(); ====<br />
<br />
:internal<br />
<br />
=== CProjectileResult ===<br />
==== scriptEvent entity '''getActualStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getAxialDir'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getFinalAngVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getFinalVel'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''getIncidenceAngle'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''getProjMass'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent entity '''getStruckEnt'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent vector '''getSurfNormal'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent string '''getSurfType'''(); ====<br />
<br />
:Getter for projectile result variable<br />
<br />
==== scriptEvent float '''isVineFriendly'''(); ====<br />
<br />
:Vine-arrow event<br />
<br />
=== CTarget_SetRelations ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetEntityRelation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeEntityRelation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idThread ===<br />
==== scriptEvent float '''acos'''(float cosine); ====<br />
<br />
:Returns the angle in degrees with the given cosine.<br />
<br />
==== scriptEvent vector '''angToForward'''(vector angles); ====<br />
<br />
:Returns a forward vector for the given Euler angles.<br />
<br />
==== scriptEvent vector '''angToRight'''(vector angles); ====<br />
<br />
:Returns a right vector for the given Euler angles.<br />
<br />
==== scriptEvent vector '''angToUp'''(vector angles); ====<br />
<br />
:Returns an up vector for the given Euler angles.<br />
<br />
==== scriptEvent float '''asin'''(float sine); ====<br />
<br />
:Returns the angle in degrees with the given sine.<br />
<br />
==== scriptEvent void '''assert'''(float condition); ====<br />
<br />
:Breaks if the condition is zero. (Only works in debug builds.)<br />
<br />
==== scriptEvent void '''cacheSoundShader'''(string shaderName); ====<br />
<br />
:Ensure the specified sound shader is loaded by the system. Prevents cache misses when playing sound shaders.<br />
::''shaderName'': the sound shader to cache<br />
<br />
==== scriptEvent float '''canPlant'''(vector traceStart, vector traceEnd, entity ignore, entity vine); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''ceil'''(float x); ====<br />
<br />
:Returns the smallest integer that is greater than or equal to the given value.<br />
<br />
==== scriptEvent void '''clearPersistantArgs'''(); ====<br />
<br />
:Clears data that persists between maps.<br />
<br />
==== scriptEvent void '''clearSignalThread'''(float signalNum, entity ent); ====<br />
<br />
:Clears the script callback function set for when the given signal is raised on the given entity.<br />
<br />
==== scriptEvent void '''copySpawnArgs'''(entity ent); ====<br />
<br />
:copies the spawn args from an entity<br />
<br />
==== scriptEvent float '''cos'''(float degrees); ====<br />
<br />
:Returns the cosine of the given angle in degrees.<br />
<br />
==== scriptEvent vector '''CrossProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the cross product of the two vectors.<br />
<br />
==== scriptEvent void '''debug_tdm_material'''(string file); ====<br />
<br />
:For temporary debuging purposes only. Should be removed eventually.<br />
<br />
==== scriptEvent void '''debugArrow'''(vector color, vector start, vector end, float size, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugBounds'''(vector color, vector mins, vector maxs, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugCircle'''(vector color, vector origin, vector dir, float radius, float numSteps, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent void '''debugLine'''(vector color, vector start, vector end, float lifetime); ====<br />
<br />
:line drawing for debug visualization. lifetime of 0 == 1 frame.<br />
<br />
==== scriptEvent float '''DotProduct'''(vector vec1, vector vec2); ====<br />
<br />
:Returns the dot product of the two vectors.<br />
<br />
==== scriptEvent void '''drawText'''(string text, vector origin, float scale, vector color, float align, float lifetime); ====<br />
<br />
:text drawing for debugging. lifetime of 0 == 1 frame.<br />
::''align'': 0 = left, 1 = center, 2 = right<br />
<br />
==== scriptEvent float '''emitParticle'''(string particle, float startTime, float diversity, vector origin, vector angle); ====<br />
<br />
:Start a particle effect in the world without using an entity emitter. Will emit one quad per particle stage when first called with sys.getTime() as the start time. Designed to be called once per frame with the same startTime each call to achieve a normal particle effect, or on demand with sys.getTime() as the startTime for finer grained control, 1 quad at a time. Returns True (1) if there are more particles to be emitted from the stage, False (0) if the stage has released all its quads.<br />
::''particle'': String: name of particle effect.<br />
::''startTime'': Game seconds since map start: use sys.getTime() for the first call unless you want to back-date the particle so that it starts part way through its cycle.<br />
::''diversity'': Randomizer value between 0 and 1. All particles with the same diversity will have the same path and rotation. Use sys.random(1) for a random path.<br />
::''origin'': Origin of the particle effect.<br />
::''angle'': Axis for the particle effect. Use $<entityname>.getAngles() to align the particle to an entity. use '0 0 0' for an upright (world-aligned) particle effect.<br />
<br />
==== scriptEvent void '''error'''(string text); ====<br />
<br />
:Issues an error.<br />
<br />
==== scriptEvent void '''fadeIn'''(vector color, float time); ====<br />
<br />
:Fades towards the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeOut'''(vector color, float time); ====<br />
<br />
:Fades from the given color over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''fadeTo'''(vector color, float alpha, float time); ====<br />
<br />
:Fades to the given color up to the given alpha over the given time in seconds.<br />
::''time'': in seconds<br />
<br />
==== scriptEvent void '''firstPerson'''(); ====<br />
<br />
:Returns view control to the player entity.<br />
<br />
==== scriptEvent float '''floor'''(float x); ====<br />
<br />
:Returns the largest integer that is less than or equal to the given value.<br />
<br />
==== scriptEvent float '''getCurrentMissionNum'''(); ====<br />
<br />
:Returns the number of the current mission (0-based, the first mission has number 0).<br />
<br />
==== scriptEvent string '''getcvar'''(string name); ====<br />
<br />
:Returns the string for a cvar.<br />
<br />
==== scriptEvent float '''getDifficultyLevel'''(); ====<br />
<br />
:Returns 0 (Easy), 1 (Medium) or 2 (Hard), depending on the difficulty level of the current mission.<br />
<br />
==== scriptEvent string '''getDifficultyName'''(float difficultyLevel); ====<br />
<br />
:Returns the (translated) name of the difficulty level passed as the argument.<br />
::''difficultyLevel'': 0 (Easy), 1 (Medium), 2 (Hard)<br />
<br />
==== scriptEvent entity '''getEntity'''(string name); ====<br />
<br />
:Returns a reference to the entity with the specified name.<br />
<br />
==== scriptEvent float '''getFrameTime'''(); ====<br />
<br />
:returns the length of time between game frames. this is not related to renderer frame rate.<br />
<br />
==== scriptEvent entity '''getLocationPoint'''(vector point); ====<br />
<br />
:Returns the idLocation entity corresponding to the specified point's location.<br />
::''point'': point whose location to check<br />
<br />
==== scriptEvent entity '''getMainAmbientLight'''(); ====<br />
<br />
:Returns the entity of the main ambient light.<br />
<br />
==== scriptEvent float '''getMissionStatistic'''(string statisticName); ====<br />
<br />
:Returns current mission statistic.<br />
::''statisticName'': Can be one of (case insensitive): gamePlayTime: gameplay time in seconds damageDealt: damage dealt to enemies damageReceived: damage received by player healthReceived: health received by player pocketsPicked: pockets picked by player foundLoot: loot found by player missionLoot: total loot available in mission totalTimePlayerSeen: total time the player was seen by enemies in seconds. Updates only when AI lose sight of player numberTimesPlayerSeen: number of times player was seen by enemies numberTimesAISuspicious: number of times AI was 'observant' or 'suspicious'. A single AI passing through both alert levels will add 2 to the score. numberTimesAISearched: number of times AI was 'investigating' or 'searching'. A single AI passing through both alert levels will add 2 to the score. sightingScore: sighting score (number of times player was seen * weight) stealthScore: stealth score (sighting score + alerts * weights) killedByPlayer: number of enemies killed by player knockedOutByPlayer: number of enemies knocked out by player bodiesFound: number of times enemies have spotted a body secretsFound: number of secrets found by the player secretsTotal: total number of secrets in the mission <br />
<br />
==== scriptEvent entity '''getNextEntity'''(string key, string value, entity lastMatch); ====<br />
<br />
:Discover all entities in the map. Returns $null_entity when no more found.<br />
::''key'': Optional string: prefix for spawnarg key match. E.g. "target" will match "target", "target1" etc.<br />
::''value'': Optional string: spawnarg value to match. Can be used independently of ''key''. If ''key'' is not set, all spawnargs will be checked for the value.<br />
::''lastMatch'': Last match: search will start after this entity. Use $null_entity or pass an uninitialized entity variable to start a new search.<br />
<br />
==== scriptEvent float '''getPersistantFloat'''(string key); ====<br />
<br />
:Returns the floating point value for the given persistent arg<br />
<br />
==== scriptEvent string '''getPersistantString'''(string key); ====<br />
<br />
:Returns the string for the given persistent arg<br />
<br />
==== scriptEvent vector '''getPersistantVector'''(string key); ====<br />
<br />
:Returns the vector for the given persistent arg<br />
<br />
==== scriptEvent float '''getPortAISoundLoss'''(float handle); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getPortPlayerSoundLoss'''(float handle); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getPortSoundLoss'''(float handle); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent float '''getRelation'''(float team1, float team2); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''getTDMVersion'''(); ====<br />
<br />
:Get the current TDM version as integer. The value will be 108 for v1.08, 109 for v1.09 and 200 for v2.00 etc.<br />
<br />
==== scriptEvent float '''getTicsPerSecond'''(); ====<br />
<br />
:returns the number of game frames per second. this is not related to renderer frame rate.<br />
<br />
==== scriptEvent float '''getTime'''(); ====<br />
<br />
:Returns the current game time in seconds.<br />
<br />
==== scriptEvent string '''getTraceBody'''(); ====<br />
<br />
:Returns the number of the body part of the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent vector '''getTraceEndPos'''(); ====<br />
<br />
:Returns the position the trace stopped due to a collision with solid geometry during the last call to trace or tracePoint<br />
<br />
==== scriptEvent entity '''getTraceEntity'''(); ====<br />
<br />
:Returns a reference to the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent float '''getTraceFraction'''(); ====<br />
<br />
:Returns the fraction of movement completed during the last call to trace or tracePoint.<br />
<br />
==== scriptEvent string '''getTraceJoint'''(); ====<br />
<br />
:Returns the number of the skeletal joint closest to the location on the entity which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent vector '''getTraceNormal'''(); ====<br />
<br />
:Returns the normal of the hit plane during the last call to trace or tracePoint<br />
<br />
==== scriptEvent string '''getTraceSurfType'''(); ====<br />
<br />
:Returns the type of the surface (i.e. metal, snow) which was hit during the last call to trace or tracePoint<br />
<br />
==== scriptEvent void '''handleMissionEvent'''(entity objEnt, float eventType, string argument); ====<br />
<br />
:Generic interface for passing on mission events from scripts to the SDK. Available since TDM 1.02<br />
::''objEnt'': the entity that triggered this event (e.g. a readable)<br />
::''eventType'': a numeric identifier (enumerated both in MissionData.h and tdm_defs.script) specifying the type of event<br />
::''argument'': an optional string parameter, eventtype-specific.<br />
<br />
==== scriptEvent float '''influenceActive'''(); ====<br />
<br />
:Checks if an influence is active<br />
<br />
==== scriptEvent void '''killthread'''(string threadName); ====<br />
<br />
:Kills all threads with the specified name<br />
<br />
==== scriptEvent float '''log'''(float x); ====<br />
<br />
:Returns the log of the given argument.<br />
<br />
==== scriptEvent void '''logString'''(float logClass, float logType, string output); ====<br />
<br />
:This is the script counterpart to DM_LOG<br />
<br />
==== scriptEvent void '''music'''(string shaderName); ====<br />
<br />
:Starts playing background music.<br />
<br />
==== scriptEvent void '''offsetRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''onSignal'''(float signalNum, entity ent, string functionName); ====<br />
<br />
:Sets a script callback function for when the given signal is raised on the given entity.<br />
<br />
==== scriptEvent void '''pause'''(); ====<br />
<br />
:Pauses the current thread.<br />
<br />
==== scriptEvent float '''pointInLiquid'''(vector point, entity ignoreEntity); ====<br />
<br />
:Checks if a point is in a liquid, returns 1 if this is the case.<br />
<br />
==== scriptEvent float '''pointIsInBounds'''(vector point, vector mins, vector maxs); ====<br />
<br />
:Returns true if the point is within the bounds specified.<br />
::''point'': test whether this point is in the bounds<br />
::''mins'': minimal corner of the bounds<br />
::''maxs'': maximal corner of the bounds<br />
<br />
==== scriptEvent float '''pow'''(float x, float y); ====<br />
<br />
:Returns the power of x to y.<br />
<br />
==== scriptEvent void '''print'''(string text); ====<br />
<br />
:Prints the given string to the console.<br />
<br />
==== scriptEvent void '''println'''(string text); ====<br />
<br />
:Prints the given line to the console.<br />
<br />
==== scriptEvent void '''projectDecal'''(vector traceOrigin, vector traceEnd, entity passEntity, string decal, float decalSize, float angle); ====<br />
<br />
:Performs a trace from the specified origin and end positions, then projects a decal in that direction.<br />
::''traceOrigin'': Start of the trace.<br />
::''traceEnd'': End of the trace.<br />
::''passEntity'': This entity will be considered non-solid by the trace.<br />
::''decal'': Decal to be projected.<br />
::''decalSize'': Size of the decal quad.<br />
::''angle'': Angle of the decal quad.<br />
<br />
==== scriptEvent void '''radiusDamage'''(vector origin, entity inflictor, entity attacker, entity ignore, string damageDefName, float dmgPower); ====<br />
<br />
:damages entities within a radius defined by the damageDef. inflictor is the entity causing the damage and can be the same as the attacker (in the case of projectiles, the projectile is the inflictor, while the attacker is the character that fired the projectile).<br />
::''inflictor'': the entity causing the damage<br />
::''ignore'': an entity to not cause damage to<br />
::''dmgPower'': scales the damage (for cases where damage is dependent on time)<br />
<br />
==== scriptEvent float '''random'''(float range); ====<br />
<br />
:Returns a random value X where 0 <= X < range.<br />
<br />
==== scriptEvent void '''saveConDump'''(string cmd, string cmd); ====<br />
<br />
:Saves condump into FM directory; first argument is appended to dump filename, everything before last occurence of second argument is removed<br />
<br />
==== scriptEvent void '''say'''(string text); ====<br />
<br />
:Multiplayer - Print this line on the network<br />
<br />
==== scriptEvent void '''sessionCommand'''(string cmd); ====<br />
<br />
:Sends the sessioncommand to the game<br />
<br />
==== scriptEvent void '''setCamera'''(entity cameraEnt); ====<br />
<br />
:Turns over view control to the given camera entity.<br />
<br />
==== scriptEvent void '''setcvar'''(string name, string value); ====<br />
<br />
:Sets a cvar.<br />
<br />
==== scriptEvent void '''setPersistantArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair that persists between maps<br />
<br />
==== scriptEvent void '''setPortAISoundLoss'''(float handle, float value); ====<br />
<br />
:AI sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setPortPlayerSoundLoss'''(float handle, float value); ====<br />
<br />
:Player sound loss scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setPortSoundLoss'''(float handle, float value); ====<br />
<br />
:Sound propagation scriptfunction on the sys object<br />
<br />
==== scriptEvent void '''setRelation'''(float team1, float team2, float val); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''setSecretsFound'''(float secrets); ====<br />
<br />
:Set how many secrets the player has found. Use getMissionStatistic() for getting the current value.<br />
<br />
==== scriptEvent void '''setSecretsTotal'''(float secrets); ====<br />
<br />
:Set how many secrets exist in the map in total. Use getMissionStatistic() for getting the current value.<br />
<br />
==== scriptEvent void '''setShaderParm'''(float parm, float value); ====<br />
<br />
:Sets the value of the specified shader parm.<br />
::''parm'': shader parm index<br />
::''value'': new value<br />
<br />
==== scriptEvent void '''setSpawnArg'''(string key, string value); ====<br />
<br />
:Sets a key/value pair to be used when a new entity is spawned.<br />
<br />
==== scriptEvent float '''sin'''(float degrees); ====<br />
<br />
:Returns the sine of the given angle in degrees.<br />
<br />
==== scriptEvent entity '''spawn'''(string classname); ====<br />
<br />
:Creates an entity of the specified classname and returns a reference to the entity.<br />
<br />
==== scriptEvent float '''SpawnFloat'''(string key, float default); ====<br />
<br />
:Returns the floating point value for the given spawn argument.<br />
<br />
==== scriptEvent string '''SpawnString'''(string key, string default); ====<br />
<br />
:Returns the string for the given spawn argument.<br />
<br />
==== scriptEvent vector '''SpawnVector'''(string key, vector default); ====<br />
<br />
:Returns the vector for the given spawn argument.<br />
<br />
==== scriptEvent float '''sqrt'''(float square); ====<br />
<br />
:Returns the square root of the given number.<br />
<br />
==== scriptEvent float '''strFind'''(string text, string find, float casesensitive, float start, float end); ====<br />
<br />
:Return the position of the given substring, counting from 0, or -1 if not found.<br />
::''casesensitive'': 0<br />
::''start'': 0<br />
::''end'': -1<br />
<br />
==== scriptEvent string '''strLeft'''(string text, float num); ====<br />
<br />
:Returns a string composed of the first num characters<br />
<br />
==== scriptEvent float '''strLength'''(string text); ====<br />
<br />
:Returns the number of characters in the string<br />
<br />
==== scriptEvent string '''strMid'''(string text, float start, float num); ====<br />
<br />
:Returns a string composed of the characters from start to start + num<br />
<br />
==== scriptEvent string '''strRemove'''(string text, string remove); ====<br />
<br />
:Replace all occurances of the given substring with "". Example: StrRemove("abba","bb") results in "aa".<br />
<br />
==== scriptEvent string '''strReplace'''(string text, string remove, string replace); ====<br />
<br />
:Replace all occurances of the given string with the replacement string. Example: StrRemove("abba","bb","ccc") results in "accca".<br />
<br />
==== scriptEvent string '''strRight'''(string text, float num); ====<br />
<br />
:Returns a string composed of the last num characters<br />
<br />
==== scriptEvent string '''strSkip'''(string text, float num); ====<br />
<br />
:Returns the string following the first num characters<br />
<br />
==== scriptEvent float '''strToFloat'''(string text); ====<br />
<br />
:Returns the numeric value of the given string.<br />
<br />
==== scriptEvent float '''strToInt'''(string text); ====<br />
<br />
:Returns the integer value of the given string.<br />
<br />
==== scriptEvent void '''terminate'''(float threadNumber); ====<br />
<br />
:Terminates a thread.<br />
<br />
==== scriptEvent void '''threadname'''(string name); ====<br />
<br />
:Sets the name of the current thread.<br />
<br />
==== scriptEvent float '''trace'''(vector start, vector end, vector mins, vector maxs, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the box from 'mins' to 'maxs' hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
==== scriptEvent float '''tracePoint'''(vector start, vector end, float contents_mask, entity passEntity); ====<br />
<br />
:Returns the fraction of movement completed before the trace hits solid geometry when moving from 'start' to 'end'. The 'passEntity' is considered non-solid during the move.<br />
<br />
==== scriptEvent string '''translate'''(string input); ====<br />
<br />
:Translates a string (like #str_12345) into the current language<br />
<br />
==== scriptEvent void '''trigger'''(entity entityToTrigger); ====<br />
<br />
:Triggers the given entity.<br />
<br />
==== scriptEvent float '''vecLength'''(vector vec); ====<br />
<br />
:Returns the length of the given vector.<br />
<br />
==== scriptEvent vector '''vecNormalize'''(vector vec); ====<br />
<br />
:Returns the normalized version of the given vector.<br />
<br />
==== scriptEvent vector '''VecRotate'''(vector vector, vector angles); ====<br />
<br />
:Rotates a vector by the specified angles.<br />
<br />
==== scriptEvent vector '''VecToAngles'''(vector vec); ====<br />
<br />
:Returns Euler angles for the given direction.<br />
<br />
==== scriptEvent void '''wait'''(float time); ====<br />
<br />
:Suspends execution of the current thread for the given number of seconds.<br />
<br />
==== scriptEvent void '''waitFor'''(entity mover); ====<br />
<br />
:Waits for the given entity to complete its move.<br />
<br />
==== scriptEvent void '''waitForRender'''(entity e); ====<br />
<br />
:Suspends the current thread until 'e' might have been rendered. It's event based, so it doesn't waste CPU repeatedly checking inPVS(). e.inPVS() will very likely be true when the thread resumes. If e.inPVS() is true, calling waitForRender() will probably just wait a frame, unless D3 can figure out that the entity doesn't need to be rendered. Optimizations regarding shadowcasting lights may not apply to this function - it is based purely off whether or not the entity's bounding box is visible.<br />
<br />
==== scriptEvent void '''waitForThread'''(float threadNumber); ====<br />
<br />
:Waits for the given thread to terminate.<br />
<br />
==== scriptEvent void '''waitFrame'''(); ====<br />
<br />
:Suspends execution of current thread for one game frame.<br />
<br />
==== scriptEvent void '''warning'''(string text); ====<br />
<br />
:Issues a warning.<br />
<br />
=== idSecurityCamera ===<br />
==== scriptEvent float '''canSee'''(entity ent); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent entity '''getEnemy'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getSecurityCameraState'''(); ====<br />
<br />
:Returns the security camera's state. 1 = unalerted, 2 = suspicious, 3 = fully alerted, 4 = inactive, 5 = destroyed.<br />
<br />
==== scriptEvent entity '''getSpotLight'''(); ====<br />
<br />
:Returns the spotlight used by the camera. Returns null_entity if none is used.<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
==== scriptEvent void '''setSightThreshold'''(float sightThreshold); ====<br />
<br />
:Set the sight threshold of the security camera: how lit up the player's lightgem needs to be in order to be seen. 0.0 to 1.0<br />
<br />
==== scriptEvent void '''state_light'''(float set); ====<br />
<br />
:Switches the spotlight on or off. Respects the security camera's power state.<br />
<br />
==== scriptEvent void '''state_see_AI'''(float set); ====<br />
<br />
:Set whether the camera can see AIs.<br />
<br />
==== scriptEvent void '''state_see_animals'''(float set); ====<br />
<br />
:Set whether the camera can see animals. Checked after seeAI or seeBodies.<br />
<br />
==== scriptEvent void '''state_see_bodies'''(float set); ====<br />
<br />
:Set whether the camera can see bodies.<br />
<br />
==== scriptEvent void '''state_see_player'''(float set); ====<br />
<br />
:Set whether the camera can see the player.<br />
<br />
==== scriptEvent void '''state_sweep'''(float set); ====<br />
<br />
:Enables or disables the camera's sweeping.<br />
<br />
==== scriptEvent void '''toggle_light'''(); ====<br />
<br />
:Toggles the spotlight on/off.<br />
<br />
==== scriptEvent void '''toggle_see_AI'''(); ====<br />
<br />
:Toggles whether the camera can see AIs.<br />
<br />
==== scriptEvent void '''toggle_see_animals'''(); ====<br />
<br />
:Toggles whether the camera can see bodies. Checked after seeAI or seeBodies.<br />
<br />
==== scriptEvent void '''toggle_see_bodies'''(); ====<br />
<br />
:Toggles whether the camera can see bodies.<br />
<br />
==== scriptEvent void '''toggle_see_player'''(); ====<br />
<br />
:Toggles whether the camera can see the player.<br />
<br />
==== scriptEvent void '''toggle_sweep'''(); ====<br />
<br />
:Toggles the camera sweep.<br />
<br />
=== Seed ===<br />
==== scriptEvent void '''cullAll'''(); ====<br />
<br />
:Cull (remove from world) all entities.<br />
<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
=== idSound ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
==== scriptEvent void '''Off'''(); ====<br />
<br />
:Turns the entity off.<br />
<br />
==== scriptEvent void '''On'''(); ====<br />
<br />
:Turns the entity on.<br />
<br />
=== idTarget_Remove ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Show ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Damage ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SessionCommand ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_EndLevel ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_WaitForButton ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetGlobalShaderTime ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetShaderParm ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetShaderTime ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_FadeEntity ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_LightFadeIn ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_LightFadeOut ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_Give ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetModel ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetInfluence ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetKeyVal ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_SetFov ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_CallObjectFunction ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_PostScriptEvent ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_EnableLevelWeapons ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_RemoveWeapons ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTarget_FadeSoundClass ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_AddObjectives ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveVisibility ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetObjectiveComponentState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_StartConversation ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetFrobable ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_CallScriptFunction ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeLockState ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ChangeTarget ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_InterMissionTrigger ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_SetTeam ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== CTarget_ItemRemove ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger ===<br />
==== scriptEvent void '''disable'''(); ====<br />
<br />
:Disables the mover/trigger<br />
<br />
==== scriptEvent void '''enable'''(); ====<br />
<br />
:Enables the mover/trigger<br />
<br />
=== idTrigger_Multi ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_EntityName ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Timer ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Count ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Hurt ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Fade ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idTrigger_Touch ===<br />
==== scriptEvent void '''activate'''(entity activator); ====<br />
<br />
:Activates this entity as if it was activated by a trigger.<br />
::''activator'': the entity that caused the action (usually the player)<br />
<br />
=== idWeapon ===<br />
==== scriptEvent void '''addToClip'''(float amount); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''allowDrop'''(float allow); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''ammoAvailable'''(); ====<br />
<br />
:Number of shots left in inventory<br />
<br />
==== scriptEvent float '''ammoInClip'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent float '''animDone'''(float channel, float blendOutFrames); ====<br />
<br />
:Returns true if the animation playing on the given channel is completed considering a number of blend frames.<br />
<br />
==== scriptEvent float '''animIsPaused'''(float channel); ====<br />
<br />
:Return whether the given anim channel is paused<br />
<br />
==== scriptEvent float '''clipSize'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent entity '''createProjectile'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''ejectBrass'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''flashlight'''(float enable); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''getBlendFrames'''(float channel); ====<br />
<br />
:Returns the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent float '''getLightParm'''(float parmNum); ====<br />
<br />
:Gets a shader parameter.<br />
<br />
==== scriptEvent entity '''getOwner'''(); ====<br />
<br />
:Returns the owning entity<br />
<br />
==== scriptEvent entity '''getWorldModel'''(); ====<br />
<br />
:Returns the entity that controls the world model<br />
<br />
==== scriptEvent float '''isInvisible'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''launchProjectiles'''(float num_projectiles, float spread, float fuseOffset, float launchPower, float dmgPower); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent float '''melee'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''netEndReload'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''netReload'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''nextWeapon'''(); ====<br />
<br />
:No description<br />
<br />
==== scriptEvent void '''pauseAnim'''(float channel, float bPause); ====<br />
<br />
:Pause all animations playing on the given channel. NOTE: Can also be used used by idWeapons<br />
::''bPause'': true = pause, false = unpause<br />
<br />
==== scriptEvent float '''playAnim'''(float channel, string animName); ====<br />
<br />
:Do not use, this is part of TDM's internal mechanics. Use playCustomAnim() on AI.in scripts instead of this. Plays the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent float '''playCycle'''(float channel, string animName); ====<br />
<br />
:Continuously repeats the given animation on the given channel. Returns false if anim doesn't exist.<br />
<br />
==== scriptEvent void '''setBlendFrames'''(float channel, float blendFrame); ====<br />
<br />
:Sets the number of frames to blend between animations on the given channel.<br />
<br />
==== scriptEvent void '''setLightParm'''(float parmNum, float value); ====<br />
<br />
:Sets a shader parameter.<br />
<br />
==== scriptEvent void '''setLightParms'''(float parm0, float parm1, float parm2, float parm3); ====<br />
<br />
:Sets the red/green/blue/alpha shader parms on the light and the model.<br />
<br />
==== scriptEvent void '''showAttachment'''(string attName, float show); ====<br />
<br />
:Show or hide an attachment.<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent void '''showAttachmentInd'''(float index, float show); ====<br />
<br />
:Show or hide an attachment by array index.<br />
::''index'': starts at 0<br />
::''show'': 1 shows attachment, 0 hides it.<br />
<br />
==== scriptEvent float '''totalAmmoCount'''(); ====<br />
<br />
:Amount of ammo in inventory. since each shot may use more than 1 ammo, this is different than ammoAvailable()<br />
<br />
==== scriptEvent void '''useAmmo'''(float amount); ====<br />
<br />
:Eats the specified amount of ammo<br />
<br />
==== scriptEvent void '''weaponHolstered'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponLowering'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponOutOfAmmo'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponReady'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponReloading'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponRising'''(); ====<br />
<br />
:no description<br />
<br />
==== scriptEvent void '''weaponState'''(string stateFunction, float blendFrames); ====<br />
<br />
:no description<br />
<br />
[[Category:Scripting]]</div>Stgatilov