• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Cooldown problem triggered spell

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
I have a problem on a charge spell im using thats triggered, when it is used it doesnt start the cooldown so its actually possible to spam ther move again and again. if i upload the map could someoen check it out and see whats going wrong?
Many thanks
 

Attachments

  • charge template.w3x
    19.5 KB · Views: 43
Level 3
Joined
May 3, 2009
Messages
41
Seas =)

You should add to the "Warrior Charge Teleport - Trigger" the action (at first step):
  • Wait - Wait 0.01 seconds

That wont work, minimum wait time is 0.27

EDIT:

Heres what you did wrong... This is how your trigger looks like:
  • Warrior Charge Teleport
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge (Triggers)
    • Actions
      • Set TempReal = (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast)))
      • Set TempReal = (TempReal + 180.00)
      • Set RushVictimInit[(Player number of (Triggering player))] = (Target unit of ability being cast)
      • Set RushUnit[(Player number of (Triggering player))] = (Casting unit)
      • Set RushVictim[(Player number of (Triggering player))] = RushVictimInit[(Player number of (Triggering player))]
      • Set RushVictimPoint[(Player number of (Triggering player))] = (Position of RushVictim[(Player number of (Triggering player))])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than 200.00
        • Then - Actions
        • Else - Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Unit - Create 1 stundummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral - Firebolt (Target unit of ability being cast)
      • Unit - Move (Triggering unit) instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]
      • Unit - Cause RushUnit[(Player number of (Triggering player))] to damage RushVictim[(Player number of (Triggering player))], dealing (100.00 x (Real((Level of Charge (Triggers) for RushUnit[(Player number of (Triggering player))])))) damage of attack type Spells and damage type Force
      • Wait 1.00 seconds
      • Unit - Remove (Last created unit) from the game
This is how the trigger Should look like:

  • Warrior Charge Teleport
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge (Triggers)
    • Actions
      • Set TempReal = (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast)))
      • Set TempReal = (TempReal + 180.00)
      • Set RushVictimInit[(Player number of (Triggering player))] = (Target unit of ability being cast)
      • Set RushUnit[(Player number of (Triggering player))] = (Casting unit)
      • Set RushVictim[(Player number of (Triggering player))] = RushVictimInit[(Player number of (Triggering player))]
      • Set RushVictimPoint[(Player number of (Triggering player))] = (Position of RushVictim[(Player number of (Triggering player))])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than 200.00
        • Then - Actions
        • Else - Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Unit - Create 1 stundummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Set StunDummy = (Last created unit)
      • Unit - Order StunDummy to Neutral - Firebolt (Target unit of ability being cast)
      • Unit - Pause StunDummy
      • Unit - Move StunDummy instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
      • Unit - Unpause StunDummy
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]
      • Unit - Cause RushUnit[(Player number of (Triggering player))] to damage RushVictim[(Player number of (Triggering player))], dealing (100.00 x (Real((Level of Charge (Triggers) for RushUnit[(Player number of (Triggering player))])))) damage of attack type Spells and damage type Force
      • Wait 1.00 seconds
      • Unit - Remove StunDummy from the game
      • Set StunDummy = No unit

Changes ive done:

- Set an Variable for the dummy (so it wont malfunction)
- Pause and Unpaused before move-instantly (this was the thing causing your cooldown not to work)

Tested, and it should work now :)
 
Level 10
Joined
Apr 3, 2006
Messages
535
thanks for the reply, adding the 0.01 wait creates the cooldown effect i need, but now you can see the "stun" part of the spell which is a fireball.

here is the trigger for everyone else, sorry i didnt think to post it before - the trigger is in 2 parts.

Warrior Charge Action
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Charge (Triggers)
Actions
Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Human\Invisibility\InvisibilityTarget.mdl
Set SpecialFX = (Last created special effect)
Set Stored_Unit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)


Warrior Charge Teleport
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Charge (Triggers)
Actions
Wait 0.01 seconds
Set TempReal = (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast)))
Set TempReal = (TempReal + 180.00)
Set RushVictimInit[(Player number of (Triggering player))] = (Target unit of ability being cast)
Set RushUnit[(Player number of (Triggering player))] = (Casting unit)
Set RushVictim[(Player number of (Triggering player))] = RushVictimInit[(Player number of (Triggering player))]
Set RushVictimPoint[(Player number of (Triggering player))] = (Position of RushVictim[(Player number of (Triggering player))])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than 200.00
Then - Actions
Else - Actions
Set TempPoint = (Position of (Target unit of ability being cast))
Unit - Create 1 stundummy for (Triggering player) at TempPoint facing Default building facing degrees
Unit - Order (Last created unit) to Neutral - Firebolt (Target unit of ability being cast)
Unit - Move (Triggering unit) instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
Custom script: call RemoveLocation( udg_TempPoint )
Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]
Unit - Cause RushUnit[(Player number of (Triggering player))] to damage RushVictim[(Player number of (Triggering player))], dealing (100.00 x (Real((Level of Charge (Triggers) for RushUnit[(Player number of (Triggering player))])))) damage of attack type Spells and damage type Force
Wait 1.00 seconds
Unit - Remove (Last created unit) from the game


ALso sorry i do not know how to copy triggers and make it so they appear here in the forums as they do in the editor.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
thanks for the reply, adding the 0.01 wait creates the cooldown effect i need, but now you can see the "stun" part of the spell which is a fireball.

here is the trigger for everyone else, sorry i didnt think to post it before - the trigger is in 2 parts.

  • Warrior Charge Action
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Charge (Triggers)
    • Actions
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Human\Invisibility\InvisibilityTarget.mdl
      • Set SpecialFX = (Last created special effect)
      • Set Stored_Unit[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
  • Warrior Charge Teleport
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge (Triggers)
    • Actions
      • Wait 0.01 seconds
      • Set TempReal = (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast)))
      • Set TempReal = (TempReal + 180.00)
      • Set RushVictimInit[(Player number of (Triggering player))] = (Target unit of ability being cast)
      • Set RushUnit[(Player number of (Triggering player))] = (Casting unit)
      • Set RushVictim[(Player number of (Triggering player))] = RushVictimInit[(Player number of (Triggering player))]
      • Set RushVictimPoint[(Player number of (Triggering player))] = (Position of RushVictim[(Player number of (Triggering player))])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than 200.00
        • Then - Actions
        • Else - Actions
      • Set TempPoint = (Position of (Target unit of ability being cast))
      • Unit - Create 1 stundummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral - Firebolt (Target unit of ability being cast)
      • Unit - Move (Triggering unit) instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Unit - Order Player_Unit_Heroes[(Player number of (Owner of (Triggering unit)))] to Attack Stored_Unit[(Player number of (Owner of (Triggering unit)))]
      • Unit - Cause RushUnit[(Player number of (Triggering player))] to damage RushVictim[(Player number of (Triggering player))], dealing (100.00 x (Real((Level of Charge (Triggers) for RushUnit[(Player number of (Triggering player))])))) damage of attack type Spells and damage type Force
      • Wait 1.00 seconds
      • Unit - Remove (Last created unit) from the game
ALso sorry i do not know how to copy triggers and make it so they appear here in the forums as they do in the editor.

Wrap it with trigger, checking ...

remove the wait 0.01

use these lines around the move unit instantly

  • Unit - Pause triggering unit
  • Unit - Move (Triggering unit) instantly to (TempPoint offset by 100.00 towards TempReal degrees), facing TempPoint
  • Unit - Unpause triggering unit
Then also remove the second 1.00 wait

Add

  • Unit - Add expirontimer generic one sec
I don't get this really:
"but now you can see the "stun" part of the spell which is a fireball."

cant you just remove the model from the fireball ability?

I see that you set the special effect but you dont remove it?

Well that's about it, hope you fixed it.

regards
~baassee
 
Level 10
Joined
Apr 3, 2006
Messages
535
hey its working now, thanks very much for your help, im giving you both rep. thanks again
 
Status
Not open for further replies.
Top