OnkelDagobert / Last_Resistance

NS2 Mod
0 stars 0 forks source link

Aliens need Leap #16

Closed MetaMind09 closed 11 years ago

MetaMind09 commented 11 years ago

Aliens need Leap ability from the start up.

OnkelDagobert commented 11 years ago

i will look into it...

MetaMind09 commented 11 years ago

I ve investigated a bit how we can do not only this but also unlocking things in general... concerning the leap upgrade there is a function in the skulk.server.lua called: function Skulk:InitWeapons()... have tried to add: self:GiveItem(Leap.kMapName) or self:GiveItem(kTechId.Leap) but id didnt work.

Anyways concerning unlocking things I think we should trigger the "commander techbuttons" on a certain condition and set the research time to 1 sec, coz all upgrades are binded to a so called: technode and its very difficult hijack into the: researchNode:SetResearched(true) command. so we should try to unlock them via commander tech triggering like i stated above:

Expl:

function Armory:GetTechButtons(techId)

local techButtons = nil

techButtons = { kTechId.ShotgunTech, kTechId.WelderTech, kTechId.MinesTech, kTechId.None,
                    kTechId.None, kTechId.GrenadeLauncherTech, kTechId.FlamethrowerTech, kTechId.None }

// Show button to upgraded to advanced armory
if self:GetTechId() == kTechId.Armory and self:GetResearchingId() ~= kTechId.AdvancedArmoryUpgrade then
    techButtons[kMarineUpgradeButtonIndex] = kTechId.AdvancedArmoryUpgrade
end

return techButtons

end

so maybe we can make a command like:

if marinepercentage < 50 then trigger:techbutton/technode = kTechId.ShotgunTech return true

OnkelDagobert commented 11 years ago

see last commit .. function UpdateChangeToSpectator(self) is called if someone respawns. u can calculate the marinepercentage there and give the hole team the tech you want, like i did in NS2Gamerules.lua (see last commit diff 5a87ea3)