Last buffed unit?

saw792

Is known to say things. That is all.
Reaction score
280
Is there any way to get 'Last Buffed Unit' or the last unit buffed with a specific buff in the trigger editor (or jass, if that's the only way)? The idea is that a multiple units are given a buff one after the other through a spell that doesn't target them. The last unit to be effected has another action applied to it. Any ideas?
 

Tyman2007

Ya Rly >.
Reaction score
74
Try using a unit array and setting the buffed unit like if its giving a buff through an ability you could use "Target unit of ability being cast" or "Triggering unit" if its the casting units.
 

saw792

Is known to say things. That is all.
Reaction score
280
As I said in the question the units are given the buff without being targeted. The spell has a glaive effect and applies the buff to each unit struck by the glaive, and causes another effect on the final unit. Thus, since only the first unit is targeted by the spell the best way I could think to apply an action to the last unit would be to 'get' the last buffed unit.
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
I will be helping you don't worry... last question... how many times does it bounce including the last target
 

saw792

Is known to say things. That is all.
Reaction score
280
The bounces change every level (3, then 4, then 5).
 

denmax

You can change this now in User CP.
Reaction score
155
Is this somehow in a line? Or a bounce? or does it have a limit of units? etc..

A line "last buffed unit" would be hard as hell, but not bounce and unit limit is quite easy since that it has a constant value of targets..
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
Sorry for Double Posting/Replying



Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to BUff 
    Actions
        Set Bounces = 0
        Set unit_casting = (Casting unit)
        Set Caster_Position = (Position of unit_casting)
        Set unit_target = (Target unit of ability being cast)
        Set Bounces = (Bounces + 1)
        Unit - Create 1 Dummy Unit for (Owner of unit_casting) at (Position of unit_casting) facing Default building facing degrees
        Unit - Add Inner Fire to (Last created unit)
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Unit - Order (Last created unit) to Human Priest - Inner Fire unit_target
        Countdown Timer - Start Timer as a Repeating timer that will expire in 0.40 seconds



Code:
Untitled Trigger 002
    Events
        Time - Timer expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Bounces Less than (2 + (Level of BUff  for unit_casting))
            Then - Actions
                Set Temp_Group = (Units within 500.00 of (Position of unit_target) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Match
                Set unit_target = (Random unit from Temp_Group)
                Set Bounces = (Bounces + 1)
                Unit - Create 1 Dummy Unit for (Owner of unit_casting) at (Position of unit_target) facing (Position of unit_target)
                Unit - Add Inner Fire to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Priest - Inner Fire unit_target
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Bounces Equal to (2 + (Level of BUff  for unit_casting))
                    Then - Actions
                        Set Temp_Group = (Units within 500.00 of (Position of unit_target) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Match
                        Set unit_target = (Random unit from Temp_Group)
                        Unit - Kill unit_target
                        Game - Display to (All players) the text: that is all folks  
                        Countdown Timer - Pause Timer
                    Else - Actions
                        Do nothing


Variables:

Bounces [Integer]
Caster Position[Point]
Temp Group[Unit Group]
Timer[Timer]
unit_casting[unit]
unit_target[unit]


set dummy unit's cast back swing and cast point both to 0


and... well.. theres .4second delay. in those successive cast OH WAIT THERES SOMETHING THAT WAS CUTTED!

Code:
Set Temp_Group = (Units within 500.00 of (Position of unit_target) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Matching unit) not equal to (unit_casting) and (((matching unit) not equal to (unit type of dummy unit)

use this complete temp group, and replace the temp group above.
 

saw792

Is known to say things. That is all.
Reaction score
280
Thanks demo, the only problem is with the visual effects. Your trigger picks a random unit in Temp_Group but the glaive effect of the ability may not strike that unit if there are too many units in the group. Thus there could be units not hit with the glaive that have the buff and not buffed hit by the glaive.
 

denmax

You can change this now in User CP.
Reaction score
155
Sorry for Double Posting/Replying



Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to BUff 
    Actions
        Set Bounces = 0
        Set unit_casting = (Casting unit)
        Set Caster_Position = (Position of unit_casting)
        Set unit_target = (Target unit of ability being cast)
        Set Bounces = (Bounces + 1)
        Unit - Create 1 Dummy Unit for (Owner of unit_casting) at (Position of unit_casting) facing Default building facing degrees
        Unit - Add Inner Fire to (Last created unit)
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Unit - Order (Last created unit) to Human Priest - Inner Fire unit_target
        Countdown Timer - Start Timer as a Repeating timer that will expire in 0.40 seconds



Code:
Untitled Trigger 002
    Events
        Time - Timer expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Bounces Less than (2 + (Level of BUff  for unit_casting))
            Then - Actions
                Set Temp_Group = (Units within 500.00 of (Position of unit_target) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Match
                Set unit_target = (Random unit from Temp_Group)
                Set Bounces = (Bounces + 1)
                Unit - Create 1 Dummy Unit for (Owner of unit_casting) at (Position of unit_target) facing (Position of unit_target)
                Unit - Add Inner Fire to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Priest - Inner Fire unit_target
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Bounces Equal to (2 + (Level of BUff  for unit_casting))
                    Then - Actions
                        Set Temp_Group = (Units within 500.00 of (Position of unit_target) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Match
                        Set unit_target = (Random unit from Temp_Group)
                        Unit - Kill unit_target
                        Game - Display to (All players) the text: that is all folks  
                        Countdown Timer - Pause Timer
                    Else - Actions
                        Do nothing


Variables:

Bounces [Integer]
Caster Position[Point]
Temp Group[Unit Group]
Timer[Timer]
unit_casting[unit]
unit_target[unit]


set dummy unit's cast back swing and cast point both to 0


and... well.. theres .4second delay. in those successive cast OH WAIT THERES SOMETHING THAT WAS CUTTED!

Code:
Set Temp_Group = (Units within 500.00 of (Position of unit_target) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Matching unit) not equal to (unit_casting) and (((matching unit) not equal to (unit type of dummy unit)

use this complete temp group, and replace the temp group above.

Wait wait wait, for the last bounce, it would kill the unit??

Great lol :D..

Well, he didn't say what kind of buffs lol :D..

And of course, the leaks, but I think you'd ignore it since it's not even your tirgger lol :D..

anyway, LEAKLESS TRIGGER..

Code:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to BUff 
    Actions
        Set Bounces = 0
        Set unit_casting = (Casting unit)
        Set Caster_Position = (Position of unit_casting)
        Set unit_target = (Target unit of ability being cast)
        Set Bounces = (Bounces + 1)
        Unit - Create 1 Dummy Unit for (Owner of unit_casting) at (Position of unit_casting) facing Default building facing degrees
        Unit - Add Inner Fire to (Last created unit)
        Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
        Unit - Order (Last created unit) to Human Priest - Inner Fire unit_target
        Countdown Timer - Start Timer as a Repeating timer that will expire in 0.40 seconds



Code:
Untitled Trigger 002
    Events
        Time - Timer expires
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Bounces Less than (2 + (Level of BUff  for unit_casting))
            Then - Actions
                [B]Set unit_targetLOC = (Position of (unit_target))[/B]
                Set Temp_Group = (Units within 500.00 of ([B]unit_targetLOC[/B]) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Matching unit) not equal to (unit_casting) and (((matching unit) not equal to (unit type of dummy unit)
                Set unit_target = (Random unit from Temp_Group)
                Set Bounces = (Bounces + 1)
                Unit - Create 1 Dummy Unit for (Owner of unit_casting) at (unit_targetLoc) facing (unit_targetLOC)
                Unit - Add Inner Fire to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Human Priest - Inner Fire unit_target
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Bounces Equal to (2 + (Level of BUff  for unit_casting))
                    Then - Actions
                        [B]Set unit_targetLOC = (Position of (unit_target))[/B]
                        Set Temp_Group = (Units within 500.00 of ([B]unit_targetLOC[/B]) matching ((((Matching unit) belongs to an ally of (Owner of unit_target)) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Inner Fire) Equal to False) and (((Matching unit) not equal to (unit_casting) and (((matching unit) not equal to (unit type of dummy unit)
                        Set unit_target = (Random unit from Temp_Group)
                        Unit - Kill unit_target
                        Game - Display to (All players) the text: that is all folks  
                        Countdown Timer - Pause Timer
                    Else - Actions
            [B]Custom Script: call RemoveLocation(udg_unit_targetLOC)
            Custom Script: call RemoveLocation(udg_Caster_Position)
            Custom Script: call DestroyGroup(udg_Temp_Group)[/B]

EDIT:

"Thanks demo, the only problem is with the visual effects. Your trigger picks a random unit in Temp_Group but the glaive effect of the ability may not strike that unit if there are too many units in the group. Thus there could be units not hit with the glaive that have the buff and not buffed hit by the glaive."

Doesn't the Glaive strike a random unit in Temp_Group? Then the problem would be about the timer, since sometimes the glaive could be overrun and may take more than 0.4 seconds..
 

saw792

Is known to say things. That is all.
Reaction score
280
He wasn't making the trigger for me so much as showing me how it would be done. I am quite capable of fixing the leaks and changing the buffs, etc. The glaive / buff problem, however, not so much :)

Thanks for showing interest in my thread. Appreciate it.
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
Hehehe.... I always make Cheesy Beefy do the Leakless version, he is awesome!.


about the spell.. so i guess you want the units to get hit not once, but a few times..... then remove the unit has a specific buff =???

about special effect.

Set unit_target = (Random unit from Temp_Group)
Set Bounces = (Bounces + 1)
create special effect at position of unit_target
destroy special effect
 

denmax

You can change this now in User CP.
Reaction score
155
EDIT:

"Thanks demo, the only problem is with the visual effects. Your trigger picks a random unit in Temp_Group but the glaive effect of the ability may not strike that unit if there are too many units in the group. Thus there could be units not hit with the glaive that have the buff and not buffed hit by the glaive."

Doesn't the Glaive strike a random unit in Temp_Group? Then the problem would be about the timer, since sometimes the glaive could be overrun and may take more than 0.4 seconds..

The solution is another big type of trigger, which would give at least one damage to the target so that it could detect the event "takes damage" from an invisible dummy unit that did fire the glaive, since it is detected, the glaive will bounce to another random unit..

Problem, I have no idea how..
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top