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
-
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?
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
-
try using move command instead of domove :D
also sugest u add delay (~0.1) in da loop
LCD OUT
-
command or commandmove?
-
i meen - move - da command is move :D
taxi move getpos taxipat1
LCD OUT
-
hm, this is a noodle scratcher. ill attatch what iv got and u can see what u can see if u like.
-
fixed it :D
check dis out ;D
LCD OUT
-
aaaah, i got the random numbers mixed around? thanx LCD, iv never used that command until now.
-
You can just use a short delay of ~0.001 in loops, no problemo.