• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ability CD being reset unintentionally

Status
Not open for further replies.
Level 3
Joined
Mar 6, 2010
Messages
36
For some reason, my ability's cooldown is being reset when I run the following triggers with it:

Things you should know, a Green Area is a area that the vampires can only access by using this spell, there are 9 of them, when he uses the spell, it teleports him to a Green Area that is being used for 30 seconds then teleports him back to his teleportation rune. (The teleportation rune is just for looks).. the other dummy is basically just the duration). The trigger works, it's just that the ability cooldown resets every time. It resets immediately after he uses the ability.

The spell is based off of taunt.

  • Vampire Teleport Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Teleportation Rune
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • GreenAreaTaken[1] Equal to False
              • GreenAreaTaken[2] Equal to False
              • GreenAreaTaken[3] Equal to False
              • GreenAreaTaken[4] Equal to False
              • GreenAreaTaken[5] Equal to False
              • GreenAreaTaken[6] Equal to False
              • GreenAreaTaken[7] Equal to False
              • GreenAreaTaken[8] Equal to False
              • GreenAreaTaken[9] Equal to False
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: No one controls a G...
          • Unit - Remove Teleportation Rune from (Triggering unit)
          • Unit - Add Teleportation Rune to (Triggering unit)
          • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 125.00)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • VampTeleporting[(Player number of (Triggering player))] Equal to True
            • Then - Actions
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You already have a ...
              • Skip remaining actions
            • Else - Actions
              • Custom script: loop
              • Custom script: exitwhen (udg_VampTeleporting[GetConvertedPlayerId(GetTriggerPlayer())] == true)
              • Set RandomInt = (Random integer number between 1 and 9)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GreenAreaTaken[RandomInt] Equal to True
                • Then - Actions
                  • Custom script: set udg_VampTeleporting[GetConvertedPlayerId(GetTriggerPlayer())] = true
                • Else - Actions
              • Custom script: endloop
              • Set Point[(Player number of (Triggering player))] = (Position of (Triggering unit))
              • Unit - Move (Triggering unit) instantly to (Center of GreenTo[RandomInt])
              • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.50 seconds
              • Unit - Create 1 Missile Down for (Owner of (Triggering unit)) at (Position of Builder Difficulty: Easy 0013 <gen>) facing Default building facing degrees
              • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
              • Unit - Create 1 Teleportation Rune for (Owner of (Triggering unit)) at Point[(Player number of (Triggering player))] facing Default building facing degrees
              • Unit - Add a 31.00 second Generic expiration timer to (Last created unit)
  • DummyVamp Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Missile Down
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) of type Vampire) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to Point[(Player number of (Triggering player))]
          • Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Picked unit)) over 0.50 seconds
          • Set VampTeleporting[(Player number of (Triggering player))] = False
          • Unit - Remove (Triggering unit) from the game
 
Level 3
Joined
Mar 6, 2010
Messages
36
You remove the ability and instantly add it back; I think the problem lies there.

That only happens if no green Areas have been taken.

The problem lies somewhere else, I've even removed those parts of the trigger and it still resets the cooldown.

To make it a bit more clear, the first two ifs check some stuff unimportant to the actual spell, it's all after those two if functions.

It's all on the bottom.
 
Level 3
Joined
Mar 6, 2010
Messages
36
Oh, in case you don't know how to remove that leak,
  • Custom script: call RemoveLocation (udg_Point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))]
Edit: Oh, I guess you know that; I just saw that loop.

Edit2: Mind pming me the map?

My map is a huge mess, so beware.

EDIT: Did you get it? It keeps giving me server errors, i'll try again.
 
Level 3
Joined
Mar 6, 2010
Messages
36
Ok, so, how can I test it now? I used the ability (it normally has cooldown by the way), but, where should I use it?

You got AIM? there are a couple triggers you need to enable (sorry i forgot to enable them before I sent it to you)
my AIM: Nutzee101

EDIT: AIM not AOL

Go to the "Ability Effects Category" and enalbe "debugs", also, go into the "Vampire Teleport Ability" triggers and change the ability being cast from howl of terror to rune of teleportation.

when the game starts, press 1 and then use the ability.
 
Level 15
Joined
Aug 14, 2007
Messages
936
I got a better suggestion. Do not use wait, because it is a very bad style, the wait command will at least take 0.25 seconds to execute, even if you specify it to be 0.01 second.

Suggestion:
Use trigger3 and a timer

Heres how it works,
Trigger3

Event: Every 0.05 second of the game
Condition:
Actions:
if(timer ==0) then
set timer = timer + 0.05
If timer = 0.05 then
move caster
and all the rest of the actions
end if
end if

that's simple and easy isn't it? all you need is another trigger and every works like smooth and wicked =)
 
Status
Not open for further replies.
Top