I've been sitting here ages trying to figure this script out, even tearing apart other scripts, and nothing is working. Obviously, I am missing something.
The idea is the rods will unlock the levers (which has not been scripted), and the levers will allow to the elevator to "move", which results in a level transition when the elevator lever is pulled down.
Some things may look a bit weird (like a sob activating when the lever puzzle is complete), but these are just stand-ins for the time being.
Do the sounds play though? I think the script stops right there. There are only those three callbacks when you enter, and those three code blocks (which could be only one) don't seem to advance the script to the other ones. Unless you have callbacks added to entities in the level? I'm guessing you do at least for the levers. I can't really check the level at the moment though.
This script might not do what you want it to. Let's just see what will happen if done.
Is this callback added to all the lever_machine_lever entities? Anything else?
Pulling all lever_machine_lever to state -1 will activate the main code, which plays some sounds and changes the elevator_lever entity. To prevent this some happening again, interaction is disabled for these levers. The last part will only activate if elevator_lever_2 is already set to state -1 before the other levers are set, or else they will remain uninteractable and can not call the code. Because elevator_lever_2 is enabled after pulling the other levers, this can cause it to not be finished, unless this callback is also added to the elevator_lever_2, however if so, it will also run the main code again once pulled, because even though the other levers are uninteractable, they're still in state -1 which will pass the code.
Changing the script down to the one RodMe (<-- my pathetic attempt at humor) made it so only one rod would go into the machine; the others would not work.
There are callbacks for the levers, but nothing else.
(11-26-2014, 08:31 AM)Mudbill Wrote: Is this callback added to all the lever_machine_lever entities? Anything else?
Pulling all lever_machine_lever to state -1 will activate the main code, which plays some sounds and changes the elevator_lever entity. To prevent this some happening again, interaction is disabled for these levers. The last part will only activate if elevator_lever_2 is already set to state -1 before the other levers are set, or else they will remain uninteractable and can not call the code. Because elevator_lever_2 is enabled after pulling the other levers, this can cause it to not be finished, unless this callback is also added to the elevator_lever_2, however if so, it will also run the main code again once pulled, because even though the other levers are uninteractable, they're still in state -1 which will pass the code.
Sounds like script-ception. o.o The callbacks are only on the lever_machine_levers.
And it still doesn't do anything but play the sound.
(11-26-2014, 08:44 AM)Romulator Wrote: Welp, I know what the problem is. Now I just have to fix it and reupload it. (For the level change, not the sounds).
Assuming that elevator_lever_2 is the one which you need to pull down to start the transition to the next level through the fade.
Yes. the elevator_lever_2 starts the level transition. I think I messed up though on the callback state (the lever should be pulled down and not up; I think it's script to be pulled up.)
(11-26-2014, 08:44 AM)Romulator Wrote: Welp, I know what the problem is. Now I just have to fix it and reupload it. (For the level change, not the sounds).
Assuming that elevator_lever_2 is the one which you need to pull down to start the transition to the next level through the fade.
Yes. the elevator_lever_2 starts the level transition. I think I messed up though on the callback state (the lever should be pulled down and not up; I think it's script to be pulled up.)
Actually, elevator_lever_2 does nothing, at least it never did anything for me, even when the levers got stuck. Maybe I did something wrong... ;-;
Back to the vanilla. Juuuuuuuust in case. Post 1800. Yay!
Discord: Romulator#0001
(This post was last modified: 11-26-2014, 08:54 AM by Romulator.)
Does it eventually make the levers uninteractable once you've put them all in state -1? What type of levers are they? If they reset to state 0 after being pulled, you can't have them all at state -1 at the same time.
PS: State 1 and -1 depend on the lever if it will be up or down. I think the control room piston levers use static states and -1 is down, but I think most levers have -1 to be up. Might be mistaken.
Edit: Does elevator_lever_2 have a callback added? Is it set to run Activate? Well, no, not really, because that's a collision callback but I see nothing calling it.