Hi all
Basically I've made a model of a boat with brushes in radiant and want
a player to be able to get in it and use a trigger to make the boat
move from point A to point B on the map.
I've given the boat a trigger_use and then used waypoints
for the boats course.
Called the thread in the script and use the moveto command to get the
boat to follow the waypoints.
This is where my problem lies...the boat doesn't move.
So could someone please tell me how to do it or if it's been done before
and where I can find the information I need?
This is for a multiplayer map.
Thanks in advance.
Moving a boat
Moderator: Moderators
move
It will need a second line below the moveto line.
ex:
$boat moveto $boat_way1
$boat waitmove
$boat moveto $boat_way2
$boat waitmove
"Waitmove" makes the script wait untill the boat gets to the waypoint before going to the next line, but you can just use the command "move". You also need to set the time it takes the boat to move between waypoints.
$boat time 150 //seconds
or
$boat speed 150 //grid units per second
Hope that helps!
ex:
$boat moveto $boat_way1
$boat waitmove
$boat moveto $boat_way2
$boat waitmove
"Waitmove" makes the script wait untill the boat gets to the waypoint before going to the next line, but you can just use the command "move". You also need to set the time it takes the boat to move between waypoints.
$boat time 150 //seconds
or
$boat speed 150 //grid units per second
Hope that helps!
-
Waylander76
- Sergeant Major
- Posts: 122
- Joined: Wed Jun 01, 2005 10:03 am
-
Waylander76
- Sergeant Major
- Posts: 122
- Joined: Wed Jun 01, 2005 10:03 am
boat
There other things you can do to it, after you get it moving, like adding engine sounds.
$boat loopsound jeep_snd_idle // would require a sound workaround.
and
$boat stoploopsound
////sound workaround////
These two lines would go just above "level waittill prespawn".
local.master = spawn ScriptMaster
local.master aliascache jeep_snd_idle sound/vehicle/veh_jeep_idle.wav soundparms 0.5 0.0 1.0 0.0 800 4000 auto loaded maps "obj dm"
A workaround is needed because the sound normally only works in singleplayer.
$boat loopsound jeep_snd_idle // would require a sound workaround.
and
$boat stoploopsound
////sound workaround////
These two lines would go just above "level waittill prespawn".
local.master = spawn ScriptMaster
local.master aliascache jeep_snd_idle sound/vehicle/veh_jeep_idle.wav soundparms 0.5 0.0 1.0 0.0 800 4000 auto loaded maps "obj dm"
A workaround is needed because the sound normally only works in singleplayer.
-
Waylander76
- Sergeant Major
- Posts: 122
- Joined: Wed Jun 01, 2005 10:03 am
no sounds required...it's a little wooden row boat! 
However the little blighter just won't move!!!
The boat is a script object with the following key : value
targetname : boat
the trigger is a trigger_use
key: setthread
value: boatmove
There are 3 waypoints
targetname : wap
target : wap1
targetname : wap1
target : wap2
targetname : wap2 (this is where the boat stops)
in my script (it's ab OBJ map) I have this after
// level waittill roundstart //
thread boatmove
boatmove:
$boat time 150 //seconds
$boat moveto $wap
$boat waitmove
$boat moveto $wap1
$boat waitmove
$boat moveto $wap2
$boat waitmove
end
Now I have a feeling I'm missing something really simple or basic...any
help appreciated!!
Tltrude: Thanks so much with the help provided so far, it's very much appreciated!
However the little blighter just won't move!!!
The boat is a script object with the following key : value
targetname : boat
the trigger is a trigger_use
key: setthread
value: boatmove
There are 3 waypoints
targetname : wap
target : wap1
targetname : wap1
target : wap2
targetname : wap2 (this is where the boat stops)
in my script (it's ab OBJ map) I have this after
// level waittill roundstart //
thread boatmove
boatmove:
$boat time 150 //seconds
$boat moveto $wap
$boat waitmove
$boat moveto $wap1
$boat waitmove
$boat moveto $wap2
$boat waitmove
end
Now I have a feeling I'm missing something really simple or basic...any
help appreciated!!
Tltrude: Thanks so much with the help provided so far, it's very much appreciated!
script
Double check your targetnames and make sure "setthread" is spelled right.
I will assume you have your script working for other things. The thread shoud be below the end line of the "main" thread, or at the bottom of the page below another thread's end line. BTW, if you comment out the roundstart line you can test your objectives alone.
//level waittill roundstart
You can try this way also.
boatmove:
$boat speed 128 // this is grid units per second, adjust as needed
$boat followpath $wap
$boat move
end
Using the other way the waypoints do not have to target each other. Also, to see if a thread is working, you can add debug lines to the thread like this.
println "The the first waypoint has been reached!"
A message can also be added to the trigger itself.
Key: message
Value: The boat trigger has been used! (don't use quotes)
Once you get it working those lines can be removed.
Ps: I have a rowboat in my "explodingdoor" tutorial map (click on my signature logo). It has ores that rotate as it moves. The zip file contains the .map file, a playable pk3, and a text version of the script.
I will assume you have your script working for other things. The thread shoud be below the end line of the "main" thread, or at the bottom of the page below another thread's end line. BTW, if you comment out the roundstart line you can test your objectives alone.
//level waittill roundstart
You can try this way also.
boatmove:
$boat speed 128 // this is grid units per second, adjust as needed
$boat followpath $wap
$boat move
end
Using the other way the waypoints do not have to target each other. Also, to see if a thread is working, you can add debug lines to the thread like this.
println "The the first waypoint has been reached!"
A message can also be added to the trigger itself.
Key: message
Value: The boat trigger has been used! (don't use quotes)
Once you get it working those lines can be removed.
Ps: I have a rowboat in my "explodingdoor" tutorial map (click on my signature logo). It has ores that rotate as it moves. The zip file contains the .map file, a playable pk3, and a text version of the script.
-
Waylander76
- Sergeant Major
- Posts: 122
- Joined: Wed Jun 01, 2005 10:03 am
