• 🏆 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!

Battle Bar System

Status
Not open for further replies.
Level 16
Joined
Aug 20, 2009
Messages
1,552
i need the system, which every action has its own "Action Cooldown"

like if you attack, your Action Cooldown will be 2 seconds,

and it is shown with Bars IIIIIIIII above the unit.

when the bar is over, we could do another action again,

each spells has diffrent Action Cooldown (Holy light, 3 sec, Chain lightning, 5 sec, etc), and also items.(Potions, 2 sec, Greater healing potion, 5 sec)

While the bar isn't over , you can't do any actions, except move, patrol, etc.

Anyone mind helping me? :D

GUI would be the best.
 
Last edited:
Level 16
Joined
Aug 20, 2009
Messages
1,552
i don't know what's final fantasy bar looked like D:

anyways, Everytime you do any action, you need to wait for the bar to fill out before doing any other actions, except move, patrol, hold position, and stop.

Each action got diffrent cooldown bars

so, if you attack, you need to wait "2 seconds" bar time.

if you do chain lightning, you need to wait "5 seconds" bar time.

the bar deplets each second, if the bar is gone, you are free to do any other action again ! :D
 
Level 4
Joined
Jun 15, 2010
Messages
67
I didn't see Pharaoh_ for couple of days, he didn't post on my treads too. He might be on vacations or something.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
uhhh....Pharao is afk....we all gonna die!!!1!111oneoneeleven1111

I don't quite get how you want to handle the stuff with attacks
if a melee unit starts attacking and has like 2 sec delay before it actually starts hitting the target won't it run away then?

and if you want it like the unit is paused after it dealt damage it will bug with ranged units with slow missiles who are fast enough to shoot again before the first missile hits the target

the attached map handles spells only
attacking is complicated because it is hard to detect but if you explain how you want it I will add it, too
  • Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set ADL_Hashtable = (Last created hashtable)
  • ADL StartAction
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Not equal to (Order(smart))
      • ((Triggering unit) is in ADL_Group) Equal to False
    • Actions
      • Set i = (Key (Triggering unit))
      • Unit - Pause (Triggering unit)
      • Unit Group - Add (Triggering unit) to ADL_Group
      • Floating Text - Create floating text that reads <Empty String> above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Hashtable - Save 2.00 as 0 of i in ADL_Hashtable
      • Hashtable - Save Handle Of(Last created floating text) as 0 of i in ADL_Hashtable
      • Trigger - Turn on ADL Loop <gen>
  • ADL FinishAction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Unit Group - Remove (Triggering unit) from ADL_Group
  • ADL Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ADL_Group and do (Actions)
        • Loop - Actions
          • Set i = (Key (Picked unit))
          • Set r = ((Load 0 of i from ADL_Hashtable) - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • r Greater than 0.00
            • Then - Actions
              • Hashtable - Save r as 0 of i in ADL_Hashtable
              • Floating Text - Change text of (Load 0 of i in ADL_HashtableIf the label is not found, this function returns NULL.) to (Substring(||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||, 1, (Integer((r / 0.03))))) using font size 10.00
            • Else - Actions
              • Unit - Unpause (Picked unit)
              • Floating Text - Destroy (Load 0 of i in ADL_HashtableIf the label is not found, this function returns NULL.)
              • If ((ADL_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing --------)
              • Hashtable - Clear all child hashtables of child i in ADL_Hashtable
(this code might look easy but it took _ME_ an hour to figure out how to choose the right events and arange everything so pause won't bug with stupid spell orders :p, even works with shift-click and uses hashtables so it's more like pharaos code!![although I prefer index systems but hashtables are easier so you get hashtables))
 

Attachments

  • ActionDelaySystem.w3x
    14.5 KB · Views: 54
Last edited:
Level 16
Joined
Aug 20, 2009
Messages
1,552
uh no, not something like that, thx 4 the effort, +REP 4 your 1 hour effort! i really Appreciate it, seriously.

its when the unit "Done" the skills(After the effect is done), like when he finishes casting holy light, there is 2 seconds where the unit cannot do anything until the bar is over. (Each spell has different cooldowns).

For attacks,(after unit deals damage)(Use damage detection system, combine it with cooldown checking is it a hero or a unit, if it is a unit, check from unit type, if it is a hero, check for agility based cooldown.)

For items, check item types. each different item got different cooldown, - hero agility/10. or something like that.

You can still do Move,hold,patrol,stop or learn hero abilities while the bar is there.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
uh no, not something like that, thx 4 the effort, +REP 4 your 1 hour effort! i really Appreciate it, seriously.

its when the unit "Done" the skills(After the effect is done), like when he finishes casting holy light, there is 2 seconds where the unit cannot do anything until the bar is over. (Each spell has different cooldowns).

For attacks,(after unit deals damage)(Use damage detection system, combine it with cooldown checking is it a hero or a unit, if it is a unit, check from unit type, if it is a hero, check for agility based cooldown.)

For items, check item types. each different item got different cooldown, - hero agility/10. or something like that.

You can still do Move,hold,patrol,stop or learn hero abilities while the bar is there.

so you want the unit to be silenced after it finished casting?
(silence can also disable melee/ranged attack and modify move/attackspeed and miss chance if you select it)
rather hard to check cooldown but it might work if you spam the order and check if the unit executes them (like if IssueOrder(someorderid and unit) == true then)
but it will stop the unit from everything as long as you try checking

also this will still fuck up with ranged attacks with slow missiles and high attack speed and spells deal damage to so you would need an orb effect buff to check if the damage source was of attack-type
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
this map will not have high aspd, i will never create such a thing,

anyways, so is it possible if, we use separate trigs for each spells? that way, you don't need to get order ID or such a thing.

every different spell with different triggers is fine, even though it may cost some file-size, i need it for the game-play.

unit cast an ability
ability = blizzard
if hero = true
set cooldown = 4 - agi/12

or something like that.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
this map will not have high aspd, i will never create such a thing,

anyways, so is it possible if, we use separate trigs for each spells? that way, you don't need to get order ID or such a thing.

every different spell with different triggers is fine, even though it may cost some file-size, i need it for the game-play.

unit cast an ability
ability = blizzard
if hero = true
set cooldown = 4 - agi/12

or something like that.

in this case you could make a huge array which stores the cooldown/the way how the cooldown is calculated and make a silence ability with as many levels as you need different cooldown times:

ini trigger:
set ability[0] = thunderclap
set cooldowntype[0] = 0
set cooldownvalue[0] = 4

cooldown trigger:
a unit finishs casting an ability
for each integer i from 0 to number of abilities do actions
if ability == ability being cast then
if cooldowntype == 0
calculate cooldown
make a dummy unit and cast silence with level calculated
if cooldowntype == 1
calculate cooldown somehow else
etc...
 
Level 9
Joined
Jun 25, 2009
Messages
427
in this case you could make a huge array which stores the cooldown/the way how the cooldown is calculated and make a silence ability with as many levels as you need different cooldown times:

ini trigger:
set ability[0] = thunderclap
set cooldowntype[0] = 0
set cooldownvalue[0] = 4

cooldown trigger:
a unit finishs casting an ability
for each integer i from 0 to number of abilities do actions
if ability == ability being cast then
if cooldowntype == 0
calculate cooldown
make a dummy unit and cast silence with level calculated
if cooldowntype == 1
calculate cooldown somehow else
etc...


Actually you can do it with 200 levels of silence, then check which ability/item is cast/used then what level.

I would try doing a bar, but i don't know how to create a model I or a floating text which can be moved.
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
uhh...i actually did it with DARK Gandalf's system and re-edit,
it doesn't work all the way i want.

but anyways, thx 4 da map lol i can't open that map in world editor,
+EDIT+
I can open it lol, my bad.

yeah, its that kind of bar, but it appears above unit, not in multiboard,

and the unit doesn't goes to the other enemy unit and attacks it, then returns,
it will still be able to walk all it wants, like normal Wc3 game.
but every action has its own silence time, when it is used.

basically- Parasite Eve Style.
 
Level 16
Joined
Aug 20, 2009
Messages
1,552
yeaa, i mean, i checked that one, and it appears on the multi-board, not above all unit ^^, i edited Dark Gandalfs, to make the one i wanted., and the unit is imovable on that map, while the Bar is recharging, what i want is, the unit still moveable, but its skill and all attack become unusable (in other word, silence the unit), well, i succeed somehow in editing Dark Gandalf's system, well, thx 4 viewing.
 
Status
Not open for further replies.
Top