OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: kevinfostereditguy on 11 Dec 2002, 22:16:00

Title: My taxi script, what is wrong?
Post by: kevinfostereditguy 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
Title: Re:My taxi script, what is wrong?
Post by: LCD 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
Title: Re:My taxi script, what is wrong?
Post by: kevinfostereditguy on 11 Dec 2002, 22:40:10
command or commandmove?
Title: Re:My taxi script, what is wrong?
Post by: LCD on 11 Dec 2002, 22:47:18
i meen - move - da command is move :D

taxi move getpos taxipat1

LCD OUT
Title: Re:My taxi script, what is wrong?
Post by: kevinfostereditguy 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.
Title: Re:My taxi script, what is wrong?
Post by: LCD on 12 Dec 2002, 17:25:15
fixed it :D

check dis out ;D

LCD OUT
Title: Re:My taxi script, what is wrong?
Post by: kevinfostereditguy on 12 Dec 2002, 17:29:29
aaaah, i got the random numbers mixed around? thanx LCD, iv never used that command until now.
Title: Re:My taxi script, what is wrong?
Post by: Loc-Dog on 14 Jan 2003, 04:11:07
You can just use a short delay of ~0.001 in loops, no problemo.