| 04-28-2007, 06:31 PM | #1 |
I made a castle door that react just the way I like. It open when a friedly unit enter a nearby region and the enemy needs to destroy it before he can enter. I made a door doodad and a door unit without pathing that need to be destroyed to destroy the doodad door. The thing is, if my unit is far from the door, instead of walking toward it if I order it to enter the castle, it tries to go around. My question is, what's the best way to make my unit ignore the door pathing while enemy units dont ? |
| 04-28-2007, 09:52 PM | #2 |
I've had vague thoughts of trying to have waygate with points on either side of the gate so units think they can still walk through. You would disable them when gates open, and gates would open before you get to themso allied units aren't a problem. How you would stop enemy units getting through, well, dunno. Something else which is a bit hackish, but might work, is to detect if a unit is issued a move/smart order inside the castle area and reissue the order to just outside it. Cancels the order inside though :/. |
| 04-29-2007, 01:23 PM | #3 |
I might try the waygates once I find a good tutorial :) What about dynamic creation of pathing blocker ? Would it be possible to create them when an unit get close and remove them when the door opens ? I just have a hard time putting this in code cause it look like it might have conflic when both an ally and an enemy enter at the same time. |
| 04-29-2007, 06:47 PM | #4 |
There might be a way to tweak the waygate ability so that it can only be targeted by Allies, otherwise, you should be able to detect when an enemy gets a smart order to go through the way gate, and then just redirect that order to an attack on the gate. |
