How do you get a bot to run away from you? Ive made a script and everything in it is good except this:
Quote:function leitRunFromPlayer(obj)
{
obj.forwardSpeed.walk=35;
obj.motionVector.??????????;
obj.model.animation.start('Moving');
...
}
What should I define as motionVector?
That depends on what you want the bot to do.
"Run away from player" won't work (what direction?)
But you could make a spot (like behind a corner or something) that has the name "runawaySpot", (just an example) and use map.object.nearest(x,z,y,name,type,angle,angleSweep,minDist,maxDist); to return it's unique ID. Then make the bot move towards it.
I can't think of any other way to do this. :/
Couldn't you tell it to walk towards the player but assign a negative value for speed?
I don't think that assigning a negative value for speed will make the object go in the other direction. :/
It's worth a try though. :P
Good idea Brian, I will use that for Derek's spider.
I am very annoyed because I can't get the stupid spider to run away

.
---The negative value doesn't work, I've tried it.
ccccc Wrote:Good idea Brian, I will use that for Derek's spider.
I am very annoyed because I can't get the stupid spider to run away
.
---The negative value doesn't work, I've tried it.
The angle values have to be positive, 0 .... 360. The opposite is 180 away, so you can use utility.angle.add(myAngle,180); to get the opposite.
I'm going to post a couple scruffy scripts, it might help you and Derek along, I'll start a new thread for those, take a look later for them.
[>] Brian
If I could look at some sidescroller scripts it would help me greatly. Derek (if he hasn't read this) probably thinks I'm not working on anything.
--Now I didn't during the second half of the IM contest because of time, but besides that I'm trying, but I'm not used to sidescroller AI

.
ccccc Wrote:If I could look at some sidescroller scripts it would help me greatly. Derek (if he hasn't read this) probably thinks I'm not working on anything.
--Now I didn't during the second half of the IM contest because of time, but besides that I'm trying, but I'm not used to sidescroller AI
.
I put one up now, it's in this subforum (scripting), check it out, it's a very simple mario-turtle like go back and forth script.
[>] Brian