Jump to content

question: script function,changing tranluscent factor and pass-through at the same time on touch


MishkaKatyusha
 Share

You are about to reply to a thread that has been inactive for 3017 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

v.v my english is so bad,ill say it in a way easier for me

 

cresent object=translucent,glow factor enabled,solid,energy field established

raise hand too/touch/click= event occurence= glow off,translucent uneffected,non solid,does not detect collision

building entered,door passed through

raise hand too/touch/click while inside building= event occurence/switch to default= glow factor enabled,solid,energy field established

 

the whole spirit of the hosue object is non-newtonian i guess one could say.the door is controlled by clicking

the door is normally in its default state,where it wont allow anything to pass through and it has the shinys going

but clicking on the door will switch it to basically a no physics,invisible state.this allows something to go through it and enter the house object

then once inside,the user can click the area of the door (clicking the invisible) and the thing wil lrevert to its default state

ill be constructing the door as one solid mesh so its unlikely that ill have to deal with linksets (infact thats most of the reason that the house itself is 205 prims,its one solid object with some very complicated shapes)

Link to comment
Share on other sites

given i have bad english,i use the phrase "non newtonian" to express something that doesnt fit into the most commonly experienced laws of physics

 non newtonian fluids are something that has a habit of reacting oddly to applied force.

 

water is a newtonian fluid,it reacts like youd expect a fluid too,thus fits within common physics

 

non newtonian fluids have a habit of reacting differently to applied force.hence you can easily pull off a "walk on water" effect with non newtonian fluid,because it immediatly increaes local density with applied pressure

 

so therefore,seeing as i have bad english,i also use this as an adjetive phrase to describe an object that does not seem to follow ordinary geometry

 

Link to comment
Share on other sites

What has that to do with quantum mathmatics and sub atomic partical physics? This a simple human readable code that creates a visual mathmatical metaverse, it is not a theortical modal of a star. As for chaos theory, it is just that theory and neither proven or disproven. Atoms at extreems of pressure and temprature behave out side known physics knowledgesimply becouse we do not understand.

Link to comment
Share on other sites

geometry.

the thing im building uses no known form of geometry

and in my original posting i suspected that there was an atleast 53% chance someone would reccomend a script used on ordinary doors

so thereby,i decided to dissuade such a postulated possibility of futile suggestion by digressing with the reason for that

possibly i used and uneccesarily intricate explanation,but it seems to have worked

and as for the part about theory.i hope to dissuade an erroneous absolutism

"all science is theory,through extensive observation and calculation the most fitting theory is chosen based on the results of said observation and calculation.so to highlight the "theory" part in a scientific debate in an attempt to dissuade usage of any particular field of science for one reason or another.would infact classify as a logical paradox"

"and what if the moon is made of cheese?,thats all science has ever been,theorys fitted to observations"

 

Link to comment
Share on other sites

1.im not a troll,you have to understand that if your even remotely rude or dismissive you invite the same against yourself

2.a quick google search will entirely disprove you claiming that "non-newtonian" doesnt exist

3.i may be using these things in uorthodox ways.but when you explode over the nonsensical,and then make a statement whereupon the entire weight of human knowledge is against you,with only your own word to defend you "i.e. "it doesnt exist" referring to non newtonian".it is generally standard procedure to gracefully bow out

Link to comment
Share on other sites

well good luck then.perhaps ill highlight how you attempted to derail my thread based on not liking a relatively simplistic response to a question you asked

 

infact,i think ill do that right now

 

youll have to learn sometime that being recognizeable doesnt entitle you to more respect,only the way you act does

Link to comment
Share on other sites

You was given that on page one, once again i will inform you that this is a scripting forum for scripters and not a general chat forum. You were given help even tho you made no effort to post an attempt at a script and many still gave their own time to help you. As far as i am concerned you will never recieve any more help from me.

Link to comment
Share on other sites


can we please get back to deciding which method is best for implementing the lightswitch like passthrough control?

It's really not immediately clear what additional help you need with that.

If I've followed this thread correctly (not so easy to do), you've decided to stick with the touch toggle, perhaps with a timeout, rather than use collisions. That's fine.

Not so fine: "ill be constructing the door as one solid mesh". As Innula pointed out much earlier, the door and frame cannot be the same mesh if the frame is to be solid while the door is open. Rather, the door would need to be either a separate object that can be set fully phantom or a linked element that can be set physics-type = none.

Now, there are two ways that I can think of to get by with just a single element to represent both the door and the frame. One is to abandon mesh and use a prim, which in contrast to mesh can dynamically change shape to make an open passage. (Can't do that with Mesh because... oh, long design story about why mesh is so crippled in SL, but bottom line: No topological transformations are supported, and only linear deformations except when rigged as an avatar attachment, and no way to swap one mesh geometry for another without replacing the instance. Yeah: Crippled, as in totally lame.)

The second would be to give up on the touch toggle and have the doorway physically pass-through all the time but only toggle its translucency as an avatar approaches, triggered by collision, sensor, raycasting, or tracking of all avatar positions in the sim. (I'd pick collision.) Simplest way to implement the translucency-changing doorway: a surface of the mesh not represented in the mesh's physics model.

But all that complexity would be to avoid the vastly simpler approach of having the door and the frame be separate elements in the linkset.

Link to comment
Share on other sites

mesh solid in default,when touched,turned passthrough

 

i wouldnt be above using an alternate method

as i was trying to explain earlier X.X,the whole theme of the house control wise is "to wave one's hand"

 

my inspiration for the method of the function is the glowing energy door on the linden wizard home i have.

now if i havent been quite accurate in the approxima then im not above modulation to acheive a result like that

Link to comment
Share on other sites


MishkaKatyusha wrote:

mesh solid in default,when touched,turned passthrough

Okay, but again, just to confirm: The entire mesh must turn "passthrough" at the same time, so if the frame is supposed to remain solid, it must be a separate part of the linkset. That's just a side-effect of the limitations of SL mesh. (You can do better with a prim, but with the usual graphical and Land Impact consequences.)

Assuming separate frame and door links, then it's not clear what more is needed. As described much earlier in the thread, a touch-related event handler can trigger toggling the door link between solid and passthrough, effected by changing its PRIM_PHYSICS_SHAPE_TYPE parameter, with whatever cosmetic graphics effects (glow? alpha? texture anim?) are to accompany this "force-field" effect.

Link to comment
Share on other sites

Sure, that's possible, but it would mean taking the Land Impact hit of both copies -- and then I'm not sure what "switching" between the copies means. You'd still need to get the solid one out of the way of passing through the no-physics one, right? so why not simply toggle the physics model on the one copy (as has been suggested all along) ?

[EDIT: Heh. I realize "physics model" is overloaded here. I simply meant toggling the prim property, not swapping-in different physics geometries for the mesh, as if  that were possible in SL.]

Link to comment
Share on other sites

i keep on trying this with my little linkset

 llSetLinkPrimitiveParams (PRIM_PHYSICS_SHAPE_NONE)

but it keeps on giving me a strange error when i save it to the main part of the script

but to be blunt,as i said on page one.i have no idea how to do this in essence

go over to page one and youll see where i said that my experience only goes so far as gingerly reprogramming vector target and some algebraic rotation coordinates

id much rather have the one object,but very little of what your saying is making any sense

ill be quite honest.i only learned how to reprogram vector target by using a peculiar codebreaking method

i had bought a script for a bed from the marketplace.and the thing went bonkers.so in my attempts to fix it i noticed that,if i changed one of the numbers in vector target,it changed the position of the animation.i noticed there were three sets of decimal numbers in the parenthesis in vector target.so i would change one,re-sit,see what happens

i rinsed and repeated that until i figured out which algebraic axis of movement each number set controlled

 

(and if i may,id liek to illustrate a potentional logical paradox with someone being new to LSL.

if someone knows nothing about lsl or is jsut starting.there are no guides,alot of people dont have the money to spend on courses or buy books,or even then dont have the english lvl needed for such things.

and as far as the forums go,its essentially this

"new comer wants to script,but hasnt scripted before,thus has no experience"

"other that somehow obtain knowledge refuse to help unless said person has experience"

thus it forms an unsolveable paradox whereupon no one new learns how to script.

im very lucky that i aquired a small amount of knowledge in lsl already due to having a little background in code tinkering and a love of mathamtics.but let me be clear,mathmatics and programming languages are not nearly the same thing.,mathamtics has its own language.and programming languages,let alone LSL,have a gigantic requirement for not only knowing how each part related to the other or how to drum up a function all together,but having a very sophisticated knowledge of english)

Link to comment
Share on other sites

There should be sample code in the wiki entries for most functions, but I guess the use of llSetPrimitiveParams family is a little tricky to start with, so let's take this example and see what questions come up from here:

 

string DOOR_NAME = "door";  // name of the door linkinteger doorLink;integer open = FALSE;findDoorLink(){   // subroutine to identify which link is the door, which will get parameter-toggled    integer thisLink = llGetNumberOfPrims();    do    {        if (DOOR_NAME == llGetLinkName(thisLink))        {            doorLink = thisLink;            return;        }    }    while (thisLink);    // if we ever get down to 0, there's no link named DOOR_NAME    llWhisper(DEBUG_CHANNEL, "name your door link and reset this script.");}    default{    state_entry()    {        findDoorLink();    }    changed(integer change)    {        if (CHANGED_LINK & change)            findDoorLink();    }    touch_start(integer total_number)    {        if (open)        {            llSetLinkPrimitiveParamsFast(doorLink,                [ PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX    // solid                , PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, 1.0   // visible                ]);        }        else        {            llSetLinkPrimitiveParamsFast(doorLink,                [ PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_NONE  // pass-through-able                , PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, 0.0   // hidden                ]);                    }        open = !open;    }}
Link to comment
Share on other sites

Thanks, Qie.

I think there's a typo in the findDoorLink() user function, though, which may confuse MishkaKatyusha    I think it should be

findDoorLink(){   // subroutine to identify which link is the door, which will get parameter-toggled    integer thisLink = llGetNumberOfPrims();    do    {        if (DOOR_NAME == llGetLinkName(thisLink))        {            doorLink = thisLink;            return;        }    }    while ( --thisLink);//reduce the value of thisLink each time    // if we ever get down to 0, there's no link named DOOR_NAME    llWhisper(DEBUG_CHANNEL, "name your door link and reset this script.");} 
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3017 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...