Jump to content
The Dark Mod Forums

Dragofer

Development Role
  • Posts

    2626
  • Joined

  • Last visited

  • Days Won

    157

Posts posted by Dragofer

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

  2. 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
  3. 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
  4. 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
  5. 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.

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

  7. 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
  8. 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
  9. 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.

  10. 12 hours ago, MirceaKitsune said:

    Ran into a few bugs. Most noteworthy is a breaking glitch that makes it impossible to continue without noclip:

    Thanks for giving it a playthrough and leaving the detailed feedback. Regarding your supposed glitch, it's actually an intended feature to ensure the player stays inside the room while the NPC is talking to him to avoid missing cues and not seeing why the objectives were updated. The barrier should be gone afterwards.

  11. 1 hour ago, JackFarmer said:

    If you don't want to try the script solution as described in the post above, you can try the following

    1. Create a blue room far away from the map and put the fog light in it

    2. Place an atdm:teleport entity at the fog light position in your map

    3. Let the atdm:teleport target the fog light in the blue room

    4. Trigger the atdm:teleport entity with a trigger_once entity or whatever you have in mind.

    This would also have the advantage that the foglight wont be contributing to an extra rendering pass of everything it touches in the map, even if its transparency were ultra high. IIRC a foglight added 1000+ drawcalls to the Perilous Refuge harbour scene.

    • Thanks 1
  12. Your approach is basically how I did it with the custom AI alert behaviour in Iris. You can only steer AIs while they're unalerted, so my script would tell them to approach the source of the commotion. Once they come close enough to see the problem, TDM's stock AI routines would take care of the rest.

    • Like 1
    • Thanks 1
  13. 14 hours ago, Skaruts said:

    @Dragofer does your version work in 2.12? I'm confused about what to download. I tried one z_addon_stealth_statistic_2_07.pk4 that I found somewhere in this thread, but it didn't work. 

    I tried out @kcghost's version (it works on 2.12), but I found that it interferes too much with my usage of inventory items, so I'd like to try out yours to see if it's more comfortable to use. I think I've seen a youtuber use it before.

     

    As the file name implies it's for v2.07, which was the last TDM version before a hook for custom user addons was added. It therefore overwrites the main TDM script file with a version from 2.07, which means several newer missions won't work anymore.

    It looks like I made an updated version that should be compatible with all 2.08+ TDM versions, as per datiswous' post. Practically it's an inventory item that triggers a GUI message popup whenever you activate it in your inventory.

  14. On 6/5/2023 at 10:17 AM, datiswous said:

    Is it possible to teleport the player to different areas depending on a condition? For example a gui selection.

    It would be nice to have a gui-selection menu opened up when you click on the door. You only get teleported after making a selection in the gui.

    Yes. You would modify the function that gets called when the player frobs a teledoor to offer the player a GUI selection, wait for his input and then update the entity variable for which teledoor it's paired to, before the teleportation begins.

×
×
  • Create New...