Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Problem with grids
Problem with grids
Jul 18 2008, 10:48 pm
By: M s4  

Jul 18 2008, 10:48 pm M s4 Post #1



I'm trying work with a mobile grid and did a simple test.

Location 9 is a 6x6 location.
Location 10 is a 2x2 location.

Here is my trigger:
Code
    Create Unit("Player 2", "Zerg Mutalisk", 9, "Location 9");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Kill Unit At Location("Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Move Location("Player 3", "Zerg Mutalisk", "Location 9", "Location 10");
    Wait(1000);
    Create Unit("Player 1", "Uraj Crystal", 1, "Location 10");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Kill Unit At Location("Player 3", "Zerg Mutalisk", 2, "Location 9");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Move Location("Player 3", "Zerg Mutalisk", "Location 9", "Location 10");
    Wait(1000);
    Create Unit("Player 1", "Khalis Crystal", 1, "Location 10");
    Wait(1000);
    Kill Unit At Location("Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Move Location("Player 3", "Zerg Mutalisk", "Location 9", "Location 10");
    Wait(1000);
    Create Unit("Player 1", "Khaydarin Crystal", 1, "Location 10");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 2, "Location 9");
    Wait(1000);
    Kill Unit At Location("Player 3", "Zerg Mutalisk", 3, "Location 9");
    Wait(1000);
    Give Units to Player("Player 2", "Player 3", "Zerg Mutalisk", 1, "Location 9");
    Wait(1000);
    Move Location("Player 3", "Zerg Mutalisk", "Location 9", "Location 10");
    Wait(1000);
    Create Unit("Player 1", "Zerg Zergling", 1, "Location 10");
    Wait(1000);
    Kill Unit At Location("All players", "Zerg Mutalisk", All, "Location 9");

I run it and I get this:



Now I added the waits to observe what was going on. But when I remove the waits, I get this.



Does anyone know what is wrong with it?



None.

Jul 18 2008, 10:51 pm Falkoner Post #2



Why don't you just remove the unit to begin with, rather than giving it, then removing it? Try doing that and see if it fixes it. Right now it looks like it is centering on a non-existent unit, so they all just get created in the middle of the large location. Also, try making the location larger than it needs to be, sometimes the units get placed weirdly because there is no room inside the location for them.



None.

Jul 19 2008, 12:00 am M s4 Post #3



That does not explain why removing waits makes the trigger behave differently.



None.

Jul 19 2008, 12:09 am Atlos Post #4



Try replacing the "Kill Unit" with "Remove Unit". If it works then I'll post an explanation.



None.

Jul 19 2008, 1:43 am M s4 Post #5



Changing Kill Unit to Remove Unit did the trick. If you are too bothered to explain why you don't need to, unless not knowing why could potentially screw me up later.



None.

Jul 19 2008, 1:52 am Atlos Post #6



It's no problem to explain. I just didn't want to write an explanation and have it turn out to be wrong. :P

Anyways, when you use "Kill Unit" it takes a trigger cycle for the unit to be considered gone. Using waits will refresh the trigger cycle which is why it worked originally. So to breakdown what was happening, you would kill the first mutalisk and then try to center on the second. What was really happening was that the first mutalisk was still considered there, and the location was centering on where it used to be. So in the end, all of the locations you centered ended up being centered in the exact same spot which is why your crystals were all messed up. Powerups can be created over units, so when you created the powerup at the location it was pushed to the side instead of giving you the unplaceable error.

Also, what's strange is that the following triggers would work on a map that has only 1 marine placed on it:
Quote
Always
-------
Kill All marine at anywhere for current player

Current Player brings at least 1 marine to anywhere
----------
Create 1 Firebat at location anywhere
While the following trigger series would not work:

Quote
Always
-------
Remove All marine at anywhere for current player

Current Player brings at least 1 marine to anywhere
----------
Create 1 Firebat at location anywhere
Lazy Blizzard programming. :P



None.

Jul 19 2008, 4:59 am rockz Post #7

ᴄʜᴇᴇsᴇ ɪᴛ!

There's a whole bunch of finicky trigger commands (like the difference between command and bring, remove and kill, etc...) You might try "give unit" as well, since I think that's instant. When something behaves erratically like this, it's best to test it out in a separate map to see what is really happening. Hopefully, the wiki has some data on it too.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Jul 19 2008, 6:38 pm M s4 Post #8



What is the difference between command and bring?



None.

Jul 20 2008, 3:50 am Falkoner Post #9



Command is updated slightly slower than bring is. And bring can be at any location, command basically means the entire map, also, command can detect some things that bring can't, such as comsat sweeps.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[05:41 am]
Ultraviolet -- 🤔 so inf is in you?
[04:57 am]
O)FaRTy1billion[MM] -- my name is mud
[04:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
[2024-5-16. : 5:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
[2024-5-16. : 3:36 pm]
NudeRaider -- :lol:
Please log in to shout.


Members Online: 7camilac5685fb7, 8milae5823he9, 5adrianc323tp9