vfig on 31/5/2019 at 19:55
I've just released all the source files for my (
/forums/showthread.php?t=149376) TDP20AC FM ‘Making a Profit' on github:
* (
https://github.com/vfig/newbridge) github.com/vfig/newbridge
All the bits of the project that I made—that is, everything but the briefing artwork, voiceover, and translations—is free to use however you want to. Poke at it, pry at it, cut bits out to use in your FMs, turn it upside down, burn it all to the ground: do as you wish!
The full commit history is there too, in case you like seeing how things develop over time.
Yandros on 1/6/2019 at 02:35
Wow, thanks so much for this! I will have to find time to dig into it!
vfig on 1/6/2019 at 09:58
I should point out a few things that might be of particular interest:
T1/T2/SS2 detection, NewDark version check, squirrel script check
(in vfig_util.nut) The CheckDarkGameType, CheckNewDarkVersion, and CheckSquirrelScript scripts each runs when the game starts, and I have them hooked up to TeleportTraps that teleport the player into a tiny room with a plaque explaining that, e.g. they’re trying to run them mission in Thief 2, or their using an old version of NewDark.
CheckDarkGameType and CheckNewDarkVersion both do nothing if everything’s okay, and teleport the player if it’s not. But CheckSquirrelScript works the other way around (since if Squirrel isn’t loaded, like sometimes happened with ND 1.25, the script can’t run): it destroys the teleport trap when everything’s okay; if it doesn’t run, a TrigPlayerRoom script on the starting room triggers the teleport.
DebugPocketStats
(in vfig_util.nut) This script runs on mission start and just checks all the belt/alt Contains links in the mission. It tells me the total number of pickpocketable items and warns if any of them are on dead AI (which as you know means they won’t get counted properly in mission-end stats).
AIStatusSuffix
(In m20_generic.nut) I really liked how Lady Rowena gave every npc in her missions a unique name, so I wanted to do the same here. But as a player, I didn’t like how that meant I couldn’t check easily if I accidentally killed someone when I only meant to knock them out. So this script keeps the npc’s name, but adds “(Unconscious)” or “(Corpse)” after it, so I could have the best of both worlds.
Editor-only objects
(in vfig_util.nut) This one is trivial, but really handy. If you run miss20.mis in Dromed, you’ll notice you have extra inventory items: a “holy symbol” that acts as a master key to every locked door and chest in the mission. And a doorknob which you can frob to progress the ‘plot state’ in the ambience controller. I think there’s a couple of other editor-only things too. These are in the released mission too—they just have the EditorOnly script attached, which simply destroys them on load if you’re not in Dromed. This meant I didn’t need to remember to delete my debug tools every time I made a beta or release build; one less thing to worry about!
objectives_test.mis
This map was for developing and testing all the objective scripting. The main region represents the layout of the main mission, with all the same items and things that change your objectives. Because the mission allows a number of different paths to discover the plot, and lets you go almost everywhere in any order you want, making sure this all worked in any order I tried was essential. And this tiny map let me develop and test all the objective scripting to make sure it was robust. This was largely only possible because I drove all the objectives from another squirrel script (m20_goals.nut) instead of making and connecting dozens of objects the usual way (I started trying to do it that way and just couldn’t keep things straight! My hat’s off to all you FM authors who had complex objectives/plots without squirrel scripting!)
Ambience system: m20_ambience.nut
The ambient sound/music in my mission responds and changes according to both to the area you’re in and the development of the plot. I found AmbientHacked/Environmental to be problematic, as turning different ones on and off with CD made for jarring transitions as the old schema+aux schemas stopped and the new schema+aux schemas started (even if some of them were the same schemas!). So I wrote my own system to play background ambience:
* I only needed three schemas (a background loop, a mood loop, and a tension loop), but my system could support more easily. (But be aware of the sfx_channels setting! Each sound playing takes one channel, so my fm.cfg specifies 16 as the default.)
* When the ambience changes (as the player moves around or the plot develops), any schemas that haven’t changed keep playing. I tend to have only one schema change between adjacent regions so the transition is smoother. (when AmbientHacked/Environmental changes, all the schemas restart, and it can be jarring; this was the reason I wrote my own system to begin with!)
* The currently playing ambience is defined by the room the player is in. Each set has a “region name”, configured with the Room:Ambient/Schema Name property; I put the property on room brush archetypes usually. This property is completely unused by T1 and T2, so I don’t put a schema name in it, but one of my own region names, like “STREETS” or “MAUSOLEUM”.
* Each region in the squirrel script then has seven sets of three schema names, to correspond with the seven stages of the plot in my mission (can be more or less just by changing the enum at the top of the script).
* In a couple of areas (the catacombs and the ritual chamber) I wanted to have the ambience change as the state of the area changed; smaller than a mission-wide plot change. So for these areas I just defined several region names (“CATACOMBS”, “CATACOMBS2”); then a script just changes the Room:Ambient property on the appropriate room archetype and sends a message to the AmbienceController that the region has changed.
For example, when you start the mission, the plot is at ‘kMissionStart’, i.e. 0. You start in the STREETS region, and the "m20city1loop", "m20city1mood", and "m20city1ten" schemas (slot 0 for STREETS) are playing. If you enter the cemetery, you move to region CEMETERY whose slot 0 schemas are "m20ceme1loop", "m20city1mood", "m20city1ten". Only one of these is different, so the AmbienceController leaves m20city1mood and m20city1ten playing without interruption, stops m20city1loop, and starts m20ceme1loop. Back out to the streets and m20ceme1loop is stopped and replaced with m20city1loop again.
Then the plot develops: let’s say you discover Argaux is dead (by examining his body or reading the notice about it). Now the plot state progresses to ‘kWhereIsArgaux’ (yeah, it’s named wrong), i.e. 1. The STREETS slot 1 schemas are "m20city1loop", "m20city1mood", and "m20city2ten". Once again only one of these has changed (so the transition sounds smoother), so now m20city1loop and m20city1mood keep on playing, but m20city1ten stops and is replaced with m20city2ten (which sounds a little more threatening).
There’s a “test_ambience.mis” mission which is just a set of tiny squares representing the different regions of the map, and a debug inventory item which I can frob to advance the plot state. You can see the ambience system at work in this map (which I used to develop it and test my schema choices).
FenPhoenix on 2/6/2019 at 01:18
Although I'm not a mission author, I just want to say a big thank you for this generous release. The stuff you've mentioned sounds really useful. :)
vegetables on 28/8/2019 at 17:14
I'm trying to use m20_ambience.nut but after adding PlayerAmbienceWatcher to the starting point Dromed crashes when going into game mode. Making a Profit also crashes when going into game mode, though I didn't have any problems playing it back when it was first released (that was with a different Thief installation though.) I'm using NewDark 1.26.
Yandros on 28/8/2019 at 18:36
Are you sure squirrel.osm is available to be loaded by Dromed in the new installation?
vfig on 28/8/2019 at 18:44
Quote Posted by vegetables
I'm trying to use m20_ambience.nut but after adding PlayerAmbienceWatcher to the starting point Dromed crashes when going into game mode. Making a Profit also crashes when going into game mode, though I didn't have any problems playing it back when it was first released (that was with a different Thief installation though.) I'm using NewDark 1.26.
It sounds like Dromed might be finding an old version of squirrel.osm. (
https://www.ttlg.com/forums/showthread.php?t=149376&p=2410939&viewfull=1#post2410939) Haplo had a very similar crash, also relating to the code in m20_ambience.nut, when loading the mission; he wrote:
Quote:
Just in case the mission crashes for anyone else in the future: The root cause was an old squirrel.osm file. Even though my NewDark was 1.26, my squirrel module was from 2016 (which is apparently known to have a problem with PostMessage()) instead of 2018.
vegetables on 28/8/2019 at 18:51
Yep, I had the same old squirrel.osm. Replacing it fixed it, thanks! Would it be worth including squirrel.osm with my mission in case anyone else has the same problem?
vfig on 28/8/2019 at 20:06
No; that wouldn't be a good idea, and is in any case unnecessary. Squirrel.osm is part of NewDark now and each release of NewDark has its own version. Since ND1.26 and up, the right version of squirrel.osm should be installed to the right location; I believe it's only if you had used ND1.25 and upgraded that you might have problems.
What might be worth doing is putting a note in your readme about this crash and the fix.