Quick and dirty Swim Region

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Quick and dirty Swim Region

Postby andylegate » Tue Jan 29, 2008 11:08 am

Hey guys. Okay, I kinda have figured out Swim Regions, and since some of us needed to know this, I thought I would put it here. Also, since someone else has already started a tutorial on the Wiki, but hasn't finished it, I didn't want to step on any toes, but did want to get this info out to those of us that have been waiting.

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.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: Quick and dirty Swim Region

Postby Marcello » Wed Jan 30, 2008 3:16 pm

There is actually a third type for swim regions called "simple". This one has no current at all, while "straight" has a straight current. As far as I know there are no extra parameters for "simple". But... I have not managed to get it working yet. Trylon has my blend file to see what's wrong.

I have written most of the swim regions tutorial tonight and tomorrow will add the final details. You post helps me do this. Thnx!
User avatar
Marcello
 
Posts: 374
Joined: Sun Nov 04, 2007 8:59 am
Location: Haarlem, The Netherlands

Re: Quick and dirty Swim Region

Postby boblishman » Thu Jan 31, 2008 3:15 am

Marcello... what an EXCELLENT tutorial !

This is the kind of tutorial we need...( HERE ) ... Clear, simple, straightforward and easy to understand, even for non coders like me. Congratulations! ... very impressive ... *Applause"

(my only suggestion - to make it perfect :P - would be to stress the importance of the indents, colons, spacing (after the colons) in the Aclscript coding... you know how just one "missing" space after a colon, or a wrong indent will stop the age from exporting! ... but this is a minor point as hopefully it will be pointed out in all tutorials that include Alscript)
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Quick and dirty Swim Region

Postby Marcello » Thu Jan 31, 2008 8:59 am

Wow boblishman! Thanx a lot! I spend a lot of time making it a fun read too so your compliment means a lot to me :)

I will add more properties for the different swim types in the upcoming days. I will test them all first. Trylon gave me specs to it's all first hand. I will add your comment too. Things like this can't be stressed often enough!

Edit: one question... would it be useful to finish each tutorial with a short checklist? Bullet/summary style? I know it would help me, but would it be useful for you too? It's easy to do and no hassle.
User avatar
Marcello
 
Posts: 374
Joined: Sun Nov 04, 2007 8:59 am
Location: Haarlem, The Netherlands

Re: Quick and dirty Swim Region

Postby boblishman » Thu Jan 31, 2008 9:54 am

Marcello wrote:one question... would it be useful to finish each tutorial with a short checklist? Bullet/summary style? I know it would help me, but would it be useful for you too? It's easy to do and no hassle.

I think thats a great idea ... I love checklists! ... I also think it's a good idea to finish with a "final" picture of the avatar actually in the Age ... showing the completed tutorial's new subject (so, in this case, a pic of your avatar swimming successfully in the pool)
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Quick and dirty Swim Region

Postby Marcello » Thu Jan 31, 2008 1:32 pm

Ok thnx. Your last comment is very important to me too. Visuals in general are, including GUI's with correct settings and stuff. Many tuts on line seem to assume we know exactly where to find things and what to do. Visuals help immensely to aid in situations that we don't know. I'm also working on the "stencils the Cyan way" tutorial and will commit to my format :)

As far as checklists are concerned, I will add one to the swim regions one and the others I've written or am writting.
User avatar
Marcello
 
Posts: 374
Joined: Sun Nov 04, 2007 8:59 am
Location: Haarlem, The Netherlands

Re: Quick and dirty Swim Region

Postby boblishman » Thu Jan 31, 2008 1:57 pm

well... here's some more praise for you ... :) ... I just did your tutorial for a swimming area ... and, it exported and worked ON THE FIRST ATTEMPT !

Now, if that isn't proof of a great tutorial, I don't know what is ... :D
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Quick and dirty Swim Region

Postby Marcello » Sat Feb 02, 2008 1:57 pm

Ok people, I could use some help. Trylon gave me the following parameters for swim region "simple":

UpBuoyancy
DownBuoyancy
MaxUpwardVel

I have no idea what range of values are possible or what these parameters do. I tried some stuff, but didn't see any difference. It would be immensely helpful if others could try them too and hopefully can give a clue about their use.

Thnx in advance!!!

Marcello
User avatar
Marcello
 
Posts: 374
Joined: Sun Nov 04, 2007 8:59 am
Location: Haarlem, The Netherlands

Re: Quick and dirty Swim Region

Postby Chacal » Sat Feb 02, 2008 2:11 pm

The data type for these parameters (int,dword, etc) will give you an idea of the allowed range. Then you can experiment to find what range makes sense in Uru.
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Chacal
 
Posts: 2515
Joined: Tue Nov 06, 2007 2:45 pm
Location: Quebec, Canada

Re: Quick and dirty Swim Region

Postby Marcello » Sat Feb 02, 2008 3:42 pm

I had a look at the python alcscript and as far as I can judge they're all floating point types.
User avatar
Marcello
 
Posts: 374
Joined: Sun Nov 04, 2007 8:59 am
Location: Haarlem, The Netherlands

Next

Return to Building

Who is online

Users browsing this forum: No registered users and 3 guests