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

Rage System

Status
Not open for further replies.
Level 2
Joined
Oct 17, 2011
Messages
7
Hi, im new at the forum and I wanted to ask you some things about a Rage System I made.

For those who don't know, Rage is the same as Mana, is what some heroes use to cast spells. The difference lies on how it behaves.

If Hero is attacked or attacks some rage is generated. Hero attacking generates more than if he is attacked. And Rage consumes with time.

I made these Triggers.

INITIALLY ON
  • Rage 1 FW
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Fury Warrior
    • Actions
      • Set FuryWarrior = (Sold unit)
      • Trigger - Turn on Rage 2 FW <gen>
      • Trigger - Turn on Rage 3 FW <gen>
      • Trigger - Turn on Rage 4 FW <gen>
      • Trigger - Turn on Rage 5 FW <gen>
INITIALLY OFF
  • Rage 2 FW
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Fury Warrior
    • Actions
      • Set FuryWarrior_Rage = (FuryWarrior_Rage + 1.50)
INITIALLY OFF
  • Rage 3 FW
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Fury Warrior
          • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Set FuryWarrior_Rage = (FuryWarrior_Rage + 4.00)
INITIALLY OFF
  • Rage 4 FW
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set FuryWarrior_Rage = (FuryWarrior_Rage - 1.00)
INITIALLY OFF
  • Rage 5 FW
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit - Set mana of FuryWarrior to FuryWarrior_Rage
My question is:
Is there any better way to do this system?

And I'm having problems with this Hero using Rage and Items. As some items give intelligence or mana regeneration; Hero's Rage (Mana) starts behaving differently. How can this be solved?

Thanks a lot :D

PD.: I am also planning in doing an Energy System.
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
There's a small time gap between the attack action and the damage dealt, this way, the unit could be "enraged" just for being attacked, but not taking any damage, which is wrong. The right way to do it is using a Damage Detection System: http://www.hiveworkshop.com/forums/...-v1-2-1-a-149098/?prev=search=GDD&d=list&r=20

BTW, the following triggers may seem really hard to understand, and even harder than yours, but it's because it has a lot of comments and unneeded Game Text Displays :).

Rage shouldn't decrease if it's in battle, so you have to give a 5sec (or so) cooldown to the unit, so the rage remains for a while after the last hit. I would use a Hashtable to do it (I'll explain how).

1. Create a Hashtable on Map Initialization
2. Create a Hashtable Type variable and call it "RageHash"
3. Set "RageHash" = Last created Hashtable

  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Hashtable Creation --------
      • Hashtable - Create a hashtable
      • -------- Setting the Hashtable to a Variable in order to Handle it --------
      • Set RageHash = (Last created hashtable)
  • Rage ATTACKED
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamagedUnit) Equal to Footman
      • (GDD_DamageSource belongs to an enemy of (Owner of GDD_DamagedUnit)) Equal to True
    • Actions
      • -------- Gives 2 mana every time it takes damage --------
      • Unit - Set mana of GDD_DamagedUnit to ((Mana of GDD_DamagedUnit) + 2.00)
      • -------- This Custom Script makes our life easier. --------
      • Custom script: set udg_UnitID = GetHandleId(udg_GDD_DamagedUnit)
      • -------- - 5 - is the Rage Cooldown. It is reduced by 1 every second. When it reaches 0, the unit starts loosing mana. --------
      • Hashtable - Save 5 as 0 of UnitID in RageHash
      • -------- If the unit isn't in the RageGroup (The enraged units) it's added. If it is already in, does nothing. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamagedUnit is in RageGroup) Equal to False
        • Then - Actions
          • -------- Unit is added to the RageGroup --------
          • Unit Group - Add GDD_DamagedUnit to RageGroup
          • -------- This Message can be deleted. Is for testing purposes. --------
          • Game - Display to (All players) the text: ((Name of GDD_DamagedUnit) + added to RageGroup (+2 mana))
          • -------- The Rage timer starts (doesn't matter if it's already started). --------
          • Countdown Timer - Start RageTimer as a Repeating timer that will expire in 1.00 seconds
        • Else - Actions
  • Rage ATTACKING
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Unit-type of GDD_DamageSource) Equal to Footman
      • (GDD_DamagedUnit belongs to an enemy of (Owner of GDD_DamageSource)) Equal to True
    • Actions
      • Unit - Set mana of GDD_DamageSource to ((Mana of GDD_DamageSource) + 2.00)
      • Custom script: set udg_UnitID = GetHandleId(udg_GDD_DamagedUnit)
      • Hashtable - Save 5 as 0 of UnitID in RageHash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamageSource is in RageGroup) Equal to False
        • Then - Actions
          • Unit Group - Add GDD_DamageSource to RageGroup
          • Countdown Timer - Start RageTimer as a Repeating timer that will expire in 1.00 seconds
        • Else - Actions
It's better to work with a timer, it's more precise that "elapsed game time". For this just create a timer, and set it to a Variable like RageTimer. When game starts start the RageTimer as a repeating timer that will expire every 1 second, then you create a trigger like the following:

  • Rage Cooldown
    • Events
      • Time - RageTimer expires
    • Conditions
    • Actions
      • -------- Here we manage all the Enraged units. --------
      • Unit Group - Pick every unit in RageGroup and do (Actions)
        • Loop - Actions
          • -------- It improves Trigger Efficiency. It's better than doing "Picked Unit" every time we need to do something it it. --------
          • Set Unit = (Picked unit)
          • -------- Again, it improves our life. --------
          • Custom script: set udg_UnitID = GetHandleId(udg_Unit)
          • -------- This is the Rage CD time (5) minus 1. --------
          • Set Integer = ((Load 0 of UnitID from RageHash) - 1)
          • -------- Now we save the already reduced by 1 Rage timer. --------
          • Hashtable - Save Integer as 0 of UnitID in RageHash
          • -------- This If/Then/Else can be deleted. It's just to display the Rage CD if it's equal or higher tan 0. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Greater than or equal to 0
            • Then - Actions
              • Game - Display to (All players) the text: ((Name of GDD_DamagedUnit) + ( RageCD: + (String(Integer))))
            • Else - Actions
          • -------- This reduces the mana of the unit by 1 if the Rage CD is equal or lower than 0. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Less than or equal to 0
            • Then - Actions
              • -------- Mana is reduced by 1 --------
              • Unit - Set mana of Unit to ((Mana of Unit) - 1.00)
              • -------- Message is displayed (Can be deleted) --------
              • Game - Display to (All players) the text: ((Name of GDD_DamagedUnit) + Mana -1)
              • -------- This removes the unit from the group if it has no mana, which means that hasn't been hit in 5 seconds. --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of Unit) Equal to 0.00
                • Then - Actions
                  • -------- Unit is removed. --------
                  • Unit Group - Remove Unit from RageGroup
                  • -------- Message is displayed: Can be deleted. --------
                  • Game - Display to (All players) the text: ((Name of GDD_DamagedUnit) + Rage OFF)
                  • -------- If there's no unit in the RageGroup there's no need to have this trigger workingso, we better stop it. --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in RageGroup) Equal to 0
                    • Then - Actions
                      • Game - Display to (All players) the text: Rage Group is Empty...
                      • Countdown Timer - Pause RageTimer
                    • Else - Actions
                • Else - Actions
            • Else - Actions
It's mostly explained with comments inside the trigger. All the comments and Game Text display can (and must) be deleted.
Ask anything you want.

You can avoid the unit from having Int based mana regen modifying the Game Constants, but it will affect all units in the game. You can also prevent the unit from picking the items that have regeneration. You can also add a -100% mana regeneration ability to the unit, so it losses all the mana he gains via intelligence.
 

Attachments

  • Rage System.w3x
    23.7 KB · Views: 123
Last edited:
Level 17
Joined
Nov 13, 2006
Messages
1,814
Hi, im new at the forum and I wanted to ask you some things about a Rage System I made.

For those who don't know, Rage is the same as Mana, is what some heroes use to cast spells. The difference lies on how it behaves.

If Hero is attacked or attacks some rage is generated. Hero attacking generates more than if he is attacked. And Rage consumes with time.

I made these Triggers.

INITIALLY ON
  • Rage 1 FW
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Fury Warrior
    • Actions
      • Set FuryWarrior = (Sold unit)
      • Trigger - Turn on Rage 2 FW <gen>
      • Trigger - Turn on Rage 3 FW <gen>
      • Trigger - Turn on Rage 4 FW <gen>
      • Trigger - Turn on Rage 5 FW <gen>
INITIALLY OFF
  • Rage 2 FW
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Fury Warrior
    • Actions
      • Set FuryWarrior_Rage = (FuryWarrior_Rage + 1.50)
INITIALLY OFF
  • Rage 3 FW
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Fury Warrior
          • ((Attacked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Set FuryWarrior_Rage = (FuryWarrior_Rage + 4.00)
INITIALLY OFF
  • Rage 4 FW
    • Events
      • Time - Every 1.50 seconds of game time
    • Conditions
    • Actions
      • Set FuryWarrior_Rage = (FuryWarrior_Rage - 1.00)
INITIALLY OFF
  • Rage 5 FW
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit - Set mana of FuryWarrior to FuryWarrior_Rage
My question is:
Is there any better way to do this system?

And I'm having problems with this Hero using Rage and Items. As some items give intelligence or mana regeneration; Hero's Rage (Mana) starts behaving differently. How can this be solved?

Thanks a lot :D

PD.: I am also planning in doing an Energy System.

dont use mana for keep rage, u can use multiboard for show the hero rage if every player got 1 hero, else if every unit on map got rage then floating text maybe

i advice use bribe gui damage engine coz i found it more userfriendly, i was damn noob when i tryed 1st time and that was easy importable also damn usefull if u want make something complicated thing later, and u can do it easier with that system

in ur case the decreasing by time i can do with unit array and 1 timer trigger

- need unit indexer and gui dmg system

-make unit array with rage_unit name and a integer variable, lets say last_index

-if u create a rage unit to player then make this

for a=1 to 8000
if rage_unit[a]==null then
set rage_unit=ur target unit
if a>last_index then
set last_index = a
endif
skip remaining action
endif
endloop

in periodic trigger
for a = 1 to last_index
if rage[custom value of rage_unit]>0 then
rage[custom value of rage_unit] = rage[custom value of rage_unit] - 1
endif
endloop

add rage similiar way when unit attack in set dmg trigger what is in gui dmg engine
-------------------------
i think this is enough fast way,u can do in gui too, not hard also this a fast way what not cause problem even u must check to alot unit
 
Level 2
Joined
Oct 17, 2011
Messages
7
Ok ,thanks a lot, I'll improve it and post it again. I would like to use mana as rage, how can I solve the item problem?
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Ok ,thanks a lot, I'll improve it and post it again. I would like to use mana as rage, how can I solve the item problem?

if u use mana then it harder, only way i think if u store mana regenerations from every item on ur map, or edit every item mana regen ability in object editor and set to 0


about hero mana regeneratioon:

- set hero mana regen to 0 in object editor
- go to Advanced->Gameplay Constants-> Hero Attributes -> Mana regen per intelligence and set it to 0
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
@shadowvzs, the rage thing isn't that complex as to require two systems (Damage Engine + Unit Indexer), besided, it can be done just detecting damage and using common WC3 options :)
 
Level 2
Joined
Oct 17, 2011
Messages
7
The thing is that some Heroes will use rage and some others not.

What I did is create for every item with intelligence another item almost the same but without the intelligence; and a trigger to switch item if the unit uses rage.

About mana regeneration I put a -100% mana regeneration ability. I don't know if this will work.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
What -100% regeneration does is null the natural Intelligence based regeneration. Any item/aura regeneration bonus will mix with that one (+25 regen item -100% regen ability = -75% regen ability). Swapping items the way you've done is one of the best ways.
 
Level 2
Joined
Oct 17, 2011
Messages
7
Ok, so now I modified the -100% mana reg ability to -100000000000%, which is the max negative value i'm allowed. I believe that should do it :p
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I would "fix" the values to 25 / 50 / 75 / 100 mana renegeration, and add your unit a -100% mana regeneration ability (on lvl 1) and increase the level of that ability to whatever you need to fight the items regeneration (Increasing from 100 to 125, 150, 175, 200, etc.. -100% prevents intelligence regen bonus.
 
Status
Not open for further replies.
Top