• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Major Help needed here

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
Well, I was making a spell and decided to make it little bit complicated.
Looks like I went too far...

This spell is supposed to to: Every 1 second, a Frozen rock will smash into 1 random enemy withing 600 range of Caster, damaging it and slowing. If target has has Buff (slowed), it'll be damaged once more. It lasts for 25 seconds.
But it does not do that (I mean, it does first second, but then it screwes up totaly...)

I don't know how do I make it works correctly so I'm requesting assistance.
Check this triggers and I guess you'll see what I want to achieve in them.



Here are the triggers of spell:
  • Icy Blizzard
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Icy Blizzard
    • Actions
      • Set MaxIndexIcyBlizzard = (MaxIndexIcyBlizzard + 1)
      • Set IcyBlizzard_TrigUnit[MaxIndexIcyBlizzard] = (Triggering unit)
      • Set IcyBlizzard_Time = 25
      • Set IcyBlizzard_TimeRemaining[MaxIndexIcyBlizzard] = IcyBlizzard_Time
      • Set IcyBlizzard_Height[MaxIndexIcyBlizzard] = 2500.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MaxIndexIcyBlizzard Equal to 1
        • Then - Actions
          • Trigger - Turn on Icy Blizzard Loop <gen>
          • Trigger - Turn on Icy Blizzard Loop 2 <gen>
        • Else - Actions
  • Icy Blizzard Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Spell_Int[17]) from 1 to MaxIndexIcyBlizzard, do (Actions)
        • Loop - Actions
          • Set IcyBlizzard_Point[1] = (Position of IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]])
          • Set IcyBlizzard_Point[2] = (Position of IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]])
          • Set IcyBlizzard_Point[3] = (IcyBlizzard_Point[1] offset by 2.50 towards (Angle from IcyBlizzard_Point[1] to IcyBlizzard_Point[2]) degrees)
          • Set IcyBlizzard_Height[Spell_Int[17]] = (IcyBlizzard_Height[Spell_Int[17]] - 75.00)
          • Unit - Move IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]] instantly to IcyBlizzard_Point[3], facing (Angle from IcyBlizzard_Point[1] to IcyBlizzard_Point[2]) degrees
          • Animation - Change IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]] flying height to IcyBlizzard_Height[Spell_Int[17]] at 10000000.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IcyBlizzard_Height[Spell_Int[17]] Less than or equal to 0.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]] has buff Icy Blizzard ) Equal to True
                • Then - Actions
                  • Unit - Create 1 Dummy Caster for (Owner of IcyBlizzard_TrigUnit[Spell_Int[17]]) at IcyBlizzard_Point[2] facing (Facing of IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]]) degrees
                  • Set TempDummyUnit[1] = (Last created unit)
                  • Unit - Add a 0.50 second Generic expiration timer to TempDummyUnit[1]
                  • Unit - Add Dummy Frost Nova to TempDummyUnit[1]
                  • Unit - Order TempDummyUnit[1] to Undead Lich - Frost Nova IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]]
                  • If ((Level of Icy Blizzard for IcyBlizzard_TrigUnit[Spell_Int[17]]) Equal to 1) then do (Unit - Cause IcyBlizzard_TrigUnit[Spell_Int[17]] to damage IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]], dealing (3000.00 + ((Real((Intelligence of IcyBlizzard_TrigUnit[Spell_Int[17]] (Include bonuses)))) / 2.00)) damage of attack type else do (Do nothing)
                  • If ((Level of Icy Blizzard for IcyBlizzard_TrigUnit[Spell_Int[17]]) Equal to 2) then do (Unit - Cause IcyBlizzard_TrigUnit[Spell_Int[17]] to damage IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]], dealing (6500.00 + (Real((Intelligence of IcyBlizzard_TrigUnit[Spell_Int[17]] (Include bonuses))))) damage of attack type Spells an else do (Do nothing)
                • Else - Actions
              • Unit - Kill IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]]
              • Unit - Create 1 Dummy Caster for (Owner of IcyBlizzard_TrigUnit[Spell_Int[17]]) at IcyBlizzard_Point[2] facing (Facing of IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]]) degrees
              • Set TempDummyUnit[1] = (Last created unit)
              • Unit - Add a 0.50 second Generic expiration timer to TempDummyUnit[1]
              • Unit - Add Dummy Frost Nova to TempDummyUnit[1]
              • Unit - Order TempDummyUnit[1] to Undead Lich - Frost Nova IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]]
              • If ((Level of Icy Blizzard for IcyBlizzard_TrigUnit[Spell_Int[17]]) Equal to 1) then do (Unit - Cause IcyBlizzard_TrigUnit[Spell_Int[17]] to damage IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]], dealing (3000.00 + ((Real((Intelligence of IcyBlizzard_TrigUnit[Spell_Int[17]] (Include bonuses)))) / 2.00)) damage of attack type else do (Do nothing)
              • If ((Level of Icy Blizzard for IcyBlizzard_TrigUnit[Spell_Int[17]]) Equal to 2) then do (Unit - Cause IcyBlizzard_TrigUnit[Spell_Int[17]] to damage IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]], dealing (6500.00 + (Real((Intelligence of IcyBlizzard_TrigUnit[Spell_Int[17]] (Include bonuses))))) damage of attack type Spells an else do (Do nothing)
              • Special Effect - Create a special effect at IcyBlizzard_Point[2] using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Set IcyBlizzardIndex_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]] = (IcyBlizzardIndex_TargetUnit[IcyBlizzardIndex_TargetUnit[17]] - 1)
              • Set IcyBlizzardIndex_DummyUnit[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]] = (IcyBlizzardIndex_DummyUnit[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]] - 1)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IcyBlizzard_TimeRemaining[Spell_Int[17]] Equal to 0
            • Then - Actions
              • Trigger - Turn off Icy Blizzard Loop 2 <gen>
              • Set IcyBlizzard_TrigUnit[Spell_Int[17]] = IcyBlizzard_TrigUnit[MaxIndexIcyBlizzard]
              • Set IcyBlizzard_TimeRemaining[Spell_Int[17]] = IcyBlizzard_TimeRemaining[MaxIndexIcyBlizzard]
              • Set IcyBlizzard_Height[Spell_Int[17]] = IcyBlizzard_Height[MaxIndexIcyBlizzard]
              • Set IcyBlizzard_TrigUnit[MaxIndexIcyBlizzard] = No unit
              • Set MaxIndexIcyBlizzard = (MaxIndexIcyBlizzard - 1)
              • Set Spell_Int[17] = (Spell_Int[17] - 1)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_IcyBlizzard_Point[1])
          • Custom script: call RemoveLocation(udg_IcyBlizzard_Point[2])
          • Custom script: call RemoveLocation(udg_IcyBlizzard_Point[3])
          • Custom script: set udg_IcyBlizzard_Point[1] = null
          • Custom script: set udg_IcyBlizzard_Point[2] = null
          • Custom script: set udg_IcyBlizzard_Point[3] = null
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MaxIndexIcyBlizzard Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Icy Blizzard Loop 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Spell_Int[17]) from 1 to MaxIndexIcyBlizzard, do (Actions)
        • Loop - Actions
          • Set IcyBlizzard_TimeRemaining[Spell_Int[17]] = (IcyBlizzard_TimeRemaining[Spell_Int[17]] - 1)
          • Set IcyBlizzard_Point[1] = (Position of IcyBlizzard_TrigUnit[Spell_Int[17]])
          • Set TempUnitGroup = (Units within 600.00 of IcyBlizzard_Point[1] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of IcyBlizzard_TrigUnit[Spell_Int[17]])) Equal to True
          • Set TempUnitGroup2 = (Random 1 units from TempUnitGroup)
          • Unit Group - Pick every unit in TempUnitGroup2 and do (Actions)
            • Loop - Actions
              • Set IcyBlizzardIndex_DummyUnit[Spell_Int[17]] = (IcyBlizzardIndex_DummyUnit[Spell_Int[17]] + 1)
              • Set IcyBlizzardIndex_TargetUnit[Spell_Int[17]] = (IcyBlizzardIndex_TargetUnit[Spell_Int[17]] + 1)
              • Set IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]] = (Picked unit)
              • Set IcyBlizzard_Point[2] = (Position of IcyBlizzard_TargetUnit[IcyBlizzardIndex_TargetUnit[Spell_Int[17]]])
              • Unit - Create 1 Dummy Icy Blizzard for (Owner of IcyBlizzard_TrigUnit[Spell_Int[17]]) at IcyBlizzard_Point[2] facing Default building facing degrees
              • Set IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]] = (Last created unit)
              • Unit - Add Storm Crow Form to IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]]
              • Unit - Remove Storm Crow Form from IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]]
              • Animation - Change IcyBlizzard_Dummy[IcyBlizzardIndex_DummyUnit[Spell_Int[17]]] flying height to IcyBlizzard_Height[Spell_Int[17]] at 10000000.00
              • Custom script: call RemoveLocation(udg_IcyBlizzard_Point[2])
              • Custom script: set udg_IcyBlizzard_Point[2] = null
          • Custom script: call RemoveLocation(udg_IcyBlizzard_Point[1])
          • Custom script: call DestroyGroup(udg_TempUnitGroup)
          • Custom script: call DestroyGroup(udg_TempUnitGroup2)
          • Custom script: set udg_IcyBlizzard_Point[1] = null
          • Custom script: set udg_TempUnitGroup = null
          • Custom script: set udg_TempUnitGroup2 = null
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
ur loop triggers should be combined. this will probably solve the problem.
use tempPoints instead of icy blizzard points. dont use an array.
u turn off the 2nd loop b4 everything is de-indexed.

change this (Integer Spell_Int[17]
to a tempInt and use that instead. it wont bug up using one temp Integer for every spell. using arrays for spell looping is bad since they are slower than non arrayed variables.
 
Level 18
Joined
May 11, 2012
Messages
2,103
ur loop triggers should be combined. this will probably solve the problem.
use tempPoints instead of icy blizzard points. dont use an array.
u turn off the 2nd loop b4 everything is de-indexed.

change this (Integer Spell_Int[17]
to a tempInt and use that instead. it wont bug up using one temp Integer for every spell. using arrays for spell looping is bad since they are slower than non arrayed variables.

How can I combine ''1.00 seconds'' and ''0.03 seconds''? The first one is for reducing the time and second for doing main actions...

Arrays take less space (remember? I said I', trying to keep'em short because size is getting huge)

Yeah, didn't noticed that

OK :)

So, everything else is set ok? It there somewhere a problem with indexing (maybe the dummy and target one?)
 
Level 18
Joined
May 11, 2012
Messages
2,103
U use a counter to count every 1 second. The counter will be about 33 when it is 1 second using the .03 timer

All u need is one tempInt to do all of ur spell looping so there is no reason for the array

I meant for ''use tempPoints''. Besides, you said it's bad to use same variables for looping triggers as they are constantly overwritten by other spells and triggers so I made variable just for the spell (and arrayisn't so bad anyway)
 
Status
Not open for further replies.
Top