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.

Mirror Image Crash

Discussion in 'World Editor Help Zone' started by Melth, Aug 24, 2015.

  1. Melth

    Melth

    Joined:
    Jul 8, 2013
    Messages:
    201
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I've recently run into a peculiar problem where my map crashes when I have a unit cast a mirror image spell.

    I have narrowed the cause of the crash down to this trigger:


    • Re Order Summons
      • Events
        • Unit - A unit Spawns a summoned unit
      • Conditions
        • (Unit-type of (Triggering unit)) Not equal to Grom Hellscream
      • Actions
        • Unit - Turn collision for (Summoned unit) Off
        • Set TempPoint = (Center of KodoSpawnZoneArray[(Custom value of (Summoning unit))])
        • Unit - Order (Summoning unit) to Move To TempPoint
        • Custom script: call RemoveLocation (udg_TempPoint)
        • Set TempUnitGroup = (Units owned by (Player((Custom value of (Summoning unit)))) matching (((Matching unit) is alive) Equal to True))
        • Set TempUnit = (Random unit from TempUnitGroup)
        • For each (Integer A) from 1 to 72, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • TempUnit Equal to EligibleTargetsUnitArray[(Integer A)]
              • Then - Actions
                • Unit Group - Add (Summoned unit) to EnemiesTargetingEachBuildingAr[(Integer A)]
                • Set TempPoint = (Position of (Summoned unit))
                • Set TempPoint2 = (Position of EligibleTargetsUnitArray[(Integer A)])
                • Set TempPoint3 = (TempPoint offset by 200.00 towards (Angle from TempPoint to TempPoint2) degrees)
                • Unit - Order (Summoned unit) to Attack-Move To TempPoint3
                • Custom script: call RemoveLocation (udg_TempPoint)
                • Custom script: call RemoveLocation (udg_TempPoint2)
                • Custom script: call RemoveLocation (udg_TempPoint3)
              • Else - Actions
        • Custom script: call DestroyGroup (udg_TempUnitGroup)


    Now the details of this trigger are entirely irrelevent as far as I'm aware, this trigger regulates the units summoned by a different spell cast by a different unit. That works fine.

    The unit whose mirror image spell causes the crash has the type Grom Hellscream. If this trigger is on, the crash happens. If this trigger is off, everything works perfectly. This baffles me since the conditions should make this trigger not run when that spell is cast anyway.
     
  2. DEE-BOO

    DEE-BOO

    Joined:
    Apr 4, 2010
    Messages:
    505
    Resources:
    1
    Icons:
    1
    Resources:
    1
    Why loop 72 times?
    • For each (Integer A) from 1 to 72, do (Actions)
     
  3. Melth

    Melth

    Joined:
    Jul 8, 2013
    Messages:
    201
    Resources:
    2
    Maps:
    2
    Resources:
    2
    The question right now is why this trigger which should not actually be running at all due to the condition causes a crash when it is enabled.
     
  4. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Use Game - Display text message for debugging. You could post the other trigger also.
     
  5. Melth

    Melth

    Joined:
    Jul 8, 2013
    Messages:
    201
    Resources:
    2
    Maps:
    2
    Resources:
    2
    It's impossible to do this because TFT crashes immediately upon the spell being cast.
     
  6. LordDz

    LordDz

    Joined:
    May 11, 2007
    Messages:
    4,307
    Resources:
    0
    Resources:
    0
    Then disable parts of the trigger and see which action causes the crash.
    (Select an action and press CTRL + F).
     
  7. SAUS

    SAUS

    Joined:
    May 22, 2015
    Messages:
    1,050
    Resources:
    0
    Resources:
    0
    EligibleTargetsUnitArray[(Integer A)]

    What is this array? Is it initialised to size 73? I don't know if it would cause a crash or not, but it might.

    Why is it looping 72 times, anyway?

    Replace this chunk:
    Set TempUnit = (Random unit from TempUnitGroup)
    For each (Integer A) from 1 to 72, do (Actions)
    Loop - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
    TempUnit Equal to EligibleTargetsUnitArray[(Integer A)]
    Then - Actions
    Unit Group - Add (Summoned unit) to EnemiesTargetingEachBuildingAr[(Integer A)]
    Set TempPoint = (Position of (Summoned unit))
    Set TempPoint2 = (Position of EligibleTargetsUnitArray[(Integer A)])
    Set TempPoint3 = (TempPoint offset by 200.00 towards (Angle from TempPoint to TempPoint2) degrees)
    Unit - Order (Summoned unit) to Attack-Move To TempPoint3
    Custom script: call RemoveLocation (udg_TempPoint)
    Custom script: call RemoveLocation (udg_TempPoint2)
    Custom script: call RemoveLocation (udg_TempPoint3)
    Else - Actions

    with this:
    Set TempUnit = (Random unit from TempUnitGroup)
    Unit Group - Add (Summoned unit) to EnemiesTargetingEachBuildingAr[(Integer A)]
    Set TempPoint = (Position of (Summoned unit))
    Set TempPoint2 = (Position of TempUnit)
    Set TempPoint3 = (TempPoint offset by 200.00 towards (Angle from TempPoint to TempPoint2) degrees)
    Unit - Order (Summoned unit) to Attack-Move To TempPoint3
    Custom script: call RemoveLocation (udg_TempPoint)
    Custom script: call RemoveLocation (udg_TempPoint2)
    Custom script: call RemoveLocation (udg_TempPoint3)
     
  8. PublishedShadow

    PublishedShadow

    Joined:
    Jun 2, 2013
    Messages:
    599
    Resources:
    2
    Maps:
    2
    Resources:
    2
    How many Mirror Images are being created? Also, isn't there a "Summoning Unit" that you could try using instead of "Triggering Unit"?