Two Trigger Problems

Denegoth

New Member
Reaction score
18
Problem 1 SOLVED

Trigger:
  • Catch
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Catch
    • Actions
      • Wait 1.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BeastmasterCaught Equal to 0
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of (Target unit of ability being cast)) Less than or equal to ((Max life of (Target unit of ability being cast)) / 4.00)
            • Then - Actions
              • Wait 0.10 seconds
              • Unit - Remove (Target unit of ability being cast) from the game
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: (|cff00FF00 + ((Name of (Target unit of ability being cast)) + caught!|r))
              • Set BeastmasterCaught = 1
              • Set BeastmasterUnit = (Unit-type of (Target unit of ability being cast))
              • Unit - Add Release to (Casting unit)
            • Else - Actions
              • Game - Display to (Player group((Owner of (Casting unit)))) the text: |cff00FF00Enemy has...
        • Else - Actions
          • Game - Display to (Player group((Owner of (Casting unit)))) the text: |cff00FF00You alrea...


This trigger used to work perfectly fine, but I changed something (Can't remember what) and now it crashes the map as soon as the spell is used.


Problem 2

Trigger:
  • Release
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Release
    • Actions
      • Set TempLevel = (50.00 + ((Real((Level of Catch for (Casting unit)))) x 50.00))
      • Unit - Create 1 BeastmasterUnit for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Animation - Change (Last created unit)'s size to (TempLevel%, TempLevel%, TempLevel%) of its original size
      • Wait 0.10 seconds
      • Unit - Add Beastmaster Life Bonus to (Last created unit)
      • Unit - Add Beastmaster Damage Bonus to (Last created unit)
      • Wait 0.10 seconds
      • Unit - Set level of Beastmaster Life Bonus for (Last created unit) to (Level of Catch for (Triggering unit))
      • Unit - Set level of Beastmaster Damage Bonus for (Last created unit) to (Level of Catch for (Triggering unit))
      • Set BeastmasterCaught = 0
      • Set BeastmasterUnit = No unit-type
      • Unit - Remove Release from (Casting unit)


Everything in this trigger works fine except the Life Bonus level increasing. The damage bonus works fine, but life bonus just stick at level 1 (+100 health). I have put the levels into the spell, so it isn't that I forgot that.
 

G00dG4m3

New Member
Reaction score
1
instead of /4 in first one, you should do *.25 and if you need a levels, then ((--*25)* Real level of ability being cast), cause its quite dificult to do the / action less and less.
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
For the first one, my best solution for bad triggers (im not saying yours is bad I just mean it causes trouble) is to delete them and re-write them.

For the seconds one, try setting that life bonus to (level of ability x 100), because otherwise it'll just use the level number as the bonus, which is usually only 1 or 2.

But my best solution for trouble triggers is to delete them and make it again, maybe you'll find the problem as you do it. (of course, it's always better to remake a trigger before deleting the original.)

EDIT: Welcome to The Helper, G00dG4m3!!! Hope you have a great time here!
 

roXplosive

New Member
Reaction score
15
My 2 cents : remove the unit from the game AFTER displaying the caster's owner the message right before adding Release ability to the caster . Otherwise it's pretty cool idea .
 

Denegoth

New Member
Reaction score
18
For the first one, my best solution for bad triggers (im not saying yours is bad I just mean it causes trouble) is to delete them and re-write them.

For the seconds one, try setting that life bonus to (level of ability x 100), because otherwise it'll just use the level number as the bonus, which is usually only 1 or 2.

But my best solution for trouble triggers is to delete them and make it again, maybe you'll find the problem as you do it. (of course, it's always better to remake a trigger before deleting the original.)

EDIT: Welcome to The Helper, G00dG4m3!!! Hope you have a great time here!

Catch is a skill the hero uses. The life bonus is a skill that is given to the unit. The life bonus is set to the same level as Catch
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
if live bonus is the item ability it cannot be leveld after given to a unit.
 

Denegoth

New Member
Reaction score
18
if live bonus is the item ability it cannot be leveld after given to a unit.

It is the item ability but I changed it to a unit ability and added levels. The damage bonus was done in the same way and levelled up fine. Is it still a problem?
 

jwallstone

New Member
Reaction score
33
That should be fine then. Some abilities are just quirky, and it's possible that life bonus is just like that.

For Problem 1, you should change Casting Unit to Triggering Unit. I think that might fix it (if not, it'll fix another problem down the line). Casting unit loses the reference to the correct unit after a period of time, i.e. it has a limited lifetime of use. Since you use Waits in your code, you are very likely losing the reference to the unit. Triggering Unit will never lose the reference (it's almost like a local variable), so it is safe to use after waits.
 

Denegoth

New Member
Reaction score
18
It turns out I messed something up in the actual Catch spell. Problem 2 is still around though :(
 

roXplosive

New Member
Reaction score
15
I agree with using variables for Caster and Target units in function 1 . About the crash I still think that the premature use of RemoveUnit() is the cause . I say move that line down just before adding the Release ability to the caster .
 

Denegoth

New Member
Reaction score
18
I agree with using variables for Caster and Target units in function 1 . About the crash I still think that the premature use of RemoveUnit() is the cause . I say move that line down just before adding the Release ability to the caster .

I've changed the trigger to do that now anyway, but I turned off the triggers and it still crashed, then I remade the spell (using Death Coil instead of Forked Lightning)
 

roXplosive

New Member
Reaction score
15
The problem with the second trigger is ? Personally I don't think resetting BeastmasterUnit type is really necessary .

Should this ability catch heroes or magic immunes because I think it might be possible .
 

Denegoth

New Member
Reaction score
18
I got it working!

Trigger:
  • ReleaseHealthBonus
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set LifeBonusAbility[1] = Beastmaster Life Bonus 1
      • Set LifeBonusAbility[2] = Beastmaster Life Bonus 2
      • Set LifeBonusAbility[3] = Beastmaster Life Bonus 3
      • Set LifeBonusAbility[4] = Beastmaster Life Bonus 4
      • Set LifeBonusAbility[5] = Beastmaster Life Bonus 5


Trigger:
  • Unit - Add LifeBonusAbility[(Level of Catch for (Casting unit))] to (Last created unit)
 
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