HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Simple Triggers dont work / break loops?!

08-18-2007, 06:50 PM#1
Bloodlust
Hey again..
After like 2 hours im so fucking frustrated... some very simple GUI trigger refuse to work and I dont get why. After a while I stripped the trigger down to this and it still didnt work:

Trigger:
MovementGrid
Collapse Events
Player - Player 1 (Red) types a chat message containing -mgrid as An exact match
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 6, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units within Mgrid_DistanceCheck of ((Position of Mgrid_Unit) offset by Mgrid_Distance towards Grid_Degree[(Integer A)] degrees) matching (((Matching unit) is hidden) Equal to False))) Equal to 0
Collapse Then - Actions
Unit - Create 1 Mgrid_GFXunit for Neutral Passive at ((Position of Mgrid_Unit) offset by Mgrid_Distance towards Grid_Degree[(Integer A)] degrees) facing Default building facing degrees
Set Mgrid_PathUnit = (Last created unit)
Else - Actions

Map is 192x192, everything default. Mgrid_unit is a unmodified Paladin, Mgrid_GFXunit is a footman with 0 foodcost. Grid_Degree[1...6] are real values (0, 60, 120, 180, 240, 300). Mgrid_Distance is 128 and DistanceCheck is 96.

Im trying to create a ... "hex"(?)-grid around the unit. while trying to find out what causes the most weird errors, I changed the trigger several dozen times and finally stripped it down to what you can see above. The problem now is... "For each (Integer A) from 1 to 6, do (Actions)" only runs once with "1".
If I copy it 6 times with 1 to 1, 2 to 2, 3 to 3, etc... it works.

Other problems included the creation of units outside that values.. like the trigger changed the values of distance and distancecheck while running, because else those units couldnt have been there or that. Not to mention that some parts of it worked.. and now dont work anymore, even thou I recreated the same trigger 1:1 ...

Im already pissed enough to stop using the editor again for some weeks/months as I always do when something like this happens.. but I want to know what the fuck happened.
08-18-2007, 07:08 PM#2
cohadar
You are probably having very similar trigger that is doing the same thing
in the same time, make sure you disable all other triggers and then try that one.

If it still does not work convert it to text and post the code here
it could be an editor problem!? so I would like to see the JASS
08-18-2007, 08:06 PM#3
Bloodlust
I started over, new map, same unit and just made the trigger from scratch... (the same trigger, just in a new map) and it worked. Gotta hate GUI.