How to unlock upgrades?

aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
I'm trying to do something:
- Have hand grenades unlock at game start and no longer require research (like welders)

I've searched through all the relevant lua files, but can't see where/how to do this at.

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 December 2013
    Look at MarineTeam.lua
    function MarineTeam:InitTechTree() ;)

    Marine_Server.lua
    function Marine:InitWeapons() to give marine cetrain granades with spawning

    Balance.lua if you just want to change researchtime and cost
  • aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
    I was able to remove grenades from appearing to research on the armory in MarineTeam.lua, now I just need them 'unlocked' and ready for players to purchase at game start.
  • MetaMindMetaMind Join Date: 2012-12-06 Member: 174358Members, Reinforced - Gold
    edited December 2013
    In Marine_Team.lua:

    Replace the:

    self.techTree:AddResearchNode(kTechId.GrenadeTech, kTechId.Armory, kTechId.None)
    self.techTree:AddTargetedBuyNode(kTechId.ClusterGrenade, kTechId.GrenadeTech)
    self.techTree:AddTargetedBuyNode(kTechId.GasGrenade, kTechId.GrenadeTech)
    self.techTree:AddTargetedBuyNode(kTechId.PulseGrenade, kTechId.None)

    - codeline with:

    self.techTree:AddResearchNode(kTechId.GrenadeTech, kTechId.None, kTechId.None)
    self.techTree:AddTargetedBuyNode(kTechId.ClusterGrenade, kTechId.None)
    self.techTree:AddTargetedBuyNode(kTechId.GasGrenade, kTechId.None)
    self.techTree:AddTargetedBuyNode(kTechId.PulseGrenade, kTechId.None)


    that should do it...
  • aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
    edited December 2013
    That worked. Thank you! Updated mod.

    http://steamcommunity.com/sharedfiles/filedetails/?id=204003592&searchtext=

    Also another question:
    function Marine:InitWeapons()

    Player.InitWeapons(self)

    self:GiveItem(Rifle.kMapName)
    self:GiveItem(Pistol.kMapName)
    self:GiveItem(Axe.kMapName)
    self:GiveItem(Builder.kMapName)
    self:GiveItem(ClusterGrenade.kMapName)

    self:SetQuickSwitchTarget(Pistol.kMapName)
    self:SetActiveWeapon(Rifle.kMapName)

    end

    ^ I've edited that line and added the "self:GiveItem(ClusterGrenade.kMapName)" in Marine_Server.lua to give a cluster grenade when spawning as marine. For some reason it doesn't work? That should be the proper call after looking in the clustergrenade.lua. It does occasionally spawn an exploding cluster grenade though.
  • 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 December 2013
    aeroripper wrote: »
    That worked. Thank you! Updated mod.

    http://steamcommunity.com/sharedfiles/filedetails/?id=204003592&searchtext=

    Also another question:
    function Marine:InitWeapons()

    Player.InitWeapons(self)

    self:GiveItem(Rifle.kMapName)
    self:GiveItem(Pistol.kMapName)
    self:GiveItem(Axe.kMapName)
    self:GiveItem(Builder.kMapName)
    self:GiveItem(ClusterGrenade.kMapName)

    self:SetQuickSwitchTarget(Pistol.kMapName)
    self:SetActiveWeapon(Rifle.kMapName)

    end

    ^ I've edited that line and added the "self:GiveItem(ClusterGrenade.kMapName)" in Marine_Server.lua to give a cluster grenade when spawning as marine. For some reason it doesn't work? That should be the proper call after looking in the clustergrenade.lua. It does occasionally spawn an exploding cluster grenade though.

    Try ClusterGrenadeThrower.kMapName instead, ClusterGrenade is the projectile itself.
  • aeroripperaeroripper Join Date: 2005-02-25 Member: 42471NS1 Playtester, Forum Moderators, Constellation
    That was it, thanks ^^
  • Racer1Racer1 Join Date: 2002-11-22 Member: 9615Members
    edited December 2013
    If grenades are free, you should make the grenade upgrade (which is still available) do something else. I'm thinking make non-upgraded grenades have 66% power (since they are cheaper and early game), and upgraded have 100%. If that is too complicated, just give more grenades once upgraded.
Sign In or Register to comment.