Jordguitar

Member
Reaction score
0
Hello, I'm trying to make a trigger for the ability "Storm Bolt", but I can't seem to get it to work.
It's supposed to have the mountain king being able to detect when a hero drops below a certain amount of health, and then storm bolt them.
But instead he just throws storm bolts at anything at full health and even at random footmen.

Thanks for help!


Storm Bolt
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A Hero) Equal to True
(Distance between (Position of Unit_MountainKing) and (Position of (Attacked unit))) Less than or equal to 800.00
((Attacked unit) belongs to an enemy of Player_MountainKing) Equal to True
(Mana of Unit_MountainKing) Greater than or equal to 75.00
Actions
Hero - Learn skill for Unit_MountainKing: Human Mountain King - Storm Bolt
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Storm Bolt for Unit_MountainKing) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Attacked unit)) Less than or equal to 100.00
Then - Actions
Unit - Order Unit_MountainKing to Human Mountain King - Storm Bolt (Attacked unit)
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Storm Bolt for Unit_MountainKing) Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Attacked unit)) Less than or equal to 225.00
Then - Actions
Unit - Order Unit_MountainKing to Human Mountain King - Storm Bolt (Attacked unit)
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Storm Bolt for Unit_MountainKing) Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Attacked unit)) Less than or equal to 350.00
Then - Actions
Unit - Order Unit_MountainKing to Human Mountain King - Storm Bolt (Attacked unit)
Else - Actions
Do nothing
Else - Actions
Do nothing
 

Jordguitar

Member
Reaction score
0
I have three abilities now that doesn't work properly, they all have in common that they trigger when something is attacked, but it doesn't seem like they check for conditions. Not sure what I'm doing wrong
 

Jordguitar

Member
Reaction score
0
This doesn't work either, he keeps storm bolting random units, not heros.

MOUNTAIN KING
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Hero - Learn skill for Unit_MountainKing: Human Mountain King - Storm Bolt
Unit Group - Pick every unit in (Units within 800.00 of (Position of Unit_MountainKing) matching ((((Owner of (Matching unit)) is an enemy of Player_MountainKing) Equal to True) and ((((Matching unit) is A Hero) Equal to True) and ((Life of (Matching unit)) Less than 100.00)))) and do (Actions)
Loop - Actions
Unit - Order Unit_MountainKing to Human Mountain King - Storm Bolt (Picked unit)
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
Why do you learn the ability every 0.1 seconds?

Could it be that other triggers mess with this one?

Both of these versions work perfectly fine for me:
Trigger:
  • StormBolt
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to Mountain King 0000 <gen>
      • ((Triggering unit) is A Hero) Equal to True
      • ((Triggering unit) belongs to an enemy of (Owner of Mountain King 0000 <gen>)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Less than or equal to 350.00
        • Then - Actions
          • Unit - Order Mountain King 0000 <gen> to Human Mountain King - Storm Bolt (Triggering unit)
        • Else - Actions


Trigger:
  • StormBolt
    • Events
      • Time - Every 0.75 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of Mountain King 0000 <gen>) matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is alive) Equal to True) and ((Life of (Matching unit)) Less than or equal to 300.00)))) and do (Actions)
        • Loop - Actions
          • Unit - Order Mountain King 0000 <gen> to Human Mountain King - Storm Bolt (Picked unit)
 
Last edited:

Jordguitar

Member
Reaction score
0
That was just so he levels the ability to do maximum damage all the time
I don't think other triggers are messing with it, I've checked everything. Maybe it could be because of memory leaks? Not sure if that's possible.
In your first trigger, why is
  • (Life of (Triggering unit)) Less than or equal to 350.00

    In a seperate condition?
    And what's the difference of the triggering and attacking unit in "a unit is attacked" event?
    Just trying to understand, quite new to map making x)
 

Jordguitar

Member
Reaction score
0
I've been working on a better one, but he keeps storm bolting full life heros, and random ghouls for a reason I don't understand


Storm Bolt
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A Hero) Equal to True
((Attacked unit) belongs to an enemy of (Owner of Unit_MountainKing)) Equal to True
(Attacked unit) Not equal to Unit_MountainKing
(Percentage life of (Attacked unit)) Less than 30.00
(Mana of Unit_MountainKing) Greater than 75.00
Actions
Set StormBoltAttacked_Unit = (Attacked unit)
Set StormBolt_Point[0] = (Position of StormBoltAttacked_Unit)
Set StormBolt_Point[1] = (Position of Unit_MountainKing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unspent skill points of Unit_MountainKing) Greater than or equal to 0
Then - Actions
Hero - Learn skill for Unit_MountainKing: Storm Bolt (Mountain King)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between StormBolt_Point[0] and StormBolt_Point[1]) Less than 800.00
Then - Actions
Unit - Order Unit_MountainKing to Human Mountain King - Storm Bolt StormBoltAttacked_Unit
Unit - Order Unit_MountainKing to Attack StormBoltAttacked_Unit
Else - Actions
Do nothing
Custom script: call RemoveLocation(udg_StormBolt_Point[0])
Custom script: call RemoveLocation(udg_StormBolt_Point[1])
Set StormBoltAttacked_Unit = No unit
Trigger - Turn off (This trigger)
Wait 9.00 seconds
Trigger - Turn on (This trigger)
 

Accname

2D-Graphics enthusiast
Reaction score
1,463
That was just so he levels the ability to do maximum damage all the time
I don't think other triggers are messing with it, I've checked everything. Maybe it could be because of memory leaks? Not sure if that's possible.
In your first trigger, why is
  • (Life of (Triggering unit)) Less than or equal to 350.00

    In a seperate condition?
    And what's the difference of the triggering and attacking unit in "a unit is attacked" event?
    Just trying to understand, quite new to map making x)
Memory leaks will only make your map lag after some time. Its thrown away memory (RAM) that can no longer be used until the game is over. They have no effect on what will actually happen during the game.

There is no real reason why I put the condition for the life-value into a separate condition. The trigger looked different at first and then I gradually changed it to test a few things.

It is always recommended to use "triggering unit" whenever possible. The "triggering unit" variable is local to each invocation of a trigger and can not be overwritten. All other variables are globals which might be overwritten when you use a "wait" action or call a different trigger directly.



In your latest trigger try to change
Trigger:
  • (Percentage life of (Attacked unit)) Less than 30.00

to
Trigger:
  • (Percentage life of (Attacked unit)) Less than 0.30

because 100% is 1.0 and 30% is 0.3.

By the way, this
Trigger:
  • (Attacked unit) Not equal to Unit_MountainKing

is also a pretty useless line of code.
And you may also want to test whether the mana of the mountain king is greater than OR EQUAL to 75. Otherwise you would need at least 76 mana to use Storm Bolt which is probably not what you want.
 

Jordguitar

Member
Reaction score
0
Oh, but he storm bolts alright, so I don't think it's a problem with the mana.
And
  • (Attacked unit) Not equal to Unit_MountainKing

    Is to make sure he doesn't target himself with it.

    After changing that, he completely ignores heros with low hp, letting one run right pass him and then he storm bolted a ghoul again. Hahah. Stupid mountain king.
 

Jordguitar

Member
Reaction score
0
In your latest trigger try to change
Trigger:
  • (Percentage life of (Attacked unit)) Less than 30.00

to
Trigger:
  • (Percentage life of (Attacked unit)) Less than 0.30

because 100% is 1.0 and 30% is 0.3.

By the way, this

Are you sure this is true? Because I have another trigger that makes enemy hero units run away once they're below 30% life, and that works well
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top