Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,886 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
car AI path question #83715
07/29/06 06:36
07/29/06 06:36
Joined: Jun 2006
Posts: 86
Asia
xboy360 Offline OP
Junior Member
xboy360  Offline 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 Offline
Expert
FoxHound  Offline
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: FoxHound] #83717
07/29/06 13:30
07/29/06 13:30
Joined: Jun 2006
Posts: 214
Germany, NRW
T
TheThinker Offline
Member
TheThinker  Offline
Member
T

Joined: Jun 2006
Posts: 214
Germany, NRW
I would script a waypoint like system. If a special dist is reached, the car must be oriented on waypoints in the road. An easy and ungly way is to use two paths for each site of the road. (Sorry, i am not so familar with english words for traffic situations).

It's a very difficult quest to produce a 'nice' code for it.

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 Offline
Expert
FoxHound  Offline
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: FoxHound] #83719
07/30/06 11:18
07/30/06 11:18
Joined: Jun 2006
Posts: 86
Asia
xboy360 Offline OP
Junior Member
xboy360  Offline OP
Junior Member

Joined: Jun 2006
Posts: 86
Asia
wohoo,thanks for the tips! Vry Helpful. And sorry about that "side", heheh...

One quick question, i used trace to let the car detect the player. This is my first time to use trace, so when i add ignore_models to trace_mode, will it also ignore me(the player)? i tried and the answer is yes.How do i do this --ignore_models except player? Ok i know this is not a quick question but answers will me much appreciated tnx!


Happy Birthday!
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 Offline
Expert
FoxHound  Offline
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: xboy360] #83721
07/30/06 12:36
07/30/06 12:36
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
set the "Ignore_me" flag so the entity which sends the trace will be ignored,
then you simply have to check:
if(you == player) //or whatever your player pointer is
after the trace instruction

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 Offline
Expert
FoxHound  Offline
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: FoxHound] #83723
07/30/06 16:41
07/30/06 16:41
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
you can also put this in there right before the trace
"you=player;"


and then put "ignore_you" in the trace, since the trace will change this pointer right afterwards anyways.

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 Offline
Expert
Xarthor  Offline
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 }
}



Page 1 of 2 1 2

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1