Symphicat Posted October 3, 2011 Share Posted October 3, 2011 Hey! I'll try and jump straight to the point: I can't code. I've been trying to make a script that listens to a numeric valuable given to it in the /1 channel with the keyword "energy". The lowest possible value being 0 & the highest possible value being 100. I want this script to do the following: automatically set full bright on an object, and the glow value to 0.23, and then lower the Glow value for every time I subtract the "energy" value by 25, so that when the "energy" value hits zero, Glow is at 0.00 and full bright is turned off.However, I also want full bright to be on the moment the "energy" value is 1 or higher. My attempts failed, I am not good enough for it. My script wasn't even remotely what I was looking for, so now I'm asking for some help! Does anyone have a script like that for me to study, mod & use, or know about a script that would suit my needs? I would honestly prefer to be able to see the code so I can learn from it if you do <3 Peace! Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 3, 2011 Share Posted October 3, 2011 You're not likely to find a pre-made script that does exactly that just lying around. You have all the logic you need, though. The function you need to play with is llSetPrimitiveParams, which will let you give values to each of the parameters you want to change ... PRIM_FULLBRIGHT and PRIM_GLOW. So, all you need to do is assign a global variable to each of those two parameters and then listen for the value of "energy" that you hear in chat. The rest is all a set of if statements .... if (energy > 1){ fullbright = TRUE;}if (energy > 75){ glow = 0.23;}else if (energy > 50){ glow = 0.12;}// blah blah blahelse{ fullbright = FALSE; glow = 0.0;}llSetPrimitiveParams([PRIM_FULLBRIGHT,fullbright,PRIM_GLOW,glow]); 1 Link to comment Share on other sites More sharing options...
Ron Khondji Posted October 3, 2011 Share Posted October 3, 2011 This is one way to do it I think. default { state_entry() { llListen(1, llKey2Name(llGetOwner()), llGetOwner(), ""); } listen(integer channel, string name, key id, string message) { list temp = llParseString2List(message, [" "], []); if (llToLower(llList2String(temp, 0)) == "energy") { integer energy = (integer)llList2String(temp, 1); if (energy > 100) energy = 100; else if (energy < 0) energy = 0; float glow = 0.23 / 4 * energy / 25; llSetPrimitiveParams([PRIM_FULLBRIGHT, ALL_SIDES, llRound(glow + .4977), PRIM_GLOW, ALL_SIDES, glow]); } } } 1 Link to comment Share on other sites More sharing options...
Symphicat Posted October 3, 2011 Author Share Posted October 3, 2011 Hey, thanks to you both! I learned a lot and the script provided works wonders! Thanks <3 I've one more inquiry though; is it possible to have a version that affects a whole linkset as well? Link to comment Share on other sites More sharing options...
Rolig Loon Posted October 3, 2011 Share Posted October 3, 2011 Use llSetLinkPrimitiveParamsFast and then be sure to specify LINK_SET instead of a specific link number. 1 Link to comment Share on other sites More sharing options...
Symphicat Posted October 3, 2011 Author Share Posted October 3, 2011 Perfect! Thank you so much! Link to comment Share on other sites More sharing options...
chelsie Goodliffe Posted December 28, 2019 Share Posted December 28, 2019 its been a few years .. but I would like to do something to modify glow. I would like to slowly and smoothly ramp up glow on mesh face; when it reaches maximum, ramp it down to zero , and repeat as a cycle. Can it be done? Thank you4 Link to comment Share on other sites More sharing options...
Recommended Posts
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