Manipulating cooldowns

TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
edited November 2012 in Modding
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

Comments

  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    I'm not entirely sure what it is you're trying to add a cooldown to, but I can tell you that kNanoShieldCooldown is defined in the Balance.lua file.
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    <!--quoteo(post=2035432:date=Nov 26 2012, 06:51 PM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 26 2012, 06:51 PM) <a href="index.php?act=findpost&pid=2035432"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm not entirely sure what it is you're trying to add a cooldown to, but I can tell you that kNanoShieldCooldown is defined in the Balance.lua file.<!--QuoteEnd--></div><!--QuoteEEnd-->

    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?
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    edited November 2012
    Edit: - ignore this post -
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    <!--quoteo(post=2035650:date=Nov 27 2012, 01:48 AM:name=TimMc)--><div class='quotetop'>QUOTE (TimMc @ Nov 27 2012, 01:48 AM) <a href="index.php?act=findpost&pid=2035650"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->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?<!--QuoteEnd--></div><!--QuoteEEnd-->


    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.
  • ChaosXBeingChaosXBeing Join Date: 2012-10-12 Member: 162114Members
    I think I've found exactly what you were looking for.

    <!--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.
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    <!--quoteo(post=2036360:date=Nov 28 2012, 12:19 AM:name=ChaosXBeing)--><div class='quotetop'>QUOTE (ChaosXBeing @ Nov 28 2012, 12:19 AM) <a href="index.php?act=findpost&pid=2036360"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think I've found exactly what you were looking for.

    <!--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!
  • TimMcTimMc Join Date: 2012-02-06 Member: 143945Members
    Hm how do I get the current commander? All other instances seem to be passing the commander to an entity. eg

    <!--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?
Sign In or Register to comment.