Quick and dirty: meaning I won't be able to explain it all, as I don't quite understand it all my self; "I'm not a scripter"
Swim Styles:
There are 2 types of swim styles that you can use. Straight and Circular.
Straight is for like swimming around in a swimming pool, or large pond and lake, with no currents affecting your Avatar.
Circular is for swimming, but with currents moving you around, like in Ahnonay at the beginning.
Keep this in mind when designing your swim area. Which do you need?
I'll cover Straight first.
You need to build your pool, pond, lake, whatever first, including the surface that is going to be the water. NOTE: make sure you leave Bounds OFF when you make your water surface......or you'll be walking instead of swimming, hehe.
Once you have it built, go to PyPRP Scripts and add a Generic Logic Region.
Edit the region to encompass the area your avie will be swimming in.
Click on the logic properties (purple smiley button) and add the following string values:
type : region
regiontype : swimdetect
Next, you can select the water surface mesh you made, and duplicate it (resize the duplicate one incase you have areas where your avie wades in the water, but doesn't swim). Move this mesh to layer 2 by hitting the M-key with you mouse in the 3D window and click on the button for the 2nd region and click on okay.
Change the name of the object to something unique, but ID's it as your swim surface, like: swimsurface1
click on the Logic Properties (purple smiley face) and add a string that says:
type : region
(the reason for this, is I've found that the mesh get's drawn in Uru if you don't set this string)
Go back to layer 1
put your cursor in the center of the swim region (and I do mean center. X, Y and Z axis). Now hit the space bar and Add>Empty
This will put one of those Empty points (like we use for sound emitters) in the middle of your swim region.
Now change the name of this Empty to something unique like: swimcenter1
Okay, now, change one of your windows to the Text Editor, and open up your ALCscript file.
Add the following script: NOTE, the stuff in the {} brackets are comments, don't add the {} brackets, just change the name to the names you gave.
- Code: Select all
swimsurface1: {the name of your swimsurface}
type: region
regiontype: swim
region:
swim:
style: straight
straight:
centerpoint: swimcenter1 {the name of the swim center point you put in}
Export and try it out. Worked great for me, my avie went swimming.
There ARE some varibles that you can add after the centerpoint: one, they are fNearDist, fNearVel, fFarDist, and fFarVel but I left them out and it seems to work just fine.
Now Circular is a bit different. I'm not using it and I don't know it, but I do know that you'll have some stuff added to the ALCscript. Your script will look something like in the FuncChk Age that Trylon made. Here's the code for that:
- Code: Select all
swimsurface1:
type: region
regiontype: swim
region:
swim:
style: cicular
circular:
centerpoint: swimcenter1
rotation: -2
pullfardist: 25
pullfarspeed: 1
pullneardist: 9
pullnearspeed: 2
Obviously the values mean something, and most likely how the "current" affects your avie. To find out how, I suggest loading up the FuncChk age, change the values around, export and see what happens.
Hope this helped people.
EDIT: for swimming sounds.
Simply add a footstep region in the area of swimming, and after editing it's size to fit, click on the Logic Properties for it and under the string surface, change the word grass to swimming.
I was getting a stack dump before, but this was not causing it. So if you read another post of mine complaining about that, ignore it, and do this. It will work fine.