Scuba/Swim script?
|
|
2fast4u Nabob
SL-ice.net
Join date: 28 Dec 2005
Posts: 542
|
03-13-2006 15:21
Hi, (This is a fantastic forum and has been a great resource - thanks to all that contribute) I am looking for the beginnings of a scuba diving script. I have seen scuba gear around and need it for my property (I have a reef for guests to explore). I plan to give away my scuba gear/swimmer so buying it to give away is out of the question (I have also seen some free grear around but it is no copy/no transfer). I need to better understand how to capture control keys (fwd/backward/up down), and invoke an animation based on that input. I also need something that describes bouyancy and collision since I expect that is how most swimming products detect contact with water and cause the avatar to 'float'. I just need a shell and can fill in the specific behaviors. Also, are the swiming/scuba animations free (kicking legs with hands at the side))? I can create that myself but I am hoping to save some time  Thanks, -2fast
|
|
Zax Aster
Registered User
Join date: 13 Nov 2006
Posts: 10
|
Anyone gona share that script?
05-14-2007 15:55
I have searched the forum high and low for the same thing. Seems for some reason this scuba script is more coveted than fort knox! Ive asked very politely dozens of designers if they would sell me a mod copy of a scuba script only to be shot dwn every time. This post is old and yet no one aswered it. Seems nobody will give up that script. I really wish i was a better scripter id do it myself but alas im a great builder and even did the swim animations i need built m own tanks but still need this animation overide script that detcts water. If any scripter would like to tackle this please IM me in world. And post it here too so other designers may be able to make something nice.
Lets not be so stingy with our scripts and things folks...
Zax
|
|
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
|
05-14-2007 18:46
I'd take a look at one of the open source AOs...
|
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
05-14-2007 19:44
From: Sindy Tsure I'd take a look at one of the open source AOs... in short, the easiest way to go about doing this is to take a basic flight assist script, and modify it to activate only when flying and your altitude is less than the water height. You can use a Bouyancy of around .75 to give you a floaty feeling.
_____________________
My SLExchange shopTypos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not. The function is working perfectly fine. It's just not working the way you wanted it to work.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
05-15-2007 02:31
From: Senuka Harbinger [...]You can use a Bouyancy of around .75 to give you a floaty feeling. For what it's worth, I've found that llSetBuoyancy() is kinda necessary for the "feel" one wants for swimming, which is kinda unfortunate because it forces one to use an attachment. I just could never get llPushObject() on the avatar to keep a steady enough force on the swimmer. Wonder if anyone had any other results.
|
|
Zax Aster
Registered User
Join date: 13 Nov 2006
Posts: 10
|
Thanks
05-16-2007 08:39
Thanks great advice on the free AO. Found ne and was able to incorporate it into my equipment no problem. Anyone know where i can get my hands on a transfer/yes swimming animation?
Also Im not a scripter at all so the whole boyancy thing your talking about is a total mystery to me. Ive been looking at flight scripts but to be honest im in ober my head with those. Simply suggesting commands doesnt do me much good if i dont know how to write them sorry for bein so unskilled here but could someone please be a little more specific as to how i should write that down in the script to make it work. I really dont know what Im doing there.So a sample script written ere i think would benefit a lot of us thanks.
|
|
Zax Aster
Registered User
Join date: 13 Nov 2006
Posts: 10
|
Scuba Help coming soon!
05-18-2007 11:52
Hi guys, since responding to this post I have received IM's in world by many people looking for the same thing and running into the same baracades. People so greedy they are unilling to share exactly how these scuba scripts work. The people on this forum though have been a big help especialy in this thread. So anyways I was inspired to sit down and write my own scripts from scratch, make my own swim animations, and even write a bubble emitter script to go with it. In the spirit of what I think we should ALL be doing (IE helping eachother learn) I will be releasing these scripts shortly for free here on the forums so that everyone nterested can study them and learn how they work. Now admitadly they will probably not be the best scripts in the world, as i am new to scripting. But I have scripted RL game engines (I Used to be a level designer for a game company) nand once i realized that LSL is very simalar to C-Script (a commonly used script language used in commerical games that derived from C++) I realized it wasnt as hard as it first appeared. So I will be commenting the heck out of these scripts so the average je can sit down read them and hopefully learn from them. Not everyone is out for the almighty Linden Dollar. Some of us just want to have fun and create cool stuff. So in that spirit I will begin my open source scuba project and all those who would like to improve upon or make them better you will have full perms to do so.
So where am I at now with this all? Well glad you asked. The swimming Animations I have finsihed making and they are not bad actually. I encorperated them into the eros free opensource AO. Which works like a charm. Also added the bubbles script which is a simple partcle (coughs at simple whew that was fun tweaking out) script. Also added the breathing sound which can be turned on and off via touching the tanks. This week I am working on the new boyancy script that will be attatched to a bcd (something the other diving gurus who so closely guard thier scripts dont have. The BCD will act just like a real life bcd in that by touching it you can control your boyancy level in te water and decide your depth. Also working on a HUD for the diving guages and even a system that actually runs out of air so the tanks have to be brought back to a refill station to be refilled. Adding a little more realsim to it if you run out of air while underwater you will begin a choking anim and you will need to resurface to return to normal anims. That last part may be a bit tricky but i already have an idea using a simple timer command i found. Will be testing all that this week and ill keep you all posted on how things turn out.
Have fun all and be kind SHARE YOUR SCRIPTS so that ohers may learn!~
|
|
Zax Aster
Registered User
Join date: 13 Nov 2006
Posts: 10
|
Ok here it is but not working right
05-18-2007 22:56
default { state_entry() { //llSetStatus(STATUS_PHYSICS, TRUE); vector pos = llGetPos(); //Current position float water = llWater(<0,0,16>); // Water height in the current Sim if (pos.z >= water) // are we at or above water surface { llSetBuoyancy(-1.5); //Sink } else if (pos.z <= water) // If we are under water surface { llSetBuoyancy(0.0); //Do Nothing } //llSetHoverHeight(-5.0,TRUE, .5); //llGroundRepel(5,TRUE,5.0); //llSetForce( <0.0,0.0,-10>,TRUE ); }
}
======================================================== Ok this almost works but does not reset once hes uderwater. if you take the bcd off and place it back on or reset the script while underwater it stops sinking. I tried the ones in the comented out section too ground repel and set force kind of work sometimes but not always and is unpredictable. Set hover hight works great but will keep you at that depth only you cannot move up or down at all. I know other scuba tanks will bounce you downward if you get close to the surface and thats what im trying to figgure out how to do here. I want to move freely underwater but not go above the surface. Anyone have any sugestions feel free to pitch in here. All this hair pulling could be so easily prevented if one of those greedy types would just share the code with us. But fear not they wont have the monopoly on scuba gear for long. Ill crack this thing yet. Oh and thanks to thse of you who contacted me in world. Its nice to know all this hard work is apreciated.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
05-19-2007 02:25
State entry only fires one when the state is first entered but not when it is rezzed. For that you would need an on_rez handler. If teh script is reset then yes state_entry will fire. That said you are going to need to do this continuiously not just in state entry, you could use the moving_start / moving_end events or a timer. Oh and dont forget to add a narc'd animation 
_____________________
I'm back......
|
|
Zax Aster
Registered User
Join date: 13 Nov 2006
Posts: 10
|
Narcd oh yeah!
05-19-2007 12:42
Too funny I should thatd be wild! Thanks for the tip on the state entry i knew i had to add something else to make it keep checking but didnt know what. So Ill try a timer that might work. And moving start moving end i didnt think of that...that would work every time he goes to move it would check then right>? good idea!
Im also going to play with a vehicle script today too. Turning the bcd into a vehicle just may be the ticket. A little more complex of a script but i think i can figgure it out. Ill let you all know how it works.
Thans again for the advice here everyone well get a good script outa me yet lol!
|
|
Zax Aster
Registered User
Join date: 13 Nov 2006
Posts: 10
|
See The new Post
05-19-2007 14:17
Ok starting a new thread so people lookin for the scripts can find them without having to dig through all my ranting above lol. Anyways look for Zax's Scuba Scripts.
|