Problem with a trigger

Status
Not open for further replies.
Level 4
Joined
Jul 30, 2010
Messages
57
I would like to know what's the problem with this trigger.

Curse of Blood fim do buff
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Targets_Cursed_By_Blood and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) has buff Curse of Blood ) Equal to False
Then - Actions
Unit Group - Remove (Picked unit) from Targets_Cursed_By_Blood
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Targets_Cursed_By_Blood) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Do nothing

This trigger was supossed to check when the buff (Curse of blood) wears off or is purged and remove the unit from the group (Targets Cursed BY Blood) but for some reason the units are being removed from the group they having the buff or not.
 
First use TRIGGER tags
  • Curse of Blood fim do buff
  • Events
    • Time - Every 0.10 seconds of game time
  • Actions
    • Unit Group - Pick every unit in Targets_Cursed_By_Blood and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) has buff Curse of Blood ) Equal to False
          • Then - Actions
            • Unit Group - Remove (Picked unit) from Targets_Cursed_By_Blood
          • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Targets_Cursed_By_Blood) Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Else - Actions
Remove Do nothing coz it does nothing

based on this trigger alone, there shouldnt be a problem so maybe there is something in your other triggers that interferes with this trigger so can you post the other triggers?
 
Level 4
Joined
Jul 30, 2010
Messages
57
Ok Ok then
This first trigger chooses the targets and put then into the group
  • Curse of Blood Alvos
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Curse of Blood
    • Actions
      • Set Alvos_Da_Curse_Of_Blood = (Units within (150.00 + ((Real((Level of Curse of Blood for (Triggering unit)))) x 50.00)) of (Target point of ability being cast))
      • Unit Group - Pick every unit in Alvos_Da_Curse_Of_Blood and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((((Picked unit) is Mechanical) Equal to True) or (((Picked unit) has buff Curse of Blood ) Equal to True)) or (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to False)
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Alvos_Da_Curse_Of_Blood
            • Else - Actions
              • Do nothing
      • Set Posicao_da_Unidade_Falsa = (Position of (Triggering unit))
      • For each (Integer A) from 1 to (2 + (Level of Curse of Blood for (Triggering unit))), do (Actions)
        • Loop - Actions
          • Set Alvo_Ja_Atingido_Curse_Of_Bloo = (Random unit from Alvos_Da_Curse_Of_Blood)
          • Unit - Create 1 Unidade Falsa for (Owner of (Triggering unit)) at Posicao_da_Unidade_Falsa facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Hide (Last created unit)
          • Unit - Order (Last created unit) to Undead Banshee - Curse Alvo_Ja_Atingido_Curse_Of_Bloo
          • Unit Group - Remove Alvo_Ja_Atingido_Curse_Of_Bloo from Alvos_Da_Curse_Of_Blood
          • Unit Group - Add Alvo_Ja_Atingido_Curse_Of_Bloo to Targets_Cursed_By_Blood
      • Trigger - Turn on Curse of Blood fim do buff <gen>
      • Custom script: call DestroyGroup (udg_Alvos_Da_Curse_Of_Blood)
      • Custom script: call RemoveLocation (udg_Posicao_da_Unidade_Falsa)
But when i've disabled the other trigger the spell was working so i am still thinking the problem is not this one.
 
I guess its because of the casting delay for the spell with the buff... maybe the unit was looped already before he gets the buff so he gets removed from the group... make sure the caster has a cast point and backswing of 0.00...

and you dont need to hide the caster, just make the unit have the model path set to none.mdl or use the dummy.mdx by vexorian...
 
I've tried to change that but it is still not working and i don't think the problem is this because the buggy trigger is initially off and it's turned on only after the choose of the targets.

well it shouldnt be a problem really...

one suggestion, dont use integerA loops (though I dont think it has something to do with the problem, its just that integerA/B causes wierd bugs)

maybe you can try adding debug messages to see what part is not working...
 
Level 4
Joined
Jul 30, 2010
Messages
57
I was thinking about what you've said and i've tried to change the event to every 2 seconds and i don't know why but it is working now. So i tried to change again and look for leeser numbers, and i've found that 0.3 is the leeser number which this trigger works. But i still don't make any idea about how it could be a problem. Anyway it's working now, thanks for the help.
 
I was thinking about what you've said and i've tried to change the event to every 2 seconds and i don't know why but it is working now. So i tried to change again and look for leeser numbers, and i've found that 0.3 is the leeser number which this trigger works. But i still don't make any idea about how it could be a problem. Anyway it's working now, thanks for the help.

maybe .1 was really too fast for it...
 
Level 10
Joined
Jul 12, 2009
Messages
321
I was thinking about what you've said and i've tried to change the event to every 2 seconds and i don't know why but it is working now. So i tried to change again and look for leeser numbers, and i've found that 0.3 is the leeser number which this trigger works. But i still don't make any idea about how it could be a problem. Anyway it's working now, thanks for the help.

Could it be that your dummy unit ("Unidade Falsa") is not able to cast instantly?

Dummy units should have a cast point and backswing of 0, and have a movement speed of 0 (so they do not have to rotate toward the target before casting.)
 
Status
Not open for further replies.
Top