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.
[02:33 am]
Symmetry -- LLMS aren't intelligent and neither are most people :hurr:
[01:24 am]
Moose -- It's okay, I don't have "real" intelligence either because I'm retarded
[11:30 pm]
Zoan -- ya totes
[10:52 pm]
NudeRaider -- one thing I find fascinating is how sure many people are AI is not "real" intelligence. "It's just a probability machine". Well yes, but who told you your brain isn't?
[09:05 pm]
Zoan -- beep beep
[09:05 pm]
Zoan -- btw speaking of movies we saw Coyote vs Acme last night; that movie was great imo
[09:04 pm]
Zoan -- I threw in more of my thoughts, get ur popcorn ready
[07:59 pm]
Zycorax -- Damn, the popcorn smiley was just in my imagination :hurr:
[07:32 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: An SD thread on AI? omg YES inject that shit directly into my veins
looks like a whole lot of popcorn is needed. Interesting how ai - that soulless thing - can stir so much emotion in us humans. :awesome:
[03:42 pm]
Vrael -- time to suppress its visibility by finally responding in the Free Will topic :D
Please log in to shout.


Members Online: SigmaRaven, Sie_Sayoka, GregoryHolden, MobMob, Sprunki