Jump to content

Remove Traits and Professions


Dr_Cox1911

Recommended Posts

Greetings,

 

is it somehow possible to delete/alter some of the current professions and traits? Would like to alter some of them or delete the ones that are not working correctly.

 

I looked through the java-docs, especially the ProfessionFactory and the TraitFactory, but I can´t find any "delete"-Functions.

Link to comment
Share on other sites

Although I´m not a huge fan of overwriting I tried to overwrite the "media/lua/shared/NPCs/MainCreationMethods.lua" but with no luck. The console shows this (only the important parts):

MOD: loading coxis-profsMOD: mod "coxis-profs" overrides media/lua/shared/NPCs/MainCreationMethods.luaLoading: C:/Users/Dr_Cox1911/Zomboid/mods/CoxisProfs/media/lua/shared/NPCs/MainCreationMethods.lua

That´s the only mention of "MainCreationMethods.lua", so it should be overwritten shouldn´t it?

Ingame it doesn´t seem so, all the professions and traits are still there, although I comment all traits and professions except for brave and unemployed.

Link to comment
Share on other sites

I too have been looking for how to do this. I assumed there would be some sort of delete/remove function. The closest I can think to get is to use a mod that transforms one of the base traits/professions to another one using some sort of "if has x trait replace with y trait" type function. I haven't had a chance to test that yet but not sure what else to say.

Link to comment
Share on other sites

EDIT: Nevermind, made a mistake

 

EDIT 2: No wait hold on, I think I got it...

 

So I did get it to work. I did basically what Dr_Cox suggested: Overwriting the "media/lua/shared/NPCs/MainCreationMethods.lua" file with my mod. Thing is, I was doing some stuff and I deactivated my mod and reactivated it, and the traits I'd removed were all there.

 

So I restarted the game. And they were gone again. So I'm not sure if that's what went wrong for you, but restarting the game with the mod already loaded seems to be essential. I'm definitely looking at the trait list with some of them (of my choice) missing. It can work.

 

Now I also deleted the lines instead of commenting them, though that shouldn't be relevant unless dark magic is involved. And I removed the "mutuallyExlusive" parts as well. I didn't remove any professions though.

Link to comment
Share on other sites

For some reasons the overwriting does work for me as well, but only with Build30. If I switch back to Build29.4 it still says in the console that the original file is overwritten, but no effects are present ingame.

 

Strange...

Kinda solved though, will work with Build30 from now on.

Link to comment
Share on other sites

Hm, still another problem though.

 

A lua-file from my mod has to be loaded before the overwritten MainCreationMethods.lua. I tried almost every combination with require but can´t find a way to load my file first.

 

One example that I tried:

require("mods/CoxisProfs/media/lua/client/Coxis_Profs_text")
Link to comment
Share on other sites

Sorry, I should be more precise next time. Even if I put an "a" at the front the file "Coxis_Profs_text.lua" gets loaded after the "MainCreationMethods.lua", which I had overwritten with my version.

 

I think this happens because even the overwritten "MainCreationMethods.lua" is still considered a lua-file from the game rather than a mod. Because all the game-lua-files are loaded before the mod-lua-files my "Coxis_Profs_text.lua" is constantly loaded after the "MainCreationMethods.lua", no matter what letter is at the beginning.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...