Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Question on using location grid
Question on using location grid
May 15 2014, 11:03 pm
By: trgk  

May 15 2014, 11:03 pm trgk Post #1



Please explain the map.

Wraith is created at where it was expected to be, but Terran machine shop isn't created well.

[attach=9493]

Wraith doesn't affect the bug.

Trigger looks like:

Code
Trigger("Player 1"){
Conditions:
    Always();
    Elapsed Time(At least, 2);

Actions:
    Move Location("Player 9", "Map Revealer", "ddrr", "X");
    Move Location("Player 9", "Map Revealer", "X", "Y");
    Move Location("Player 9", "Map Revealer", "Y", "Main");
    Create Unit("Player 1", "Terran Wraith", 1, "Main");
    Create Unit("Player 1", "Terran Machine Shop", 1, "Main");
}

//-----------------------------------------------------------------//




and the map looks like this.

[attach=9492]

Attachments:
test2.png
Hits: 0 Size: 43.53kb
overview.jpg
Hits: 0 Size: 38.38kb
lgridtest.scm
Hits: 1 Size: 34.71kb

Post has been edited 3 time(s), last time on May 16 2014, 1:25 am by trgk.



EUD

May 16 2014, 1:24 am trgk Post #2



Solved. Bug of location grid techniques.

(This seems to be in fact a bug of Starcraft. Starcraft is inconsistent for including right edge in the location.
But anyway, we cannot fix SC. So this should be regarded as a bug of location grid techniques itself.)


SC Location shifting works by the following way.
(Not exact code, but it works like this)

Code
 width = location.right - location.left;
 if(location.left < 0) {
   location.left = 0
   location.right = width;
 }

 if(location.right [b]>=[/b] mapwidth) {     // right edges are included in location.
   location.right = mapwidth - 1;
   location.left = location.right - width;
 }



In my map, location X has width 2048 (left = 0, right = 2048)
After move location:

- location.left = -1
- location.right = 2047

weird. So location main is centered at (1023, 1023), shifted one pixel up and left from the intended position.
Buildings created with triggers seems to snap to grid by flooring coordinates, so 64*64 box centered at (1023, 1023) is
( 991, 991 ) ~ ( 1055, 1055 )

After flooring by unit 32:
( 960, 960 ) ~ ( 1024, 1024 )

So buildings are built at some weird position.

Post has been edited 4 time(s), last time on May 16 2014, 9:29 am by trgk.



EUD

May 16 2014, 8:03 am Wormer Post #3



Weird. Actually I myself had some problems with this in the past. Never really figured out what was happening, but I think move location works fine, it's just the problem of rounding, because 2028 pixels wide location doesn't have a middle.



Some.

May 26 2014, 10:15 am Sacrieur Post #4

Still Napping

Quote from trgk
weird. So location main is centered at (1023, 1023), shifted one pixel up and left from the intended position.

http://www.staredit.net/topic/14204/



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
Please log in to shout.


Members Online: jun3hong, Roy