Jump to content

Scripting a Surfboard


Frankie Blackwood
 Share

You are about to reply to a thread that has been inactive for 1836 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello everyone! Fairly new to scripting but I do have some experience and I am wanting to challenge myself with a bigger project. I am wanting to create a rideable surfboard that will interact of course float on typical SL water but then also be compatible with user created waves i.e. when you paddle onto the wave you stand up and can ride and then when you've left the wave you move back into the paddle position. There would be some keyed maneuvers, so like pressing "e/pgup" would perform a specific animation. Then other things like, arrows to turn, speed up, slow down, jump releasing the speed up key etc etc.

I don't want someone to write this script for me so I am really just asking for a direction and things I might read/consider when scripting this. Where is my starting point and maybe some first steps. I'm eager to learn and would be willing to talk inworld too to someone.

Thanks!

  • Like 1
Link to comment
Share on other sites

Step one is to develop some basic familiarity with LSL and practice by writing a lot of relatively simple scripts before you take on an advanced project like this one.  Even if you have some previous experience with writing code for computers, you'll find that LSL is a different sort of beast.  So, start at square one.

Then, once you have your feet under you, take a modular approach to a complicated project like this one.  See how other people have scripted floating objects, for example, and focus on adapting what you have learned from them about how to make a surfboard float.  Don't copy their code, but digest its logic. Then worry about figuring out how to handle a simple animation, and then handle a series of animations.  And so on.  A complicated script like the one you have outlined looks scary when you view it as a whole, but is much easier if you view it as a stack of interrelated operations.

BTW, I was tempted to suggest that you look at how other people have scripted surfboards -- there are many -- but I'm afraid that you will get locked into their way of solving your challenge instead of thinking it all the way through for yourself first. I'd recommend waiting until after you have made good headway on your own surfboard script before you look seriously at someone else's.  I discovered years ago than I understand a complex script much better if I developed it myself from the ground up than if I tried to cut/paste someone else's logic into my scripts.  I steal from myself all the time, using snippets of my older scripts, but I resist borrowing scripts wholesale from other people.

Finally, as you learn and run up against challenges that have you scratching your head, share them here.  We won't write a script for you, but people here are pretty good about posting code snippets that illustrate ways to get out of whatever hole you have dug.  

  • Like 3
Link to comment
Share on other sites

In addition to Rolig's wise advice, you might want to take a look at the Linden Vehicle Tutorial (http://wiki.secondlife.com/wiki/Linden_Vehicle_Tutorial), and also Cory Linden's Simple Vehicle Script (https://www.outworldz.com/cgi/freescripts.plx?ID=768) for a very well commented example of how to put together a basic vehicle.   His example is for a motorbike but the principles for constructing any vehicle (which a surfboard is) are pretty much the same, whatever you're making

I feel justified in directing you to that example since it's basically a tutorial in the form of a script. 

  • Like 3
Link to comment
Share on other sites

Thanks for the replies thus far, they will get me going down the path. I definitely don't want to get caught up doing the same things others have done so it will be a bunch of baby steps. I do have have been involved in surfing for quite some time in SL now and so I am wanting to create a new type of ride with things I like and taking out the things I don't from other boards I've used.

  • Like 1
Link to comment
Share on other sites

Weekly update

Got the best board built and scripting is happening. I've currently go it working to a point were you can ride waves, move etc. If I called it quits right now, I would have a simple functional surfboard but I'm not done yet. I am about to clean up my scripting a bit and get it better organized before optimizing how the board reacts on water versus on the wave. Following that I'll introduce more animations and then some keyed actions i.e. Hang-ten, handstand, etc.

Thanks, for the help getting me going. This is definitely happening and I am super excited!

Link to comment
Share on other sites

  • 1 month later...

Well guys! Complete success! Board are all created and we are 100% up and running! You can read a bit about the whole project there and find landmarks etc. If you want to try out the boards, there is a public rezzer for everything here, http://maps.secondlife.com/secondlife/Barbuda Shores/236/114/21

Thanks again everyone for your help!

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1836 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...