[NS2 mod hello world] Unable to load/test my mod

KatzenfleischKatzenfleisch Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
edited March 2014 in Modding
Hi,

I have been trying to do some modding but I am stuck at the beginning: loading my mod in the game.

I am actually following this tutorial "http://forums.unknownworlds.com/discussion/128106/how-to-make-a-mod-for-natural-selection-2" but in vain. I have also checked many time the content of my lua and xml file to ensure there were no errors.

I was thinking about a wrong mod path so i have tried those:
* AppData\Roaming\Natural Selection 2\Workshop (where downloaded mod are stored)
* AppData\Roaming\Natural Selection 2\
* Desktop\
* Steam\SteamApps\common\Natural Selection 2 (as suggested by the tutorial)

Also, for some path the the Spark Engine Builder is unable to build it at all and give me this output:
"""
Rebuilding...
Build complete (0 seconds)
0 succeeded, 0 failed, 0 up-to-date, 7 skipped
"""

Each time I start the game (starting with the shortcut option "-game randomizealiens -hotload") and type 'map ns2_XXX' it look like it is loading a normal server with the name entered in "Browse Server/Create Server/Server Name". However I found one way to make it work: edit by hand one existing mod in "Roaming\Natural Selection 2\Workshop\m....", but I need to reload the game each time and the -hotload option crash the game. (which is too much painful and time consuming).

I will be thanks full if anyone has an idea on how to resolve this issue and allow me to continue this work.

Ps: I provide in attachment the files I am working on.

Comments

  • 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 March 2014
    First of all that tut is abit outdated and if you do a lua mod, just directly create the lua files in the output folder.
    A personal tip: Use the builder.exe only if needed!!!

    BTW: This tut by uwe is imho easier to understand and abit better: http://unknownworlds.com/ns2/time-to-make-the-mods/ ( even as this is also outdated )

    And hotload is just buggy as **** so better don't use that also.

    For now just copy your lua folder and game_setup.xml into the output folder and click at launch game in the launchpad to start ns2 with your mod ( the output folder ) mounted. To load changes just restart the local server ( esc -> server browser -> create server -> create )

    Tip: to speed things up i really suggest to use a dev map. Those can be found in this forum or some major mods.

    FYI:

    The game_setup.xml should only be used if you create a new gamemode as it only can be used once.

    If you want to add something to the game try to use the entry system and hooks ( via sewleks framework ).

    To get how to use this read the readme in lua/entry in the ns2 folder + read some source files of mods using this system ( e.g. CHUD https://github.com/Mendasp/CustomHUD/tree/master/lua )

    The easiest way to mod so far is to just overload default lua files. You do this by copying the files you want to mod into your output folder and just edit them. Warning: Your mod will conflict with any other mod using the same files.
    But this is a good way to do smaller stuff and get used to ns2 modding.

    If you want to do mostly server stuff. I would recommend to work with the shine lib/ framework and create a shine plugin:

    You will find all info you need for that here in the shine wiki: https://github.com/Person8880/Shine/wiki#for-developers

    Hope this isn't too much for now and i wish you good luck with getting into ns2 modding. If you have any questions just ask them in this forum we have alot ppl around here who are happy to help you getting things done :D
  • KatzenfleischKatzenfleisch Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
    edited March 2014
    I do not know how but things are now working (remote black magic maybe ?), I have a shotgun corresponding to the tutorial one. Thanks ! (I thinks its because you suggest to work directly on the output folder.)

    I am now working on find&load a small map to speed up lua development.

    About the modding I am working on an upgrade of the Faded mode 0.16.

    By the way, did you know where I can find usefull console command ? (like "give shotgun" or "cheats 1", this kind of cmd), to give all upgrade at once for exemple.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    edited March 2014
    @Katzenfleisch‌

    There is a list of useful console commands stickied somewhere, but basically:

    cheats 1 - turns on cheats and starts the game
    gorge/skulk/ - etc give you that lifeform as an alien
    pres - gives you 100 personal res
    tres - gives you 100 team res
    give skulk/gorge/marine - etc will drop that item where you are standing, usually on top of your head.
    alltech - unlocks all the games technology

    That's all you need for basics, just play to find more, and as you are modding things, have a look at the console commands lua files to see the other juicy options available :D
  • 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 March 2014
    Soul_Rider wrote: »
    @Katzenfleisch‌

    There is a list of useful console commands stickied somewhere, but basically:

    cheats 1 - turns on cheats and starts the game
    gorge/skulk/ - etc give you that lifeform as an alien
    pres - gives you 100 personal res
    tres - gives you 100 team res
    give skulk/gorge/marine - etc will drop that item where you are standing, usually on top of your head.
    alltech - unlocks all the games technology

    That's all you need for basics, just play to find more, and as you are modding things, have a look at the console commands lua files to see the other juicy options available :D

    Or just look at the wiki page: http://wiki.unknownworlds.com/ns2/Console_Commands Samusdroid keeps that pretty much up to date.

    Also i forgot to mention the ns2doc is pretty helpfull if you don't want to search all lua files all the time to find the func doing xy. Just download it here https://drive.google.com/file/d/0B_AoHvDBSRoDaWlHaTNqR3pOMGs and run the ns2docs-console.exe. It will create automatically the docs in the same folder under ns2docs.

    To open it best start with the index.html in globals ;)
  • KatzenfleischKatzenfleisch Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
    edited March 2014
    I am looking at your command link and the documentation, thanks a lot.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    I can't get ns2docs to work, can you link to some more detailed instructions?
  • 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
    Soul_Rider wrote: »
    I can't get ns2docs to work, can you link to some more detailed instructions?

    Strange never had a problem to run it, here is the 264 version for anyone else who is not able to run the exe themself: https://drive.google.com/file/d/0B_AoHvDBSRoDWDVmbWVVc2RiOTg/edit?usp=sharing
  • KatzenfleischKatzenfleisch Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
  • 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

    It's the same (not sure if up to date) hosted by someone.
Sign In or Register to comment.