1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

GUI Loop problem

Discussion in 'Triggers & Scripts' started by deathdoorway, Jul 25, 2012.

  1. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    So i have this ability.. Works great but for some reason it wont shut off. Im using the indexing system to loop it for MUI.

    Triggers
    • TW loop Copy
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer TW_index3) from 1 to TW_index_size, do (Actions)
          • Loop - Actions
            • Set TW_index2 = TW_index1[TW_index3]
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (TW_targetrect[TW_index2] contains TW_dummy[TW_index2]) Equal to False
              • Then - Actions
                • Game - Display to (All players) the text: error 2
                • -------- ----- storing the position of the wave to move the wave later ------ --------
                • Set TW_dummypoint = (Position of TW_dummy[TW_index2])
                • -------- ----- set the offset point by using the current wave's position to make the wave move ----- --------
                • Set TW_offsetpoint = (TW_dummypoint offset by 15.00 towards TW_facing[TW_index2] degrees)
                • -------- ----- move the wave ----- --------
                • Unit - Move TW_dummy[TW_index2] instantly to TW_offsetpoint
                • -------- ----- picking all the enemies around the wave ----- --------
                • Custom script: set bj_wantDestroyGroup = true
                • -------- ----- note that the following trigger runs to each unit, one-by-one in a very quick time, instead of all together ----- --------
                • -------- ----- thus, it cause the "damage reduction trigger" to runs to each unit one-by-one, causing the damage to reduce each time it meets a new enemy --------
                • Unit Group - Pick every unit in (Units within 240.00 of TW_offsetpoint matching (((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and (((Matching unit) is Magic Immune) Equal to False))) and ((((Matching unit) is alive) Equal to True) and do (Actions)
                  • Loop - Actions
                    • -------- ----- storing all the picked enemies into variable ----- --------
                    • Set TW_pickedunit = (Picked unit)
                    • -------- ----- storing the position of all the picked enemies to knockback/drag the enemies and create the effects ----- --------
                    • Set TW_picked_point = (Position of TW_pickedunit)
                    • -------- ----- set the damage ----- --------
                    • -------- ----- reduce the damage each time the wave meets a new enemy ----- --------
                    • -------- ----- also check whether the damage above 50% ----- --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • TW_damage[TW_index2] Greater than TW_damagecheck[TW_index2]
                      • Then - Actions
                        • Set TW_damage[TW_index2] = (TW_damage[TW_index2] - TW_damagereduced[TW_index2])
                        • Set TW_damagereduced[TW_index2] = (TW_damage[TW_index2] / 20.00)
                      • Else - Actions
                    • -------- ----- set the speed to decrease each time the wave meets an enemy ----- --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • TW_dragspeed[TW_index2] Greater than 1.00
                      • Then - Actions
                        • Set TW_dragspeed[TW_index2] = (TW_dragspeed[TW_index2] - 0.15)
                      • Else - Actions
                    • -------- ----- set the offset point to move the enemies so that it looks like the wave drag along the enemies ----- --------
                    • Set TW_picked_offsetpoint = (TW_picked_point offset by TW_dragspeed[TW_index2] towards TW_facing[TW_index2] degrees)
                    • -------- ----- move the enemies ----- --------
                    • Unit - Move TW_pickedunit instantly to TW_picked_offsetpoint
                    • -------- ----- create some effects on the knockback/drag ----- --------
                    • Special Effect - Create a special effect at TW_picked_point using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
                    • Special Effect - Destroy (Last created special effect)
                    • -------- ----- check whether the enemy is in DT_hitgroup so that the wave damages only once ----- --------
                    • -------- ----- enemies that has been hit by the wave will be added to the unit group ----- --------
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (TW_pickedunit is in TW_hitgroup[TW_index2]) Equal to False
                      • Then - Actions
                        • Unit - Cause TW_caster[TW_index2] to damage TW_pickedunit, dealing TW_damage[TW_index2] damage of attack type Spells and damage type Normal
                        • Unit Group - Add TW_pickedunit to TW_hitgroup[TW_index2]
                      • Else - Actions
                    • -------- ----- clearing leaks ----- --------
                    • Custom script: call RemoveLocation (udg_TW_picked_offsetpoint)
                    • Custom script: call RemoveLocation (udg_TW_picked_point)
                • -------- ----- clearing leaks ----- --------
                • Custom script: call RemoveLocation (udg_TW_offsetpoint)
                • Custom script: call RemoveLocation (udg_TW_dummypoint)
              • Else - Actions
                • -------- ----- kill the wave as soon as the wave reaches the target point ----- --------
                • Unit - Explode TW_dummy[TW_index2]
                • -------- ----- clearing leaks ----- --------
                • Custom script: call RemoveRect (udg_TW_targetrect[udg_TW_index2])
                • Custom script: call DestroyGroup (udg_TW_hitgroup[udg_TW_index2])
                • -------- ======================================================== --------
                • Set TW_index1[TW_index3] = TW_index1[TW_index_size]
                • Set TW_index1[TW_index_size] = TW_index2
                • Set TW_index_size = (TW_index_size - 1)
                • Set TW_index3 = (TW_index3 - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • TW_index_size Equal to 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
     
    Last edited by a moderator: Jul 25, 2012
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Use Game - display text message, convert the TW_index_size into a string. See how it behaves.
     
  3. KhaosMachine

    KhaosMachine

    Joined:
    Dec 30, 2011
    Messages:
    117
    Resources:
    6
    Spells:
    6
    Resources:
    6
  4. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    @ maker It seems to go 1,1,1,1,1,1,1, for about 6-7 cast. Then it gets buggy and stays 1,1,1,1,1,1 every .03 secs. If i cast the spell in the mean time it goes 1,1,1,1,2,2,2,2,1,1,1.etc the 2s start to increase
     
  5. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    I recommend you attach the spell in a map file in your post.
     
  6. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
  7. Vladadamm

    Vladadamm

    Joined:
    Apr 19, 2011
    Messages:
    1,255
    Resources:
    9
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    9
    I already discussed of that with defskull (if my memory is good), and we had that conclusion : There's no "best MUI system for GUI". Both Hashtables and Indexing have their own avantages and their defaults.
     
  8. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ok but can u help with my spell?
     
  9. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
  10. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1
  11. deathdoorway

    deathdoorway

    Joined:
    Apr 13, 2005
    Messages:
    621
    Resources:
    1
    Maps:
    1
    Resources:
    1