Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Newbie to scripting - needs some help :)

Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
05-25-2005 03:10
Hey my friend made a nice car and ask me to script it. As being like 2 days old atm i took some linden or other example scripts and made the car work (all i had to edit was the seating co-ords).

Now what im trying to do is make a command in the script to make it hover drive, or just drive normaly on the ground using its wheels.

I have been messing around with the if and else if function and a hover car script but geting no were.

All i want is that the drive sits in the car, the car says what mode then the person can say Drive or Hover (you can also do that mid driving aswell to get over stuff). So if u say drive it activates the car script, if u say hover it activates and hovercar script.

Also is there a way of making the hovercar hover over a set distance from the ground.


Also is there anyone who can teach me good scripting in game as there is no scripting mentor/classes events :(

P.S. i dont want the hovercar to go up or down i just want it a few feet off the ground.

Thanks tons!

EDIT: forgot to add this. Is there a way u can stop your head from following the direction of where your mouse is pointing??
Zindorf Yossarian
Master of Disaster
Join date: 9 Mar 2004
Posts: 160
05-25-2005 05:32
Have you seen the LSL wiki? It's an extremely useful trove of scripting knowlege. No scripter is complete without it. LSL Wiki

For hovering, you need to use llSetVehicleFloatParam(VEHICLE_HOVER_HEIGHT, float height), where height is the height above the ground you want it to hover at. You also need llSetVehicleFloatParam(VEHICLE_HOVER_EFFICIENCY, float efficiency) where efficiency is a float between 0 and 1 to specify damping amount. 0 will produce a bouncy undamped effect, 1 will be a smooth damped effect. Lastly, you need llSetVehicleFloatParam(VEHICLE_HOVER_TIMESCALE, float timescale), where timescale is how long it takes to achieve its hover height, in seconds.

You will also want this: llSetVehicleFlags(HOVER_TERRAIN_ONLY | HOVER_UP_ONLY)
to make it set its hover height based on the land, and to make it only hover up.

To turn off hovering, i think you could set the hover height to 0. Maybe that would work.
_____________________
Badass Ninja Penguin: Killing stuff it doesn't like since sometime in May 2004.
Tom Geer
Registered User
Join date: 18 May 2005
Posts: 10
05-25-2005 10:48
Any more help?

I need alot of info, need someone to explain all these { and }s aswell lol.


Also can someone teach me ingame?

Also how do i use the IF and ELSEIF functions correctly??
Hiro Turnbull
Freelance Scripter
Join date: 20 Apr 2005
Posts: 24
Help
05-25-2005 11:02
Tom,

I would be willing to help you in game. The best advice I can offer you
out of game is to just look at example code. Change the variables
and add and remove code to see changes. Even the best programmers
in the world copy and past all the time. So don't be afraid to use
any example code you find. If you are still interested in having
in game help you can IM when ever you like.

Hiro Turnbull

P.S.

You can use a animation to make our body stay in one set position.
That way your head wont move when you use the mouse. But you
will be stuck in that position. What also helps is if you don't put
your mouse pointer on the ladies' boobs. Just look at them with
your real life eyes and move the mouse somewhere else. That
way they don't know you are staring. ;)