Vehicle Problem

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
alexander
Private
Posts: 6
Joined: Mon Sep 20, 2004 2:22 pm
Location: Netherlands

Vehicle Problem

Post 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?
{AK} (211) NIHFSS

ALEX
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Re: Vehicle Problem

Post 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
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

level.script

Post 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
Tom Trude,

Image
alexander
Private
Posts: 6
Joined: Mon Sep 20, 2004 2:22 pm
Location: Netherlands

Post by alexander »

ok ill try...

already thanx...

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

Scrip file
Map file
{AK} (211) NIHFSS

ALEX
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

There's a few more variable names that need a local. in front :wink:
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post 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?
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Post Reply