Trigger Firing Twice

jedi8955

New Member
Reaction score
4
I'm having a bloody weird problem with a trigger firing twice in a row. It's a little nothing trigger too, it shouldn't have any trouble. It waits about 1 real time second, then it fires the trigger again. It's the only one I'm having this problem on.

Code is below, explaination follows.

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
      • (I've tested this with Starts the effect and Begins casting an ability, both fire wrong.)
    • Conditions
      • (Ability being cast) Equal to Tinker_Lv1_Test_Positive
    • Actions
      • Unit - Increase level of Tinker_Lv1_DamagePos_Test for (Target unit of ability being cast)


Ability: Tinker_Lv1_Test_Positive
This is a dummy ability based off of Inner Fire. It in and of itself does nothing, it only server to spring the trigger.
Duration: 0
Targets Allowed: Friend, Mechanical, Structure (These match the unit it's to be used on)

Ability: Tinker_Lv1_DamagePos_Test
This is the real ability I'm trying to manipulate. Based off of Trueshot Aura, it increases the unit's damage by a % amount. This ability sits inside a Spell Book.
Targets: Self
Levels: 11 (Level 1 = 0)


So, when I have a unit use the triggering ability, it applies the effect, waits a sec, then applies it again. It's only supposed to apply it once.

I also have a negative version with its own trigger, that dummy ability is based off of Slow. This also fires twice, with the target ability residing in the same spellbook.

There's nothing in my trigger scheme that repeats a trigger, so I have no bloody idea why the hell it's doing this. My only guesses are that it's something to do with the Spell Book or something to do with Trueshot Aura.

Any help would be greatly appreciated. Thanks!
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
My bet would be that slow and innerfire fire the effect event twice - once for the cooldown start and mana consumption and once for the applied buff. But that wouldn't explain why it doesnt work with start casting then.

Is the unit casting slow/innerfire twice? or only once and the trigger fires 2 times?

other than that, there has to be another trigger influencing this. There is nothing wrong with that trigger.

Are you sure your innerfire and slow dummy abilities dont have the same orderstring?
 

jedi8955

New Member
Reaction score
4
My bet would be that slow and innerfire fire the effect event twice - once for the cooldown start and mana consumption and once for the applied buff. But that wouldn't explain why it doesnt work with start casting then.

Is the unit casting slow/innerfire twice? or only once and the trigger fires 2 times?

The unit is only casting it once, it's just that the trigger fires twice.


Make a 2 sec cooldown to stop it from firing twice.


Incompatible with the map design, unfortunatly. Still, if I can't figure this out, I might have to hack this in.

I think its re-casting the spell because the level has changed.

Well, the level of the dummy spell hasn't changed, only the targeted ability.

I have a trigger in game, working that operates similarly. However, it's AoE based and adds a bunch of people to a hashtable, adds them to a unit group and then increases the level of the ability. (It's in a hashtable because it's timer based and needs to be MUI) This is working just fine.

It's got me bloody stumped.



I have a feeling that this is something to do with the targeted ability being in a SpellBook. It might just be inexperience, but I have a weird feeling about it.

I'll have to keep looking. Thanks for your help guys, if you have any more ideas, it'd be appreciated.

_________________________________________________

Edit: Further testing has the initial effect waiting approximatly 1 second after the dummy ability is cast, then applying the effect once, waiting about another second, then applying it again! Bloody weird.

_________________________________________________

Return of the Edit: Here we go. Found something on the googles that might explain some of this rubbish.

http://www.mindflare.com/wc3maps/strange.htm said:
Level of an upgradeable ability in a Spellbook added through triggers is too high

In an earlier patch, upgradeable abilities added through triggers used to not be granted upgrade bonuses properly; I suspect that when they fixed this, they introduced something which gives the bonus to abilities inside Spellbooks more than once, causing them to be a higher level than they should be. You can work around the problem by using the "Unit - Set Level of Ability for Unit" trigger action to set the ability to the proper level after adding the Spellbook.

This is exactly what is happening.

So, it looks like I'll need to get the integer value of the level of the ability being manipulated, set it to a variable, add 1, then set the ability to be equal to the variable. I need to go through all that because I don't know what level the ability will be.


On a completely unrelated note, I'm noticing that after watching an episode of Top Gear, I use a lot of British slang.

_______________________________________

Son of the Edit

And that didn't do a damned thing.

I changed the trigger to be this:

Trigger:
  • TinkerLv1Test Pos
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tinker Lv 1 Test Positive
    • Actions
      • Set Tinkering_Int = ((Level of Tinker_Lv1_DamagePos_Test for (Target unit of ability being cast)) + 1)
      • Unit - Set level of Tinker_Lv1_DamagePos_Test for (Target unit of ability being cast) to Tinkering_Int
      • Set Tinkering_Int = 0


Still takes effect twice. So it's definitly firing the entire trigger twice.

Bleh.

_____________________________________

Edit vs. Mecha-Edit!

So I added Turn Off (This Trigger) to the beginning of it, then Turn On (This Trigger) to the end. Still has double effect.

It has to be reading the spell being used twice. Dunno how else to explain it.

_____________________________________

Crappy American Remake of Edit:

So, I just changed what the dummy was based on to Channel, thinking it had to be something with the Order ID. Same result, applies it twice.

_____________________________________

20th Anniversary Release of Edit:

Kept messing around with it.

Put Turn Off (This Trigger) at the end of it, without turning it back on. Still has double effect.

Found out that it is only increasing the real ability by 1 level (least, by the tooltip), but that the effect is that it's twice.

Let me explain.

The targeted ability is based off of Trueshot Aura and increases damage by 2% per level. It's set to 0 AoE and targets Self only.

After the dummy is used, the unit with the real ability shows its normal damage + 4% in green.

I am thoughly confused and frustrated. I think I'm done for tonight, I'm gonna play some Endless Frontier and bludgeon myself into unconsciousness.
 

jedi8955

New Member
Reaction score
4
Ok, I've gotten this figured out.

This is a bug specifically with Trueshot Aura.

I tried plugging in an ability based off of Devotion Aura into the targeted ability, it showed up just fine.

I'm just going to half all my values based on TS.

Thanks for all the help with this :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top