AgEnTHuskey1488304671 Posted September 28, 2013 Share Posted September 28, 2013 Going to be honest this is probably somewhere on the wiki but I'm not the best scripter.. All I've worked with so far is particlesI want to make a script that can make the object its placed in toggle its glow and transparency setting.When on I want it to set the transparency to 60 and glow to 0.20 and off would be 100/0.00Also I want it to toggle by command of something like /7suscon and /7suscoffSo with the help of someone on answers page I got this far... llSetAlpha, llSetLinkPrimitiveParamsFast, setting the parameter PRIM_GLOW are some how involved... but at this point im fairly lost... Can anyone offer a little help? // Susano Jutsu Version 1 StartSteam() { ; } StopSteam() { ; } default { state_entry() { StartSteam(); llListen(7, "", llGetOwner(), ""); } changed(integer change) { if (change & CHANGED_OWNER) { llResetScript(); } } listen(integer channel, string name, key id, string message) { if (0 == llSubStringIndex(message, "suscon")) { StartSteam(); } else if (0 == llSubStringIndex(message,"suscoff")) { StopSteam(); } } } Link to comment Share on other sites More sharing options...
Rolig Loon Posted September 28, 2013 Share Posted September 28, 2013 Not bad. Really the only thing that needs fixing (other than the particle commands in your two functions) is the syntax of the two if tests in your listen event. Try the exact wording I suggested in Answers. if (message == "suscon") and else if (message == "suscoff") ETA: Oh yes... the alpha and glow. llSetAlpha is straightforward enough. You shoudl be able to see that directly from the wiki. llSetLinkPrimitiveParamsFast can be confusing at first, though. That function needs two bits of information. One is the link number of the prim you are going to be changing. The other is a list of things you want to change -- in this case PRIM_GLOW. If you look in the wiki, you'll see that the syntax for PRIM_GLOW is [ PRIM_GLOW, integer face, float intensity ]. So your overall function call to set glow at 0.2, for example, has to be llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_GLOW,ALL_SIDES, 0.2 ]); Link to comment Share on other sites More sharing options...
steph Arnott Posted September 28, 2013 Share Posted September 28, 2013 You want 3 states, the default on_rez staate, the on state and the off state.. So the on_rez state sets it to off or on upto you then goes to the switch sttetes. E.G when rezzzed the default is off, gets a message goes to the on state gets a message goes too the off state, gets a message goes to the on state. ADDED: I just like toggling states. LOL. Getting old. ETA: The alpha in scripts works back to front, 100 in the object edit is 0 in a script. why i have no clue. default{ on_rez(integer start_param) { //set up } state_entry() { llOwnerSay("in default state"); state other; } state_exit() { llOwnerSay("leaving default state"); }}state other{ state_entry() { llOwnerSay("in state other"); } touch_start(integer detected) { state other1; } state_exit() { llOwnerSay("leaving state other for state other1`"); }}state other1{ state_entry() { llOwnerSay("in state other1"); } touch_start(integer detected) { state other; } state_exit() { llOwnerSay("leaving state other1 for state other"); }} Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now