Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rez Object Location Help

Flash Axel
Registered User
Join date: 8 Jun 2008
Posts: 6
12-09-2008 16:59
Hello,

Im a newbie to LSL, with some novice background programming I use TADS a c+ language that creates basic text adventures( think infocom) anyway...

I'm following this tute on rezzing an object:
btw self=object2

default
{
state_entry()
{
llSay( 0, "Hello, Avatar!";);
}

touch_start(integer total_number)
{
llSay( 0, "Touched.";);

llRezObject("Object1", llGetPos() + < 0, 0, 0.5 >, ZERO_VECTOR,
ZERO_ROTATION, 42);
}
}

My question is, how do I rez object1 above object2 regardless of its position as if the avi was holding it in an animation. At < 0, 0, 0.5> its rezzing object2 there, but I want it to be intelligent and determine the exact position of (self) and rez directly on top of prim, even at a tilt. And then, I would have to figure out how to lock object1 to 2. Also I'll have to figure out how to reverse the steps to remove object1, if else statements?

Anyway, I might not even be going in the right direction if someone wants to help, I'm making a switchblade, object2 would be hilt, object 1 blade. While I'm on the subject, I'm still slowly progressing through LSL, can custom made sounds and animations be dropped into an objects contents and used in the script, should i be using a hud..any pointers helpful.

Right now I have a fully constructed set of prims representing the hilt, custom 'switch' wav file, custom animation (avi reaches in pocket and points skyward with hand, flicking knife) and prim set making the blade. All thats left is to make it all work.
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
12-10-2008 05:45
From: Flash Axel
Hello,

Im a newbie to LSL, with some novice background programming I use TADS a c+ language that creates basic text adventures( think infocom) anyway...

I'm following this tute on rezzing an object:
btw self=object2

default
{
state_entry()
{
llSay( 0, "Hello, Avatar!";);
}

touch_start(integer total_number)
{
llSay( 0, "Touched.";);

llRezObject("Object1", llGetPos() + < 0, 0, 0.5 >, ZERO_VECTOR,
ZERO_ROTATION, 42);
}
}

My question is, how do I rez object1 above object2 regardless of its position as if the avi was holding it in an animation. At < 0, 0, 0.5> its rezzing object2 there, but I want it to be intelligent and determine the exact position of (self) and rez directly on top of prim, even at a tilt. And then, I would have to figure out how to lock object1 to 2. Also I'll have to figure out how to reverse the steps to remove object1, if else statements?

Anyway, I might not even be going in the right direction if someone wants to help, I'm making a switchblade, object2 would be hilt, object 1 blade. While I'm on the subject, I'm still slowly progressing through LSL, can custom made sounds and animations be dropped into an objects contents and used in the script, should i be using a hud..any pointers helpful.

Right now I have a fully constructed set of prims representing the hilt, custom 'switch' wav file, custom animation (avi reaches in pocket and points skyward with hand, flicking knife) and prim set making the blade. All thats left is to make it all work.


I'd take a look at:
http://wiki.secondlife.com/wiki/LlRezAtRoot
to rez based on a pos.

Generally, weapons are not rez'd so much as hidden and revealed.
You'd build the switchblade as objects 1 and 2. Object 2 (hilt) would
send linked messages to object 1(blade) to show or hide itself by
using llSetAlpha or llSetLinkAlpha. That tends to eliminate the rez
and de-rez issues involved and results in an immediate "appearance"
and "disappearance" of the blade on the hilt if you get my meaning.

An example would be most handguns, where you wear 2 guns, one in
a holster and one in your hand. The holster generally acts as a toggle,
sending linked messages to the guns in the holster and hand. When the
holster gun is visible, the one in the hand isn't. When the one in the hand
is visible, the holster one isn't. Now a switchblade is slightly different in
that it's only half of that process. Basically you just toggle the blade
being visible based on user interaction, typically a touch, llDialog,
llListen and/or linked messages.
Jeredin Denimore
Romani Ite Domum
Join date: 5 Jul 2008
Posts: 95
12-10-2008 07:18
*pushes you back over to your other thread on this topic* hehe