HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Convert Coordinates to Point [GUI]

01-20-2006, 10:01 PM#1
Jacek
OK... I have a trigger:

Trigger:
init
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 64, do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to 64, do (Actions)
Collapse Loop - Actions
Set loc = (Point(((Real((Integer A))) x 15.00), ((Real((Integer B))) x 15.00)))
Unit - Create 1 Wisp for Neutral Extra at loc facing Default building facing degrees
Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
Custom script: call RemoveLocation(udg_loc)
Custom script: set udg_loc = null

I thought that units will be spawned from upper-left corner, but they are occupying center of map. And I don't know why
Second, do I have some leaks in this trigger? I am not too good in hunting GUI leaks.
01-20-2006, 11:15 PM#2
Vexorian
because coordinates start with negative numbers, and the center is usually 0,0
01-21-2006, 09:38 AM#3
Anitarf
Yes, unless you change map bounds, the centre of the map should always be 0, 0.
01-21-2006, 12:08 PM#4
Jacek
Thanks
01-21-2006, 11:32 PM#5
PerfectlyInsane
Nice stuff.