Help With An Ability

Jagan

New Member
Reaction score
30
Hi people, I am trying to trigger a aura/passive spell that adds 1 Agility to my hero for every friendly unit in an AoE. Can someone point me in the right direction? I don't particularly need a testmap or anything, for I am just hoping to learn something from the many veterans around here.

Thanks in advance. :)
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
You'd have to check when a unit has the buff/ability and then pick every unit within x of the unit which has it, and add agility... But i'm not really sure since i never did such a spell.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
You can use a dummy ability, which will be an aura, then have a trigger, trigger upon learning the dummy ability that will give Item Add Agility, or w/e, to the allied units.


Not sure if this will work, but...


Code:
Untitled Trigger 001
    Events
        Unit - A unit Learns a skill
        Unit - A unit Starts the effect of an ability
    Conditions
        ((Triggering unit) has buff Agi Detect ) Equal to True
        (Ability being cast) Equal to Endurance Aura
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked player) is an ally of (Triggering player)) Equal to True)) and do (Unit - Add Item Agility Gain to (Triggering unit))
 

Jagan

New Member
Reaction score
30
Hmm can't seem to set the level of the Add Agility ability right. It stays at level 1.

Code:
Soul Empowerment Setup
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Soul Empowerment (Soul Stealer)
    Actions
        Set SoulEmpowermentCaster = (Learning Hero)
        Trigger - Turn on Soul Empowerment Effects <gen>
        Trigger - Turn on Soul Empowerment Cancel <gen>


Code:
Soul Empowerment Effects
    Events
        Time - Every 0.25 seconds of game time
    Conditions
    Actions
        Set SoulEmpowermentGroup = (Units within 1000000000.00 of (Center of (Entire map)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Soul Empowerment ) Equal to True)))
        Unit Group - Pick every unit in SoulEmpowermentGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in SoulEmpowermentGroup) Less than or equal to 15
                    Then - Actions
                        Unit - Add Soul Empowerment (Bonus Agility) to SoulEmpowermentCaster
                        Unit - Set level of Soul Empowerment (Bonus Agility) for SoulEmpowermentCaster to (Number of units in SoulEmpowermentGroup)
                    Else - Actions


Code:
Soul Empowerment Cancel
    Events
        Time - Every 0.25 seconds of game time
    Conditions
        (Number of units in SoulEmpowermentGroup) Equal to 0
    Actions
        Unit - Remove Soul Empowerment (Bonus Agility) from SoulEmpowermentCaster


Help? :)


EDIT: @Renendaru - It's a passive/aura spell. But thanks for trying. Can you take a look at my codes so far?
 

ThePlague

New Member
Reaction score
14
cant see anything wrong in your code but why not use
Hero-Modify Hero attribute instead of an ability?
 

HappyPeasant

New Member
Reaction score
8
um...
why not just make a trigger that checks 500 around caster. set int var = number of units. then add int # to agi....
 

demotry241

Don't Ever Categorize Yourself.
Reaction score
105
huhu.. let me try.


every 2 seconds of game time

condition

action

set DAGROUP = units in whole map with matching condition, matching unit level of (da dammi ability) is more or equal to 1,and matching unit is alive.

pick all units in da group

loop
set 2nd Da Group = units within 600 range of picked unit matching condition matching unit is an ally of picked unit = true and alive.
------
set level of agility bonus of picked unit to number of units in 2nd da group,


then just destroy leaks....


unit learns an ability

ability being learn = da dummy ability

add ability ( agility bonus) to triggering unit

set level of ability(agility bonus) for trigerring unit to 1

level 1 of that agility bonus must add 0 bonuses
 

Jagan

New Member
Reaction score
30
Thanks a lot, guys. I'll get back to you as soon as I try them out! :)
 

Jagan

New Member
Reaction score
30
Hmm.. It still doesn't set the ability level right. The count for the number of units in the group is accurate but somehow the leveling seems to be bugged. Can some check it out for me? These are the updated codes. I'll upload the map if this still doesn't work.

Code:
Soul Empowerment Setup
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Soul Empowerment (Soul Stealer)
    Actions
        Set SoulEmpowermentCaster = (Learning Hero)
        Trigger - Turn on Soul Empowerment Effects <gen>
        Set SoulEmpowermentMaxUnitNumber = 25
        Countdown Timer - Start SoulEmpowermentTimer as a Repeating timer that will expire in 0.50 seconds

Code:
Soul Empowerment Effects
    Events
        Time - SoulEmpowermentTimer expires
    Conditions
    Actions
        Unit - Remove Soul Empowerment (Bonus Agility) from SoulEmpowermentCaster
        Set SoulEmpowermentGroup = (Units within 1000000000.00 of (Center of (Entire map)) matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of SoulEmpowermentCaster)) Equal to True)) and (((Matching unit) has buff Soul Empowerment ) Equal
        Set SoulEmpowermentUnitsNumber = (Number of units in SoulEmpowermentGroup)
        Unit Group - Pick every unit in SoulEmpowermentGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SoulEmpowermentUnitsNumber Greater than 0
                    Then - Actions
                        Game - Display to (All players) for 3.00 seconds the text: (String(SoulEmpowermentUnitsNumber))
                        Unit - Add Soul Empowerment (Bonus Agility) to SoulEmpowermentCaster
                        Unit - Set level of Soul Empowerment (Bonus Agility) for SoulEmpowermentCaster to SoulEmpowermentUnitsNumber
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                SoulEmpowermentUnitsNumber Greater than SoulEmpowermentMaxUnitNumber
                            Then - Actions
                                Unit - Set level of Soul Empowerment (Bonus Agility) for SoulEmpowermentCaster to SoulEmpowermentMaxUnitNumber
                            Else - Actions
        Unit Group - Remove all units of SoulEmpowermentGroup from SoulEmpowermentGroup
        Set SoulEmpowermentUnitsNumber = 0

Thanks again.

EDIT: Am using a custom Attribute Bonus for the bonus agility, just in case that was of any importance.
 

Jagan

New Member
Reaction score
30
Ermmm...bump? Any help, guys? Would really like to get this spell to work. It's the final spell for my hero. I'd willingly +Rep for anyone who contributes a hand. :)
 

Jagan

New Member
Reaction score
30
Erm, please specify exactly? I don't quite get it. Sorry, I'm not exactly a pro when it comes to triggers yet.

I don't get why it doesn't work. It counts the number of units in the group and also adds the bonus agility spell correctly, but somehow the level just can't be set according to the number of units. Weird.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
If Number greater than Max
- Set Number = Max
If Number less than 1 then
- Set Number = Max

Unit - Add ability ... to Caster
Unit - Set level of Ability ... for Caster to Number


The loop is not needed.
Or did I miss something here?
 

Jagan

New Member
Reaction score
30
If Number greater than Max
- Set Number = Max
If Number less than 1 then
- Set Number = Max


Unit - Add ability ... to Caster
Unit - Set level of Ability ... for Caster to Number


The loop is not needed.
Or did I miss something here?

Errr...wouldn't that make having 0 allied units nearby set the level of the bonus agility to max as well?
 

Jagan

New Member
Reaction score
30
Code:
Soul Empowerment Effects
    Events
        Time - SoulEmpowermentTimer expires
    Conditions
    Actions
        Unit - Remove Soul Empowerment (+1 Agility) from SoulEmpowermentCaster
        Set SoulEmpowermentGroup = (Units within 1000000000.00 of (Center of (Entire map)) matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of SoulEmpowermentCaster)) Equal to True)) and (((Matching unit) has buff Soul Empowerment ) Equal
        Set SoulEmpowermentUnitsNumber = (Number of units in SoulEmpowermentGroup)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                SoulEmpowermentUnitsNumber Greater than 0
            Then - Actions
                Game - Display to (All players) for 3.00 seconds the text: (String(SoulEmpowermentUnitsNumber))
                Unit - Add Soul Empowerment (+1 Agility) to SoulEmpowermentCaster
                Unit - Set level of Soul Empowerment (+1 Agility) for SoulEmpowermentCaster to SoulEmpowermentUnitsNumber
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SoulEmpowermentUnitsNumber Greater than SoulEmpowermentMaxUnitNumber
                    Then - Actions
                        Unit - Set level of Soul Empowerment (+1 Agility) for SoulEmpowermentCaster to SoulEmpowermentMaxUnitNumber
                    Else - Actions
        Unit Group - Remove all units of SoulEmpowermentGroup from SoulEmpowermentGroup
        Set SoulEmpowermentUnitsNumber = 0

Still doesn't work. Hmm or did I get your message wrongly? It still only adds the ability and does not set the level properly.
 
General chit-chat
Help Users
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top