Difficulties with triggering

Megika

New Member
Reaction score
4
Well, I have two abilities I can't get working. One is based off firebolt, and the other is based off chain lightning. The idea with the firebolt is the hero shoots the bolt at an enemy unit, and a flame strike is targeted there. My code currently looks like this:

Code:
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Conflagration 
    Actions
        Set CasLoc = (Position of (Triggering unit))
        Set Caster = (Triggering unit)
        Unit - Create 1 Dummycaster for (Owner of Caster) at CasLoc facing Default building facing degrees
        Unit - Hide (Last created unit)
        Unit - Add Flame Strike (Conflagration)  to (Last created unit)
        Unit - Set level of Flame Strike (Conflagration)  for (Last created unit) to (Level of Conflagration  for (Triggering unit))
        Unit - Order (Last created unit) to Human Blood Mage - Flame Strike (Target point of ability being cast)
        Unit - Add a 21.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_CasLoc)

The problem with this is that when the ability is cast, it instantly casts the flame strike at the point where the unit was. If the unit is moving, it looks terrible. Also, some of the time, when a unit is killed by the flame strike no experience is given.

The chain lightning skill does this: when cast, it creates a dummycaster which then casts chain lightning at random nearby units. That part works fine. However, I want it to also cast more chain lightning at other random units when a unit is struck by the first chain lightning, if that makes sense. Sadly, I have no idea whatsoever on how to do this.

Thanks in advance.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
For the first one you could try and include a wait for condition action. With the condition being the unit has buff stunned. That way it won't cast when the unit is still running from the firebolt. The second one is much harder as the game has no way of detecting if a unit was hit by a chain spell. There is a tutorial on creating chain spells here, If you create your own custom chain lightning you will be able to detect when a unit is hit by a chain lightning jump and then have another chain lightning branch out from it. Note that what I'm proposing is infinity more complicated than the first one, have fun figuring it out.
 

Megika

New Member
Reaction score
4
Having difficulty with the 'Wait for Condition' action... Can you give me a more precise idea of what to do? Since the only thing in the conditions is, obviously, the Buff Comparison. But all I can see under that is things along the lines of 'If *Buff* equal to *Buff* then do such and such.' So... how would I make it check if the target unit is stunned?
 

FireBladesX

Eating my wings!
Reaction score
123
The second one is much harder as the game has no way of detecting if a unit was hit by a chain spell.

You can use a damage detection system.

On casting the ability, create 1 dummy, and make the dummy be the one to cast the lightning. The hero's skill won't actually do anything.
The damage trigger has no event, and has the condition:
(Level of (Chain Lightning (dummy)) for Damage Source greater than 0).

the setup looks very roughly like this.
Code:
DamageTrigger
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Trigger - Add to DamageTrigger <gen> the event (Unit - (Triggering unit) Takes damage)

You can use that for the firebolt one too.

So... how would I make it check if the target unit is stunned?
It's a boolean comparison. "Unit has specific buff". That method is much easier, too, than using damage detection for the firebolt. But the way I figure it, if you use it once, why not use it again?
Just do a string of if/then/else statements.
 

Megika

New Member
Reaction score
4
Conflagration (the firebolt spell) still isn't working properly. The firebolt hits them, and then it does nothing :confused: Code is as follows:

Code:
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Conflagration 
    Actions
        Set CasLoc = (Position of (Triggering unit))
        Set Caster = (Triggering unit)
        Unit - Create 1 Dummycaster for (Owner of Caster) at CasLoc facing Default building facing degrees
        Unit - Hide (Last created unit)
        Unit - Add Flame Strike (Conflagration)  to (Last created unit)
        Unit - Set level of Flame Strike (Conflagration)  for (Last created unit) to (Level of Conflagration  for (Triggering unit))
        Wait until (((Target unit of ability being cast) has buff Stunned) Equal to True), checking every 0.10 seconds
        Unit - Order (Last created unit) to Human Blood Mage - Flame Strike (Position of (Target unit of ability being cast))
        Unit - Add a 21.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_CasLoc)

Can't figure out why it's still not working...

As for the chain lightning spell, I actually went ahead and made a different spell while I was waiting for a reply. So... the new spell works perfectly. :D

Anyway, thanks for all your help so far, just need a little more...
 

FireBladesX

Eating my wings!
Reaction score
123
Create the unit after the wait, or else it won't correctly recognize the last created unit.

Code:
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Conflagration 
    Actions
        Wait until (((Target unit of ability being cast) has buff Stunned) Equal to True), checking every 0.10 seconds
        Set CasLoc = (Position of (Triggering unit))
        Set Caster = (Triggering unit)
        Unit - Create 1 Dummycaster for (Owner of Caster) at CasLoc facing Default building facing degrees
        Unit - Add Flame Strike (Conflagration)  to (Last created unit)
        Unit - Set level of Flame Strike (Conflagration)  for (Last created unit) to (Level of Conflagration  for (Triggering unit))
        Unit - Order (Last created unit) to Human Blood Mage - Flame Strike (Position of (Target unit of ability being cast))
        Unit - Add a 21.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation(udg_CasLoc)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top