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

Why loop ends in here?

Level 17
Joined
Jun 2, 2009
Messages
1,141
Hello everyone. I have a many timers in my map and if one of them expires,

  • TestTrigger
    • Events
      • Time - Dagger[2] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if (GetExpiredTimer() == udg_Dagger[bj_forLoopAIndex]) then
          • Set TempIntegerDagger = (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in Oluler_ug) Equal to False
              • (Life of HeroOyuncu[TempIntegerDagger]) Greater than or equal to 2.00
            • Then - Actions
              • Game - Display to (All players) for 1.00 seconds the text: First 2 conditions ...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HeroOyuncu[TempIntegerDagger] has an item of type FAKE ITEM) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by DaggerUnit[TempIntegerDagger] of type FAKE ITEM)
                  • Hero - Create TRUE ITEM and give it to DaggerUnit[TempIntegerDagger]
                  • Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • Game - Display to (All players) for 1.00 seconds the text: Hero DOES NOT HAVE ...
            • Else - Actions
              • Game - Display to (All players) the text: 5
          • Custom script: exitwhen true
          • Custom script: endif
          • Game - Display to (All players) the text: 6
When i die, i am waiting for several seconds and reviving my Hero and removing it from ug_Oluler but still game not giving me the TRUE ITEM.
I think timer restarts until my unit removed from ug_Oluler. But this trigger works once.
What am i missing in here?
 
Level 20
Joined
Feb 27, 2019
Messages
593
An loop with an if then else statement within it in gui is constructed like this:

  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
THE ABOVE IS THE SAME AS THIS
JASS:
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 12
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if (1 + 1 == 2) then
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop

.> = greater than
bj_forLoopAIndex = IntegerA
bj_forLoopAIndexEnd = 12

loop = this is where the loop starts
exitwhen ... = this is what causes the loop to end, in this case when IntegerA is greater than 12
endloop = not the end of the loop per se, but this is where the loop restarts, which is right after IntegerA has been increased by 1 so next time it runs IntegerA is 1 higher than before

if (condition) then = if something is what the condition says then do
else = if something is not what the condition says do this instead
endif = end of the if then else statement

notice that set bj_forLoopAIndex = 1 and set bj_forLoopAIndexEnd = 12 happens before the loop starts



What do you think happens in this example, whats the value of bj_forLoopAIndex when the loop ends?
JASS:
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 12
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( 1 + 1 == 2 ) then
            exitwhen true
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
 
Last edited:
Level 20
Joined
Feb 27, 2019
Messages
593
This is gui:
  • Unit - Kill (Triggering unit)
This is jass:
JASS:
call KillUnit( GetTriggerUnit() )
This is a custom script in gui:
  • Custom script: call KillUnit( GetTriggerUnit() )
You can try adding some custom script instead of a regular gui action for fun.

EDIT: Can you figure out how this would look in a custom script?
  • Unit - Kill (Picked unit)
 

Attachments

  • 1.png
    1.png
    15.9 KB · Views: 10
  • 2.png
    2.png
    21.1 KB · Views: 10
  • 3.png
    3.png
    21.2 KB · Views: 10
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Still i do not understand. Should i kill dying unit? I just want to do that. Check the picture please.
And i have shared the map file as well

OR here is what i exactly want. Check the first post. This is full trigger. A bit of complicated. Check inside for details.

But stil i prefer fixing the current trigger. Because it is getting harder for me to understand with any new details.
I just want to do this.


Example
Player 4 Hero died.
Dagger timer 4 expired BUT still Player 4 Hero not revived.
Just restart the Dagger timer 4 for Player 4.
 

Attachments

  • zz.png
    zz.png
    35.5 KB · Views: 5
  • jfaitem.w3t
    149.9 KB · Views: 0
Level 20
Joined
Feb 27, 2019
Messages
593
Still i do not understand. Should i kill dying unit? I just want to do that. Check the picture please.
It was an exercise to learn about custom script related to you saying that you didnt understand custom scripts. I wanted you to tell me what this action looks like in a custom script by using the information in my last post:
  • Unit - Kill (Picked unit)
Also what do you think is the value of bj_forLoopAIndex when the loop in this example ends?
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (1 + 1) Equal to 2
        • Then - Actions
          • Custom script: exitwhen true
        • Else - Actions
THE SAME AS THE GUI ABOVE BUT JASS
JASS:
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 12
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( 1 + 1 == 2 ) then
            exitwhen true
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
If you can give me the answers Ill tell you how to restart your timer when the unit is dead.
 
Level 39
Joined
Feb 27, 2007
Messages
5,027
I hate to just flame you here but holy shit this thread is the perfect window into why it is so goddamn hard to help you, JFAMAP.

Duckfarter wrote a long and detailed reply breaking down every single line of a simple loop example for you. He took the time to explain each line one-by-one in order from top to bottom so that you could compare them and more easily think about them. He did this because he knows you do not understand JASS, and because he knows that your lack of understanding is what ‘causes’ this problem with your code in the first place.

Then, because he knows you are learning, he decided to write a simple exercise for you to practice. It isn’t to make you feel stupid or to confuse you, and it isn’t necessary to solve your problem here… but it is instructive. If you understand his exercise, you will understand his first reply in this thread where he explained what the problem is.

You just… didn’t even try to do his exercise. And then completely shut down the thread.



Knowledgable members of this site are not here to fix your triggers for you. We could… but we won’t do that. We are here to help you learn necessary skills to fix your own triggers and to prevent future problems.

I apologize for being rude, but it’s just impossible to help you if you will not try even the smallest, simplest things. I know you think you’re too stupid to learn, but that is not true. Apply yourself. Find a small success and build on that until you find a medium success.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
No need to apologize. I am not not smart enough to understand these. I know that. I decided to set him free this is why i have told him i apologize. And it is my 6'th day and still i am trying to find a way to fix my trigger. Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 second this works only once and twice and no more runs when my hero dead. I just want to make it work every 3 seconds until my hero revives.
 
Last edited:
Level 12
Joined
May 7, 2008
Messages
334
No need to apologize. I am not not smart enough to understand these. I know that. I decided to set him free this is why i have told him i apologize. And it is my 6'th day and still i am trying to find a way to fix my trigger. Countdown Timer - Start Dagger[TempIntegerDagger] as a One-shot timer that will expire in 3.00 second this works only once and twice and no more runs when my hero dead. I just want to make it work every 3 seconds until my hero revives.

So can you explain in simple terms what your trigger does?

Why are you using arrays for Timers?
 
Level 39
Joined
Feb 27, 2007
Messages
5,027
Instead of disabling the item for 3s after taking damage in a sane way, he’s temporarily swapping out the item for a different one. Then runs a 3s timer (MPI is all he needs so that’s where the timer array comes in) that swaps the item back on expiration. Every time the unit takes damage the timer is restarted.

If the unit dies while the item is switched, the timer expiration trigger cannot swap the items back (dead heroes can’t have their items manipulated). This introduces the annoying timing issues that JFAMAP is experiencing. Because he doesn’t understand how his loop works those timers are not properly paused and restarted to avoid this problem.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
Even easier, he can just Loop over the inventory of a newly revived hero and reset any Disabled items back to their working form:
  • Events
    • Unit - A unit Finishes reviving
  • Conditions
  • Actions
    • For each (Integer X) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item carried by (Triggering unit) in slot X) Equal to Disabled Item 1
            • Then - Actions
              • Unit - Remove Item carried by (Triggering unit) in slot X
              • Unit - Create Enabled Item 1 and give it to (Triggering unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item carried by (Triggering unit) in slot X) Equal to Disabled Item 2
            • Then - Actions
              • Unit - Remove Item carried by (Triggering unit) in slot X
              • Unit - Create Enabled Item 2 and give it to (Triggering unit)
I was under the impression that you could manipulate the inventory of a dead hero, or I would've suggested this sooner.

I'm pretty sure he still doesn't understand how to check for BOTH items though. His previous thread was mistakenly using the Else - Actions section for checking the status of the second Item, so instead of checking and fixing both, it would only check and fix one OR the other.

@JFAMAP
Hopefully this makes sense, I don't know how else to explain it.
  • Else - Actions
^ This is bad here. Do not use.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Guys. Honestly i have decided to delete item from the game. Many fails after many tries and not being capable what you tell to me, i think i cannot handle this thing. If i am creating 3 topics about that and still i do not understand, that means this is not possible for me.At this point i think i will try your new suggestions and fail again and demoralized badly. Already failed many times.
We need to know when we stop. This system is clearly beyond my skills. Sorry for bothering you. Not everytime i can create any skill/system i want :)
I give up.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Ok last time i will check this. Currently i am testing and it worked few times but after i died when it is disabled, i have revived and disabled item stays in my inventory and never changes.

This trigger disables the item and gives me the fake version.

  • Dagger Event Copy
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource is A Hero) Equal to True
      • (DamageEventSource is an illusion) Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget has an item of type Dagger of Teleportation) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by DamageEventTarget of type Dagger of Teleportation)
          • Hero - Create Disabled Dagger of Teleportation and give it to DamageEventTarget
          • Countdown Timer - Pause Dagger[(Player number of (Owner of DamageEventTarget))]
          • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
          • Set DaggerUnit[(Player number of (Owner of DamageEventTarget))] = (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DamageEventTarget has an item of type Disabled Dagger of Teleportation) Equal to True
            • Then - Actions
              • Countdown Timer - Start Dagger[(Player number of (Owner of DamageEventTarget))] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions
And this is the 3 seconds cooldown. It is giving me the true item.

  • Dagger Timer Expires Copy Copy Copy
    • Events
      • Time - Dagger[2] expires
      • Time - Dagger[3] expires
      • Time - Dagger[4] expires
      • Time - Dagger[5] expires
      • Time - Dagger[6] expires
      • Time - Dagger[8] expires
      • Time - Dagger[9] expires
      • Time - Dagger[10] expires
      • Time - Dagger[11] expires
      • Time - Dagger[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in ug_Dead) Equal to False
              • (Life of DaggerUnit[(Integer A)]) Greater than or equal to 2.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DaggerUnit[(Integer A)] has an item of type Disabled Dagger of Teleportation) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by DaggerUnit[(Integer A)] of type Disabled Dagger of Teleportation)
                  • Hero - Create Dagger of Teleportation and give it to DaggerUnit[(Integer A)]
                  • Countdown Timer - Start Dagger[(Integer A)] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (GOD_Hero[(Integer A)] has an item of type Disabled Windblade) Equal to True
                    • Then - Actions
                      • Item - Remove (Item carried by DaggerUnit[(Integer A)] of type Disabled Windblade)
                      • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to DaggerUnit[(Integer A)]
                      • Countdown Timer - Start Dagger[(Integer A)] as a One-shot timer that will expire in 3.00 seconds
                    • Else - Actions
            • Else - Actions
And this time i have decided to put this under my revive trigger. I know this will not works if the unit reincarnates. But it is another story. I just want to solve it until here.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (GOD_Hero[(Integer A)] has an item of type Disabled Dagger of Teleportation) Equal to True
    • Then - Actions
      • Item - Remove (Item carried by GOD_Hero[(Integer A)] of type Disabled Dagger of Teleportation)
      • Hero - Create Dagger of Teleportation and give it to GOD_Hero[(Integer A)]
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GOD_Hero[(Integer A)] has an item of type Disabled Windblade) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by GOD_Hero[(Integer A)] of type Disabled Windblade)
          • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to GOD_Hero[(Integer A)]
        • Else - Actions
But i have revived with disabled item and not changed.

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(GOD_Hero[(Integer A)] has an item of type Disabled Dagger of Teleportation) Equal to True
Then - Actions
Item - Remove (Item carried by GOD_Hero[(Integer A)] of type Disabled Dagger of Teleportation)
Hero - Create Dagger of Teleportation and give it to GOD_Hero[(Integer A)]

Why trigger still not giving me the Dagger of Teleportation. Why.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
Ok last time i will check this. Currently i am testing and it worked few times but after i died when it is disabled, i have revived and disabled item stays in my inventory and never changes.
Just add this new trigger:
  • Events
    • Unit - A unit Finishes reviving
  • Conditions
  • Actions
    • For each (Integer X) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item carried by (Triggering unit) in slot X) Equal to Disabled Item 1
            • Then - Actions
              • Unit - Remove Item carried by (Triggering unit) in slot X
              • Unit - Create Enabled Item 1 and give it to (Triggering unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item carried by (Triggering unit) in slot X) Equal to Disabled Item 2
            • Then - Actions
              • Unit - Remove Item carried by (Triggering unit) in slot X
              • Unit - Create Enabled Item 2 and give it to (Triggering unit)
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Already have @Uncle my last trigger (my previous post) is part of my revive trigger. If you want to see entire trigger, here.

  • Respawn Check
    • Events
      • Time - RespawnTimer[2] expires
      • Time - RespawnTimer[3] expires
      • Time - RespawnTimer[4] expires
      • Time - RespawnTimer[5] expires
      • Time - RespawnTimer[6] expires
      • Time - RespawnTimer[8] expires
      • Time - RespawnTimer[9] expires
      • Time - RespawnTimer[10] expires
      • Time - RespawnTimer[11] expires
      • Time - RespawnTimer[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: if GetExpiredTimer() == udg_RespawnTimer[bj_forLoopAIndex] then
          • Custom script: exitwhen true
          • Custom script: endif
      • Custom script: set udg_Boolean = UnitAlive(udg_GOD_Hero[bj_forLoopAIndex])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Boolean Equal to True
        • Then - Actions
          • Set RespawnTime[(Integer A)] = -1.00
          • Selection - Select GOD_Hero[(Integer A)] for (Owner of GOD_Hero[(Integer A)])
          • Unit - Set life of GOD_Hero[(Integer A)] to 100.00%
          • Unit - Set mana of GOD_Hero[(Integer A)] to 100.00%
          • Unit Group - Remove GOD_Hero[(Integer A)] from ug_Dead
          • Camera - Pan camera for (Owner of GOD_Hero[(Integer A)]) to (Position of GOD_Hero[(Integer A)]) over 0.50 seconds
          • Animation - Change GOD_Hero[(Integer A)] flying height to 0.00 at 0.00
          • Countdown Timer - Pause RespawnTimer[(Integer A)]
          • Multiboard - Set the text for NewTable item in column 3, row Table_PlayerLine[(Integer A)] to <Empty String>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of GOD_Hero[(Integer A)]) is in LeaverPlayers) Equal to False
            • Then - Actions
              • Game - Display to (All players) the text: (PlayerNames[(Integer A)] + para ödeyerek dogdu!)
            • Else - Actions
        • Else - Actions
          • Set RespawnTime[(Integer A)] = (RespawnTime[(Integer A)] - 1.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RespawnTime[(Integer A)] Less than or equal to 0.00
            • Then - Actions
              • Multiboard - Set the text for NewTable item in column 3, row Table_PlayerLine[(Integer A)] to <Empty String>
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • mod_sp Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player((Integer A))) is an ally of ClanDevilPlayer) Equal to True
                    • Then - Actions
                      • Hero - Instantly revive GOD_Hero[(Integer A)] at (Center of LumbersD <gen>), Show revival graphics
                      • Hero - Instantly revive zU_AIHero[(Integer A)] at (Center of LumbersD <gen>), Show revival graphics
                    • Else - Actions
                      • Hero - Instantly revive GOD_Hero[(Integer A)] at (Center of LumbersR <gen>), Show revival graphics
                      • Hero - Instantly revive zU_AIHero[(Integer A)] at (Center of LumbersR <gen>), Show revival graphics
                • Else - Actions
                  • Hero - Instantly revive GOD_Hero[(Integer A)] at ((Owner of GOD_Hero[(Integer A)]) start location), Show revival graphics
              • Selection - Select GOD_Hero[(Integer A)] for (Owner of GOD_Hero[(Integer A)])
              • Camera - Pan camera for (Owner of GOD_Hero[(Integer A)]) to (Position of GOD_Hero[(Integer A)]) over 0.50 seconds
              • Animation - Change GOD_Hero[(Integer A)] flying height to 0.00 at 0.00
              • Unit - Set life of GOD_Hero[(Integer A)] to 100.00%
              • Unit - Set mana of GOD_Hero[(Integer A)] to 100.00%
              • Unit Group - Remove GOD_Hero[(Integer A)] from ug_Dead
              • Countdown Timer - Pause RespawnTimer[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (GOD_Hero[(Integer A)] has an item of type Disabled Dagger of Teleportation) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by GOD_Hero[(Integer A)] of type Disabled Dagger of Teleportation)
                  • Hero - Create Dagger of Teleportation and give it to GOD_Hero[(Integer A)]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (GOD_Hero[(Integer A)] has an item of type Disabled Windblade) Equal to True
                    • Then - Actions
                      • Item - Remove (Item carried by GOD_Hero[(Integer A)] of type Disabled Windblade)
                      • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to GOD_Hero[(Integer A)]
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerLockedCameraMode[(Integer A)] Equal to 1
                • Then - Actions
                  • Camera - Lock camera target for (Owner of GOD_Hero[(Integer A)]) to GOD_Hero[(Integer A)], offset by (0.00, 0.00) using Default rotation
                  • Camera - Set (Owner of GOD_Hero[(Integer A)])'s camera Field of view to 90.00 over 0.00 seconds
                • Else - Actions
            • Else - Actions
              • Multiboard - Set the text for NewTable item in column 3, row Table_PlayerLine[(Integer A)] to (Player_Colors[(Integer A)] + ((String((Integer(RespawnTime[(Integer A)])))) + |r))
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
I don't see my trigger anywhere in there.

Create a NEW trigger.

Make it look exactly like this:
  • Events
    • Unit - A unit Finishes reviving
  • Conditions
  • Actions
    • For each (Integer X) from 1 to 6, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item carried by (Triggering unit) in slot X) Equal to Disabled Item 1
            • Then - Actions
              • Unit - Remove Item carried by (Triggering unit) in slot X
              • Unit - Create Enabled Item 1 and give it to (Triggering unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item carried by (Triggering unit) in slot X) Equal to Disabled Item 2
            • Then - Actions
              • Unit - Remove Item carried by (Triggering unit) in slot X
              • Unit - Create Enabled Item 2 and give it to (Triggering unit)
Of course change some things to use your Items/variables.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
Sure i can do that but I am already reviving heroes, changing their health, mana, walk height, some other things etc etc in there but can we not check their inventories during process? And i have to detect reincarnated units as well.
Of course you can use that trigger. It's not that complicated:

When a Hero revives -> Fix it's items.

The moment the Hero is back in the game would be a good time to fix the items.
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
Just realized, my system already works since 2 days. I just using the wrong test command...
But still my question is valid.
How can i detect reincarnated unit? I have an item that allows players use reincarnation ability. But my trigger and "unit is revived" not works.
And this one leads to my very first question asked at the beginning.
  • Dagger Timer Expires
    • Events
      • Time - Dagger[2] expires
      • Time - Dagger[3] expires
      • Time - Dagger[4] expires
      • Time - Dagger[5] expires
      • Time - Dagger[6] expires
      • Time - Dagger[8] expires
      • Time - Dagger[9] expires
      • Time - Dagger[10] expires
      • Time - Dagger[11] expires
      • Time - Dagger[12] expires
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DaggerUnit[TempIntegerDagger] is in ug_Dead) Equal to False
              • (Life of DaggerUnit[(Integer A)]) Greater than or equal to 2.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (GOD_Hero[(Integer A)] has an item of type Disabled Dagger of Teleportation) Equal to True
                • Then - Actions
                  • Item - Remove (Item carried by DaggerUnit[(Integer A)] of type Disabled Dagger of Teleportation)
                  • Hero - Create Dagger of Teleportation and give it to DaggerUnit[(Integer A)]
                  • Countdown Timer - Start Dagger[(Integer A)] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (GOD_Hero[(Integer A)] has an item of type Disabled Windblade) Equal to True
                    • Then - Actions
                      • Item - Remove (Item carried by DaggerUnit[(Integer A)] of type Disabled Windblade)
                      • Hero - Create Windblade |cffffff00(Agility Unique)|r and give it to DaggerUnit[(Integer A)]
                      • Countdown Timer - Start Dagger[(Integer A)] as a One-shot timer that will expire in 3.00 seconds
                    • Else - Actions
            • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,578
You have to use a special trick relying on the Defend ability to detect reincarnation. There's an older system that has this built in so it should be compatible:
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,141
Ah hold on. I believe (Life of DaggerUnit[(Integer A)]) Greater than or equal to 2.00 should gonna work. But today i will check this GUI Unit Event when i go home and let me know you about the results.

Ah by the way i have a huge nightmare Uncle. I have reached the code limit in my map. I have verified this with many people.
My triggers suddenly stopped working and in my last version i even cannot started the game :D When game started many of the map inits not started to work. It was the first time i saw something like this.
I have currently solved it by combining my item combine triggers under 7 triggers instead of 160. And everything started to work again.
After these day i have started to compile my triggers....
 
Level 17
Joined
Jun 2, 2009
Messages
1,141
No more i do care when people say "bro you have created AI system for moba, shared and explained to people and how you cannot do that thing bla bla bla" because STILL I CANNOT. If i cannot do, no need to be stubborn.
This system is clearly beyond my limits and knowledge. No need to spent time for me and other people who tries to help me.

I give up and i decided to delete this item and it's upgrade from my game. No more i will visit this topic, so you can lock it.
 
Last edited:
Level 12
Joined
May 7, 2008
Messages
334
No more i do care when people say "bro you have created AI system for moba, shared and explained to people and how you cannot do that thing bla bla bla" because STILL I CANNOT. If i cannot do, no need to be stubborn.

I give up and i decided to delete this item and it's upgrade from my game. No more i will visit this topic, so you can lock it.

I mean people have tried to help you numerous of times but you completely ignore them and then you proceed to rant about something totally unrelated.

If you don't want help that's fine, put the thread under Solved and move on, no need to waste anyone's time with that attitude.
 
Top