Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

One way wall...?

Brasou Kwasman
Registered User
Join date: 12 May 2008
Posts: 15
06-16-2008 22:59
im looking at this wall in game, its 1 prim, you can walk though one side and not the other :S how the heck did they do this? I cant figure it out, its like one side is phantom, and the other side isn't. Its a script for sure, but I cant view the script :(
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
06-16-2008 23:39
I saw that too and was wondering how it's scripted. Probably something ridiculously simple that I'm not thinking of, but it's definitely a neat thing, although I can't see much use for it personally.



http://www.secondscripter.com/
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
06-17-2008 00:20
It's either normally phantom, and turns solid when an av collides with it from one direction, or vice-versa. There are similar scripts floating around which make a prim selectively phantom or solid depending on, say, group affiliation or the name appearing on a whitelist, etc.
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
06-17-2008 00:22
Could it be that a script in the wall sense the nearest AV, find its position and set the phantom true or false accordingly? I guess that would work...
What happens when two AVs approach the wall from each side? will it be phantom or not?
_____________________
From Studio Dora
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
06-17-2008 00:42
From: Dora Gustafson
What happens when two AVs approach the wall from each side? will it be phantom or not?

Depends on who it senses first... or more specifically, who it senses second.
Keumjoo Ahn
Registered User
Join date: 13 Jan 2007
Posts: 15
06-17-2008 04:18
I think I walked trough such a door in the Devil's Labyrinth and was totally lost because I couldn't go back..lol
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
06-17-2008 06:14
From: Brasou Kwasman
im looking at this wall in game, its 1 prim, you can walk though one side and not the other :S how the heck did they do this? I cant figure it out, its like one side is phantom, and the other side isn't. Its a script for sure, but I cant view the script :(

Brasou

I have a door script that can do that, it requires 2 prims though, the 1st for the wall and the second for a remote which is placed a few metres in front of the wall and is transparent.

When the avatar colides with the remote it sends a message to the door script in the wall, through a notecard I can alter the way the door opens (setting it to 0.001 so it opens but would not be visible to the eye) and also set it to phantom on open, this option is used so on an actual doors that open fully they don't bump your AV when opening towards him/her. Once opened an Autoclose feature is enabled so after 20 seconds for example (allowing enough time for an AV to pass through) it will automatically close. Now that you are on the other side there is no remote to open it again so it would appear as a solid prim.


From: Johan Laurasia
although I can't see much use for it personally.
I think it would be cool if used on something like a Labrynth or maze.
Laurence Corleone
Registered User
Join date: 12 Oct 2006
Posts: 126
06-17-2008 06:24
Wouldn't a sensor with the arc set to PI/4 or even PI/2 and the arc range facing in the direction of the "incoming" agent open the door for an avatar on one side of the door but not the other?


Or is the visualisation on this page outdated and wrong?
http://rpgstats.com/wiki/index.php?title=LlSensor
_____________________
There are no stupid questions, just stupid people.
Eric Stuart
Registered User
Join date: 5 Jul 2006
Posts: 203
06-17-2008 06:54
Ooooh, I know this one!

One sided walls may have a sensor that is not attached to them in world. More than likely it's hidden, but it basically is something that triggers the script on touch and makes the wall go phantom. The sensor normally goes right up to the wall so it goes back to being non-phantom right when you step through the wall, as you stop having your avatar touch the sensor.
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
06-17-2008 09:41
The wall prim itself could have a sensor in it, but collision would probably be more efficient than a sensor.
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
06-17-2008 09:51
I made one of these once on a sim boundry.
Made a large solid object and placed it right on the edge of the sim.
When on the same sim as the object.. you hit it. When on the other sim.. you are able to pass through it before your client actually switches to the new sim. This then acts as a oneway door per-say.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
06-17-2008 10:27
you could do some math using "llDetectedRot" and a collission sensor.. so that "if the avatar is facing mostly east, switch phantom."

Be worth experimenting with at least/
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-17-2008 11:11
From: Winter Ventura
you could do some math using "llDetectedRot" and a collission sensor.. so that "if the avatar is facing mostly east, switch phantom."

Be worth experimenting with at least/

Right. Or simply test the position of the avatar on collision. Something like:

(Note: Not yet compiled; may need some minor syntax fixes.)
CODE

// Make sure that the wall's narrow dimension is along its x-axis. Avatars
// will be able to cross when moving in the direction of the positive x-axis
// (in the direction the red axis arrow points) but not the other way.

list passingAvatars = [];
integer nPassingAvatars = 0;

integer avatarCanPass(key avatar)
{
list details = llGetObjectDetails(avatar, [ OBJECT_POS ]);
if (llGetListLength(details) == 0)
{
return FALSE;
}

vector avatarPos = llList2Vector(details, 0);
vector relPos = (avatarPos-llGetPos())/llGetRot();

return (relPos.x < 0.0);
}

// Try this velocity-based version too. See which works better.
integer alternateAvatarCanPass(key avatar)
{
list details = llGetObjectDetails(avatar, [ OBJECT_VELOCITY ]);
if (llGetListLength(details) == 0)
{
return FALSE;
}

vector avatarVel = llList2Vector(details, 0);
vector relVel = avatarVel/llGetRot();

return (relVel.x > 0.0);
}

openPortal()
{
llVolumeDetect(TRUE);
}

closePortal()
{
llVolumeDetect(FALSE);
passingAvatars = [];
nPassingAvatars = 0;
}

default
{
collision_start(integer nDetected)
{
integer i;
for (i = 0; i < nDetected; ++i)
{
key id = llDetectedKey(i);
if (llGetAgentSize(id) != ZERO_VECTOR &&
llListFindList(passingAvatars, [ id ]) < 0)
{
if (avatarCanPass(id))
{
passingAvatars = (passingAvatars=[])+passingAvatars+[ id ];
++nPassingAvatars;
} else
{
closePortal();
return;
}
}
}

if (nPassingAvatars > 0)
{
openPortal();
}
}

collision_end(integer nDetected)
{
integer i;
for (i = 0; i < nDetected; ++i)
{
key id = llDetectedKey(i);
integer index = llListFindList(passingAvatars, [ id ]);
if (index >= 0)
{
passingAvatars = llDeleteSubList(passingAvatars, index, index);
--nPassingAvatars;

if (nPassingAvatars == 0)
{
closePortal();
return;
}
}
}
}
}
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
06-17-2008 11:12
From: Winter Ventura
so that "if the avatar is facing mostly east, switch phantom."
Ah, but what if the av backs into the wall? :cool:

Take the dot product of the wall prim's (for example) fwd axis vector and the difference between the avatar and wall position vectors. If positive, avatar is on the +x side. If negative, on the -x side. Switch phantom on or off accordingly.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
06-17-2008 11:41
CODE

init()
{
llSetPrimitiveParams(
[PRIM_COLOR
, ALL_SIDES // faces
, <1,1,1> // color
, 1.0 // alpha
,PRIM_COLOR
, 4 // JUST the door face
, <1,1,1> // color
, 0.75 // alpha
,PRIM_TEXTURE
, ALL_SIDES // faces
, "7bef5e2f-40a2-d753-42e9-4b2a04df0d7b" // texture
, <1,1,0> // repeats (ignore z)
, <0,0,0> // offsets (ignore z)
, 0.0 // rotation
,PRIM_SIZE
, <0.10, 1.50, 3.00>
,PRIM_FULLBRIGHT
, 4 // face
, TRUE // toggle
]);
}

permit()
{
llTriggerSound("0cb7b00a-4c10-6948-84de-a93c09af2ba9", 1);
llSetAlpha(0.25, 4); // open door
llSetStatus(STATUS_PHANTOM, TRUE);
llSetTimerEvent(1);
}

block()
{
llTriggerSound("be582e5d-b123-41a2-a150-454c39e961c8", 1);
close();
}

close()
{
llSetAlpha(0.75, 4); // close door
llSetStatus(STATUS_PHANTOM, FALSE);
}

default
{
state_entry()
{
init();
}

on_rez(integer startparam)
{
init();
}

collision_start(integer num_detected)
{
vector angle = llRot2Euler(llDetectedRot(0) / llGetRot()) * RAD_TO_DEG;
if (llDetectedType(0) & AGENT)
{
if (angle.z > 55 || angle.z < -55) block();
else permit();
}
}

timer()
{
close();
}
}


Here's what I came up with. pretty simple. The avatar CAN "walk backwards" to go back through the doorway. I'm sure there's some math-fu that can be done with llDetectedVel(0).. or perhaps as simple as a simple comparison of llGetPos (on the door) and llDetectedPos(0) (of the avatar) to determine if they are on "X side" or "Y side"
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Vares Solvang
It's all Relative
Join date: 26 Jan 2005
Posts: 2,235
06-21-2008 14:23
From: Laurence Corleone
Wouldn't a sensor with the arc set to PI/4 or even PI/2 and the arc range facing in the direction of the "incoming" agent open the door for an avatar on one side of the door but not the other?


Or is the visualisation on this page outdated and wrong?
http://rpgstats.com/wiki/index.php?title=LlSensor



If the wall is only a single prim, then yes it probably uses a sensor set this way. The sensor only scans on one side of the wall so won't detect avatars on the other side.

If it was two prims then I would say it's using a collision detector in the second prim which is only on one side of the wall.
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
06-22-2008 01:18
heh, it can be done even more simply


use llDetectedPos() and llDetectedVel() in the collision_start event to determine where and which direction the avtar is travel from and to when it collides. if it's headed in the right direction from the correct side, then turn phantom, if not, then stay solid.


you can also use this with volume_detect on a prim that stays phantom to shove the avatar in the correct direction, or bounce it away if it's coming from the wrong direction (assuming push is enabled for you on the parcel)
_____________________
My SLExchange shop

Typos are forgiven; desecrating the english language with reckless abandon and necrophilic acts is not.


The function is working perfectly fine. It's just not working the way you wanted it to work.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
Post #13
06-22-2008 01:51
Yes. Yes, you could do something like that.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
09-20-2008 20:43


this one worked great, and it's quite simple, i recomment using PI/4 instead of PI/2 to centralize it more in front of the door
_____________________
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