HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Idea for a universal aura, I believe this has a lot of potential...

11-10-2003, 07:33 PM#1
FerretDruid
I just thought of an interesting idea for an aura, while trying to think of a way to make my Bleeding / Near Death abilities more functional.

There is a few things I need to know but the general idea has a lot of applications:

--------------------------------------------------------------------------

1. Does the range an aura can effect have any kind of limitation? (ie: on an epic size map, can I have a unit in one *corner* effect a unit in the *opposite corner* ?)

2. Can an normally friendly aura be altered to affect any/all units that meet a certain condition?

3. Can an aura be put on a permanently invisible unit and still affect other units? (I suppose this could be solved just by making a unit with no model... But, I'm curious anyway)

4. How can I make an aura/ability effect a unit/stop affecting a unit in real-time as soon as the unit's percentage life reaches above/below a set amount? (<<<--- THIS IS WHAT HAS PREVENTED ME FROM SLEEPING THE LAST 2 DAYS!!! Though, I've gotten it to work to a degree.)

--------------------------------------------------------------------------

Anyway, those are all my questions (I think). My idea is to make a neutral, permanently invisible building somewhere on the map - with an aura that can affect ANY unit on the map. The auras I am currently using are Endurance and Unholy, because they have the exact effects I need (first, unholy to lower life regen and movement speed (bleeding), then endurance to further lower movement speed with an added attack speed reduction (near death).) But this could be used with any type of aura.

This would be useful for giving an effect to any unit that meets the condition (for me, it is lower than 50% life, then another effect at lower than 20% life) and then remove it if the unit stops meeting that condition and/or meets another condition (greater than 80% life and greater than 25% life, respectively). Doing this would prevent the unit from aquiring an extra ABILITY BUTTON in their command box (OMG shoot me) and would otherwise just be convenient as every unit under the effect would not have to have their own ability.

There are surely other questions that will come up, and problems with this but let's start from here.

Edit: I left out a word, and I'm a Warrior!! <---!! What's that mean?
11-10-2003, 09:32 PM#2
Ligature
Er. Could you just make two abilities that had no icon that have the effects you want... and then add them with triggers to the units with something like this:

Code:
E - (add events to this trigger that go like "UnitArrayMember[n] takes damage")
C - Percent life of Triggering Unit is less than XXX
A - remove ability YYY from triggering unit
A - add ability YYY to triggering unit
A - if percent life of triggering unit is less than UUU then do
         Actions:
                    A - remove ability VVV from triggering unit
                    A - add ability VVV to triggering unit

The removes are just so the abilities don't overlap - there might be a better way of doing that
11-10-2003, 11:05 PM#3
FerretDruid
The auras I'm using were based from the "Item" versions at first, but that didn't stop the icons from appearing. So, I assume they will appear no matter what on the unit that actually HAS the ability. From my experience, deleting the entry to an icon just causes a tool tip error and doesn't stop the tooltip from actually appearing. (Unless there is some workaround I'm not familiar with?)

I'll use the first ability as an example of my triggers, just a note: They stack just fine there isn't any problem there that I'm aware of.

Code:
Bleeding when below 50 percent
    Events
    Conditions
        (Percentage life of (Triggering unit)) Less than 50.00
    Actions
        Unit - Add Bleeding (Custom) to (Triggering unit)

I have 2 triggers to add units to this trigger with several different events. Unit is attacked, unit uses item, unit is issued order targeting a unit/point/no target etc. I also apply the units events to the following trigger:

Code:
Unbleed at 70 percent
    Events
    Conditions
        (Percentage life of (Triggering unit)) Greater than 50.00
    Actions
        Unit - Remove Bleeding (Custom) from (Triggering unit)

And granted, the triggers WORK... There are the problems, one being the annoying ability icon that appears. It is not a BIG deal, because the icon I made is a custom icon with custom tooltip. I would love to be able to make this work without the icon appearing on the command menu though! (ie: Just the "buff" art on the unit portrait area, which is nice)

Another problem is the timing. An idle unit cannot get the abilities removed because.. it is idle and it's not setting off any of the events I've listed, so. If, for instance, you use a healing salve and stand there until your HP is full, you will still be bleeding until you start moving around again. The timing can get REALLY screwy and sometimes the ability won't remove itself for 30 seconds, or longer. But sometimes it is right on time. It seems random but I *think* it has something to do with the normal delay of a unit losing the effect of an aura after they lose the item/leave the area of the unit granting the aura. /boggle

Help me out here ;) I've tried many variations of the percentage life and it is still random and weird. Would what I mentioned above have a possibility of working? The neutral universal aura? 8)) 8))
11-11-2003, 02:59 AM#4
Grater
To prevent an icon appearing simply use an item ability that isn't also a unit ability. (ie dont use any aura, bash, silence etc item abilities)

Any item ability that isn't actively used (pots..) and isn't also a unit/hero ability doesn't have an icon, generally they can also be added multiple times and the effect stacks (unlike MOST unit abilities). I suggest using such abilities as item move speed bonus, item attack speed bonus, item life regeneration, item damage bonus etc etc these can always be set to no effect making them useful for dummy abilities.

Your aura idea is really kinda bad (no offense hmmm) just add/remove item move speed bonus and item attack speed bonus as the actions.
11-11-2003, 03:18 AM#5
FerretDruid
The reason I used auras is because they do not stack. If I based this off of an item attack speed bonus it would continuously apply the bonus every time a unit initiated my events wouldn't it? Same with item hit point regen. (This is correct?) It also wouldn't have a buff art or buff tip (like an aura does).

I don't see how my idea is bad, in the slightest. If it worked, it would actually be pretty convenient in this situation. What's bad about it?

I still haven't figured out a better way to apply an action from percentage life than the way I have set up, which is sort of troubling. Any solutions to that?
11-11-2003, 09:39 AM#6
Grater
It's pretty easy to ensure no double adding. Two possible ways (and not the only possible ways are)
Create a unit group: bleeding_units. (or whatever)
When the event triggers, first check the triggering unit is not in bleeding_units, then add it to bleeding_units and add the ability.

For the remove event, remove the unit from bleeding_units and remove the ability. (theres no need to check)

Ofcourse you can use two or more unit groups.

The other way is to use the units custom value, 0 = unhurt, 1 = hurt, 2 = really hurt, whatever. And use conditions to ensure the ability is only added/removed when nessecary.

The reason the aura idea is bad is beacuse unit groups are such a powerful tool for doing what you want to.
11-11-2003, 05:15 PM#7
FerretDruid
Bah, unit group variables. Way to make me feel like a newb 8))

You're right, your way is pretty simple. If I do it your way I don't think it will change much from what I've already done though (with my particular abilities).

The abilites I am using are perfect right now with the exception of the icons appearing in the command box - I have looked but I don't see any item abilities that have the same effects without a duration. (ie: boots of speed compared to scroll of speed). This wouldn't be an issue if there were some item abilities *without* a duration that give a percentage increase rather than a set increase. (boots of speed is +60 to move speed, scroll of speed I'm just not sure about, it says increase 2.0 I'm not sure if that is a multiplier or what. Rings of regen, are +2 per second, but no matter what I set this to, lower HP units will always be at a severe disadvantage with this effect)

If I change my abilites from auras to item abilities with durations, and apply them to the unit - the ability will naturally expire after a time because of the duration value? If so, I can't do that without some workaround to counter the duration.

And I still don't understand a way to make the ability get applied in real time the moment a unit reaches a certain HP percentage - this has been my primary problem from the start. I know I could de a Game Time - Every X seconds event but to check something like that on every unit in the map efficiently would be impossible I think.

I appreciate your responses so far :D I've still got some work to do though it seems.

EDIT: Ligatures sig lags the hell out of my browser, I never experienced that before - why is it doing that?
11-11-2003, 05:23 PM#8
Ligature
That's so weird... Biflspud told me the same thing about my new signature... maybe the glow is too complicated
11-11-2003, 05:30 PM#9
FerretDruid
Bah! Keep the sig and help me out ;)
11-11-2003, 07:19 PM#10
Ligature
You need to use the Specific Unit Event - A Unit Takes Damage, and apply it to units that aren't pre-placed on the map by creating a big unit array and using the action Trigger - Add Event. It's tricky, but I've tested it and it works. You can't detect what did the damage, but you can use "triggering unit" to refer to the damaged unit.

(EDIT) Sig!
11-11-2003, 07:49 PM#11
Grater
Checking every unit every second or 2 is nowhere near as impossible as you think. You need to start checking every unit hundreds or thousands of times a second before WC3 starts to croak.

You have to realise WC3 internally does dozens of things to every unit dozens of times a second already (move, life regen, animation, disease/burning, ability cooldowns, auras, the list goes on), and it does it in much the same way as "pick every unit"

So there is absolutely nothing wrong with using a "pick every unit in playable map area" event.

I took the liberty of writing an example, it uses 3 unit groups HealthyUnits, HurtUnits, and VeryHurtUnits, every unit that can be "Hurt" (probably not structures, mechanical or dead) is always in one of unit groups, by keeping the units in the appropriate unit group you dont need to check every condition on every unit group. the trigger might look complicated, but really, it's just long, how it works is simple enough.
Code:
Periodic
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in HeathlyUnits and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Percentage life of (Picked unit)) Less than or equal to 50.00
                    Then - Actions
                        Unit Group - Remove (Picked unit) from HeathlyUnits
                        Unit Group - Add (Picked unit) to HurtUnits
                        -------- Add hurt abilities --------
                    Else - Actions
                        Do nothing
        Unit Group - Pick every unit in HurtUnits and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Percentage life of (Picked unit)) Less than or equal to 20.00
                    Then - Actions
                        Unit Group - Remove (Picked unit) from HurtUnits
                        Unit Group - Add (Picked unit) to VeryHurtUnits
                        -------- Add very hurt abilities - prehaps remove hurt abilities --------
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Percentage life of (Picked unit)) Greater than or equal to 80.00
                            Then - Actions
                                Unit Group - Remove (Picked unit) from HurtUnits
                                Unit Group - Add (Picked unit) to HeathlyUnits
                                -------- Remove hurt abilities --------
                            Else - Actions
                                Do nothing
        Unit Group - Pick every unit in VeryHurtUnits and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Percentage life of (Picked unit)) Greater than or equal to 25.00
                    Then - Actions
                        Unit Group - Remove (Picked unit) from VeryHurtUnits
                        Unit Group - Add (Picked unit) to HurtUnits
                        -------- Remove veryhurt abilities, prehaps add hurt abilities --------
                    Else - Actions
                        Do nothing

You also need a couple of other triggers:
(and possibly more)
Code:
Fleshy Unit enters map
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A structure) Equal to False
        ((Triggering unit) is Mechanical) Equal to False
    Actions
        Unit Group - Add (Triggering unit) to HeathlyUnits

Unit dies
    Events
        Unit - A unit Dies
    Conditions
    Actions
        -------- It doesn't matter if you try to remove a unit from a unit group it isn't in. --------
        Unit Group - Remove (Dying unit) from HeathlyUnits
        Unit Group - Remove (Dying unit) from HurtUnits
        Unit Group - Remove (Dying unit) from VeryHurtUnits
11-11-2003, 08:02 PM#12
FerretDruid
I'll take your word for it about the lag, perhaps I shouldn't have assumed that the engine would cough checking so much at once.

I'll give your example an honest try and see how it works - I will have to customize it a bit :D but it looks like it will clear up my problems.
11-11-2003, 09:35 PM#13
FerretDruid
I owe you one !! That trigger is perfect, and like 10x better than my old one - which was almost perfect. Amazing!

...and now I have an idea to get around the icons appearing in the command menu! But I'll make a new topic later about it... It involves giving every normally blank command button space (ie: abilities that have not been learned yet, or the spot under the "stop" button) an "idle" icon until they become populated with the icon that SHOULD be there. But they will all be the same, so it won't matter what space the icon is in. Hrmmm. Actually, are there any icons that are just black spaces? That should work also.. I think. I'll have to check it out. OMG I'm still happy about my abilities working how I want them to. :D 8)) ;)