spell cooldown
Nov 17 2007, 7:09 pm
By: Marine  

Nov 17 2007, 7:09 pm Marine Post #1



how do you get a spell cooldown for like 30 seconds or 5 minutes? if some one could explain and give a demo that would be greatly appreciated. :dontgetit:



None.

Nov 17 2007, 9:01 pm NudeRaider Post #2

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

You can't block a unit's spells (or special abilities) if it has the energy to cast them. Spells usually have a built in cooldown of something near a second which cannot be changed.

If you want to prevent a unit from casting spells you would need to set its energy to 0 and set it to any desired amount of energy after your custom cooldown ended. Preserving the energy it had before setting it to 0 is not possible.
The problem here is to detect when a player has cast a spell. This is usually not possible. Exceptions are Disruption Web and Dark Swarm.

But if you talk about custom spells like in rpgs (e.g. hallucinations created for the hero when he trains a marine in his spell barracks) implementing a cooldown is not hard to do.

When a spell is cast set a death counter to for example 15 to have a cooldown of 30 game seconds when not using hyper triggers.

Have another trigger always subtract 1 from that counter.

Then make 2 triggers
1) that casts the spell if the counter is 0
2) that removes the Marine (or w/e) and gives the player his money/mana back when the counter is at least 1.




Nov 17 2007, 9:32 pm ZugZugZealot Post #3



Agreed, the cooldowns of spells imbedded into units is not changable (that is playable on battle.net).


For custom triggers, there is a method to have a counter with hyper triggers, but it requires you have a resource open only for the use (rather it be caster's slot ore/gas or a computer's ore/gas slot).


In the condition list for the spell trigger add "'switch 99' is set"
In the action list for the spell trigger add "clear 'switch 99'"
In the same action list add "however minerals to the slot/player of your choosing"
In the same action list cast add "set 'switch 100'"



Make another trigger...
[players]
Use the player slot you planned on using for minerals.
[conditions]
-switch '100 is set'
[Actions]
-subtract 1 ore/gas for current player
-preserver trigger

And another trigger
[players]
Use the player slot you planned on using for minerals.
[conditions]
-switch '100 is set'
-Current player accumulates 0 ore/gas
[actions]
-clear 'switch 100'



Or if you want your map to have hyper triggers as much as possible, you may give your hyper triggers a condition of a switch, and toggle that switch as you need to use timers. Though a duration as long as that toggling probably won't be viable.



None.

Nov 18 2007, 1:42 am who Post #4



You don't have to use ore/gas for counter waits, death counts are much easier because there are so many unused units.
A hypertrigger executes about eleven actions per second.



None.

Nov 18 2007, 9:48 am NudeRaider Post #5

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from someone09
You don't have to use ore/gas for counter waits, death counts are much easier because there are so many unused units.
Yeah... your (@ZugZugZealot) method seems very complicated compared to what I suggested.

Ofc you could add minerals or gas to show the player how long he has to wait but thats optional.
If your minerals are already used for another purpose you could make a square where 15 units are created on spell casting and remove 1 of them everytime a death counters is subtracted. Again that would only be for the visual and thus is optional.

Quote from someone09
A hypertrigger executes about eleven actions per second.
It's quite exactly 12 counts per real time second (Lag-free, Speed 7) and 8 counts per ingame second.




Nov 19 2007, 6:12 am Vrael Post #6



Conditions:
Current Player has suffered exactly 0 deaths of Independant Command Center(or otherwise unused unit)
(Other Conditions, i.e. accumulates 100 vespene gas)
Actions:
Spell Actions
Add 24 deaths of Independant Command Center for Current Player
Preserve Trigger

Conditions:
Current Player has suffered at least 1 deaths of Independant Command Ceneter
Actions:
Subtract 1 death of Independant Command Center for Current Player
Preserve trigger

With hyper triggers, this will be a 2 second cooldown, and without hyper's this will be 24 seconds.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:37 am]
jjf28 -- :wob:
[04:29 am]
Ultraviolet -- :wob: must :ban: RdeRenato from shoutbox :wob:
[01:59 am]
lil-Inferno -- :wob:
[01:30 am]
Apos -- I like to :wob: irl, who is with me?
[12:11 am]
Ultraviolet -- :wob:
[09:08 pm]
Vrael -- :wob:
[08:11 pm]
UndeadStar -- Damn, got a letter wrong, meant :wob:
[08:11 pm]
UndeadStar -- Too many words, not enough :wub:
[2020-7-03. : 10:38 pm]
MTiger156 -- w
Please log in to shout.


Members Online: Laurimore7, Roy, C(a)HeK