• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Help With Trigger/Spell! (Crashes Editor)

Status
Not open for further replies.
Level 9
Joined
Oct 12, 2005
Messages
281
Whenever I enter the "Custom Script: loop" section of this:
Events

Unit - A unit Starts the effect of an ability

Conditions

(Ability being cast) Equal to Your Ability

Actions

-------- Required Variables --------
-------- - AntiLeak_Point --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

Or - Any (Conditions) are true

Conditions

(Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Your Item
(Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Your Item
(Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to Your Item
(Item-type of (Item carried by (Triggering unit) in slot 4)) Equal to Your Item
(Item-type of (Item carried by (Triggering unit) in slot 5)) Equal to Your Item
(Item-type of (Item carried by (Triggering unit) in slot 6)) Equal to Your Item

Then - Actions

Set AntiLeak_Point = (Position of (Triggering unit))
Item - Create Your Potion at AntiLeak_Point
Custom script: call RemoveLocation(udg_AntiLeak_Point)
Hero - Give (Last created item) to (Triggering unit)
Custom script: set bj_forLoopAIndex = 0
Custom script: loop
Custom script: set bj_forLoopAIndex = bj_forLoopAIndex + 1
If (All Conditions are True) then do (Then Actions) else do (Else Actions)

If - Conditions

(Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Your Item

Then - Actions

Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
Skip remaining actions

Else - Actions

Custom script: endloop

Else - Actions
, My world editor just crashes can someone tell me what is wrong?
 
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 4)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 5)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 6)) Equal to Your Item
    • Then - Actions
      • Set AntiLeak_Point = (Position of (Triggering unit))
      • Item - Create Your Potion at AntiLeak_Point
      • Custom script: call RemoveLocation(udg_AntiLeak_Point)
      • Hero - Give (Last created item) to (Triggering unit)
      • Custom script: set bj_forLoopAIndex = 0
      • Custom script: loop
      • Custom script: set bj_forLoopAIndex = bj_forLoopAIndex + 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Your Item
        • Then - Actions
          • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
          • Skip remaining actions
        • Else - Actions
      • Custom script: endloop
    • Else - Actions
There. I'm guessing this is how he has it.

But you're right, he's missing an exitwhen.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
The lack of an exitwhen would not cause the compiler to crash. It would just cause a lag spike in the game when it was run.

However, if the loop strikes home in the second if-statement, it doesn't really matter, as Skip remaining actions will end it. (With his if-statement, it should have to)

However, in GUI, I would suggest subbing in "For Each Integer A" rather than the JASS equivelant. It's better for the most part to use GUI in GUI (excluding leak fixing, which in many cases must be JASS), and JASS in JASS.
 
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 4)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 5)) Equal to Your Item
          • (Item-type of (Item carried by (Triggering unit) in slot 6)) Equal to Your Item
    • Then - Actions
      • Set AntiLeak_Point = (Position of (Triggering unit))
      • Item - Create Your Potion at AntiLeak_Point
      • Custom script: call RemoveLocation(udg_AntiLeak_Point)
      • Hero - Give (Last created item) to (Triggering unit)
      • For each Integer A from 1 to 6 do (Actions)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Your Item
          • Then - Actions
            • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
            • Skip remaining actions
          • Else - Actions
      • Else - Actions
Fixed now.
 
Status
Not open for further replies.
Top