• 0

    posted a message on How does "Last Attacker" work?

    KratsAU you can thank Blizzard for the new patch!

    from the patch notes:

    • Added a trigger event when an effect executes.

    So when your effect occurs, get the damaging unit (should be working now)

    Posted in: Triggers
  • 0

    posted a message on Capture point pings

    I was thinking of something like this:
    You store the owners player number as an integer for each point and check if the new pointclaimer is owner of the previous points.

    Events
    Unit - Any Unit Enters within 10.0 of Point 003
    Local Variables
    Conditions
    (Owner of (Triggering unit)) == Point[1]
    (Owner of (Triggering unit)) == Point[2]
    OR
    (Owner of (Triggering unit)) == Point[4]
    Actions
    Variable - Set Point[3] = (Owner of (Triggering unit))

    The only problem would be that, it only runs the trigger if you enter it, not while you are on it. But you can wait for the condition(s) to happen every x game seconds with another action function.

    Posted in: Triggers
  • 0

    posted a message on Hellion with Nuke
    Quote from 177348 »
    I'm trying to make a new ability for hellions. A sort of Ghosts' Nuke
    without requirements and with a time cooldown before to use it again.
    So... I duplicated the "Ghost - Nuclear Strike" ability and:
    1) Removed requirements in Commands+.
    2) Removed "Effect - Calldown Effect".
    3) Changed "Effect - Effect" to "Ghost - Nuke (Persistent)". Now, the nuclear bomb starts from the hellion and hits the targeted
    location. To complete my work I need to understand how to:
    - Avoid that Hellion dies (something to do with "Ghost - Nuke (Suicide)"
    maybe?) when the bomb hits the ground.

    Are you sure the nuke does not kill the Helion? A ghost isn't killed by the nuke, so a helion shouldn't too.
    If you really think the Suicide effect kills the Helion, try to set Nuke (damage) Amount to 0
    Under search you should be able to not target Player and Allies.
    Quote:- Make the Hellion's turret rotate to the targeted point's direction and
    raise before the bomb is launched (because the bomb goes up in the sky).
    - Reduce the bomb size (missile and smoke) to fit the Hellion's turret.
    Go to actors, search for 'Nuke' reduce the scale under the "Art" tab
    Quote:- Reduce the explosion effect to make it smaller (it's a mini-nuke,
    after all).
    Same story here actor is named "Ghost nuke Explode"
    Quote:- Reduce the time the Hellion must not move (only 3/5 seconds... not
    until the bomb explodes).
    Well its a channeling spell, maybe you could reduce the 2,5sec finish time under stats?
    Quote:Can someone help me through those steps?
    Many, many thanks in advance!
    Posted in: Data
  • 0

    posted a message on How do I make a unit move?
    Quote from Gurrgel: Go

    For your second question, the Set Player Resources action you found is
    the right one. To add to the already existing amount, set the amount
    given to Arithmetic, and set one of the two values to the amount you
    want him to gain (1000 in your case) + the other value, which you set to
    player property (think thats the name, should be able to find minerals
    or which ever resource it is you're adding).

    As I said, I'm not at the editor right now, but hopefully the terms I
    used aren't too far from the truth.

    He only has to change "set to" to "Add"

    Posted in: Triggers
  • 0

    posted a message on How To Pool Resources

    @boparooski:

    Maybe this topic can be of help:
    http://forums.sc2mapster.com/development/triggers/11151-problems-with-shared-minerals/#p6

    It differs from what you want though: a total pool for everyone instead of diving resources.
    So I've thought of the following, you'll need 2 vars for gas and minerals. One for the Pool and one per player in an array.
    Edit: I thought of this after all i wrote the following down, but, you'd have to set the mineralsPool variable sometime so: You could just use that instead of the 500.

    Melee Initialization
    Events
    Game - Map initialization
    Local Variables
    Conditions
    Actions
    Player Group - For each player (Number of players in (All players)) in (All players) do (Actions)
    Actions
    Variable - Set mineralsPOOL = (mineralsPOOL + (Player (Picked player) Minerals))
    Player - Modify player (Picked Player) Minerals: Set To mineralsPOOL

    Pool changes
    Events
    Player - Player (Number of players in (All players)) Minerals changes
    Local Variables
    Conditions
    Actions
    Variable - Set mineralsp1spent = mineralsPOOL - (Player (Triggering player) Minerals))
    Variable - Set mineralsPOOL = (mineralsPOOL - mineralsp1spent)
    Player - Modify Player (Number of players in (All players)) Minerals: mineralsPOOL

    In addition: don't make a trigger for each player, player groups will be more helpful here.
    Disregard the rest (i will keep it in the post, untill i spot an error)


    Give every player a max of 500 minerals and gas, and add/substract everytime they mine above that and add that to the 2 vars. Everytime the property minerals is used, condition: mineralpoolvar >= 500 Hmm this condition wont work if you somehow end up in minus... BIG PROBLEM

    second trigger:
    Melee Initialization 2
    Events
    Player - Player 1 Minerals changes
    Local Variables
    Conditions
    mineralsPOOL <= 0
    Actions
    Variable - Set mineralsp1spent = (500 - (Player (Triggering player) Minerals))
    Variable - Set mineralsPOOL = (mineralsPOOL - mineralsp1spent)
    Player - Modify player 1 Minerals: Set To 0
    Turn off the 2 above triggers

    New trigger/In debt:
    In debt 1
    Events
    Player - Player 1 Minerals changes
    Local Variables
    Conditions
    mineralsPOOL <= 0
    Actions
    Variable - Set mineralsp1spent = (0 - (Player (Triggering player) Minerals))
    Variable - Set mineralsPOOL = (mineralsPOOL - mineralsp1spent)
    Player - Modify player 1 Minerals: Set To 0

    In debt 2
    Events
    Player - Player 1 Minerals changes
    Local Variables
    Conditions
    mineralsPOOL > 0
    Actions
    Variable - Set mineralsp1spent = (0 - (Player (Triggering player) Minerals))
    Variable - Set mineralsPOOL = (mineralsPOOL - mineralsp1spent)
    Player - Modify player 1 Minerals: Set To 500
    Turn off the in debt triggers, turn on first 2 triggers

    They'll have to mine untill the pool is above 0 again and cant spent that way, if the pool then reaches 0 again the first trigger fires up again. You could also change that to 50, since most cheap units cost that much.--

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?

    <<reply 177900>>
    "Thats what I said earlier"
    Cant find where you said that

    Anyhow, it triggers every time the unit is attacked, so also the "last time" the hero is attacked.

    If you want to be more precise you could make an event for " 'Unit in Unit Group' (hero unit group) is attacked" or 'each hero' (in a unit array). That way it wont fire up that much. So if you want to be really sure that the last attacker is indeed the "killer", is the unit turned invulnerable when the effect occurs?
    Because I guess the reason you're asking is because the trigger doesn't work well this way?

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?

    <<quote 177363>>

    Yeah I think I've tried that one as well, the problem is Last Attacker
    is always empty for some reason. Is it supposed to be a number?
    <</quote>>
    According to the trigger, it should return a specific unit.

    So I've tested some different triggers, this is an example of a simple one:
    Untitled Trigger 001
        Events
            Unit - Marauder [44.69, 29.75] is attacked
        Actions
            Unit - Kill (Returns the unit who last attacked the specified unit Marauder [44.69, 29.75])
    And the action seems broken, or at least not useable for user players.

    So we will have to look at a different trigger.

    Further testing:
        Events
            Unit - Any Unit is attacked
        Local Variables
        Conditions
            ((Triggering unit) can create Sentry - Guardian Shield (Apply Behavior) on Sentry [42.17, 19.83]) == true
        Actions
            Unit - Kill (Attacking Unit)
    If you use 'Attacking Unit' instead of 'Last Attacker' it will return the correct Unit. However, Attacking Unit really requires the 'Unit is Attacked' Event. This will trigger everytime a unit is attacked. You'll have to make good conditions to get it work correctly.

    Posted in: Triggers
  • 0

    posted a message on Play specific Death Animation while get killed

    <<reply 177334>>
    afaik there is no trigger for death animations. What you can do is create an action that aplies acid damage.
    for example:
    dublicate "Roach - Needle Spines (Damage)" and change the amount (of damage it deals) under Combat too -1 (that should be infinite damage, otherwise change it to a million or something)

    Action:
            Environment - Execute Roach - Acid Spines (Damage) Copy on (Triggering unit) from (Triggering unit)

    downside: It won't kill unvulnerable units

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?

    <<quote 177297>>

    Of course I have used conditions, but that doesn't help when there is no
    suitable event.

    The unit has the behavior to begin with, that's how it works.

    Your hero has a behavior that stops them for dying,
    This behavior can do an effect when the fatal blow occurs
    You can use this effect to produce a damage dummy effect that causes 0
    damage to your unit, this is the only way to detect it via a trigger
    afaik

    The problem is that it appears to be the Hero itself that creates the
    dummy damage effect that lets you get the trigger, so there is no link
    back to the unit that did the fatal damage to your hero.
    <</quote>>
    So the behaviour is passive and will give you an effect.
    The real problem will be finding a good Event (with or without a condition).
    Maybe you could give this one a shot?

    Untitled Trigger 001
        Events
            Unit - Any Unit specialization progress is Completed
        Local Variables
        Conditions
            (Triggering progress effect) == dummy damage effect
        Actions
            Variable - Set Player #[(Owner of (Returns the unit who last attacked the specified unit (Triggering unit)))][0] = Player #[(Owner of (Triggering unit))][(+ (1))]

    Posted in: Triggers
  • 0

    posted a message on How to make Multiple Dialog Buttons and multiple players work?
    Quote from Yaos01: Go

    @DrTrunks: Wow. You should definitivly take a look at the "For" loop function.

    'For each player in player group' is a For loop too, depending on what you are doing you could use an integer for players too.

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?

    <<quote>>Unit - Any Unit Enters (respawn area) and Unit - Any Unit is being
    removed from the game aren't really any use because I need to be able to
    detect that they have been made unconscious to begin with. Since there
    is no event for behaviors being applied you can only do this in
    roundabout way.

    When does a unit is revived fire? I assumed this was after a unit gets
    back up, back I guess it could fire when they actually take the kiling
    blow since the combat response is stopping them from dying.<</quote>>

    There is no event that fires specifically for a behaviour, thats why you use conditions to filter on the behaviour. Do you never use conditions?
    To be honest, I haven't used revived myself.

    Quote:

    It's easy to test, pick any unit, create a behavior for it, edit the combat response field and tick "Fatal". This will stop the unit from dying and allows you to handle what happens on a fatal blow.

    Who applies this behaviour? Target, Source Unit, Caster?

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?

    <<quote 177253>>

    This basically means the hero never dies, so you can't use that event.
    Also it's done via a behiavior which hooks into the combat response, and
    I haven't found any way of referencing the unit that caused the damage,
    resulting in the combat response firing.
    <</quote>>

    Well you can test the condition i used earlier.

        Events
                    Unit - Any Unit is revived
    or
            Unit - Any Unit Enters (respawn area)
    or
            Unit - Any Unit is being removed from the game

    try to get an event that doesnt put too much stress on the game (not any unit takes damage for instance)

        Local Variables
        Conditions
                    ((Triggering unit) behavior 1) == iamdeadbehaviour
        Actions
                    Variable - Set Player #[(owner of (last attacker))]][0] = Player #[(owner of (last attacker))][+ 1]

    (i dont know if you want to save it in an integer array like this or load it into a data table)

    The only thing that could obstruct this trigger is that the hero that died, is attacked after he 'dies'.

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?
    Quote from KratsAU: Go

    Quote from DrTrunks: Go

    @KratsAU: Go If an event gives you a 'triggering player' you can get the 'last attacker'.

    I don't think this is the case, I've had events with triggering player but the last attacker was still empty.

    Anyhow it's not going to be enough for what I want so i'll stick with recording it manually.

    woops, did I write player? i meant UNIT. You need a unit that has been attacked, not a player.

    What are you trying to do? Maybe there is another solution.

    Posted in: Triggers
  • 0

    posted a message on How to make Multiple Dialog Buttons and multiple players work?
    Quote from darkdemondd: Go

    on a side note question, does anyone know where to edit Talents? for instance the Reaper Nitro Pack upgrade i cannot find anywhere(i have story and campaign depends enabled) and it says its listed as a talen and i need to edit the cost of it but i am unable to locate it.

    Its an upgrade, not a talent. In the data editor go to upgrades, search for reaper and go to the Cost tab.

    Posted in: Triggers
  • 0

    posted a message on How does "Last Attacker" work?
    Quote from KratsAU: Go

    Ahh okay, so it doesn't work for the normal generic attack command that doesn't add any behaviors etc?

    I ended up just storing the last attacker in a global, couldn't find any other way to get the last attacker :(

    You dont need a condition that ws just an example. If you leave out the condition, any unit (watch the event!) that attacks gets killed according to that previous trigger. You can adjust the condition and action to your will.

    But only certain events will give you a last attacker e.g. 'unit dies' 'unit property changes' 'unit uses ability' If an event gives you a 'triggering unit' you can get the 'last attacker'.

    Posted in: Triggers
  • To post a comment, please or register a new account.