Time To Make The Mods blog post

SystemSystem Join Date: 2013-01-29 Member: 182599Members, Super Administrators, Reinforced - Diamond
edited May 2013 in NS2 General Discussion

Comments

  • FuleFule Join Date: 2009-06-04 Member: 67683Members
    I would love to hear your feedback on this. I plan to make more tutorials in the future to go more in depth with programming.

    Thanks!
    Cool username.
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    you may want to go in more detail which folders you need for which mod.

    For example.. Using a viewmodel skin.
    * Do I only need models folder?
    * Do I need to use the builder, or am I better of copying it to the output folder?
    * I want to change x thing, where do I need to start? Materials? Maps?

    Make it as insanely dumb as you possibly can. I always let folk who have no clue test how to's and manuals. If they can do it, anyone can. :)

    (my questions were rhetorical, I dont need a answer to them)
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    I think you've covered it in enough detail to get started for most people - I wish I had this guide about a year ago :]
  • SquishpokePOOPFACESquishpokePOOPFACE -21,248 posts (ignore below) Join Date: 2012-10-31 Member: 165262Members, Reinforced - Shadow
    Nice, managed to apply fire effects to the pistol. Eventually I'll figure out how to increase bullet damage and lower firing speed, and then import a revolver model. :P
  • ResRes Join Date: 2003-08-27 Member: 20245Members
    Open the UberShotgun.lua file and type the following:
    function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer) if HasMixin(hitEnt, "Fire") then hitEnt:SetOnFire(player, self) end
    end

    I assume that this is calling various effects functions within the NS2 code?

    What I'd like to know is how to find the NS2 code to know where I find these named functions.
  • HughHugh Cameraman San Francisco, CA Join Date: 2010-04-18 Member: 71444NS2 Developer, NS2 Playtester, Reinforced - Silver, Reinforced - Onos, WC 2013 - Shadow, Subnautica Developer, Pistachionauts
    Squishpoke wrote: »
    Nice, managed to apply fire effects to the pistol. Eventually I'll figure out how to increase bullet damage and lower firing speed, and then import a revolver model. :P

    This is possibly the greatest idea since sliced bread was invented. WTB Squishpoke revolver mod!

  • ShazbroShazbro Join Date: 2013-03-16 Member: 184007Members
    Alright, question of the century: I did the effect to the rifle, and while that was cool and all... How would I go about making a welder that sets things ablaze (BadlyEngineeredWelder)? Is it as simple as a name, or would more of the code be different?
  • CrazyEddieCrazyEddie Join Date: 2013-01-08 Member: 178196Members
    Awesome beyond belief.
  • SquishpokePOOPFACESquishpokePOOPFACE -21,248 posts (ignore below) Join Date: 2012-10-31 Member: 165262Members, Reinforced - Shadow
    Shazbro wrote: »
    Alright, question of the century: I did the effect to the rifle, and while that was cool and all... How would I go about making a welder that sets things ablaze (BadlyEngineeredWelder)? Is it as simple as a name, or would more of the code be different?

    Brian's code calls predefined functions, so theoretically you should be able to just copy his code and have the Welder call the "set things ablaze" function.
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    MCMLXXXIV wrote: »
    I think you've covered it in enough detail to get started for most people - I wish I had this guide about a year ago :]

    Where would have been then the fun ^^

  • ZycaRZycaR Join Date: 2002-11-12 Member: 8263Members
    edited May 2013
    will do a NS2 lua codes contains <summary> in future (on methods especially) ?
    it is sometimes very hard to figure out what they doing and on which object can be used ...

    also can you point to wiki with tree of LUA classes? I lost link in some point of time ;)
  • CloudwolfCloudwolf Join Date: 2012-11-11 Member: 169690Members
    Please Please please document the API in more detail. Explicitly give information about the event hooks. Please explain certain details. As it stands reading your code here Yes i could copy and paste it to make a flaming shotgun I could event potentially add that effect to other weapons but I don't know what all effects I can call. I've tried looking at the source code before and it just turns into the old saying turtles all the way down. It is very difficult for a beginner to grasp. What would benefit the modding coumunity in my opinion is having the API be detailed with examples and information such as what type of thing it can take what the function does what it takes in what it outputs etc.
  • ZycaRZycaR Join Date: 2002-11-12 Member: 8263Members
    Cloudwolf wrote: »
    Please Please please document the API in more detail...
    the same should be described in Wiki what I asked for.

  • sinkingmistsinkingmist Join Date: 2012-11-22 Member: 172905Members
    Squishpoke wrote: »
    Nice, managed to apply fire effects to the pistol. Eventually I'll figure out how to increase bullet damage and lower firing speed, and then import a revolver model. :P
    Damage is defined in Balance.lua

    Incidentally, Balance.lua also has this:
    // not used yet
    kPistolMinFireDelay = 0.1
  • Racer1Racer1 Join Date: 2002-11-22 Member: 9615Members
    Great mod primer. Hoping to see more details about commonly changed files and APIs available in a future tutorial.
  • VenatosVenatos Join Date: 2012-03-31 Member: 149762Members, Reinforced - Shadow, WC 2013 - Gold
    thnx for the tutorial, i fiddled around with the lua code in notepad but didnt know how to actualy make it a mod.
    and a more in depth programming tutorial would be realy nice too. for example i tried for hours to make my own powernode-lighthandler, but even when i just copy and rename a existing one it didnt work, so i ended up using the lowpower-lighthandler to run my code if the powernode is unsocketed.
  • delta78delta78 Join Date: 2013-01-08 Member: 178131Members
    Very interesting. I'm gonna try this when I get the time. Hope its soon ^^
  • phoenixbbsphoenixbbs Join Date: 2003-02-10 Member: 13379Members, Constellation, NS2 Playtester, Subnautica Playtester
    Thanks for this, I'm sure it will give people the "nerve" to try making their own - I've got a few ideas myself, but don't know Lua :-}
  • MuzzzyMuzzzy Join Date: 2005-07-20 Member: 56360Members
    You can load the ns2 project file in Decoda. Use CTRL + SHIFT + F to search the entire project for functions and whatnot.
  • alzarocalzaroc Join Date: 2003-07-26 Member: 18451Members, Constellation
    Is there a way to start the game with hotloading from the Spark Launch Pad?
  • VenatosVenatos Join Date: 2012-03-31 Member: 149762Members, Reinforced - Shadow, WC 2013 - Gold
    thnx brian, ur the boss! ;)
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    you may want to do a explenation of how to customise stuff.

    It seems counter intuitive (for me) for example to load a mod to edit a weapon viewmodel skin in launcher, only to have to manually load the model itself in the viewer.
    Also basic movement in certain programs like zoom, up down etc in like the viewer.
  • zeepzeep Join Date: 2002-11-01 Member: 3367Members
    I know you said you're not going to teach lua code here, but just explaining these commands you use would have helped to understand what's going on much much better.
    function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer)

    if HasMixin(hitEnt, "Fire") then

    hitEnt:SetOnFire(player, self)

    end
    end

    For the rest, lovely post!
  • MurphyIdiotMurphyIdiot NS2 programmer Join Date: 2008-04-17 Member: 64095Members, Super Administrators, NS2 Developer, Subnautica Developer, Pistachionauts, Future Perfect Developer
    zeep wrote: »
    I know you said you're not going to teach lua code here, but just explaining these commands you use would have helped to understand what's going on much much better.
    function Shotgun:ApplyBulletGameplayEffects(player, hitEnt, impactPoint, direction, damage, surface, showTracer)

    if HasMixin(hitEnt, "Fire") then

    hitEnt:SetOnFire(player, self)

    end
    end

    For the rest, lovely post!

    Basically, there is a function that is called to do damage and play sound effects when a bullet hits something. I am hooking into this function and checking if the hit target entity (hitEnt) can be set on fire. If so, I set it on fire.

    I plan to make another tutorial soon that covered more of how the NS2 gameplay code works and how to hook into it.
  • axamdeepaxamdeep Shanghai, China Join Date: 2010-07-02 Member: 72226Members, Squad Five Blue
    hello, this article is very helpful so I translated it and post on http://onos.cc/modding-tutoral.html for some Chinese readers.
  • buzmxbuzmx Join Date: 2013-05-17 Member: 185275Members, Reinforced - Shadow
    So i followed the instructions but for some reason its not switching my text files to lua files and my builder keeps saying "The system cannot find the file specified" for all 4 files. Any ideas?
Sign In or Register to comment.