GUI Unit Event v2.5.2.0

This bundle is marked as approved. It works and satisfies the submission rules.

Unit Event for GUI gives you access to all kinds of events which normal GUI events can't do. Now fully integrating Unit Indexer, I've listed all substantial events and variables. In each event, the custom value of the "triggering unit" is equal to UDex and the way to get the unit with that custom value is via UDexUnits[(Custom value of Unit) --- In this case "UDex"].

Detect the instant when a unit starts reincarnating Event: Game - DeathEvent Becomes Equal to 0.50

Detect when a unit is brought back to life via Reincarnation, Resurrect or Reanimate Event: Game - DeathEvent Becomes Equal to 2.00

You can differentiate between the three of these as well. If it is summoned, that means it was reanimated. If IsUnitReincarnating[UDex] is true, that means it finished reincarnating. Otherwise, it was simply resurrected.

Detect when a unit is loaded into a transport Event: Game - CargoEvent Becomes Equal to 1.00Unit: CargoTransportUnit[UDex] --- The unit who loaded this unit

Detect when a unit is unloaded from a transportEvent: Game - CargoEvent Becomes Equal to 2.00Unit: CargoTransportUnit[UDex] --- The unit who unloaded this unit

Detect when a unit transforms into a new unit typeEvent: Game - UnitTypeEvent Becomes Equal to 1.00Unit Type: UnitTypeOf[UDex] --- The previous unit type

Detect the instant before a unit is completely removed from the game Event: Game - UnitIndexEvent Becomes Equal to 2.00

To detect when any unit is created (including pre-placed units) Event: Game - UnitIndexEvent Becomes Equal to 1.00

To detect when a new unit is summoned (fires after the Create event)Event: Game - UnitIndexEvent Becomes Equal to 0.50Unit: SummonerOfUnit[UDex]

To detect when any unit dies (including units created dead) Event: Game - DeathEvent Becomes Equal to 1.00Unit: KillerOfUnit[UDex]

Unit Event also gives you access to some other useful variables, such as:

Boolean: IsUnitAlive[(Custom value of Unit)] - never bugs (checking life is not always accurate)

Unit Group: CargoTransportGroup[(Custom value of Transporter)] - A unit group which holds all of the cargo of a transporting unit.

There are also some additional obscure things you can do with the system as well, such as looping through all the units in a map or reading data/events based on when the system initialized.

How to install:

- Delete Unit Indexer from your map (if you already have it)
- Copy the "Unit Event Ability" ability from Object Editor
- Copy the Unit Event trigger category
- Paste the Unit Event Ability from object editor twice
- Set the DetectRemoveAbility variable in the Unit Event Config trigger to one of the abilities.
- Set the DetectTransformAbility variable in the same trigger to the other of the two.

As you have fail to read what Bribe has wrote he mentions "reincarnation" and what you have there, is just a text that the unit has died?
Also this system also uses his famous GUI Unit Indexer; which turned out to be a quite remarkable system

Edit :

Bribe once again your work is remarkable; will surely help those who use GUI.
Good work; Rating 5/5

That's the demo map. This doesn't use a timer to detect when reincarnation finishes, so
a timer would not be possible here. The "defend" ability has a bug that make it fire an
"undefend" order when a unit dies, gets removed or gets revived, which is what this is
based on.

You can't get the duration of Reincarnation without consulting the object editor, so this
will work with any duration of reincarnation. It wouldn't make sense to set a timer
because the reincarnation could be 1 second, it could be 7 or it could be 60.

That's the demo map. This doesn't use a timer to detect when reincarnation finishes, so
a timer would not be possible here. The "defend" ability has a bug that make it fire an
"undefend" order when a unit dies, gets removed or gets revived, which is what this is
based on.

You can't get the duration of Reincarnation without consulting the object editor, so this
will work with any duration of reincarnation. It wouldn't make sense to set a timer
because the reincarnation could be 1 second, it could be 7 or it could be 60.

Click to expand...

Ahh right okay,
haven't had chance todownload the map yet, cause not on my laptop,
I understand, okay then i shall change my rating to 5/5, just that was making it difficult to choose between 5 and 4.5,

Lol instead of going through all this work I'd rather trigger my own reincarnate -.-
Also, all this work for a spell that high end maps don't even use? Well the idea is bad, but the execution was good, I'll rate this 3/5.

maddeem, you have a very skeptical attitude towards basically everything I upload.

I challenge you to make a reincarnation detection that detects exactly when the unit starts
reincarnating, exactly when it stops reincarnating, perfectly on queue like this does. I also
challenge you to include a way to detect when a unit is raised from the dead like this does.
Also keep in mind that reincarnation can have basically any timeout. So starting a timer to
expire in 7 seconds is not going to do any good.

It can't be done any simpler than this. Look at how complex Unit Event by Nestharus is,
for comparison. This is a minimal approach to do something so useful.

Reincarnation detection is one of the most requested things out there, as well. So the idea
is bad? Really, I'm calling you on this. Do it better or don't knock it. I want you to explain
your opinion better than this blank reply you've given.

Also, high end maps don't use reincarnation? I'm not sure you know what you're talking about.

maddeem, you have a very skeptical attitude towards basically everything I upload.

I challenge you to make a reincarnation detection that detects exactly when the unit starts
reincarnating, exactly when it stops reincarnating, perfectly on queue like this does. I also
challenge you to include a way to detect when a unit is raised from the dead like this does.
Also keep in mind that reincarnation can have basically any timeout. So starting a timer to
expire in 7 seconds is not going to do any good.

It can't be done any simpler than this. Look at how complex Unit Event by Nestharus is,
for comparison. This is a minimal approach to do something so useful.

Reincarnation detection is one of the most requested things out there, as well. So the idea
is bad? Really, I'm calling you on this. Do it better or don't knock it. I want you to explain
your opinion better than this blank reply you've given.

Also, high end maps don't use reincarnation? I'm not sure you know what you're talking about.

Click to expand...

maddeem, A world of notice;
- Don't mess with Bribe
- You should really read up a bit more before posting negative comments about someones system
- Unless you are able to create something the same but in a simpler form

- Bribe makes these, so people are able to have a much easier map making life, rather than doing it themselves, especially those new to Warcraft III and Jass, so he has made GUI Versions.

Evilcrizpy

Edit :
Also as bribe mentions, believe you can do bettter; go ahead.
If you are able to succeed then yes i shall applaud you.

-And the variable safety checks are they really necessary? the first one could be removed or the last one, no?

Click to expand...

I did that because of recursion - that is a nasty thing. If the function is called twice before
it can be set to 0, the second event won't fire because you set variable with value 1 to 1
again which doesn't trigger the event. I set to 0 afterward because maybe you want some
kind of event id check (which I use in this script btw).

Which brings my next point regarding this:

Make another ini trigger with this in? Isn't it useless to check this if all the time even if it's a ini thingie

Click to expand...

The problem is the Map Initialization event is not guaranteed to run before the map
initialization event of Unit Indexer, so then you'd be adding an ability to the unit which
has a value of 0.

You made the make ability permanent bj go away so why not this one as well? (yeah it is a lame bj like the pause unit bj but you already know that)

Click to expand...

Is there a GUI function for it? I didn't see it, which is why I made the custom script.
Obsessing over BJ's to the point where you make custom script just to avoid them is
pointless in almost all cases. If I cared so much I would eliminate all the GUI if-blocks
and well I'd not even use GUI for that matter, because then I'd be using conditions for
actions for that speed advantage, too. Then I'd be doing some inane variable shortening.

Trust me some things are not worth it. That's why I don't have such impositions on GUI
users who submit their spells here. The standards for a pure-JASS script are much
higher than a GUI script, because there are fewer limitations with pure JASS scripts.

1.
The problem is the Map Initialization event is not guaranteed to run before the map
initialization event of Unit Indexer, so then you'd be adding an ability to the unit which
has a value of 0.

2.
Is there a GUI function for it? I didn't see it, which is why I made the custom script.
Obsessing over BJ's to the point where you make custom script just to avoid them is
pointless in almost all cases. If I cared so much I would eliminate all the GUI if-blocks
and well I'd not even use GUI for that matter, because then I'd be using conditions for
actions for that speed advantage, too. Then I'd be doing some inane variable shortening.

Trust me some things are not worth it. That's why I don't have such impositions on GUI
users who submit their spells here. The standards for a pure-JASS script are much
higher than a GUI script, because there are fewer limitations with pure JASS scripts.

Click to expand...

1. Ah I see, my bad.

2. Yeah it's in the "player" category I think. It confused me a bit that you were a BJ hunter and still had a BJ right before it lol

I have a completed Cargo Event which lets you pick all units inside of a transport, detect
when a unit is unloaded from a transport, and also get the transport carrying a unit. It
would require this script to run, but I am wondering if I should just merge it into this
script because AutoEvents by grim001 merges those two libraries as well.