Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: "Pushing" a unit out of location
"Pushing" a unit out of location
Jul 6 2009, 5:33 am
By: Saox  

Jul 6 2009, 5:33 am Saox Post #1



So here is my question.

I have a hero unit, on which I centered 3 locations: small, medium, large. Is it possible(if yes, then how) to push away all foes from the hero starting by small, medium, large and in the right direction? A spell is supposed to triggert his.



None.

Jul 6 2009, 6:05 am Falkoner Post #2



Yes, you'd have to use several Mobile Grids to first get locations on all sides of your hero, then secondly, get more locations even further out than that to order the units away.

Alternatively, you could also try the Junk Yard Dog AI, see if that does the trick, but I think the enemies might just keep attacking.



None.

Jul 6 2009, 6:10 am Echo Post #3



The best way to do this is by using mobile grid.
You should read up on this if you don't understand it; http://www.staredit.net/wiki/Grid_Systems

Here is a visual of what you should be doing

Let's say that the Xs are where the units can come to and the Qs are where they would be pushed back. The O is where the hero unit is at
Code
Q Q Q Q Q
Q X X X Q
Q X O X Q
Q X X X Q
Q Q Q Q Q


So basically with the mobile grid, you would probably need a 5x5, depending on how big you want it

What you do is detect by moving a location on the enemy unit and if it brings both the enemy unit and whatever unit you're using for the grid at location X and you move it to location Q.

Let's say they entered from "Z". What you would have to do is move it back to "Y".

Code
Q Q Q Q Q
Q X X X Q
Q X O X Q
Q X Z X Q
Q Q Y Q Q


So basically after you create the first grid and detect where it entered from, you create a second unit grid and push it back to the corresponding location/unit.

You would have to read the wiki to understand this.
3 4 7
2 6 8
1 5 9

That is the order that the locations are moved and how the units are removed. You would just have to extend it by 5x5 so it would be like this.

5 6 11 16 21
4 7 12 17 22
3 8 14 18 23
2 9 13 19 24
1 10 15 20 25

So with this, you replace the Xs and Qs.


Let's say the enemy unit brings a zealot to grid 13 (Location 5 if you want to start it at a 3x3 grid). You would already have a location on the hero to detect if an "foe" brings a unit there. If it does, you move location "Enemy" on the zealot at location "Hero". Then depending on which grid location the zealot is at and what grid unit is on location "Enemy", you recreate a larger grid (if you didn't create a 5x5) and then you move it to location 15.

If that way is more complicated, you should probably practice and try to learn more about the grid system and for now use a cheap imitation of it. One of the easy way is to create an observer or any other invisible unit that is on junk yard and make the enemy unit move below the observer.



None.

Jul 6 2009, 6:35 am rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from Falkoner
Yes, you'd have to use several Mobile Grids to first get locations on all sides of your hero, then secondly, get more locations even further out than that to order the units away.

Alternatively, you could also try the Junk Yard Dog AI, see if that does the trick, but I think the enemies might just keep attacking.
temporarily ally would do the trick with JYD.

Otherwise, I think a mobile grid would do best. a 5x5 grid would work, but a 9x9 would be better, and much harder to trigger (you have 4 circles rather than 2).



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

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:41 am]
ManCubuS -- Seems like something's broken regarding the site then. Sadge...
[07:36 am]
Oh_Man -- have i ever told u guys my SC2 pro-gamer story
[11:30 pm]
Ultraviolet -- That's strange, it looks like you targeted the base image file (sometimes people make the mistake of just using the imgur page link which doesn't work for embedding) but it still didn't work it sounds like.
[2026-7-26. : 3:34 pm]
ManCubuS -- Used : " [img=https://i.imgur.com/gpOjTuD.jpeg] "
[2026-7-26. : 3:28 pm]
ManCubuS -- Even tried with imgur, doesn't attach.
[2026-7-26. : 3:14 pm]
ManCubuS -- I should try a workaround, thanks! Sadly imgur is blocked in my country for some unknown reason.
[2026-7-26. : 3:05 pm]
NudeRaider -- I think SEN has trouble with https or hotlinking is forbidden. It certainly is nothing about the size, it just fails to get any size. You can get it working if you use imgur and include the actual image link for the img tag. Like this: [img=https://i.imgur.com/ddYqXZa.jpeg]
[2026-7-26. : 11:15 am]
ManCubuS -- Hey fellas! Anyone knows why when I try to upload an image it says "failed to get image size"? I even tried making it so small. Imgur isn't working here and I tried postimg no luck.
[2026-7-23. : 6:40 am]
Oh_Man -- true
[2026-7-23. : 3:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
Please log in to shout.


Members Online: Symmetry