Jump to content
The Dark Mod Forums

Dragofer

Development Role
  • Posts

    2682
  • Joined

  • Last visited

  • Days Won

    161

Posts posted by Dragofer

  1. There are already flickering versions for a bunch of lit windows, which mappers can choose if they wish. IIRC I used them in Perilous Refuge for the ship windows and a certain house, but thought the effect would be too much if it were on all windows.

    I don't think there's anything to simulate a shadow being cast onto the window from inside the house. The closest thing is switching the window to an unlit version when the corresponding light sources are exintinguished.

    • Like 1
  2. The breakdown of the stim/response system is that entities can be set to emit stims around themselves, like a signal. If the stim reaches another entity that has a response to that type of stim, that entity will perform various response effects. For example a fire arrow emits a fire stim in a radius of x units every y milliseconds, so if an unlit candle with a fire response comes within that distance it'll perform the "relight self" response effect. The key part is that the stim is on one entity while the response is on a different entity.

    You can also create your own custom stims, for example the audiographs consist of stim-emitting tapes and machines that respond to that stim type. If you bring them close enough together a script is called to insert the tape and start playing the sound.

    Most stims are distance-based, but there are special cases such as frobbing and collision-based. Most of the stim types (fire, holy, visual etc.) only differ in name and ID #, and work the same way.

    • Thanks 2
  3. 2 hours ago, snatcher said:

    Thinking of the "transition period", I have a question: what happens if by the time 2.12 comes out an add-on has both a "tdm_user_addons.script" and a "tdm_user_addons_spiders.script"?

    There's nothing really hindering it, you just have to make sure that both scripts dont try to run at the same i.e. by starting with a version check to pick the right script.

    2 hours ago, snatcher said:

    First come first served, I guess.

    In the case of conflict the Modder (Addoner?) publishing his/her work last should be around listening and can be warned and take action.

    Core scripts already include the identifier "tdm" to minimise the risk of conflicts with FM scripts (originally: with Doom3 scripts). You could make up your own identifier such as "snatch", and in a community of this size it'll be unlikely that anyone else will think of the exact same one.

  4. 6 minutes ago, jaxa said:

    I hear these addons make saves incompatible between installations (relevant when swapping saves during beta testing)? That should be noted if accurate.

    This would be accurate since saves are specific to the scripts (and TDM build) that were installed at the time, so getting a newer version of an addon will make saves incompatible. Changing other custom files like entityDefs will probably cause issues as well. I added this to the creators' notes.

    • Thanks 1
  5. On 11/4/2023 at 9:34 PM, MirceaKitsune said:

    How do I attach a func_rotating propeller to an AI, but make it so that it stops rotating once the AI is dead?

    The most appropriate method would be an on_death script. You can reference the fire elemental for an example.

    Also, the sole purpose of tdm_custom_scripts.script is to allow mappers to add more .script files to their FM, so there's no reason not to use it.

  6. 18 minutes ago, STiFU said:

    How the hell did you pull off

    As part of the 2.10 update, a long extinct engine feature was restored by duzenko that allowed the visual changes to happen. Meanwhile, when the item is used its custom scriptobject cycles through all entities on the map that have been marked with a custom spawnarg and updates their solidity. 2.10 was a very feature-heavy update so that became a theme in the contest and using this back-then experimental feature gave bonus points. Meanwhile it's become a core feature.

    @MirceaKitsuneas this FM is the first instance of the overhauled and quite complex multi-part version of this AI script, it'd probably be good to compile all known issues like yours so the script can be finetuned further. Could probably also do with a wiki page to describe how to use its features.

    • Thanks 1
  7. For scripting it's essential what order the functions come in because a function can only call another function or access a variable if it has already been seen by the scripting engine. This would make auto-loading scripts in alphabetical order problematic unless all core and FM scripts have their names changed in a way that mimics their current #include orders. It would be better if the order no longer mattered, but that's probably a change in a different ballpark entirely.

    Also note that tdm_custom_scripts.script is explicitly for mappers and tdm_user_addons.script is explicitly for users/addon creators, with warnings in the respective files similar to how most of our GUI files point people to which ones are safe for them to tamper with. The messup with Hazard Pay happened because the FM provided a copy of tdm_user_addons.script (accidentally left behind after testing), conflicting with other addons.

    @wesp5files outside of .pk4s already overwrite same-named files inside .pk4s, both on the core and FM levels.

    In any case, we've recently started looking into a way of supporting unlimited addons in parallel by auto-including and auto-calling script files and functions whose names follow a specific naming convention (tdm_user_addon*).

    • Thanks 2
  8. 10 minutes ago, wesp5 said:

    I tested the new Hazard Pay version with my patch and I still get errors when starting it, because the mission contains the same statistics scroll script as my patch and doesn't like that variables and other things are reassigned. Is there an easy way to avoid missions breaking if they include duplicate scripts or do I need to rename everything in my version and hope that nobody uses the same names? I can imagine the same happening to snatchers mod, like if a mission editor likes a feature and includes it in his mission, the mission will break once snatcher's mod is installed in case names are the same...

    The first thing you need is to make sure all your script files have inclusion guards so they can only be loaded into the script stack once (these are the #endif lines you see at the start and end of official TDM script files). If you have those, then as long as both your addon and the FM author use the same name for the same .script file there shouldn't be an issue in terms of re-inclusion.

    Problems can still arise if both the author and you try to initialise the custom script separately, i.e. in this case you would have 2 copies of the stealth statistics scroll.

    Another issue arises if the FM author overwrites tdm_user_addons.script, which is the case here, because that will overwrite your addons. This is an error that should be corrected by the FM author (they should use tdm_custom_scripts.script, which is designed for mappers to use), and I've already told kingsal about this just now.

    Ultimately I think it's hard to avoid conflicts if the FM author integrates a user addon into his map. The best thing you can probably do besides what's above is to make sure each of your files and functions has unique names so both copies of the script can run in parallel in peace. Ofc this doesn't help if the author got the addon from your addon pack. We should probably discourage FM authors from integrating addon packs and instead ask them to point players to a download link.

    • Like 2
  9. 51 minutes ago, datiswous said:

    Btw. what happens if there's an ai patrol route in the location the player gets teleported to and the player ends in the place where the ai is at that moment?

    I guess you'll have a horrible teleportation accident on your hands, then. I don't think the setOrigin code checks whether the destination is free and applies an offset.

  10. 6 hours ago, datiswous said:

    I was just thinking, is it possible to make it behave as a normal door for ai but when the player interact with the door it behaves as a teledoor?

    Something to try out...

    Not with the current scripting, right now frobbing causes the door to open and close a little bit to simulate Skyrim-style opening of a closed door to another map section. This would conflict with the stock door opening effects. Apart from that I don't see a technical issue with adding new script effects to an existing door.

    Conceptually, the teledoor script is designed for permanently closed doors. If the door can be used normally by AI you might find it fully opened. It would be odd if AIs and the player can walk through at will but if the player frobs it he gets teleported somewhere else.

  11. 7 hours ago, HMart said:

    Thou the first thing that came to my mind when I read the question was using a func_mover, it exists exactly for that, I'm surprised if there's nothing in TDM wiki about it, if there's not here are something about it, and a more powerful and complex tutorial here thou a slide door is just a special binary func_mover.

    I believe there's no way to control a func_mover without using a script. Doors have the advantage of having an inbuilt response to frobs and triggers. If you can script, then func_movers are the more elegant option. In this case their advantage would be that you can more easily make it a single-use thing.

    • Like 1
  12. 3 hours ago, datiswous said:

    Well I think there's just one guy doing that and you can just put him on ignore. Or apply moderation. But ok, I understand.

    Ignoring is somewhat inadequate as you still see other members engaging in a discussion with the problematic user, and as Wellingtoncrab says such discussions displace all other content within that channel.

    Moderation is also imperfect as being unpleasant to engage with is not in itself banworthy, so there is nothing more to do if such people return to their old behaviour after a moderator had a talk with them, except live with it or move away.

    I'd be more willing to deal with it if it felt like there were more on-topic discussion, i.e. thoughts about recently played fan missions or mappers showcasing their progress, rather than a stream of consciousness about a meta topic that may or not have to do with TDM. I guess the forums already serve the desired purpose, or they just compartmentalise discussions better.

    • Like 4
  13. 3 hours ago, MirceaKitsune said:

    Thanks for clarifying. Unfortunately there's still a bug as the barrier never goes away: When I first enter the apartment the husband says "is she hurt, please put her on the bed"... I do so and the objective is completed, but after that the husband says nothing else and the barrier never goes away. I looked around the room and tried frobbing him, but nothing ever happens for some odd reason. Wonder if some triggers or signals got broken in latest dev?

    Hm, he's meant to continue talking after the placement is complete and the objective ticks off.

×
×
  • Create New...