Monday, January 21, 2008

My Next Second Life Creation

I've moved on from the Tic-Tac-Toe game. I took a break as I got really busy, but I finally got some extra time in and went back and did some more digging into SecondLife Script.

In this next game I'm thinking it will have a bunch of moving parts. So instead of creating all the objects at build time, I think they need to be generated programatically instead of creating them at build time. So, I found myself looking into Inventory functions and specifically llRezObject.

My initial attempts were flawed. I called my object "puck" and linked it to the object that had the script. This is the way I did it in Tic-Tac-Toe. Then I called


llRezObject("puck", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 1);

Thinking it would create the new puck object. No luck and no error and nothing at all happened.

Then I found that inventory page and read it more closely. "SL has two kinds of inventories, one for users and one for objects".

I finally read somewhere else, I can't find it now. That an object's inventory is actually under the "contents" tab when editing. So I unlinked the puck. Took it into my own inventory, then dragged the puck to my game's contents. Wala! It was there with the main script and sure enough the script created a new puck at the center of my other object with I touched a lever I had setup to test this. Overall, a good learning experience.

No comments: