Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

New to SL and wanted to ask if this was possible

Kal Oskar
Registered User
Join date: 25 Oct 2009
Posts: 3
10-25-2009 11:54
Hi,

I've been introduced to Second Life as part of a project in where I am trying to compile or create scripts for an interactive game/tutorial. There are several aspects I'd like to this but I'm a complete newbie to scripting. One of these particular ideas I have is, is it possible to for example get a set of objects (fashioned to be small boxes) each with a unique tag and the goal being the user has to rearrange them in a specific way and if achieved, would trigger an opening of a door or a popup with text information.

These boxes could have random numbers on them and the task could be to rearrange these numbers to make a certain phone number, for example. Is this possible, and if so, is anyone able to do this?

Another thing I'd like is it possible to open a door only if you input a certain code/password?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
10-25-2009 12:38
Your first challenge is the interesting one. Take a look at how to script a control event (http://lslwiki.net/lslwiki/wakka.php?wakka=control) to see how a user can move objects with arrow keys (or whatever). If you constrain prims to move only along the X-axis, for example, and then test with llGetPos to find out where the user has moved them relative to each other, you ought to be able to do what you want.

The second challenge is trivial. Devise whatever way you like for the user to enter the password (e.g., type it in chat, click buttons on a keypad, ...), and then write

string pass;
if(pass == "the secret password";){
//Open the door
}
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Kal Oskar
Registered User
Join date: 25 Oct 2009
Posts: 3
10-25-2009 13:45
From: Rolig Loon
Your first challenge is the interesting one. Take a look at how to script a control event (http://lslwiki.net/lslwiki/wakka.php?wakka=control) to see how a user can move objects with arrow keys (or whatever). If you constrain prims to move only along the X-axis, for example, and then test with llGetPos to find out where the user has moved them relative to each other, you ought to be able to do what you want.

The second challenge is trivial. Devise whatever way you like for the user to enter the password (e.g., type it in chat, click buttons on a keypad, ...), and then write

string pass;
if(pass == "the secret password";){
//Open the door
}


Thank you. Just to make sure, that's the script for the door right? E.g. create the door and enter that into the Script tab
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
10-25-2009 14:19
No, that's purely schematic. I assume that you have a script for the door already. To add password protection, you need some way for the user to enter the password (pick one -- there are lots of possible ways) and then you need a way to verify that it's the correct password. That schematic snippet says "If the password that was entered ("pass";) is the same as the one I was told is correct, open the door." You just need to put that test at the start of whatever code actually opens the door.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at