|
Dragnar Drake
Registered User
Join date: 6 Feb 2006
Posts: 25
|
04-10-2007 11:44
ok I'm trying to make a submarine, now I know that using a mod boat script won't work because it hovers over the water, never under. what I understand I'll need to use a balloon type vehicle script but I need to know how to make it so I can't go past the water hight *llWater()*
now if anyone has a submarine script that they can give me a copy, or tell me where I can find one that would help alot
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
04-10-2007 11:48
You could probably use your boat script, but then make sure to set the VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT And remove the VEHICLE_FLAG_HOVER_WATER_ONLY From what I've seen here: http://slhomepage.com/lsl/LindenVehicleTutorial.htmRj
|
|
Dragnar Drake
Registered User
Join date: 6 Feb 2006
Posts: 25
|
04-10-2007 12:09
thank you, but the issues still remains about not being able to be move above the water line
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
04-10-2007 13:30
From: Dragnar Drake thank you, but the issues still remains about not being able to be move above the water line I thought there used to be a submarine example in the wikki library?
|
|
Dragnar Drake
Registered User
Join date: 6 Feb 2006
Posts: 25
|
04-10-2007 14:10
I haven't found one yet, if you can find a link with it, that would come in handy
|
|
Rumbeard Chowderhead
Registered User
Join date: 9 Apr 2006
Posts: 7
|
04-20-2007 04:32
I made a couple subs that use VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT. To keep it from floating above the water I used a timer checking it's position. if it raised above the water level the sub would be pushed back down
|
|
Django Yifu
Beat Island Gaffer
Join date: 7 May 2007
Posts: 189
|
10-16-2007 09:55
Use llWater to get the water level and llGetPos to get the position then just check that pos.z doesnt go above llWater. I used soemthing like
vector pos = llGetPos(); float surface = llWater(ZERO_VECTOR);
if (pos.z >= surface) { how you want it to behave }
if you put this into the control part of a vehicle script you can get the sub to check it's height each time a control is pressed. Also think about changing the linear motor power or bouyancy in the if statement. I had the linear motor ramping down the nearer you get to surface and actually producing negative power if you are at the surface think about if (pos.z + 1 >= surface) etc to get the effect your after. I actually put the code into the part where the up control was checked but it could go in the main control section to take effect whenever a control is pressed. I am at work right now so I can't post the code as I used it but that's the basic premise. Just play around
_____________________
Tread softly upon the Earth for you walk on my face.
|