Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I work on a mod to TDM itself. It is meant to affect all missions and needs a script to execute before the difficulty selection screen (preferred) or at actual mission start (good enough).

So is there a canonical way to get my script executed for every map or do i have to search for a rarely updated script in TDM's pk4s and infect it with my code?

Posted

To my understanding, you would use the "script/tdm_custom_scripts.script" parent script to define overarching behaviors. This inherits from tdm_main.script . If you cannot use the tdm_custom_scripts.script file to override in a satisfactory way, you may need to do what the wiki advises against and include a modified tdm_main.script in your mod pack.

https://wiki.thedarkmod.com/index.php?title=Scripting_basics

Not that I'm particularly any kind of expert in this topic. Just my thoughts based on our documentation and the few scripting adventures I've done.

 

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Posted
3 hours ago, nbohr1more said:

To my understanding, you would use the "script/tdm_custom_scripts.script" parent script to define overarching behaviors. This inherits from tdm_main.script . If you cannot use the tdm_custom_scripts.script file to override in a satisfactory way, you may need to do what the wiki advises against and include a modified tdm_main.script in your mod pack.

Nah, can't override tdm_custom_scripts.script as the comment inside it explicitly states that it is meant to be overridden by FMs - which would then disable my mod.

Posted
1 hour ago, stgatilov said:

I think tdm_user_addons.script was added specifically for this, although the problem of having several mods at once is sort-of unsolved...

It isn't mentioned in the wiki, but looks like the perfect place to put the mod manager initialization code, which then should include all files matching the glob pattern "mods/*/script/init.script".

Is it possible to include scripts like that and is there a way to run a function right after it got defined in a freshly included script?

Posted

The main thing i that function user_addon_init is called by every FM at start, and you can override this whole file.
So you can include other script files and call their functions.

However, you cannot change the time when this function is called.

  • Like 1
Posted

Running at map start is good enough for now.

Looks like i have to package a mod for each of my probably six combinations of functionality though as there can be only one mod overriding that script and i definitely don't want to require users to edit the script file for mod management... Well, still feasible, so i probably do that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      German Intelligence (BND) just revealed, why MS Outlook is down: even the MS CEO has been seduced by a Chinese spy and the BND just published a convincing picture of the agent:

      Way to go, lads!
       
       
      · 2 replies
    • JackFarmer

      I will NOT return to Discord. Who wants to try something new?
       
      · 12 replies
    • JackFarmer

      I do not understand why Gilmour/Waters trash the "Atom Heart Mother" album and wish for that "all existing copies get dumped".
      I think it is a great recording. Is there something wrong inside my twisted little brain?
      · 3 replies
    • revelator

      Asus ROG strix x570-E gaming ryzen 3700x 32 gb ram radeon RX9070XT 10 tb ssd space (all full)
      · 5 replies
    • The Black Arrow

      I was playing Doom 3, and I learned how to edit maps text-by-text, this should help me a lot with finding secrets and locations I hope.
      That is, if I feel sneaky and greedy...Which I always do, can't get enough 100% a mission.
      · 3 replies
×
×
  • Create New...