• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

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