• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Scumbag Ankh...

Status
Not open for further replies.
Level 30
Joined
Nov 29, 2012
Messages
6,637
How can I detect when Ankh is used?

Another question: How can I make unlimited reincarnation charges without having the number of charges on the icon?

I cant seeem to answer your main question but for your another question: You can make a trgger that when the unit dies and has an item, that tem is the Ankh, create ankh cross model (the model used when ankh takes in effect, the cross!), revive dying unit and dont turn off trigger. Because it seems impossible to make Ankh have unlimited revive with no charge.... I have tried it setting it to 0 charge, permanent classification and Perishable to false but didnt work. SO I suggest triggering it.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
U have to options for mui w waits then. Well there's more than that but these are the easiest.
Events
Unit dies
Condition
Unit has item type of manipulated item equal to ankh
Actions
(Option1)
Wait 5.00 seconds
Revive triggering unit.
(Option2)
Custom script: local unit u = GetTriggerUnit()
Wait 5 seconds
Custom script set udg_tempUnit = u
Revive tempUnit
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
When unit dies under the effect of reincarnation, it doesn't actually gets registered by the event via A unit Dies.

Now, you need to understand the threshold for a unit to "die" is its HP to become less than 0.405 (0.404, 0.403,...,0.000).

Use this as condition to detect if the unit actually "die".

So, here's a trick to detect its "death" if the unit has Ankh equipped;
  • Detect Ankh
    • Events
      • Unit - Blood Mage 0001 <gen>'s life becomes Less than 0.41
    • Conditions
    • Actions
      • Game - Display to (All players) the text: detected
But by using that event, it must refer to the pre-defined unit, so how do we refer to non-exist unit yet ?

We add those affected unit via trigger;
  • Ankh Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit has an item of type Ankh of Reincarnation) Equal to True
            • Then - Actions
              • Custom script: call TriggerRegisterUnitLifeEvent(gg_trg_Ankh_Detect, udg_unit, LESS_THAN, 0.405)
            • Else - Actions
  • Ankh Detect
    • Events
    • Conditions
    • Actions
      • -------- DO SOMETHING HERE --------
Since I don't know how those units get their Ankh, I just assume that those units get it at the start of the map.

If you could tell me exactly how those units get their Ankh, I might change the Event.

@deathismyfriend
Since dead unit that is not "fully" dies yet (having Ankh), they will not get registered by the Event - A unit Dies.
Therefore, you should use GetWidgetLife(unit) to detect whether the unit truly hits the limit or not.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well, it's not simple as it looks, that is why some people made a system for this.

As for unlimited charge of Ankh, follow these steps;
1. Create a new ability based off Reincarnation
2. Set Cooldown to 0
3. Set Required Level to 1
4. Apply this ability to the Item Ability (your Ankh item)
5. Change the item's Stats - Number of Charges to 0
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
When unit dies under the effect of reincarnation, it doesn't actually gets registered by the event via A unit Dies.

Now, you need to understand the threshold for a unit to "die" is its HP to become less than 0.405 (0.404, 0.403,...,0.000).

Use this as condition to detect if the unit actually "die".

So, here's a trick to detect its "death" if the unit has Ankh equipped;
  • Detect Ankh
    • Events
      • Unit - Blood Mage 0001 <gen>'s life becomes Less than 0.41
    • Conditions
    • Actions
      • Game - Display to (All players) the text: detected
But by using that event, it must refer to the pre-defined unit, so how do we refer to non-exist unit yet ?

We add those affected unit via trigger;
  • Ankh Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit has an item of type Ankh of Reincarnation) Equal to True
            • Then - Actions
              • Custom script: call TriggerRegisterUnitLifeEvent(gg_trg_Ankh_Detect, udg_unit, LESS_THAN, 0.405)
            • Else - Actions
  • Ankh Detect
    • Events
    • Conditions
    • Actions
      • -------- DO SOMETHING HERE --------
Since I don't know how those units get their Ankh, I just assume that those units get it at the start of the map.

If you could tell me exactly how those units get their Ankh, I might change the Event.

@deathismyfriend
Since dead unit that is not "fully" dies yet (having Ankh), they will not get registered by the Event - A unit Dies.
Therefore, you should use GetWidgetLife(unit) to detect whether the unit truly hits the limit or not.

How abut remove ankh''s revivng capabilites and let the trgger handle it? ANkh has no ability so if the unit holding it dies.. it is full dead because Ankh has no reviving capabilites anymore. Then let the trigger handle the reviving? is that somehow good?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Because simply, dead unit without Ankh considered as dying unit while unit that dies while having Ankh considered to be Undead (literally).

There are 2 different matters here that you need to understand.
But if you still want to let trigger to handle all the reincarnation, why would you have that item in the first place ?
Just for dummy ?
If so, you should have told us earlier about this.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
To me, Blizzard's default mechanics > Trigger Editor.
If Blizzard can handle reincarnation on its own, why should we ?
Unless, there is more than what we want, such as in DotA, why they let the trigger handle it ?
It's because they want to show timers in Timer Window, also, not to revive the unit at the same spot (just like Reincarnation does), and many things.

In this case, it's just a simple reincarnation issues, that should be done by default reviving mechanics of Blizzard.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Well, it's not simple as it looks, that is why some people made a system for this.

As for unlimited charge of Ankh, follow these steps;
1. Create a new ability based off Reincarnation
2. Set Cooldown to 0
3. Set Required Level to 1
4. Apply this ability to the Item Ability (your Ankh item)
5. Change the item's Stats - Number of Charges to 0

not working... Dies after 3 deaths
 
Status
Not open for further replies.
Top