Truck error

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Truck error

Post 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???
Mapping 4 life
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Do you by any chance have more than 1 entity named 'truck1' ?
Image
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post by martijn_NL »

I changed the $targetname of the truck in truck2 and i still get the same error.
Mapping 4 life
omniscient
Major General
Posts: 694
Joined: Tue Sep 16, 2003 12:02 am

Post 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.
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post by martijn_NL »

I found the error, i had a double vehicle piont with the same targetname :oops: , thanks for the help anyway
Mapping 4 life
Post Reply