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.
[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.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: adelinedfischer, Moose