Loops replacing each other second time used

FroznYoghurt

New Member
Reaction score
37
OK im stuck in deep shit and im clueless bout what do >.<'

The problem is unlike anything ive ever seen :Z, A spell that uses two different but yet pretty similar periodic time trigger loops, one in the beginning and one inte the end. The second loop checks for a condition to also end the spell, and the problem is...
The second time the spell is used the second trigger is ("%?!!+"? used first! wich ends the spell instantly!:banghead: Ive searched the triggers with spyglass but been unable to find anything... :confused:

If you got anything il shower you with rep...

If you want me to be more specific ask me to be more specific ;)
Altought its thought to be a spell pack so id rather not give away the whole triggers but il do if necessary
 

FroznYoghurt

New Member
Reaction score
37
awww... guess i have no choice then... but be hush-hush bout it! want this spell pack to turn out good :rolleyes:
The spookiest part is that it now starts malfunction randomly, not specificly the second time :<
ah well... prepare for some reading...

The "main" trigger
Code:
[The spells name] Ini
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to [The spells name]
    Actions
        -------- Animation  + Variables --------
        Set Caster = (Triggering unit)
        Set Destination_Point = (Target_loc offset by 900.00 towards (Facing of Caster) degrees)
        Animation - Play Caster's Stand Victory animation
        Animation - Change Caster's animation speed to 150.00% of its original speed
        Wait 0.75 seconds
        -------- Temporary Special Effect --------
        Special Effect - Create a special effect attached to the chest of Caster using a special effect :P
        Special Effect - Destroy (Last created special effect)
        -------- Freeze --------
        Animation - Change Caster's animation speed to 0.00% of its original speed
        -------- Summon --------
        Set TempPoint = (Position of Caster)
        Unit - Create 1 Summoned Unit for (Owner of Caster) at TempPoint facing (Facing of Caster) degrees
        Set Summon = (Last created unit)
        Unit - Add a 15.00 second Generic expiration timer to Summon
        Animation - Play Summon's Walk animation
        Unit - Turn collision for Summon Off
        Custom script:   call RemoveLocation(udg_TempPoint)
        -------- Loop --------
        Trigger - Turn on Entering Loop <gen>
        -------- Loop Duration --------
        Wait 0.16 seconds
        -------- Loop Ends --------
        Trigger - Turn off Entering Loop <gen>
        Unit - Turn collision for Summon On
        -------- Duration of The Spell --------
        Wait 14.84 seconds
        -------- Spell Ends --------
        Animation - Change Caster's animation speed to 100.00% of its original speed
        Set Target_loc = (Position of Summon)
        Set Target_Loc2 = (Position of Caster)        
        Unit - Remove Summon from the game
        Unit - Create 1 Wrath for (Owner of Caster) at Target_loc facing Target_Loc2
        Set Summon = (Last created unit)
        Unit - Turn collision for Summon Off
        Custom script:   call RemoveLocation(udg_Target_loc)
        Custom script:   call RemoveLocation(udg_Target_Loc2)
        -------- Loop --------
        Trigger - Turn on Finishing Leap Loop <gen>
        -------- Loop Duration --------
        Wait until (CustomBoolean Equal to True), checking every 0.10 seconds
        -------- Loop Ends --------
        Trigger - Turn off Finishing Leap Loop <gen>
        Set CustomBoolean = False

Loop #1

Code:
Entering Loop
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Target_loc = (Position of Summon)
        Set Target_Loc2 = (Target_loc offset by 30.00 towards (Angle from Target_loc to Destination_Point) degrees)
        Unit - Move Summon instantly to Target_Loc2
        Custom script:   call RemoveLocation(udg_Target_loc)
        Custom script:   call RemoveLocation(udg_Target_Loc2)

Loop #2
Code:
Finishing Leap Loop
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set TempPoint = (Position of Caster)
        Set Target_loc = (Position of Summon)
        Set Target_Loc2 = (Target_loc offset by 30.00 towards (Angle from Target_loc to TempPoint) degrees)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Distance between TempPoint and Target_loc) Greater than 10.00
            Then - Actions
                Unit - Move Summon instantly to Target_Loc2
                Custom script:   call RemoveLocation(udg_TempPoint)
                Custom script:   call RemoveLocation(udg_Target_loc)
                Custom script:   call RemoveLocation(udg_Target_Loc2)
            Else - Actions
                Set CustomBoolean = True
                Unit - Remove Summon from the game
                Special Effect - Create a special effect attached to the chest of Caster using a special effect
                Special Effect - Destroy (Last created special effect)
                Custom script:   call RemoveLocation(udg_TempPoint)
                Custom script:   call RemoveLocation(udg_Target_loc)
                Custom script:   call RemoveLocation(udg_Target_Loc2)
you read this far? :O
Thx in advantage ;)
 

ShadowTek

New Member
Reaction score
23
I see that you are somehow waiting for the CustomBoolean to be true at a point in the main trigger, but I don't see where you ever set it to true. You set it to false at the end of the first trigger, but thats all I see of it.

I hope you aren't trying to use this for more than one unit at a time. If so, then I don't see how this could work since you are using the same globals for everything (such as "Caster").
 

FroznYoghurt

New Member
Reaction score
37
True, i have yet not mastered the art of MUI
And ops, i did forget to change the Variable in the post, changed the name to "CustomVariable" trying not to give the slightest bit away :>
 

NapaHero

Back from the dead...
Reaction score
43
Just a few errors there:

Code:
-------- [COLOR="green"](From here)[/COLOR] Summon --------
        Set TempPoint = (Position of Caster)
        Unit - Create 1 Summoned Unit for (Owner of Caster) at TempPoint facing (Facing of Caster) degrees
        Set Summon = (Last created unit)
        Unit - Add a 15.00 second Generic expiration timer to Summon
        Animation - Play Summon's Walk animation
        Unit - Turn collision for Summon Off
        Custom script:   call RemoveLocation(udg_TempPoint)
        -------- Loop --------
        Trigger - Turn on Entering Loop <gen>
        -------- Loop Duration --------
        Wait 0.16 seconds
        -------- Loop Ends --------
        Trigger - Turn off Entering Loop <gen>
        Unit - Turn collision for Summon On
        -------- [COLOR="green"](To here, is okay)[/COLOR] Duration of The Spell --------
        Wait 14.84 seconds
        -------- [COLOR="green"](This is where start the problems)[/COLOR] Spell Ends --------
        Animation - Change Caster's animation speed to 100.00% of its original speed
        [B]Unit - Remove Summon from the game[/B] [COLOR="green"]Why you need this? You already used a expiration timer that will remove the unit[/COLOR]
        [B]Set Target_loc = (Position of Summon)[/B] [COLOR="green"]Can you tell me where's Summon? It already has been removed[/COLOR]
        Set Target_Loc2 = (Position of Caster)
        Unit - Create 1 Wrath for (Owner of Caster) at [B]Target_loc[/B] facing Target_Loc2 [COLOR="green"]Where's Loc?[/COLOR]
        [B]Set Summon = (Last created unit)[/B] [COLOR="green"]Here's you back, but why haven't you received a Expiration Timer? You leaks if not removed.[/COLOR]
        Unit - Turn collision for Summon Off
        [B]Animation - Change Caster's animation speed to 100.00% of its original speed[/B] [COLOR="green"]Again? You already used this above[/COLOR]
        Custom script:   call RemoveLocation(udg_Target_loc)
        Custom script:   call RemoveLocation(udg_Target_Loc2)
        -------- Loop --------
        Trigger - Turn on Finishing Leap Loop <gen>
        -------- Loop Duration --------
        Wait until (CustomBoolean Equal to True), checking every 0.10 seconds
        -------- Loop Ends --------
        Trigger - Turn off Finishing Leap Loop <gen>
        Set CustomBoolean = False

You really should fix these.
 

FroznYoghurt

New Member
Reaction score
37
Quite a sharp eye you got there :) or its me thats half-blind, havent slept much lately, i blame that for now xD.

OK the double reset ani speed is plain stupid, fixed now
The reason for removal of Summoned is that i dont want its death animation to be played, instead i want it to dissapear.
The placing of "position of unit" fixed :> thought i fixed that earlier

And i dont quite get how it leaks if i dont have expiration timer :O

+rep though
 

NapaHero

Back from the dead...
Reaction score
43
The reason for removal of Summoned is that i dont want its death animation to be played, instead i want it to dissapear.
And i dont quite get how it leaks if i dont have expiration timer :O

1 - Then don't put an Expiration Timer

2 - More units ingame = More lag. You don't want that, do you?

Thanks for +rep :)
 

FroznYoghurt

New Member
Reaction score
37
The second unit is removed in the second loop so it dosent need an expiration timer, the second unit is mostly an "SFX unit"

The Expiration Timer on the first unit is there only for graphical reasons, to help the caster to keep track of the spell duration.

And the problem is still rock solid, the second loop is randomly triggered instead of the first one. :banghead:

Consider this partially a bump. :cool:
 

NapaHero

Back from the dead...
Reaction score
43
Code:
Entering Loop
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Target_loc = (Position of Summon)
        Set Target_Loc2 = (Target_loc offset by 30.00 towards (Angle from Target_loc to Destination_Point) degrees)
        Unit - Move Summon instantly to Target_Loc2
        Custom script:   call RemoveLocation(udg_Target_loc)
        Custom script:   call RemoveLocation(udg_Target_Loc2)

I'm still wondering where you set Destination_Point. Oh, since it's a point, leaks and you don't remove it. Maybe this is the awnser for your problems? :p
 

FroznYoghurt

New Member
Reaction score
37
I did forget to remove the location... :cool: but since its not in a loop its hardly gonna cause major lag.

The variable is set in the beginning of the first trigger though.
Set Destination_Point = (Target_loc offset by 900.00 towards (Facing of Caster) degrees)
 
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