Home   Help Search Login Register  

Author Topic: My taxi script, what is wrong?  (Read 2312 times)

0 Members and 1 Guest are viewing this topic.

kevinfostereditguy

  • Guest
My taxi script, what is wrong?
« on: 11 Dec 2002, 22:16:00 »
This is my script for a taxi to pick a destination, and when close enough to that destination, picks another what it is not at. it usually just stops at the first, whats wrong?

Code: [Select]
taxi domove getpos taxipat1
taxi stop false
taxi setspeedmode "limited"
taxi setbehaviour "safe"

number = random 3

?(number <= 1) : taxi domove getpos taxipat1
?(number <= 2) : taxi domove getpos taxipat2
?(number <= 3) : taxi domove getpos taxipat3

#loop
?(taxi Distance taxipat1 <= 5) : goto "fromtaxipat1"
?(taxi Distance taxipat2 <= 5) : goto "fromtaxipat2"
?(taxi Distance taxipat3 <= 5) : goto "fromtaxipat3"
goto "loop"

#fromtaxipat1
number = random 2
?(number <= 1) : taxi domove getpos taxipat2
?(number <= 2) : taxi domove getpos taxipat3
goto "fromtaxipat1loop"

#fromtaxipat1loop
?(taxi Distance taxipat2 <= 5) : goto "fromtaxipat2"
?(taxi Distance taxipat3 <= 5) : goto "fromtaxipat3"
goto "fromtaxipat1loop"


#fromtaxipat2
number = random 2
?(number <= 1) : taxi domove getpos taxipat1
?(number <= 2) : taxi domove getpos taxipat3
goto  "fromtaxipat2loop"

#fromtaxipat2loop
?(taxi Distance taxipat1 <= 5) : goto "fromtaxipat1"
?(taxi Distance taxipat3 <= 5) : goto "fromtaxipat3"
goto "fromtaxipat2loop"


#fromtaxipat3
number = random 2
?(number <= 1) : taxi domove getpos taxipat2
?(number <= 2) : taxi domove getpos taxipat3
goto "fromtaxipat3loop"

#fromtaxipat3loop
?(taxi Distance taxipat1 <= 5) : goto "fromtaxipat1"
?(taxi Distance taxipat3 <= 5) : goto "fromtaxipat2"
goto "fromtaxipat3loop"

taxipats are points i have put on the map as game logics, the destination for the taxi

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:My taxi script, what is wrong?
« Reply #1 on: 11 Dec 2002, 22:38:57 »
try using move command instead of domove :D

also sugest u add delay (~0.1) in da loop

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

kevinfostereditguy

  • Guest
Re:My taxi script, what is wrong?
« Reply #2 on: 11 Dec 2002, 22:40:10 »
command or commandmove?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:My taxi script, what is wrong?
« Reply #3 on: 11 Dec 2002, 22:47:18 »
i meen - move - da command is move :D

taxi move getpos taxipat1

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

kevinfostereditguy

  • Guest
Re:My taxi script, what is wrong?
« Reply #4 on: 11 Dec 2002, 23:45:06 »
hm, this is a noodle scratcher. ill attatch what iv got and u can see what u can see if u like.

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:My taxi script, what is wrong?
« Reply #5 on: 12 Dec 2002, 17:25:15 »
fixed it :D

check dis out ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

kevinfostereditguy

  • Guest
Re:My taxi script, what is wrong?
« Reply #6 on: 12 Dec 2002, 17:29:29 »
aaaah, i got the random numbers mixed around? thanx LCD, iv never used that command until now.

Loc-Dog

  • Guest
Re:My taxi script, what is wrong?
« Reply #7 on: 14 Jan 2003, 04:11:07 »
You can just use a short delay of ~0.001 in loops, no problemo.