• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Problems in trigger running

Status
Not open for further replies.
Level 12
Joined
Aug 12, 2008
Messages
349
This is one of the spell I'm going to put it in my spellpack but somehow it doesn't even work during the loop trigger.
  • Purging Circulate cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Purging Circulate
    • Actions
      • -------- ===== Hanky's dynamic indexing system ===== --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PC_index_size Equal to 0
        • Then - Actions
          • Trigger - Turn on Purging Circulate loop <gen>
        • Else - Actions
      • Set PC_index_size = (PC_index_size + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PC_index_size Greater than PC_index_max
        • Then - Actions
          • Set PC_index1[PC_index_size] = PC_index_size
          • Set PC_index_size = PC_index_max
        • Else - Actions
      • Set PC_index2 = PC_index1[PC_index_size]
      • -------- ======================================================== --------
      • -------- ===== setting the caster ===== --------
      • Set PC_caster[PC_index2] = (Triggering unit)
      • -------- ===== duration of Lightning Ball ===== --------
      • Set PC_duration[PC_index2] = (6.00 + (2.00 x (Real((Level of Purging Circulate for PC_caster[PC_index2])))))
      • -------- ===== setting points to create the Lightning Ball ===== --------
      • Set PC_castpoint = (Position of PC_caster[PC_index2])
      • Set PC_createpoint = (PC_castpoint offset by 500.00 towards (Facing of PC_caster[PC_index2]) degrees)
      • Unit - Create 1 Lightning Ball for (Owner of PC_caster[PC_index2]) at PC_createpoint facing Default building facing degrees
      • -------- ===== storing the Lightning Ball into variable ===== --------
      • Set PC_dummy[PC_index2] = (Last created unit)
      • -------- ===== clearing leaks ===== --------
      • Custom script: call RemoveLocation (udg_PC_castpoint)
      • Custom script: call RemoveLocation (udg_PC_createpoint)
  • Purging Circulate loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Trigger running!
      • For each (Integer PC_index3) from 1 to PC_index_size, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Worked!
          • Set PC_index2 = PC_index1[PC_index3]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PC_caster[PC_index2] is alive) Equal to True
              • PC_duration[PC_index2] Greater than 0.00
            • Then - Actions
              • -------- ===== set the point of caster and Lightning Ball to make sure the Lightning Ball rotates around the caster ===== --------
              • Set PC_casterpoint = (Position of PC_caster[PC_index2])
              • Set PC_dummypoint = (Position of PC_dummy[PC_index2])
              • -------- ===== pick enemies in range 220 with conditions to cast purge on the enemies ===== --------
              • Unit Group - Pick every unit in (Units within 220.00 of PC_dummypoint matching (((((Matching unit) has buff Purge) Equal to False) and (((Matching unit) is A structure) Equal to False)) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is Magic Immune) Equal to Fa and do (Actions)
                • Loop - Actions
                  • -------- ===== set the point of picked unit ===== --------
                  • Set PC_pickedpoint = (Position of (Picked unit))
                  • -------- ===== create a dummy to purge the enemies ===== --------
                  • Unit - Create 1 Purge_dummy for (Owner of PC_caster[PC_index2]) at PC_pickedpoint facing Default building facing degrees
                  • Unit - Order (Last created unit) to Orc Shaman - Purge (Picked unit)
              • -------- ===== rotate the Lightning Ball ===== --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PC_radreal Greater than or equal to 358.00
                • Then - Actions
                  • Set PC_radreal = 0.00
                • Else - Actions
                  • Set PC_radreal = (PC_radreal + 2.00)
              • Set PC_offsetpoint = (PC_dummypoint offset by 225.00 towards (72.00 x PC_radreal) degrees)
              • Unit - Move PC_dummy[PC_index2] instantly to PC_offsetpoint
              • -------- ===== reduce the duration ===== --------
              • Set PC_duration[PC_index2] = (PC_duration[PC_index2] - 0.03)
              • -------- ===== clearing leaks ===== --------
              • Custom script: call RemoveLocation (udg_PC_pickedpoint)
            • Else - Actions
              • Set PC_index1[PC_index3] = PC_index1[PC_index_size]
              • Set PC_index1[PC_index3] = PC_index2
              • Set PC_index_size = (PC_index_size - 1)
              • Set PC_index3 = (PC_index3 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PC_index_size Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
The loop trigger is not complete (the rotation part) yet but I don't think that's the factor of the trigger can't run, isn't it? The problem is the message display during the loop trigger that reads "Worked!" don't even display when cast while the Lightning Ball created and the message "Trigger running" able to display. I guess that's the problem of "For Each Integer ..." but I don't know how to solve it. Can anyone help me? I'm in desperate to complete this spellpack as soon as possible. Credits sure will be given.
 
Status
Not open for further replies.
Top