Popular Post Dragofer Posted July 17, 2020 Popular Post Report Posted July 17, 2020 As my custom assets work has increasingly shifted from models towards scripting, I'll open a new thread here to contain any scripts that I write which can be reused in other missions, starting with the A ) Presence Lamp This is a Lost City-style lamp that brightens and dims depending on the presence of the player or an AI. It fades between 2 colours and can trigger its targets whenever it switches fully on or off, so it should also be viable in various other situations. The standard setup consists of the following: - a trigger_multiple brush. The spawnarg "anyTouch" controls whether AIs, too, are able to activate it - a presence lamp, highly recommended with a colorme skin - one presence light, or any other light with appropriate spawnargs The targeting chain is trigger brush -> lamp -> light When the player or an AI stands in the trigger_multiple brush, the lamp switches on and starts a short timer. Subsequent triggers reset the timer. If the timer runs out because no one's standing in the trigger brush anymore, the lamp switches itself off. Notes - Multiple trigger brushes can target the same lamp, and one trigger brush can target multiple lamps. However, each presence lamp can only target one light, so if you want i.e. a bouncelight you'll need to hide an additional silent presence lamp somewhere and target it from the same trigger brush. - The lamp and the light use their own colour spawnargs respectively, since setting 0 0 0 on a lamp would make it appear pitch black. - Technically the trigger brush can be exchanged for anything else that triggers the lamp every 0.5s (this number can be changed via "update_interval" on the lamp), i.e. a trigger_timer. - This was originally named the proximity lamp and was one of many scripting jobs for The Painter's Wife. I've renamed it to "presence lamp" because the mapper may place the trigger brush(es) wherever he wishes: proximity to the lamp is not a factor. Credits go to Bikerdude for putting together the crystal lamp models. Download Presence Lamps - Google Drive Place or extract the .pk4 into your FM archive, then look up the presence lamp prefabs. If you already are using other custom scripts, remember to add the presence lamp's .script to your tdm_custom_scripts file. B ) Teledoor This is a Skyrim-style door which opens just a bit into a black_matt "void" before teleporting the player to a different area of the map, which may represent the other side of the door. This is used for connecting physically separated map areas with each other, such as when there's an exterior/interior split of a building or ship to allow for more mapping freedom. [Full Thread] C ) Mass Teleport This is a teleportation setup designed to seamlessly teleport the player and any moveables between two identical-looking areas. This allows the mapper to link 2 physically distant areas with each other while maintaining the illusion that they're connected. The teleportation zones should be free of AIs as they can't be teleported like this without their patrols breaking. [Post] D ) Automaton Station A station for Sotha's automatons (includes the automatons) which can be switched on and off by patrolling automatons. (Part of core assets as of 2.10) [Post] E ) Camgoyle A sentient turret originally made for the FM Written in Stone. It's based on the new security camera entity and augmented with scripting to allow it to fire magical projectiles at the enemies it detects. People are more than welcome to use it and to convert it into something else, such as a mechanical turret. [Post] [Download] F ) Audiograph The audiograph is an Inventor's Guild device for playing back recordings stored on spindles, which are small metal cylinders the player can pick up and store in his inventory. [Post] G ) Turret A new companion to security cameras familiar to Thief players. It will become active as soon as an enemy is detected by a targeted security camera, firing projectiles to fend off the intruders. Similar to the security camera and the camgoyle sentry, turrets are highly customisable in their behaviour and appearance. [Thread] G ) Fog Fade Dynamically change fog density depending on what location the player is in. [Thread] 10 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Bienie Posted July 19, 2020 Report Posted July 19, 2020 Loving that presence lamp setup! That could be very useful to mappers. I've wanted to make a lost city style map for a long time, and that is one piece that I wouldn't have to worry about, should I pursue that idea! Quote My Fan Missions: Series: Standalone: Chronicles of Skulduggery 0: To Catch a Thief The Night of Reluctant Benefaction Chronicles of Skulduggery 1: Pearls and Swine Langhorne Lodge Chronicles of Skulduggery 2: A Precarious Position Chronicles of Skulduggery 3: Sacricide
VanishedOne Posted August 2, 2020 Report Posted August 2, 2020 When I tried to make Lost City lamps with trigger_inactivity, I found it worked for the player but the trigger_multiple would repeatedly trigger its target with an AI inside it only if the AI was pathing, not if it was standing still. Have you found differently? 1 Quote Some things I'm repeatedly thinking about... - louder scream when you're dying
Obsttorte Posted August 2, 2020 Report Posted August 2, 2020 @VanishedOneThat's indeed the case. Note that Dragofer doesn't directly triggers the light via the trigger_multiple, but instead uses it to reset a timer that turns the light off once it ran out. 1 Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter
VanishedOne Posted August 2, 2020 Report Posted August 2, 2020 Right: that's basically what I did as well. If the AI stood still for long enough the timer would run out and the AI would be plunged into darkness. If memory serves, the last time I mentioned this you suggested using a different set-up with a modified AI scriptobject. 1 Quote Some things I'm repeatedly thinking about... - louder scream when you're dying
Dragofer Posted August 2, 2020 Author Report Posted August 2, 2020 I can confirm that trigger_multiple brushes stop firing triggers if an AI stands still within them. So I see 3 options: Report this for 2.09 so it hopefully gets fixed, or keep both mechanisms so we have both motion sensors and presence sensors. Develop a different presence mechanism that doesn't (wholly) rely on trigger brushes Turn this into a feature and rename to "motion lamp" instead of "presence lamp". Change the script so the lamp only responds to player movements that exceed a certain velocity. 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
VanishedOne Posted August 2, 2020 Report Posted August 2, 2020 I favour (1) unless there are technical reasons not to, because it would remove a disparity between how AI and the player are treated by the trigger. Quote Some things I'm repeatedly thinking about... - louder scream when you're dying
Oktokolo Posted August 2, 2020 Report Posted August 2, 2020 If it is possible to use stim/response for proximity detection, binding something emitting a special stim would allow for detecting the proximity of an AI while standing still. Quote
Dragofer Posted August 3, 2020 Author Report Posted August 3, 2020 Posted to the bugtracker: 0005319: Trigger_multiple stops working if AI stops moving Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Obsttorte Posted August 3, 2020 Report Posted August 3, 2020 You could check whether ai emit a visual stim, they player should. The lamps could than do a proximity test. Otherwise a custom stim applied to the ai could serve the purpose. It would probably good to allow both versions, either by using a trigger to control the lamp or the stim variant. 19 hours ago, Dragofer said: Turn this into a feature and rename to "motion lamp" instead of "presence lamp". Change the script so the lamp only responds to player movements that exceed a certain velocity. You could basically have both. If the minimum velocity needed for the lamp to turn on is controlled via a spawnarg, mappers would have the choice to set it to zero if the want a "presence lamp". A "motion lamp" could be interesting in respect to gameplay. Besides the magical lamp type of Lost City style one could also think of such lamps in manor missions or similar, whereas those are something by the inventors guild. Sneaking by lamps that go on if you are to fast while there is ai around could create quiet some tensive moments. Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter
Dragofer Posted August 3, 2020 Author Report Posted August 3, 2020 A motion lamp should be quite feasible if I can get trigger_multiple brushes to inform the script who activated it. Trigger_touch has such a function (pass_activator and pass_self spawnargs) but I don't see that for trigger_multiple. Surely that possibility exists? For making stim-triggered presence lamps, a problem will be that the radius of the stim is defined on the humanoid and not on the lamp, and any existing stims might be too short-ranged for general use. Would likely need to put custom stims with a large radius on all AIs and the player and only let the lamp react if the humanoid is within a certain spawnarg-specified radius. Alternatively each lamp lamp could check every second whether it can see someone, though then it'd frequently switch on/off when the player or AI moves around objects that provide cover. Another potential problem is that the AI might be very close but on a different floor/in an adjacent room. Visibility checks can't be used to identify this because the humanoid might be hidden behind cover, so it'll have to be location-based: each room should be its own location. Looks like this is a more involved route than the trigger brush method. Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Obsttorte Posted August 3, 2020 Report Posted August 3, 2020 Even if a stim is used to initiate the lamp behaviour, you can specifically define on how you want to do the detection. So to mimic the trigger behaviour (assuming you are using cuboid shaped triggers) you could do a coordinate check (via mins/maxs as done by some entities for example). To apply the custom stim you only have to modify the ai_base and player_base definitions. So you don't have to add the stim to all affected entities manually. Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter
Dragofer Posted October 3, 2020 Author Report Posted October 3, 2020 Here's a .pk4 containing @Sotha's great automaton guards from Ulysses: Genesis as well as an alternative design for the charging station that I had already made on another occasion, as requested by @JackFarmer. The reason I'm posting this in my scripting thread is that I've made a straightforward scriptobject for the charging station, allowing an automaton to switch it on and off as part of its patrol, thereby saving a lot of money on the lord's electricity bill and preventing the station from getting out of sync. It also switches off after a specified time (time_max), in case the automaton is destroyed while it was charging. Mapping wise, it works by having path_anim nodes activating callobjectfunctions, calling either station_on or station_off on the station. The station toggles its targets, unless it's already in the desired state. Prefabs can be found under prefabs/mechanical/automaton_station. Here's the simple scriptobject: Spoiler object automaton_station { void init(); void station_on(); void station_off(); //INTERNAL float m_station_state; //SPAWNARGS float m_time_max; //station automatically switches off after this time if bot fails to switch it off (i.e. because it's been killed at the station). 0 = infinite. }; void automaton_station::init() { m_time_max = getFloatKey("time_max"); } void automaton_station::station_on() { if(!m_station_state) { activateTargets(self); m_station_state = 1; } if(m_time_max) { sys.wait(m_time_max); thread station_off(); } } void automaton_station::station_off() { if (m_station_state) { activateTargets(self); m_station_state = 0; } } Under the hood, I've taken the opportunity to clean up the assets a fair amount, trimming unused components and ensuring it follows TDM's conventions, which is a necessary step towards an inclusion in the core assets. The download can be found in section D of the original post. 1 2 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
JackFarmer Posted October 3, 2020 Report Posted October 3, 2020 (edited) That's my boy, thank you for your quick help! Jack Edited October 3, 2020 by JackFarmer 1 Quote
HMart Posted December 24, 2020 Report Posted December 24, 2020 On 10/3/2020 at 1:30 PM, Dragofer said: Here's a .pk4 containing @Sotha's great automaton guards from Ulysses: Genesis as well as an alternative design for the charging station that I had already made on another occasion, as requested by @JackFarmer. The reason I'm posting this in my scripting thread is that I've made a straightforward scriptobject for the charging station, allowing an automaton to switch it on and off as part of its patrol, thereby saving a lot of money on the lord's electricity bill and preventing the station from getting out of sync. It also switches off after a specified time (time_max), in case the automaton is destroyed while it was charging. Mapping wise, it works by having path_anim nodes activating callobjectfunctions, calling either station_on or station_off on the station. The station toggles its targets, unless it's already in the desired state. Prefabs can be found under prefabs/mechanical/automaton_station. Here's the simple scriptobject: Reveal hidden contents object automaton_station { void init(); void station_on(); void station_off(); //INTERNAL float m_station_state; //SPAWNARGS float m_time_max; //station automatically switches off after this time if bot fails to switch it off (i.e. because it's been killed at the station). 0 = infinite. }; void automaton_station::init() { m_time_max = getFloatKey("time_max"); } void automaton_station::station_on() { if(!m_station_state) { activateTargets(self); m_station_state = 1; } if(m_time_max) { sys.wait(m_time_max); thread station_off(); } } void automaton_station::station_off() { if (m_station_state) { activateTargets(self); m_station_state = 0; } } Under the hood, I've taken the opportunity to clean up the assets a fair amount, trimming unused components and ensuring it follows TDM's conventions, which is a necessary step towards an inclusion in the core assets. The download can be found in section D of the original post. That's really cool Dragofer and Sotha, man I really need to play TDM more, I didn't even knew such characters existed in TDM. 1 Quote
Obsttorte Posted June 12, 2022 Report Posted June 12, 2022 So I've looked into #5319 and was able to solve the issue. By default, ai only activate triggers if they have changed their position in the last frame. I don't know whether it was setup like this for optimization purposes or whether there is another reason. The Bugtracker list a couple of missions that use those triggers in combination with ai, so someone who knows the mission or the mission creators themselves might investigate whether the current behaviour is required for those setups to work. I haven't commited anything yet due to this but imho it is rather inconsistent if a trigger reacts differently to the ai as it does to the player. At least I suspect most mappers wouldn't expect that, as both represent humans. UPDATE: After looking at most of the missions myself (except winter harvest, that isn't listed in the downloader), there seem to be no case were trigger_multiples or other multiple firing triggers are used with ai. So I commited the change as it shouldn't influence existing missions. 1 Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter
Dragofer Posted July 2, 2022 Author Report Posted July 2, 2022 Here's the camgoyle sentient turret that I originally made for the FM Written in Stone. It's based on the new security camera entity and augmented with scripting to allow it to fire magical projectiles at the enemies it detects. People are more than welcome to use it and to convert it into something else, such as a mechanical turret. Features Predicts the target's position based on its current velocity to fire more accurately. This can be disabled, i.e. on certain difficulties. Also traces towards the target before shooting to ensure the projectile has an unobstructed flight path. Uses a custom, purplish magical projectile with new sfx as a new alternative to fireballs. Comes with a scripted power source pedestal that can be placed anywhere in the map and be disabled by a special inventoryable staff, "atdm:mage_hand_staff". See prefabs/ai/machines for a prefab. Can be destroyed by fire arrows, causing it to break apart into pieces that fly about the room. Smoke will billow forth from the husk that still remains in place. The spotlight is set to be volumetric. You can use your own spotlight with the "spotlight_custom" spawnarg (see also: Security Camera wiki for other common functionality). By default the camgoyle is on the undead team, #8, so it'll only shoot at living targets such as the player. Google Drive 3 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Popular Post Dragofer Posted November 11, 2022 Author Popular Post Report Posted November 11, 2022 The next new entity type for TDM: the audiograph. The model has been made by Epifire and was first seen in use in Goldwell's FMs, but with the new dedicated entity definition and scriptobject it's now easy to use and supports various new features. Introduction from the new wiki article Quote The audiograph is an Inventor's Guild device for playing back recordings stored on spindles, which are small metal cylinders the player can pick up and store in his inventory. It offers the following features: * Every audiograph can load, unload and play any spindle. * Spindles are loaded by frobbing or using an audiograph while the player has a spindle selected in his inventory. * To start or stop playing the recording, frob the audiograph or trigger it from i.e. a lever. * Audiographs can target a spindle to automatically load it at map start. If the "start_on" spawnarg is set it will play the recording. * AIs can be alerted if an audiograph plays (certain) recordings. * The spindle's targets can be triggered at the end of a recording, i.e. as a pass-phrase for opening a secret door. It will be released with TDM 2.11 (rev 16646), but it will also work on earlier versions and can be downloaded here: Google Drive. 6 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
datiswous Posted November 11, 2022 Report Posted November 11, 2022 From how it looks I would expect a projection beam come from the left side, which plays a video recording on the side wall.. Using volumetric light and a video texture on the wall... Just an idea. Quote
Baal Posted November 11, 2022 Report Posted November 11, 2022 A lot of cool new stuff in this thread. If you're looking for ideas: What about a working furnace for a crematory, for example? That could be useful for someone. *wink wink* Quote
Amadeus Posted November 11, 2022 Report Posted November 11, 2022 1 hour ago, Baal said: If you're looking for ideas: What about a working furnace for a crematory, for example? That could be useful for someone. *wink wink* I feel like this is something that can be done in DR's Stim/Repsonse editor. Body goes in, ashes come out... But we'll wait for Dragofer to explain why we need a script Quote FMs: A Good Neighbor, Eye on the Prize Co-FMs: Displacement, Seeking Lady Leicester, Written in Stone, The Painter's Wife
datiswous Posted November 11, 2022 Report Posted November 11, 2022 (edited) I think there's a stove in mission Who Watches The Watcher, with an activation button. It's not really for bodies I think though. I mean it's large enough for bodies, but it doesn't look like the usual type. Edited November 11, 2022 by datiswous Quote
Dragofer Posted November 13, 2022 Author Report Posted November 13, 2022 Updated the download link with an update for the audiograph: Added custom sounds for switching on/off, loading/unloading and generic background noise for when a recording is playing, provided by Goldwell. More control over when playing a recording will trigger targets. The trigger_max spawnarg allows to limit how often targets can be triggered, while the trigger_from spawnarg(s) allows to restrict triggering to only when the spindle is played from a specific audiograph(s). More flexible support for scripting. Scripts can load any spindle regardless of whether the player has it in his inventory. Spindles can be returned either to the player's inventory or to the place they were loaded or picked up from. This allows the audiograph to be fully operated from scripts. On 11/11/2022 at 2:01 PM, Baal said: A lot of cool new stuff in this thread. If you're looking for ideas: What about a working furnace for a crematory, for example? That could be useful for someone. *wink wink* Thanks! I actually needed an audiograph for my map, but figured I'd do it "properly" so that we have an easily reusable audiograph entity for the core mod. If you need help with implementing a crematory I can advise. On 11/11/2022 at 3:10 PM, Amadeus said: I feel like this is something that can be done in DR's Stim/Repsonse editor. Body goes in, ashes come out... But we'll wait for Dragofer to explain why we need a script S/R is fine for making stuff happen by bringing 2 entities close to each other (i.e. furnace and body), but it gets messy if you want a sequence of events to happen and more detailed stuff like placing particle emitters at specific joints. On 11/11/2022 at 11:21 AM, datiswous said: From how it looks I would expect a projection beam come from the left side, which plays a video recording on the side wall.. Using volumetric light and a video texture on the wall... Just an idea. That can be done as a custom addon, just need to add a frob response to the audiograph that calls up a script which makes a video patch and a light appear until the sound is no longer playing (is_playing is 0). 3 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
snatcher Posted November 15, 2022 Report Posted November 15, 2022 Your stuff is most excellent, Dragofer. Have you ever thought about creating small maps/missions showcasing your tools in action along with the different options / configurations? And I really mean a bare bones map. I personally find it more intuitive seeing something and replicating what others did than trying to figure something out from docs/wiki/boards. 1 Quote
Dragofer Posted November 15, 2022 Author Report Posted November 15, 2022 47 minutes ago, snatcher said: Have you ever thought about creating small maps/missions showcasing your tools in action along with the different options / configurations? And I really mean a bare bones map. I do usually make test FM archives for each asset, as it helps make sure that all custom assets are in place. When I release an asset it's basically that archive minus the maps folder. I could try to dig the maps up again. The assets are usually made for missions, so you can also find the assets in there (presence lamp in Painter's Wife, camgoyles in Written in Stone, automaton station in The Anomaly, the audiograph and teledoors feature in WIPs). 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.