Light control

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Light control // Interactive Artwork

1  |  

Post by Wigand // Sep 28, 2007, 8:33am

Wigand
Total Posts: 462
pic
Here is a light control for several lights in your scene.

You can change the colors by hand or by joystick (if you own one:rolleyes: )


If you move the joystick, the color of connected lights changes.

For each light you can switch the connection On and Off.


You should change the path/name of the connectors if you change the name

of the scene. (Maybe someone can tell me the function to get the

current path, or I have to look for).

Post by trueBlue // Sep 28, 2007, 2:48pm

trueBlue
Total Posts: 1761
pic
With regards to Path and Name for Lights.
Look for ObjectName in the System - Kernel library.
Insert ObjectName inside Spotlight3.
Export the connectors Object and ObjectName.
8679
Exit out of Spotlight3.
Then connect ObjectName to Object 3 name.
8680
It seems that your Error handling worked in this case because I do not have a Joystick and no error.
I would however offer some instructions instead of doing nothing. Somebody may think it just does not work.
Also you could start timer from here.

If isobject(Joy) Then
Joyloaded_var=True
' Activate Timer
Node.Value(Space.CurrentScene() + "/Timer Event", "Active") = -1
Else
' Instructions about missing dll.
System.Alert("You must download and register Joy.dll from www.wigand.com (http://www.wigand.com) first after you pay me one million dollars :)")
EndIf



With the Stop Activity button you could stop the timer by adding next line to button script:

Node.Value(Space.CurrentScene() + "/Timer Event", "Active") = 0


With your Send_Value script you will have to add to script for panel name and path.
Not familar with VB but I will try and see what I can do.
Not sure if you can but I would Encapsulate your Joystick control to make it nice a tidy.

Post by spacekdet // Sep 28, 2007, 3:00pm

spacekdet
Total Posts: 1360
pic
And it's just that easy.

Post by Wigand // Sep 29, 2007, 2:54am

Wigand
Total Posts: 462
pic
With regards to Path and Name for Lights.

Look for ObjectName in the System - Kernel library.

Insert ObjectName inside Spotlight3.

Export the connectors Object and ObjectName.


Exit out of Spotlight3.

Then connect ObjectName to Object 3 name.




I thought about a similar way. But If I would know LE better...



In VB I would do this:


I would look for the collection of lights in the scene then

I would look if they have a color input.

These lights I would put in an array

From this array I would create an object with

buttons and inputs for every light.


So, the script would be useful for everyone not only for persons

who know how to put the object name object into the lights objects.

And it would be possible to select every light from script

not only these I had connected to the control.



It seems that your Error handling worked in this case because I do not have a Joystick and no error.

I would however offer some instructions instead of doing nothing. Somebody may think it just does not work.

Also you could start timer from here.



If isobject(Joy) Then

Joyloaded_var=True

' Activate Timer

Node.Value(Space.CurrentScene() + "/Timer Event", "Active") = -1

Else

' Instructions about missing dll.

System.Alert("You must download and register Joy.dll from www.wigand.com (http://www.wigand.com) first after you pay me one million dollars :)")

EndIf



That is realy a good idea, especialy the part with the dollars ;)




With the Stop Activity button you could stop the timer by adding next line to button script:



Node.Value(Space.CurrentScene() + "/Timer Event", "Active") = 0





With your Send_Value script you will have to add to script for panel name and path.

Not familar with VB but I will try and see what I can do.

Not sure if you can but I would Encapsulate your Joystick control to make it nice a tidy.


I already done it partial in meeting room. Here I let it opened to show

the functions.



The subject with the button scripts need a good manual. You know the

most of it. Maybe it is something for you to do? :rolleyes:
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn