Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

opening a hatch

Triarius Firanelli
Registered User
Join date: 25 Aug 2009
Posts: 2
10-07-2009 05:53
I'll post this in the building forum as well, but does anyone know how to make a prim morph from one shape to another without using Edit? What I need is for a solid ship hull (sphere shape) to open a hatch (dimple one end) via chat or touch command.

I have two options in mind, actually change the shape of the object or to switch between a solid visible hull and a phantom transparant hull. Any suggestions?
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-07-2009 06:28
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParams
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
10-07-2009 06:32


Yes, that the answer, although they do appear to have broken this so your milege may vary :(
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
10-07-2009 06:35
From: Beverly Ultsch
Yes, that the answer, although they do appear to have broken this so your milege may vary :(

what do you mean broken?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
10-07-2009 06:52
I'd change the shape of the prim rather than turn it phantom, because you can't link phantom prims to non-phantom ones, and you probably don't want to turn the whole ship phantom if you can avoid it (or people will fall through the floors).

The function you want to look at is llSetPrimitiveParams. That lets you set by script a wide variety of prim properties. If you take a look at http://lslwiki.net/lslwiki/wakka.php?wakka=llSetPrimitiveParams it gives you a very detailed breakdown of how to specify them all -- you give the script a list containing as many or as few properties as you want.

Try something like this to toggle the dimples at each end of a hollow sphere. I don't think it's quite the effect you want, but it should give you something to start from:

CODE
integer toggle; // binary value to switch between dimple and no dimple
list no_dimple = [
PRIM_TYPE, PRIM_TYPE_SPHERE, 0, //a sphere, with the default hole shape for that type of prim
< 0.00000, 1.00000, 0.00000 >, //cut starting at 0 and ending at 1 (not cut, in other words)
0.95, // .95 hollow
< 0.00000, 0.00000, 0.00000 >, //no twist
< 0.00000, 1.00000, 0.00000 > // dimple starts at 0 and ends at 1 (no dimple)
] ;

list dimple = [
PRIM_TYPE, PRIM_TYPE_SPHERE, 0,
< 0.00000, 1.00000, 0.00000 >,
0.95,
< 0.00000, 0.00000, 0.00000 >,
< 0.3, 0.72500, 0.00000 > //as before but now the dimple starts at 0.3 and ends at 0.725
];


default
{
state_entry()
{
llSetPrimitiveParams(no_dimple);//start with no dimple
}

touch_start(integer total_number)
{
toggle=!toggle; //flip the value of toggle each time you touch the prim
if(toggle){ //if toggle is true
llSetPrimitiveParams(dimple); //apply the dimple list of parameters
}
else{ // if it's not true
llSetPrimitiveParams(no_dimple); //apply the no_dimple list
}
}
}
Beverly Ultsch
Registered User
Join date: 6 Sep 2007
Posts: 229
10-07-2009 07:33
From: Ruthven Willenov
what do you mean broken?

ok Its not as big a break as I thought, but

http://jira.secondlife.com/browse/MISC-2847

If you want to mess with things by script, don't use slice, because it will reset as soon as you alter anything by script.



Going back to the original problem, I don't think this is the way to go, any change is going to unseat everyone. Why not just build a hatch ?