Dr_Cox1911 Posted November 22, 2014 Share Posted November 22, 2014 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 More sharing options...
Dr_Cox1911 Posted November 23, 2014 Author Share Posted November 23, 2014 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.luaThat´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 More sharing options...
Masochist Posted November 26, 2014 Share Posted November 26, 2014 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 More sharing options...
Greeny Posted November 29, 2014 Share Posted November 29, 2014 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 More sharing options...
Dr_Cox1911 Posted December 1, 2014 Author Share Posted December 1, 2014 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 More sharing options...
Dr_Cox1911 Posted December 1, 2014 Author Share Posted December 1, 2014 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 More sharing options...
EnigmaGrey Posted December 1, 2014 Share Posted December 1, 2014 Add a z in front of CoxisProfs in both the file name and the directory.If I remember, the game still doesn't do requires right. Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted December 2, 2014 Author Share Posted December 2, 2014 But if I add a "z" to the beginning it will always get loaded as last, the file needs to be loaded at first (even before the overwritten MainCreationMethods.lua). Link to comment Share on other sites More sharing options...
EnigmaGrey Posted December 2, 2014 Share Posted December 2, 2014 Then add an 'a'. Link to comment Share on other sites More sharing options...
Dr_Cox1911 Posted December 2, 2014 Author Share Posted December 2, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now