Problems creating a Mod

radogarradogar Join Date: 2012-12-23 Member: 176002Members
Hi if tryed to create a Mod but have Problems testing it. If tryed things discribed here: http://forums.unknownworlds.com/discussion/128106/how-to-make-a-mod-for-natural-selection-2 The Problem is I cant start my one Mod.

I have tryed with hotload. I created a Shortcut with thies extiction: " -game NSLite -hotload". But I end up in the main menu with text. And it won't work.

I tryed to Debug it via Decoda. Menu looks right. I set a Breakpoint a the start of every lua code. But it doesn' stop anywhere. And it won't work.

I tryed to publish it. And load it via steam workshop but my Publisher looks like that. See attachment. So thiswon't work too.

Please help me?

Comments

  • HuzeHuze Insightful Join Date: 2003-11-12 Member: 22724Members, NS1 Playtester, NS2 Playtester, Squad Five Blue, Reinforced - Shadow
    I have no idea what's wrong with your mod. All you said was it didn't load. You'll have to explain more about what's wrong if you want help. Adding the launch arguments should be enough to load it for testing. What changes did you make that aren't working?

    Regarding the publisher, try increasing your resolution. I think the publisher doesn't show all the buttons at lower resolutions.
  • radogarradogar Join Date: 2012-12-23 Member: 176002Members
    edited April 2013
    My Problem is that i didn't load. Nighter with Launch arguments nor witht the methoeds I described in my first post. I can see in the commandlines that the game is loading other mods (loading mod from NS2folder\SteamWorkshop...) but not mine. Also I have 681 lua files (with all other mods disabled) wich are loaded with the pure game and 681 lua files wich are loaded with the launch args.

    What changes have I made. The file game_setup.xml looks like this:
    <game>
    	<name>NSLite</name>
    	<description>Natural Selection Lite: Just test something!</description>
    	<client>lua/LiteClient.lua</client>
    	<server>lua/LiteServer.lua</server>
    	<predict>lua/LitePredict.lua</predict>
    	<loading>lua/Loading.lua</loading>
    	<soundinfo>sound/NS2.soundinfo</soundinfo>
    </game>
    


    I have created the following files:

    lua\LiteClient.lua:
    Script.Load("lua/LiteShared.lua")
    Script.Load("lua/Client.lua")
    

    lua\LiteServer.lua:
    Script.Load("lua/LiteShared.lua")
    Script.Load("lua/Server.lua")
    

    lua\LitePredict.lua:
    Script.Load("lua/LiteShared.lua")
    Script.Load("lua/Predict.lua")
    

    lua\LiteShared.lua:
    // Weapons
    Script.Load("lua/Weapons/Marine/Pistol.lua")
    

    And lua\Weapons\Marine\LitePistol.lua
    Script.Load("lua/Pistol.lua")
    
    function Pistol:GetHasSecondary(player)
        return true
    end
    
    Here I tryed to override the funktion to see something.


    For the resolution. I running 1600x900 and can't incrase it. I don't thing it is a Problem see the picture:
  • HuzeHuze Insightful Join Date: 2003-11-12 Member: 22724Members, NS1 Playtester, NS2 Playtester, Squad Five Blue, Reinforced - Shadow
    radogar wrote: »
    ...
    lua\LiteShared.lua:
    // Weapons
    Script.Load("lua/Weapons/Marine/Pistol.lua")
    
    ...

    For the resolution. I running 1600x900 and can't incrase it. I don't thing it is a Problem see the picture:

    You're not loading LitePistol.lua, so that clearly won't work. What is your directory structure and what launch arguments are you using?

    Your font/resolution is clearly the problem with the buttons getting cut off the bottom of the publisher. If you can't change your resolution try changing your font size: http://windows.microsoft.com/en-us/windows7/make-the-text-on-your-screen-larger-or-smaller
  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    Add
    Print("blabla")
    
    in one of your lua files, so you can check if the mod is loading or not (I think when you use -hotload nothing is printed by default in console)
    btw try to use the new hooking system in /lua/entry
  • radogarradogar Join Date: 2012-12-23 Member: 176002Members
    @Huze: Thanks if corrected the Error and I can use the Publisher with a smaler font size.
    I'm using the arguments
    "C:\Steam\SteamApps\common\Natural Selection 2\NS2.exe" -game nslite -hotload
    
    But it din't seam to work. I had copied one of the original balance .lua -files in my mode folder and changed it a bit. Without adding it to any list. If I now start the game via Debugger it applies the Changes. But not with Hotload. And my one files are still not in use. Maybe the XML is broken...

    @Tharos: Thanks for Print-function thies will make things a little bit easyer. What do you mean with new hooking system? Shoud I replace the XML with thies Entry? Or how is it used?
  • HuzeHuze Insightful Join Date: 2003-11-12 Member: 22724Members, NS1 Playtester, NS2 Playtester, Squad Five Blue, Reinforced - Shadow
    And your mod folder is named nslite? Everything looks fine to me, but I may be overlooking something.

    Andi's simple mod framework was recently included into the main game, so you can try to load your code using it: http://forums.unknownworlds.com/discussion/126678/simple-mod-framework-lua
  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    I mean that you can keep the default XML file and use the .entry files to hook your modified lua files.

    It's described in SteamApps\common\Natural Selection 2\ns2\lua\entry\readme.txt

    Create a file called ns2lite.entry in your mod folder (in /lua/entry)
    modEntry = [[
    	Client: lua/ns2liteClient.lua,
    	Server: lua/ns2liteServer.lua,
    	Predict: lua/ns2litePredict.lua,
            Shared: lua/ns2liteShared.lua,
    	Priority: 5
    ]]
    

Sign In or Register to comment.