• 🏆 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!

Game Crash without error message on trigger

Status
Not open for further replies.
Level 12
Joined
Jan 13, 2008
Messages
559
  • toFist
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Unit-type of (Triggering unit)) Not equal to Fist
      • (Unit-type of (Triggering unit)) Not equal to Backpack
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • For each (Integer toFist_int) from 0 to maxUnits, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to items[toFist_int]
              • (Unit-type of (Triggering unit)) Equal to units[toFist_int]
            • Then - Actions
              • Unit Group - Remove (Triggering unit) from heroGroup
              • Wait 0.01 seconds
              • Trigger - Turn off get crafting points <gen>
              • Set TempLoc = (Center of (Playable map area))
              • Unit - Create 1 no weapon or tool equipped (dummy_CraftingTable) for (Owner of (Triggering unit)) at TempLoc facing Default building facing degrees
              • Custom script: call RemoveLocation(udg_TempLoc)
              • Unit - Replace (Triggering unit) with a Fist using The old unit's relative life and mana
              • Hero - Modify Strength of (Last replaced unit): Set to (Strength of (Triggering unit) (Exclude bonuses))
              • Hero - Modify Agility of (Last replaced unit): Set to (Agility of (Triggering unit) (Exclude bonuses))
              • Hero - Modify Intelligence of (Last replaced unit): Set to (Intelligence of (Triggering unit) (Exclude bonuses))
              • Hero - Set (Last replaced unit) experience to (Hero experience of (Triggering unit)), Hide level-up graphics
              • Selection - Select (Last replaced unit) for (Owner of (Triggering unit))
              • Set player_hero[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
              • Unit Group - Add (Last replaced unit) to heroGroup
              • Trigger - Turn on get crafting points <gen>
            • Else - Actions
without the wait 0.01 seconds the game crashes..but why?
 
when using event
  • Unit - A unit Loses an item
and when you making some actions in this trigger - you should know that for game engine this dropped item is still inside hero inventory.
Inside this action:
  • Unit - Replace (Triggering unit) with a Fist using The old unit's relative life and mana
there is Drop item from OldHero action (and give to new unit), so I susspect here infinite loop. It will crash when inside loop:
  • For each (Integer toFist_int) from 0 to maxUnits, do (Actions)
like in your trigger. Find diffrent solution.
(Moreover using waits inside a loop is not a good idea)
 
Status
Not open for further replies.
Top