Wombat or any other scripter

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Wombat or any other scripter

Post by G3mInI »

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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Post by tltrude »

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

Image
Tom Trude,

Image
tstrait72
Second Lieutenant
Posts: 154
Joined: Tue Jun 04, 2002 1:25 am
Location: York, PA U.S.A.
Contact:

Post by tstrait72 »

how about a map file to go with that script?
Toby, or not Toby, that is the question...

Staff Member
MoH Design
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

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
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

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.......
Wombat's
Eats roots shoots then leaves...........
Zelex
Private
Posts: 1
Joined: Wed Jul 10, 2002 4:54 am
Contact:

Post by Zelex »

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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Boat

Post by tltrude »

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
Tom Trude,

Image
Wombat
Colour Sergeant
Posts: 93
Joined: Fri Jun 14, 2002 5:10 pm
Location: Adelaide, Australia
Contact:

Post by Wombat »

Originally my wombat_moveit.scr was written for exploding things.......

ie flying trucks, rocks, etc.......
Wombat's
Eats roots shoots then leaves...........
Post Reply