Anyone able to get a mod working? If so, how?
TooMuchFun
NunyaBiznizz Join Date: 2014-04-28 Member: 195653Members
in Modding
I've been following Rio's tutorial on creating lua mods. Its not working for me though.
This is what my NS2/lua mod folder looks like:
The message in the "SchizoModShared.lua" file featured there just isn't appearing in game. I've checked for spelling errors too, it all checks out.
Any help?
This is what my NS2/lua mod folder looks like:
The message in the "SchizoModShared.lua" file featured there just isn't appearing in game. I've checked for spelling errors too, it all checks out.
Any help?
Comments
I do not know what LoadModFIles.lua is about for now but I may ask how you load those since everything seams correct from my point of view:
Ideally detailling how you test your mod in order to tell if it's working or not.
Why use a shortcut if you can simply click "launch game" in the launchpad ?
@TooMuchFun
Rio is using the game_setup.xml in his/her tut but I'm not seeing it in your mods folder.
Maybe have a look at this tut which is a bit more up to date than Rio's one: http://unknownworlds.com/ns2/time-to-make-the-mods/
Also i recommend to investigate a bit into the entry system to avoid having to use the game_setup.xml. Because each file can be only "over-mounted" by one mod.
1. Tried that. Didn't work.
2. Nope. I'm smarter than that
3. Never heard of that. Must I?
The mod is just a basic "Hello world" which prints to the console.
For the record thats my lua scripts folder I took a screenshot of. Above that is the mod directory, which does contain the game_setup.xml file I modified to load the SchizoMod files.
This mod can't be more simple, it has a single "usefull" file name "ping_file.lua" which write the current date and time to a log file in "%appdata%/Natural Selection 2/server_modding_ping.txt" each second, it's server VM side code. You can just add a 'Print("Hello word")" on the lua to test more. Tell me if it works correctly, if not you must have an issue on how you load the mod and we can debug you further.
@GhoulofGSG9: good to know
@TooMuchFun: Uploading to the workshop and creating a server (first go to "mods", activate your mod on the list, then "server browser" -> start server).
While it's an "overkill" way to be totally sure your mod is correctly loaded, it would take too much time if you need to edit/test your code frequently so better fix this.
Edit: a reupload the mod with the "publish_id" line of the mods.settings removed, so it will create a new mod instead of giving you an error for not having access to it.
Otherwise you can try to use the launchpad and upload it on steam workshop. You will know if it's an issue on the code or on how you load it.
Edit:
These are my errors:
This is SchizoModShared.lua's contents:
SchizoModServer.lua:
SchizoModClient.lua: SchizoModPredict.lua:
Edit: if you have published your mod, can you give us the id (so we can check on the workshop and test it ?). Nevermind it's on the log: m1b78b0c9
Edit2: The error is here
Those issues with builder might be caused by your IDE locking access to the source files.
You should notice that your mod won't really run the game as you don't link back to the original files in any way.
@Katzenfleisch
Have a look at the entry folder readme file! Your example mod does some "weird things":
Like linking back to the vm entry files or not just using the Shared entry point. The entry system is post-loaded by those vm entry files
I would use quotes in your Print statement instead of apostrophes. You also don't need the semi's in lua.
Using the game_setup.xml as your loading point isnt the best path if you are making a simple mod, but thats not a huge deal in the beginning. If you want an example of a simple mod using the entry system, you can look at this small mod I made to tweak ragdolls - https://github.com/xToken/Ragdoll
Its like the publish feature isn't doing anything...
Hmn, i guess posting the fixed version of your mod here might help you most.
Just create a new mod with the Launchpad and extract the attached zip into the output folder. Then start the game via the "Launch game" shortcut of Launchpad.
[edit] I did what you said except I published it before starting the game. The results are almost exactly identical though:
I have to ask you what kind of Editor or IDE you use, because your files cause errors for me too unless i re-save them once with something like notepad++.
Also change to
[EDIT/UPDATE] This is just so stupid. Why shouldn't DECODA work with the game for gods sake? I just DLed Java and Eclipse for Lua. Still not working. I disabled my AV for ten minutes too, and it still isn't working.
I also noticed when I start the game the console complains about my mod not having a valid description. This happens even after I give it one on the steam workshop and in the launchpad.
[EDIT] So I changed the description to some BS and gave it a name in both LaunchPad and on the steam workshop. It seems it isn't complaining about missing files and invalid character escapes anymore. The only problem? Its not printing the text "HELLO UNKNOWN WORLDS!!!". I'm gonna try what the tutorials say: "Shared.Message("Text message to display")
I really have no clue what you are doing wrong, this is the output i get when i launch the game with the test mod i posted before as attached file: