Closed MetaMind09 closed 11 years ago
i will look into it...
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
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)
Aliens need Leap ability from the start up.