I tried Mansteins lightswitch tut. After compiling, the light just kept turning on and off without having to use the trigger (I wasn't even near it when it was going on/off. I don't know if there is a typo here somewhere, but here is the script:
Try doing this make all your lighttrigger's with the same targetname lighttrigger and
have the trigger's target the lightswitch and have the lightswitch target the light and
have the light target the corona .
hmmmm. Keeping in mind that I understood nothing u had typed there, I tried but didn't work. The switches turned and made sound - turned back right away without me triggering the "off". No lights worked. I know the targetnames were all the same, cause the lines in radient went from one to the other.
Is it crazy of me to just script each one? Cut and paste the script, but just modify each targetname slightly.
There is no modern light switch, but you can make one easy enough. Make a switch plate and add an arm that is a script_object. Then in place of the animation for the model switch, make the arm rotate up and down in the script.
$myswitch rotateZup 60
$myswitch move
$myswitch rotateZdown 60
$myswitch move
The script_object arm should also have an origin brush for the hindge point (like a door) as part of the object. If axis Z does not work, try X or Y.
Try adding a wait at the end of the thread like this it maybe that you are triggering it again that wait will give you time to let go of the use key . I assume it is a trigger_use . If the wait is not long enough make it longer . From what you have posted it seem that the script is working ok it is just the trigger triggering again too fast I think . This way is the best no sence makeing a long script for no reason .
}
wait 2
}
end
Also only the triggers need to have the same targetname in fact if you take away all the targetnames of the lights , switches and coronas and then redo the targeting by first selecting the trigger then the switch press control k on the key board to get the line from the trigger to the switch then do the same for the switch to the light and then light to corona the game will actually give then a targetname when you do the control k .
Maybe I am naming something wrong. I tried using ctrl-k, but still the switches wont work properly and will turn back. They won't stay on/off. Also they are not triggering the coronas - the light is present but corona doesn't get activated.
I have 2 lights - both targetname lighttrigger. My switches are targetname switch1 and switch2. i used ctrl-k to link up the trigger to its corresponding switch. I have 2 lights targetname light1 and light2. I used ctrl-k to link switch to light. I have 2 coronas targetname corona1 and corona2. I used ctrl-k here as well.
I used word for word the script above including the "wait 2" line.
You are only running the lightswitches thread once right? and you are not useing setthread for the triggers right ? Try this then it should work better .
ARRRRRRGGGGGGHHHHH!!!!!!!!!!!!! Finally got multiple (2) switches to work. This is using the animate/equipment/electric switch no pulse and the second script that bdbodger added. Now, HOW and WHERE can I add tltrudes:
$myswitch rotateZup 60
$myswitch move
$myswitch rotateZdown 60
$myswitch move
to my script. I have 3 brushes in my switches: 1 back plate, 1 origin brush, and the knob that is supposed to move. If at all possible, how would I make 2 lights activated by 1 switch. Questions questions.....
local.switch = $(self.target) // trigger targets the switch
the trigger should target your new switch or should I say the knob
This part of the thread turns off the light so it makes sence to put the rotatezdown line inside this part of the thread does it not ? I think if you think about it you will be to see where to put the lines and use local.switch rotatezdown 60 for this .
K - got that working, but.... When i push the use button for the first time, I hear the alarm_switch sound, but nothing moves. After the initial use, everything works perfect. This happens for each switch I have.
local.switch move should go after every rotate statement in other words you do the rotate command but the switch does not move untill the move statement is used .
also positive x rotation is forward and down it looks ok to you because the move statement does not happen untill the trigger is triggered again the way you have it . You will probably switch the rotatestatements when you make the changes to the two parts of the thread to add the move or waitmove statements to them . Move and waitmove are the same but with waitmove the script pauses untill the move is done before continueing .