Is it possible to chain mods on the same script
Avatar

Let's say two mods are overriding the Scripts/Settings.gd script, each trying to extend it:

extends "res://Scripts/Settings.gd"

func _ready() -> void:
    super()
    # mod stuff here

Is it possible for these to co-exists? MCM will say that adding super() at the top should help, but it doesn't really, because two scripts are just overwriting Settings.gd, they don't seem to chain.

In my case I was going to publish a whole bunch of modular mods for various settings to make the game run faster. But I may need to package into one bigger mod.

Any thoughts?

Edit: I think this isn't possible in my case because Settings.gd in particular has a class_name. Leaving this here in case it helps anyone else:
https://github.com/Ryhon0/VostokMods/wiki/Overriding-Classes

Edit2: so the workaround is to just get creative and find existing scripts in the game that don't have class_name appended and navigate the scene tree to the node you want. Otherwise, trying to find nodes from an autoload invovles recursively parsing the scene tree

Edit3: Everyone should probably be using the Community Mod Loader as it fixes at least one of the script inheritance issues:
https://github.com/ametrocavich/vostok-mod-loader

I think the update will be coming to modworkshop soon

Info
Replies

No Replies Found

69 1723