Page 1 of 1

Vehicle Problem

Posted: Sat Oct 02, 2004 9:19 am
by alexander
I've got a map, and i've made vehicle points on it. and i have a crossing
there are 2 ways you can come from, and 2 ways you can leave from the crossing. and i have the following script

Code: Select all



main:
exec global/ai.scr
exec global/loadout.scr maps/test_truckmove.scr
exec gloal/friendly.scr

level waittill prespawn
exec global/ambient.scr test_truckmove
level waittill spawn
level.script = "maps test_vehicle.scr"
thread truck

end

truck:
$truck1 drive $t1 //$truck1 = the truck, $t1 = waypoint 1
thread truckcross
end

truckcross:
crossdirnames[1][1] = $t64 // entering direction 1, leave dir. 1
crossdirnames[1][2] = $t67 // entering direction 1, leave dir. 2
crossdirnames[2][1] = $t61 // entering direction 2, leave dir. 1
crossdirnames[2][2] = $t30 // entering direction 2, leave dir, 2
while (1) {
  $truck waittil drive
  crossdirnew = randomint (2) 
  $truck drive crossdirnames[crossdirnew][crossdirold]
crossdirold = crossdirnew
}
end
can anybody tell me what i am doing wrong?

Re: Vehicle Problem

Posted: Sat Oct 02, 2004 9:31 am
by jv_map
alexander wrote:can anybody tell me what i am doing wrong?
You forgot to put local. in front of your variable names :wink:

crossdirnames[1][1] = $t64 // entering direction 1, leave dir. 1
crossdirnames[1][2] = $t67 // entering direction 1, leave dir. 2
crossdirnames[2][1] = $t61 // entering direction 2, leave dir. 1
crossdirnames[2][2] = $t30 // entering direction 2, leave dir, 2

should be

local.crossdirnames[1][1] = $t64 // entering direction 1, leave dir. 1
local.crossdirnames[1][2] = $t67 // entering direction 1, leave dir. 2
local.crossdirnames[2][1] = $t61 // entering direction 2, leave dir. 1
local.crossdirnames[2][2] = $t30 // entering direction 2, leave dir, 2

level.script

Posted: Sat Oct 02, 2004 4:02 pm
by tltrude
This line is wrong too, but will probably not cause the script to fail.

level.script = "maps test_vehicle.scr"

should be:

level.script = maps/test_vehicle.scr

or:

level.script = maps/dm/test_vehicle.scr

Posted: Sat Oct 02, 2004 6:45 pm
by alexander
ok ill try...

already thanx...

it didn't work :( ..by the way...this is the .map file:

Scrip file
Map file

Posted: Sat Oct 02, 2004 9:23 pm
by jv_map
There's a few more variable names that need a local. in front :wink:

Posted: Sun Oct 03, 2004 12:51 am
by Master-Of-Fungus-Foo-D
hmm i took a look into the map and heres my thought...

is the vehiclepoints being underground a problem at all?