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.
[06:40 am]
Oh_Man -- true
[03:16 am]
RIVE -- Still annoyed there was never a trigger to stop or pause wavs.
[01:40 am]
Oh_Man -- tthen u come to SCBW and it's like - upload WAV, play WAV.... sigh why cant it be that easy
[01:40 am]
Oh_Man -- and no consistent easy to use way to then play the audio either
[01:39 am]
Oh_Man -- where they use third party audioprogram called WWISE which basically makes adding audio extremely difficult
[01:39 am]
Oh_Man -- i appreciate SCBW's ability to just let us upload and play WAVs so much compared to nightmare that is total war warhammer 3
[2026-7-18. : 2:27 am]
Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
[2026-7-17. : 2:58 pm]
Ultraviolet -- Symmetry
Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
fr fr
[2026-7-17. : 2:39 am]
Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
[2026-7-16. : 6:28 am]
NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
Please log in to shout.


Members Online: lucaspalm