How about a tut for making a vehicle move from waypoint to waypoint. Using the self.drive command like they do in the game. I have tried with no success. I constantly get script errors with self.origin. Origin applied to null listener.I tried using your script wombat to move my vehicle down a road.... the problem i had was that when i wanted to angle the vehicle down to go down the hill the vehicle would do a complete front flip to get to the negative angle. LOL looked rather funny actually. I just wanted to make a script where a vehicle (namely the german opel covered truck) would drive down the road. In my map the allies could jump on the back of the truck and catch a free ride into axis territory. I tried and tried and cuould not get it to work. Was also wanting of course to 'glue' a driver to this truck.
Any ideas ?
G3mInI
Wombat or any other scripter
Moderator: Moderators
Imagine me helping you, ha ha. Anyway, here is a thread that might help. It makes a V1 rocket (takes off at 15 degrees nose up) rotate to level while traveling to the first waypoint.
//*********************************************
// V1 movement Threads
//*********************************************
V1_movement:
$v1_rocket moveto $way01 // Moves rocket to the start position.
$rocket_flame bind $v1_rocket // Attaches the flame to the rocket so it moves with the rocket.
$rocket_flame anim stop //disarms the flame.
$rocket_launch anim off // disarms the switch.
$v1_rocket time 3 // sets the rocket travel time to the first waypoint, 3 seconds in this case.
goto rocket_standby // standby for player to activate the trigger
//----------------------------------------------------------->
// rocket is idle, and waiting user to activate the trigger
//----------------------------------------------------------->
rocket_standby:
$launch_button waittill trigger
$rocket_launch anim on
$rocket_launch anim waittill animdone
$rocket_launch playsound alarm_switch
$rocket_flame anim start
if (vector_length ($v1_rocket.origin - $player.origin) < 1024)
{
thread jitter_medium 0
}
wait 1
$v1_rocket moveto $way03
$v1_rocket playsound m1l3b_first_stuka_takeoff
wait 8
$rocket_launch anim off
$v1_rocket rotateXup 15
$v1_rocket waitmove
$v1_rocket time 6
$v1_rocket moveto $way11
$v1_rocket waitmove
$v1_rocket remove
$rocket_flame remove
end

//*********************************************
// V1 movement Threads
//*********************************************
V1_movement:
$v1_rocket moveto $way01 // Moves rocket to the start position.
$rocket_flame bind $v1_rocket // Attaches the flame to the rocket so it moves with the rocket.
$rocket_flame anim stop //disarms the flame.
$rocket_launch anim off // disarms the switch.
$v1_rocket time 3 // sets the rocket travel time to the first waypoint, 3 seconds in this case.
goto rocket_standby // standby for player to activate the trigger
//----------------------------------------------------------->
// rocket is idle, and waiting user to activate the trigger
//----------------------------------------------------------->
rocket_standby:
$launch_button waittill trigger
$rocket_launch anim on
$rocket_launch anim waittill animdone
$rocket_launch playsound alarm_switch
$rocket_flame anim start
if (vector_length ($v1_rocket.origin - $player.origin) < 1024)
{
thread jitter_medium 0
}
wait 1
$v1_rocket moveto $way03
$v1_rocket playsound m1l3b_first_stuka_takeoff
wait 8
$rocket_launch anim off
$v1_rocket rotateXup 15
$v1_rocket waitmove
$v1_rocket time 6
$v1_rocket moveto $way11
$v1_rocket waitmove
$v1_rocket remove
$rocket_flame remove
end

ahh so i could just use rotatex y or z and maybe rotatexup or down and do it that eh ? ... hmmm i never even attempted that. But be sure that I will now. However it will take quite some trial and error becaue my 'road' that I want to drive my vehicle on is not flat in any single spot. Constant up and down hills, with the exception of a flat bridge that it traverses. However I will see what I can do. Thanks for the insight!
G3mInI
G3mInI
-
Wombat
- Colour Sergeant
- Posts: 93
- Joined: Fri Jun 14, 2002 5:10 pm
- Location: Adelaide, Australia
- Contact:
G3mInI,
replace these lines in the wombat_moveit.scr
if ( local.movex > 180 ) {local.movex -= 360 }
if ( local.movey > 180 ) {local.movey -= 360 }
if ( local.movez > 180 ) {local.movez -= 360 }
with these
if ( local.movex > 180 ) {local.movex -= 360 }
if ( local.movey > 180 ) {local.movey -= 360 }
if ( local.movez > 180 ) {local.movez -= 360 }
if ( local.movex < -180 ) {local.movex += 360 }
if ( local.movey < -180 ) {local.movey += 360 }
if ( local.movez < -180 ) {local.movez += 360 }
seems i forgot to check if the change in angle was less than -180 ie -270
this should fix your issue with wombat_moveit.scr
thanks for that G3mInI............
I will update the script, in the garagetruck.zip file. To reflect the new changes.......
replace these lines in the wombat_moveit.scr
if ( local.movex > 180 ) {local.movex -= 360 }
if ( local.movey > 180 ) {local.movey -= 360 }
if ( local.movez > 180 ) {local.movez -= 360 }
with these
if ( local.movex > 180 ) {local.movex -= 360 }
if ( local.movey > 180 ) {local.movey -= 360 }
if ( local.movez > 180 ) {local.movez -= 360 }
if ( local.movex < -180 ) {local.movex += 360 }
if ( local.movey < -180 ) {local.movey += 360 }
if ( local.movez < -180 ) {local.movez += 360 }
seems i forgot to check if the change in angle was less than -180 ie -270
this should fix your issue with wombat_moveit.scr
thanks for that G3mInI............
I will update the script, in the garagetruck.zip file. To reflect the new changes.......
Wombat's
Eats roots shoots then leaves...........
Eats roots shoots then leaves...........
Making a vehicle drive in multiplayer should work. Vehicles have their own code to move them around that automatically conforms the vehicle to the terrain underneath it. Be cautios though, there is a limit to how high of an obstacle they can drive over. You should be able to make them drive exactly how the SP maps make them drive. Try researching how the SP maps do it and try to reproduce it. If all else fails just drop me an e-mail or ICQ and I can help.
------
Jon Olick
Programmer
2015, Inc
Jon Olick
Programmer
2015, Inc
Boat
Here is a little "up and down the river" boat map I made that you guys can try.
http://www.intplsrv.net/tltrude/Temp/boat.zip
I uses waypoints and it works fairly well, although the boat gets crooked after a few trips back and forth. Putting an origin brush in the center of the boat made it worse. It would be good for one way trips or ship to ship, I think. Just a thought: Maybe "rotateY 45" makes it spin for 45 time units? If that's the case, I need a way to make it spin to a degree.
I did learn something from doing it--how to turn off a looping sound:
$boat_motor loopsound boat_snd_idle // turns on the loop
$boat_motor loopsound boat_snd_idle wait // turns off the loop
http://www.intplsrv.net/tltrude/Temp/boat.zip
I uses waypoints and it works fairly well, although the boat gets crooked after a few trips back and forth. Putting an origin brush in the center of the boat made it worse. It would be good for one way trips or ship to ship, I think. Just a thought: Maybe "rotateY 45" makes it spin for 45 time units? If that's the case, I need a way to make it spin to a degree.
I did learn something from doing it--how to turn off a looping sound:
$boat_motor loopsound boat_snd_idle // turns on the loop
$boat_motor loopsound boat_snd_idle wait // turns off the loop
