Manipulating cooldowns
Hello all,
Just trying to wrap my head around cooldowns. In the Techdata there is a few abilities that have cooldowns:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{ [kTechDataId] = kTechId.NanoShield, [kTechDataCooldown] = kNanoShieldCooldown, [kTechDataAllowStacking] = true, [kTechDataCollideWithWorldOnly] = false, [kTechDataMapName] = NanoShield.kMapName, [kTechDataDisplayName] = "NANO_SHIELD_DEFENSE", [kTechDataCostKey] = kNanoShieldCost, [kTechDataTooltipInfo] = "NANO_SHIELD_DEFENSE_TOOLTIP"},<!--c2--></div><!--ec2-->
Further up the page it says kTechDataCooldown = "coldownduration", but I cannot find any further references to cooldowns.
What I am trying to do is manually initiate cooldowns based on events besides placement by the commander. Does anyone have an idea how this could be done? In my instance, I want to make it so losing a cyst causing a stacking 3 second cooldown.
Thanks
Just trying to wrap my head around cooldowns. In the Techdata there is a few abilities that have cooldowns:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{ [kTechDataId] = kTechId.NanoShield, [kTechDataCooldown] = kNanoShieldCooldown, [kTechDataAllowStacking] = true, [kTechDataCollideWithWorldOnly] = false, [kTechDataMapName] = NanoShield.kMapName, [kTechDataDisplayName] = "NANO_SHIELD_DEFENSE", [kTechDataCostKey] = kNanoShieldCost, [kTechDataTooltipInfo] = "NANO_SHIELD_DEFENSE_TOOLTIP"},<!--c2--></div><!--ec2-->
Further up the page it says kTechDataCooldown = "coldownduration", but I cannot find any further references to cooldowns.
What I am trying to do is manually initiate cooldowns based on events besides placement by the commander. Does anyone have an idea how this could be done? In my instance, I want to make it so losing a cyst causing a stacking 3 second cooldown.
Thanks
Comments
I know. What I am trying to do is manually trigger a cooldown event when a cyst is destroyed, rather than when a cyst is placed. Is this possible, or does the game engine not currently support this?
I wouldn't <i>swear</i> to you that it's possible, but I would be absolutely amazed if it wasn't. I'll take a look later today when I'm working on my mod, see if I can't find anything out for you.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->self:SetTechCooldown(techId, cooldown, Shared.GetTime())<!--c2--></div><!--ec2-->
Just do a search for that, and you'll find everywhere that calls for a tech cooldown, including the cooldown for cysts. (It's defined in Commander.lua)
Have at it.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->self:SetTechCooldown(techId, cooldown, Shared.GetTime())<!--c2--></div><!--ec2-->
Just do a search for that, and you'll find everywhere that calls for a tech cooldown, including the cooldown for cysts. (It's defined in Commander.lua)
Have at it.<!--QuoteEnd--></div><!--QuoteEEnd-->
Woo very cool. Thanks!
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function ARC:PerformActivation(techId, position, normal, commander)<!--c2--></div><!--ec2-->
I tried query for the alien commander like an entity, which seems to work. However I imagine this is bad way?
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> for i, entity in ipairs(GetEntitiesForTeam("AlienCommander", self:GetTeamNumber())) do
entity:SetTechCooldown(kTechId.Cyst, 10, Shared.GetTime())
end<!--c2--></div><!--ec2-->
Also putting this in the Cyst:OnDestroy() method causes the cooldown to trigger randomly aswell as on destruction. I thought onDestroy should only trigger when I go and blow up one of those cysts?