Page 1 of 1

Truck error

Posted: Sun Jan 11, 2004 4:41 pm
by martijn_NL
I made a op truck gave it a target name added some veheicle paths, gave it a targetname. It then i used this script line:

Code: Select all

$truck1 thread global/vehicles_thinkers.scr::enemy_truck_think 2000 6 $truck1_path $trigger_truck1 green human/german_wehrmact_soldier 0 truck1_guys truck1_driver
When i ran into the trigger the truck did not moved, but the ai was already in the back of the truck. The console gave this error:
truck starting to drive
self drive local.path local.speed local.accel 200 local.lookahead (global/vehicles_thinkers.scr, 277)
self ^

^~^~^ Script Error: Cannot cast 'array' to entity
Does someone know what i can do the make the truck drive???

Posted: Sun Jan 11, 2004 4:54 pm
by jv_map
Do you by any chance have more than 1 entity named 'truck1' ?

Posted: Sun Jan 11, 2004 6:57 pm
by martijn_NL
I changed the $targetname of the truck in truck2 and i still get the same error.

Posted: Sun Jan 11, 2004 11:18 pm
by omniscient
i dunno much about this, but look for the word array, and make sure it isnt in the wrong place :D prolly wont work but wirht a shot eh.

Posted: Mon Jan 12, 2004 3:51 pm
by bdbodger
Is this suppose to be on the same line it looks like it is : truck1_guys truck1_driver

enemy_truck_think local.hp local.passengers local.path local.trigger local.type local.guy_type local.special:

global/vehicles_thinkers.scr::enemy_truck_think 2000 6 $truck1_path $trigger_truck1 green human/german_wehrmact_soldier 0 truck1_guys truck1_driver
the only option for special is panzer to give one of the ai's a panzerschrek

if ( (local.special == "panzer") && (local.slot == 1) )
local.gun = "panzerschrek

You don't need to add a 0 to the last option just leave it out .

Posted: Mon Jan 12, 2004 6:34 pm
by martijn_NL
I found the error, i had a double vehicle piont with the same targetname :oops: , thanks for the help anyway