TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 4 of 4

Thread: Making a Profit — source release

  1. #1
    Registered: Apr 2011

    Making a Profit — source release

    I’ve just released all the source files for my TDP20AC FM ‘Making a Profit’ on github:

    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.

  2. #2
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Fields of bluegrass
    Wow, thanks so much for this! I will have to find time to dig into it!

  3. #3
    Registered: Apr 2011
    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.

    (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).

    (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!

    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).

  4. #4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts