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.

      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