Total War: WARHAMMER II

Total War: WARHAMMER II

Community Modding Framework
 This topic has been pinned, so it's probably important
Crynsos  [developer] 20 Oct, 2017 @ 2:50pm
Framework Registration & How to Use
Post in this thread with what name you want for your registration.
Please keep everything else outside of this thread.

The recommended format is <Username>_<Mod_Name>, though it doesn't have to be the full name of your mod, just something that uniquely identifies you and your mod for easy association and to differentiate if you want to add multiple files into this system.

One file registration per mod is recommended, but if multiple mods of yours use the exact same script, this is of course not necessary.

By default I register the same files to both the Eye of the Vortex and Mortal Empires campaigns, so if you want to edit both separately, then please list separate file names.

If you require direct access into an existing vanilla file, then please state this and at which point of the file.

Please link your mod if it already exists, so that I can add it to the list of compatible mods, otherwise link it once it is present and tell me what file you tied it to.


How to use this Framework?
All you have to do is import the file that is assigned to you, insert your code into the function that is present in the file and switch the mod registration within the file to true.

function Faction_Unlocker()
cm:set_saved_value("Faction_Unlocker", false);

<Random Scripting>
end;


For example this is the placeholder for my Faction Unlocker scripts. You will insert your core scripts within this primary function, which will be called upon from wh_start, so it will by default be started up once at the creation of the campaign.

You can of course still create subfunctions and have them sit outside of this initial function, but they have to be referred to from it in some way to work and will have to stay within the same file.

Finally, please switch the set_saved_value from false to true in your file.


Active Script Mod Detection
Each mod within this system will be required to register itself within its own code.
This way every other mod that is currently in use can check whether another specific mod is currently also in use and modify its own behaviour accordingly.

if cm:get_saved_value("Faction_Unlocker") == true then
<Script 1>
else
<Script 2>
end


This example executes Script 1 if the Faction Unlocker is in use together with this framework, while Script 2 will be used instead the Faction Unlocker was not detected.


Although checking for other mods and reacting accordingly should resolve pretty much any potential problems between very similar or normally conflicting mods, there may be rare cases where this is not sufficient.

By default I will add all files in an alphabetical order (= later changes overwrite identical earlier ones), so if problems remain and you can't solve them via such a mod detection check, please talk to me about it.

All of the mod registration IDs that you can use to check if another mod registrated within this system is also being used will be linked in the full list of compatible mods.
Last edited by Crynsos; 12 Nov, 2017 @ 1:26pm
< >
Showing 1-15 of 36 comments
Galle 28 Oct, 2017 @ 9:55am 
I've just finished porting boliviantreemonkey's Legitimacy mod for Warhammer I to Mortal Empires. Since this mod makes some alterations to wh_campaign_setup.lua, I'd like to register it with this project. Egotistically, I'll request the registration name galle_legitimacy.
Crynsos  [developer] 29 Oct, 2017 @ 6:05am 
Will be done as soon as I get around to fix up my other stuff and this mod for Mortal Empires.
PlummusDucis 1 Nov, 2017 @ 10:35pm 
Hi Crynsos. I'd like to register my Liberate as Vassals mod.

plumduk_libvassals

Do you have an easy template I could copy off to get my mod working? I'm pretty new to scripting Total War games.
Last edited by PlummusDucis; 1 Nov, 2017 @ 10:36pm
Tetoa 2 Nov, 2017 @ 1:11am 
Hy Crynsos, thanks for doing this mod!
I would like to register three mods (for Mortal Empires), which will be released in the next weeks or months, with some scripts to change the campaign map.

tetoa_wob
tetoa_tosh
tetoa_invskv
DrunkFlamingo 7 Nov, 2017 @ 3:56pm 
Hi. Im working on a mod that may in the future start using scripts to add features, so i'd like to reserve

df_grudges_dwf
df_grudges_agr
df_grudges_kad
Crynsos  [developer] 9 Nov, 2017 @ 2:44pm 
All of these have now been registered.

As two campaigns are now available, by default I register all files to both campaigns, so if you want different files for each of the campaigns then please tell me about that.

Also tell me if you require direct access into a vanilla file that I currently do not provide and where exactly.

It would be also quite helpful if you linked me the mods that you intend to create in combination with this mod.
Last edited by Crynsos; 9 Nov, 2017 @ 2:52pm
Crynsos  [developer] 9 Nov, 2017 @ 2:47pm 
@PlummusDucis
A simple template to enter your scripts into is now present within this mod in the file with the name of your choosing.
AndrewOverload519 12 Nov, 2017 @ 8:49am 
I would like to register my Legendary Heroes mod as aov519_heroespack2, the reason being that I will need to start using scripts to make my unique Heroes properly functional on the campaign map at the very least.
Crynsos  [developer] 12 Nov, 2017 @ 1:08pm 
aov519_heroespack2 has been registered.
PlummusDucis 14 Nov, 2017 @ 5:43am 
Hi Crynsos

It appears cm:add_listener and core:add_listener doesn't work in scripts called by your script injector function in wh_start.lua.

In addition, I tried calling plumduk_libvassals() from another script injector function I added to wh_campaign_setup.lua (which is where I have my add_listener function in my vassal mod) to test if that would fix the problem, but that didn't work either.

I've also tried playing with the load order - putting my mod before and after your mod, to no avail.

Any advice on how to make add_listener behave with this framework? Anything I might've missed? I've been wracking my brains for a few days trying to get it working. I really want to be a part of the framework. :/
Hi Crynsos can you create Dog_OrcTrade for me? It's a mod that just turns Orc Trade from False, False to true, true in wh_start.lua. Is there anything I need to do other than copy paste than line into the file?
Crynsos  [developer] 25 Nov, 2017 @ 5:48am 
Dog_OrcTrade is now registered.
I'd like to register for malloa_landmarksotow
Crynsos  [developer] 28 Nov, 2017 @ 4:22pm 
Done
stateky 29 Nov, 2017 @ 5:10am 
Witt53_Faction unlocker+
< >
Showing 1-15 of 36 comments
Per page: 1530 50