Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Vehicle scripting for Dummies

Ilsa Munro
Registered User
Join date: 1 Apr 2008
Posts: 29
05-27-2008 08:06
Hi everybody,

I've reached the point where I can cobble together a script for pretty much anything that I want to do (so far) with one large exception. Vehicle scripts. I can take existing examples and tinker and fidget and eventually get them to do what I want, but I don't have as clear an understanding of them as I would like.

Or any understanding actually :)

My problem is that the terms used in the wiki explanation are a little bit over my head.

For example (apologies if I get the constant names wrong, I'm not at a SL friendly location so I can't look up exactly what I was doing), I've got a three wheeled vehicle which uses a modified motorcycle script. The one thing I want to change is banking since one clearly can't lean into a turn in a trike, but a sharp turn at speed might cause the wheel on the inside of the turn to life off the ground.

As it stands now the outer wheel lifts so I've gone in and changes every aspect of the three BANKING variables. BANKING_EFFICIENCY seemed to be exactly what I was loking for but switching it from 1 to 0 to -1 all had no results. I tried various values for BANKING_MIX in conjunction with BANKING_EFFICIENCY and got no where. By now I was just punching in random numbers, resetting and trying it again.

Is there a fairly comprehensive tutorial on vehicles written for those of use who got Ds in physics :)

Thanks
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
05-27-2008 08:18
There's one here: http://rpgstats.com/wiki/index.php?title=TutorialVehicle .

I didn't find it an easy read, though. It's certainly better than nothing but I thought it was more of a reference manual than a guide. I haven't looked at it in a year+, though - it may have been updated.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Sean Martin
Yesnomaybe.
Join date: 13 Sep 2005
Posts: 584
05-29-2008 03:38
For the turn effect, try to use your current speed.
If the vehicle travels over a certain speed then have the script set the banking to a value which allows for it to lean.
If it's less than a certain speed that "lean" effect can be stopped by turning off your banking.

This will give you more control on when it is allowed to tip over.

If you find your banking is not responding to any value at all then you might want to check the following as it might get in the way:

VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY
VEHICLE_VERTICAL_ATTRACTION_TIMESCALE
_____________________