3 registered members (Dico, AndrewAMD, TipmyPip),
16,874
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
car AI path question
#83715
07/29/06 06:36
07/29/06 06:36
|
Joined: Jun 2006
Posts: 86 Asia
xboy360
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2006
Posts: 86
Asia
|
hello evryone, how do i program a car that overtakes the player when it senses that the player is near an object?Kinda like a taxi.Yes! a taxi game, that's what i'm making. I try making 2 paths, one for each side of the road / left and right. Now this car/taxi-opponent follows the right path. When it senses a player stopping for a passenger in front of it, it ignores the passenger and goes to the left path(path for overtaking),after maybe 3 secs, it goes back to the right path. I am trying everything in the manual to make it work, searching for path functions, but gives unwanted results. Can someone help me, or is my solution not right? Thanks in advance! I'll post this game when i finish it. 
Happy Birthday!
|
|
|
Re: car AI path question
[Re: xboy360]
#83716
07/29/06 08:53
07/29/06 08:53
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
A lot of programming is thought. In fact a programmer is worthless if he can't come up with his own theory.
Have you got to the point of getting the AI to pick up passangers? After this point you can tell it to ignore passangers if the player is so close and driving at a slow speed. If it's ignroing that passanger it should go back to it's "search for passanger" function.
If you're not this far, you need to worry about this later.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: car AI path question
[Re: TheThinker]
#83718
07/29/06 15:51
07/29/06 15:51
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
you means "lanes" the left lane and the right lane.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: car AI path question
[Re: xboy360]
#83720
07/30/06 12:36
07/30/06 12:36
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
quick answer: You can't.
What you can do is do that trace, and if it's that player keep tracing.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: car AI path question
[Re: Xarthor]
#83722
07/30/06 13:19
07/30/06 13:19
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
he said "ignore_models except player" not ignore player and look for other models.
One idea i have now is if the player is the only model you care about then put in the ignore_models and do the trace from the player to you, see if the trace makes it. if not then you know you can't see the player.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: car AI path question
[Re: lostclimate]
#83724
07/30/06 17:31
07/30/06 17:31
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
@FoxHound: Thats what I mean. You simply do NOT ignore models but if you have found one, then you check if it is the player, if not you don't care about it, but if it is the player you can do whatever you want. @lostclimate: Thats what FoxHound is talking about, your code would ignore the player. But xboy360 wants to ignore all models BUT the player. so this pseudo code would work: Code:
c_trace(from,to,ignore_me); if(you != null) { if(you == player) { //do something } }
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|