|Lancelot||How can i let a character guard a room like in walk around it all the time.|
The easy answer is:|
where theGuard is a pointer and Guard is an instance, or something like that. I forget the technical terminology. ^_^ However, when I tried to set up it, I noticed a small issue. You'll want to set up the looper as well:
Otherwise, he "floats". XD
The more difficult answer involves writing your own "wander" class, but that's a bit beyond my scope at the moment. ^_~
Hey I was thinkin about your question and with wander the guard is going to go all over the screen, you could set up a changestate method and set it up so that he'll walk to one point before he walks to another point and so on.|
or, a simpler but but more fun approach...
set up a method doit that goes something like
if guard on control colour red then setmotion walk to xy1, else if guard on control colour green then setmotion walk to xy2
now add the two colours to your pictures each surrounding the appropriate set of xy
when init the guard be sure to set him on one of the two colors, and he should just truck back and forth.
Thanks that did it.|
I had the problem by using the wander method.
Here a scrip with wander is used:|
|Nychold||There is also a DPath class (which I found after I had finished a Path class) which allows you to add points (x,y) to a List, and then those points get cycled through. Unfortunately, I didn't see a way to pause the actor, which I'm currently working on. You may want to look into using this class, as well. :)|