A still enemy Unit.
Moderator: Forum Moderators
-
- Posts: 16
- Joined: March 10th, 2010, 4:27 pm
A still enemy Unit.
Hello together,
can anyone say me how I can creat a unit which doesnt move until the player attacks it?
Greez
can anyone say me how I can creat a unit which doesnt move until the player attacks it?
Greez
Re: A still enemy Unit.
Well, if you're in debug mode you can turn an AI unit into a "guardian". This means it won't move until an enemy comes within it's movement radius. That's about as close as I can come with my limited knowledge of WML, but I'll add it just in case.
(Or to save the time of people who *do* know what they're talking about)
(Or to save the time of people who *do* know what they're talking about)
- artisticdude
- Moderator Emeritus
- Posts: 2424
- Joined: December 15th, 2009, 12:37 pm
- Location: Somewhere in the middle of everything
Re: A still enemy Unit.
This should probably have been posted in the WML forums, as this forum is more for story and dialogue than coding problems.
As far as your question goes, there are a number of ways you could do this, but none of them are exactly easy to code. Unless it's absolutely necessary for the unit not to move until it is attacked, you can get away with the ai_special=guardian, which works as stated above.
As far as your question goes, there are a number of ways you could do this, but none of them are exactly easy to code. Unless it's absolutely necessary for the unit not to move until it is attacked, you can get away with the ai_special=guardian, which works as stated above.
"I'm never wrong. One time I thought I was wrong, but I was mistaken."
-
- Posts: 16
- Joined: March 10th, 2010, 4:27 pm
Re: A still enemy Unit.
THX. It has worked. Sorry for the wrong thread. Greez
Re: A still enemy Unit.
btw, if you modify the units movement costs (to 100 each) it wont move until it gets attcked
(this can be easily done via object-->effect for example)
i still recommend to set the unit ALSO to guardian though since this will save a lot of ai calc time
(this can be easily done via object-->effect for example)
i still recommend to set the unit ALSO to guardian though since this will save a lot of ai calc time
The best bet is your own, good Taste.