Changing shape scripts
|
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
|
09-19-2004 11:29
Can someone point me in places where i can learn about changing the prims shape (size, etc..) inside the script.
Thanks.
|
Chris Knox
Member
Join date: 22 Apr 2004
Posts: 40
|
09-19-2004 11:34
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-20-2004 09:24
While on this subject, can someone add an example of what you do in a script to make an object brighter, such as a lightbulb? Perhaps a "Clap on Clap off"?
I can add the listen to add the commands, but wanted to see an example of the brightness commands.
The Wiki was very detailed, but it was a little like drinking from a fire hydrant.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Jason Foo
Old Timer
Join date: 6 Feb 2004
Posts: 105
|
09-20-2004 09:55
From: someone Originally posted by Samhain Broom While on this subject, can someone add an example of what you do in a script to make an object brighter, such as a lightbulb? Perhaps a "Clap on Clap off"?
I can add the listen to add the commands, but wanted to see an example of the brightness commands.
The Wiki was very detailed, but it was a little like drinking from a fire hydrant. Yes, a brightness command would be great since when it comes to lighting, objects are weak. I would like to be able to make a halogen bulb out of an object. Maybe lighting is the next thing the lindens could work on 
|
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
09-20-2004 11:32
From: someone Originally posted by Samhain Broom While on this subject, can someone add an example of what you do in a script to make an object brighter, such as a lightbulb? Perhaps a "Clap on Clap off"?
I can add the listen to add the commands, but wanted to see an example of the brightness commands.
The Wiki was very detailed, but it was a little like drinking from a fire hydrant. Make an invisible prim. Put in a script to listen for commands that change it from Light to Glass (or Light to whatever) and back again. Make it phantom. The size of the prim determines brightness.
_____________________
</sarcasm>
|
Dancininda Street
Registered User
Join date: 3 Aug 2004
Posts: 19
|
09-21-2004 07:49
I control brightness by changing the transparency of the invisible prim. Here's a snippet from my dimmer switch code: // "lights 10" = 10% of lights, "lights 90"=90% of lights string dimstr = llGetSubString(message,7,llStringLength(message)); integer dimnum = chr2int(dimstr); float dimpct = dimnum / 100.00; llSetTexture("White Tile",ALL_SIDES); llSetAlpha(dimpct,ALL_SIDES);
Dancininda
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-21-2004 08:59
Ah! Thanks Dancininda, I'll play with that and see what happens. I was looking at llSetPrimitiveParams and thought I found something. This looks much simpler!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
McWheelie Baldwin
Registered User
Join date: 9 Apr 2004
Posts: 154
|
Dimmer Lights
09-23-2004 13:56
It should be noted that Dancininda's code snippet will make the prim itself 'look' brighter or dimmer, but has no effect on the actual lighting aspects of the prim. What Moleculor said about the prim size controlling brightness is correct when using local lighting with prims that have a material setting of LIGHT. One way to make a dimmer type light effect that is a combination of the two would be to use the llSetPrimitiveParams() function to make the invisible LIGHT prim larger or smaller in conjuction with the transparency changes to a visible 'bulb' prim. In this scenario each light bulb would consist of the two prims, the invisible light prim used to affect local lighting in the rendering engine, and the visible, variable transparency prim to give visiual cues as to the light level. You could even use code similar to Dancininda's example for the invisible prim, just making the appropriate changes for the rescaling calls... //Modified from Dancininda Street's example code. // "lights 10" = 10% of lights, "lights 90"=90% of lights float maxScale = 2.0; string dimstr = llGetSubString(message,7,llStringLength(message)); integer dimnum = chr2int(dimstr); float dimpct = dimnum / 100.00; float size = dimpct * maxScale; llSetPrimitiveParams([PRIM_SIZE, <size, size, size>);
Of course this is probably just over complicating things, but it could work out with some tweaking. Also to turn the light completely off, you would have to use the following calls.... //Turn off lighting llSetPrimitiveParam([PRIM_MATERIAL, PRIM_MATERIAL_GLASS]);
//Turn on lighting llSetPrimitiveParam([PRIM_MATERIAL, PRIM_MATERIAL_LIGHT]);
For what it's worth, I hope this is helpful in some small way. Happy Scripting, McW
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-24-2004 11:40
When I get a chance to try these tonight (or this weekend if IM's flood me) I'll let you know!
But I'm sure this will help!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Tony Tigereye
Registered User
Join date: 4 Sep 2003
Posts: 165
|
09-24-2004 12:52
Another alternative is to change the color of the prim that is the light source. A darker color makes a darker light.
|