Jump to content
The Dark Mod Forums

Canonical way of registering additional scripts to core mod?


Oktokolo

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...