Truck not moving.....help please

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Truck not moving.....help please

Post by Waylander76 »

Hi

I followed the tutorial on this site and have a truck with waypoints,
but no matter what I try the truck just won't move. :cry:

I just need a player to 'use' the truck by using a trigger_use to start
it's journey along the waypoints and then have the truck stop.

The map is a Multiplayer Spearhead map

I have a trigger_use targetname truck_trigger,a truck targetname trk
and 6 waypoints targetnames wap1,wap2,wap3,wap4,wap5 and wap6.

My script is below any help appreciated......

Code: Select all

main:

level waittill prespawn

exec global/ai.scr
exec gloal/friendly.scr 

level waittill spawn

level.defusing_team = "axis" 
level.planting_team = "allies"
level.targets_to_destroy = 2 
level.bomb_damage = 200 
level.bomb_explosion_radius = 2048 

//level waittill roundstart

thread truck
end

truck:

$truck_trigger waittill trigger

$trk drive $wap1
$trk waittil drive
$trk drive $wap2
$trk waittill drive
$trk drive $wap3
$trk waittill drive
$trk drive $wap4
$trk waittill drive
$trk drive $wap5
$trk waittill drive 
$trk fullstop // or fullstop (hit the brakes!)
 
goto truck 
end

User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

It has been a while and never did do much like this but ... Do your waypoints target each other to form a path ? If it is one path all you need to do is to use drive with the first waypoint . Are you useing a vehicle and not a static vehicle ? This is an old thread from some map I made maybe there are some things in it that will help
jeep_start:

spawn vehicles/jeep.tik "targetname" "jeep" "origin" $jeep_path1.origin
$jeep.driver = $jeepdriver
$jeep.gun = $jeep queryturretslotentity 0
$jeepdriver thread ai_show

$jeep rendereffects "-shadow"
$jeep thread speed_controls
$jeep.driver rendereffects "-shadow"
$jeep AttachDriverSlot 0 $jeepdriver
$jeepdriver exec global/disable_ai.scr
$jeepdriver anim jeep_idle_drive
$jeepdriver nodamage
$jeepdriver notsolid
$jeepdriver gun "none"
$jeepdriver immune bullet
$jeepdriver immune fast_bullet
$jeepdriver immune explosion
$jeepdriver immune rocket
$jeepdriver.gren_awareness = 0
$jeepdriver forceactivate
$jeep nodamage
if ($jeep.target)
{
self.collisionent = self.target
// self.collisionent hide
}
$jeep drive jeep_path1 300 30 200 level.lookahead
$jeep waittill drive
$jeep stop

$player playsound dfr_M1L2_145m_1 //"Hurry, get in. We've got to go!"
iprintln "use the use key to get in jeep"

end

//**********************************************************************************************

player_getinJeep:

local.vturretent = $jeep queryturretslotentity 0
local.vturretent unlock
$jeep attachturretslot 0 $player // Attach the player to the jeep
$player perferredweapon ".30cal Machine Gun"
local.vturretent lock
$jeep drive $jeep_path2 300 30 200 level.lookahead

for(local.i=1;local.i <= $bridgeguy.size;local.i++)
{
$bridgeguy[local.i] thread ai_show
}
for(local.i=1;local.i <= $bridge_guard.size;local.i++)
{
$bridge_guard[local.i] thread ai_show
}
$jeep waittill drive

local.vect = angles_toleft ($jeepdriver.angles)
local.dist = -100

local.vect[0] = local.vect[0] * (local.dist)
local.vect[1] = local.vect[1] * (local.dist)
local.vect[2] = local.vect[2] * local.dist

local.spotdriver = local.vect + $jeepdriver.origin

$jeep detachdriverslot 0 local.spotdriver

$jeepdriver exec global/runto.scr $bridgeobjective

waitthread wait_dead $bridge_guard

//************************************************************************************************************
//************************************************************************************************************
//************************************************************************************************************
//************************************************************************************************************
// level ends here use exec global/missioncomplete.scr nextmission 1 for nextmap or leave out for next level
// and delete the next lines
//************************************************************************************************************
//************************************************************************************************************
//************************************************************************************************************
$player stufftext "ui_hud 1"

iprintln " you win "
iprintln " you win "
iprintln " you win "
iprintln " you win "
iprintln " you win "
wait 10

$player stufftext "disconnect"


end
Image
Waylander76
Sergeant Major
Posts: 122
Joined: Wed Jun 01, 2005 10:03 am

Post by Waylander76 »

hi bdbodger...yes I have 6 way points that target each other forming a path. In radiant all are linked as they should be.
Targetnames are wap1 to wap6, wap1 targets wap2,wap2 targets wap3 etc.

I'm using a vehicle model taken from the M1L1 script, spawned in using your script below, plus some bits from m1l1.

What happens is the truck gets spawned and the wheels are turning
but it's not moving to the first waypoint :roll:

What am I missing??? Why won't the truck move??

Code: Select all

main:

level waittill prespawn

exec global/ai.scr
exec gloal/friendly.scr 

level waittill spawn

level waittill roundstart
thrad truck

end

truck:

spawn script_model "targetname" "trk" "spawnflags" "2" "origin" $truck_origin.origin 
$trk model "vehicles/opeltruck.tik"
$trk rendereffects "-shadow"
$trk nodamage 
$trk anim idlenolights
$trk drive $wap1  300 30 200 level.lookahead
$trk waittill drive
$trk stop 
end

Post Reply