Yumiyashi Posted June 26, 2011 Share Posted June 26, 2011 (edited) How can i make a computer have a menu to enable and disable lights? And when it enables the lights it would loop a sound. Could someone tell me the script or something to help em out? Edited June 26, 2011 by Yumiyashi Link to comment Share on other sites More sharing options...
caramellcube Posted June 26, 2011 Share Posted June 26, 2011 (edited) If you need any more detail on this I can post some more tomorrow if nobody else does, but the first step would be to create the terminal itself. I start by finding one of the malfunctioning terminals in the objects window (the ones that start with Default), drag it into the render window, open it up and select Edit Base, then change the name to something unique (best to start with a short version of your username to avoid conflicts). If you close it's ask if you want to create a new form, click yes and you now have a terminal, but with no options. Before adding the options though, you need to give them something to control. Drag an Xmarker into the render window and give it a unique name. This is going to controll the lights and looping sound. Drag in whatever lights you want from the object window, then find the sound you want and drag that in too, it should appear as a green shape. Select the lights, sound, and whatever else you want the terminal to control (not the Xmarker) and press the - key. On the batch assign menu that pops up, select Set enable parent, and choose the Xmarker you just made as the reference to use. This way, if the Xmarker is enabled or disabled, so are all the items you just selected. With the enable parenting set up, go back to the terminal, select Edit Base again, and create 2 options. Light On and Light Off. The script is simple, if your Xmarker was called XmarkerName (it shouldn't be) then the script for Light On would be: XmarkerName.enable and Light Off would be: XmarkerName.disable these should be entered into the script result box on each option. If it all works, the lights and sound should now be controlled by the termainal. After this point it's best to add a condition to each option that checks if the light is on or not, so it will only display the option it needs to. I have to logout now so I'll leave that part for tomorrow unless anyone else wants to explain. Hope this helps. EDIT - back, so, conditionals. around the bottom of the terminal editing window is the conditions box, so with Light On selected go to there and make a new condition. The command should be GetDisabled, which should == 1 for the option to be displayed. Set it to run on a Reference, and select the Xmarker from earlier. For the Light Off option, copy the condition but change the == to != and the conditions are done. Just 1 more thing to do though, and that's to make sure the screen refreshes each time you change something, so go to each of the options and click Force Redraw. That should be everything. Sorry if this has been a bit incoherent, it was done in a bit of a rush, but hopefully it'll help. Edited June 27, 2011 by caramellcube Link to comment Share on other sites More sharing options...
Recommended Posts