Temporarily disabling abilities

Kiido

New Member
Reaction score
2
Hello everyone, I’m having a problem with one of the abilities in my map.

This ability is called “Sprinting”, it is a bearform-based ability which allows a unit (called Rifleman) to switch to a state where he has +100 ms, but has no attack and is unable to cast spells.

Removing his attack was simple enough. My solution to preventing him from casting spells was to remove those undesired abilities (Rocket-propelled Grenade, Flashbang) after he casted Sprinting, while leaving the “Turn-off Sprinting” ability to allow him to switch back to his regular self.

This seemed to work well enough, especially as the abilities automatically restored themselves when he switched back to his non-sprinting form.

But this created a huge bug, in that ability cooldowns are reset when an ability is removed and then added again. As such, players were able to continuously cast spells by toggling between sprint and non-sprint.

My second idea was to get an enemy dummy caster to permanently soul-burn (with only the silence effect) the Rifleman while he is sprinting. But I didn’t bother to try this as I guessed this would prevent him from switching back to non-sprint.

For now, I’m using a trigger to issue a “Stop” command when the Rifleman tries to cast any of the undesired abilities while he is in Sprint form. But this could be confusing to players who see the cast animation but no spell effects.


So I need to ask if I can cause one of those spell messages to appear:

eg. When you try and cast storm bolt on a building. “Cannot target structures”

So that the players are notified when they try and cast a spell when sprinting, something like “Cannot use this ability while sprinting”


Also, if anyone has a better solution on how to disable certain abilities when in bearform (sprinting), please share it with me, any ideas are really appreciated!

Thanks very much for your time people, I know it was a long post :)
 

KileRatZ

Member
Reaction score
4
If you wish to sometimes disable an ability, you can do this:
Create a new dummy unit. This unit will not do anything, the only important thing is its name as seen in the game. In your case, you'd probably name it "Not sprinting".
Go to the ability you want disabled sometimes, Techtree->Requirements, and add the "Not Sprinting" unit to the required "Tech Items".

Your ability will now be disabled exactly when its owner does not also have "Not Sprinting" on the map.

So for example, on initialization you create the "Not Sprinting" unit for the player on some hidden location. Everytime he'll start sprinting, you remove the unit. Once he stops sprinting, you re-add it.

The ending result should look something like this:
screenshotnc.jpg


The cool thing about this method is that it greys out the ability when it's disabled, and it also still displays the cooldown on it.

Hope this helps :)
 

Carnerox

The one and only.
Reaction score
84
You can also use an upgrade.. Just set the upgrade to 0 when used and then 1 when not used.
 

KileRatZ

Member
Reaction score
4
Unfortunately, upgrades cannot be "downgraded" again, but it would certainly be way easier if they could be. That's why all the hassle with unit requirements is needed, instead.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top