[Unanswered] How can I make a simple mod?

TooMuchFunTooMuchFun NunyaBiznizz Join Date: 2014-04-28 Member: 195653Members
edited April 2014 in Modding
Heya fellow NS2 players and modders! I'm new to NS2 modding and I understand a good portion of Lua but what I don't understand is how to do anything with it. The wiki modding guide is obsolete from what I can tell and Rio's tutorial is either too old to be relevant (he left out section 3... very annoying) or just plain wrong.

I haven't figured out how to print a message to the console.

My general question is how do I examine the lua files and determine what modules to include in my mod so that I can use them? I understand that everything in the game is connected. That means I have to at least understand the modules that I am using if not the whole game. Rio's tutorial mentioned using the find in files feature of Decoda.

I don't know how useful that technique is because I've tried it but I don't know what files are relevant to search for what I want to do.

Comments

  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    Shared.Message(string)
    or Print(string)
    or Print(ToString(notastringthatwillbecomeastring))
    You just make a new mod, and put relevant files in the lua directory, and then it will override them, or you can use hooks, look at existing mods to do this.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited April 2014
    Best way to get into ns2 modding is to read the source of some other mods, to understand how the ns2 gameplay code is working it's prettty helpfull to use NS2Docs ( just download it and generate the docs yourself ).

    Futhermore we had some other thread here where we explained different ways of modding (hooks, overriding vanilla files, the entry system, the gamesetup.xml etc.) , use the search function to find them.

    If you still have any question after read some other mods sources ask them here.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Best Tip I've got: In Decoda, CTRL+SHIFT+F ...use it, love it, abuse it.

    While more seasoned developers will probably use some other kind of Lua editor; for starting ns2 modding (assuming no real programming experience) I recommend you stick with the tools provided with the game.

    Also, checkout this thread: http://forums.unknownworlds.com/discussion/128106/how-to-make-a-mod-for-natural-selection-2
    Just about everything in that thread still applies, and the things that are wrong are mentioned.

    Good luck, and remember to have fun! It can get frustrating some times, but stick with it and the satisfaction of seeing your own creation come to "life" will pay off! :)
  • TooMuchFunTooMuchFun NunyaBiznizz Join Date: 2014-04-28 Member: 195653Members
    I got an error when I fired up the builder; it says "No setup file was specified". It won't let me build anything because of that. Another thing how would I get my changes to the code to happen? I would assume using the builder but like I said it doesn't work right now... When it did work it just said "0 completed, 0 up to date, 0 etc. 7 skipped".

    I'm fairly certain the modding tools nearly destroyed my computer because I didn't realize I had about ten instances of the builder running and then I fired up NS2. All of a sudden my computer shutdown NS2 and all of my programs, and proceeded with shutdown without warning. It shut down normally but I think it may have overheated... Its still functioning now though.

    One last thing how come when I use Decoda's debugging tool or even start without debugging my framerate is abysmal?
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Are you starting with the LaunchPad, and creating a "New" mod?
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    TooMuchFun wrote: »
    I got an error when I fired up the builder; it says "No setup file was specified". It won't let me build anything because of that. Another thing how would I get my changes to the code to happen? I would assume using the builder but like I said it doesn't work right now... When it did work it just said "0 completed, 0 up to date, 0 etc. 7 skipped".

    I'm fairly certain the modding tools nearly destroyed my computer because I didn't realize I had about ten instances of the builder running and then I fired up NS2. All of a sudden my computer shutdown NS2 and all of my programs, and proceeded with shutdown without warning. It shut down normally but I think it may have overheated... Its still functioning now though.

    One last thing how come when I use Decoda's debugging tool or even start without debugging my framerate is abysmal?

    Just don't use the builder if you don't need. What you won't do if you aren't creating some new models etc. . Just place all your mod files directly into the output folder.

    Also i never really needed my editors lua vm debugger, most bugs i run over are kinda game play related or don't show up by just running the code with a simple test case.

    Just use the game directly to debug ( safest way ). Maybe not so fast if you do alot of typos etc. but otherwise it should be no issue.

    Maybe you try to explain us then what exactly is your issue and post your code here or at sites like gihub ;)
Sign In or Register to comment.