Page 1 of 1

SDL state trouble

PostPosted: Wed Feb 27, 2013 4:55 am
by Render
Hi all, picked up building my age again after a long time.
Trying to make my age more playable and ran into trouble.
Let me explain:
I have a ride that workes but need some way of calling it back on either side of the ride, think of the elevator in Teledahn but with only two floors instead of three.
There are three activators involved:
1. Button to open gate and call the ride back if it is not there.
2. Lever to make the ride up and down depending on its SDL state (already fully working)
3. Button to open gate at end of ride and call if not there.

I have given all three an SDL booltoggle however i can't figure out how to keep them in sinc.
Is there a way to toggle all three at once (prefferably via Alcscript) ?

Any help or guidance would be much appreciated.

Re: SDL state trouble

PostPosted: Wed Feb 27, 2013 1:20 pm
by Render
Searching all posts on the forum I found the amended BoolToggleRespond.py
Would this possibly help me solve my problem?
If so, could anyone point mre in the right direction?

Re: SDL state trouble

PostPosted: Fri Mar 01, 2013 6:32 am
by diafero
Think of SDL as providing global variables (state) which are consistent for the entire age. So, you have an SDL files which describes which variables your age has - that may be "ElevatorUp" to store where a two-floor elevator currently is. Then you can use PythonFileMods to connect that variable with something in the game, using xBoolToggleRespond and various other scripts. Each script ah an argument to tell it the SDL variable it is working on, and just by using the same variable everywhere, you "connect" them - if you have a button which toggles that SDL variable, and an elevator which responds to toggling of the same variable, then pressing the button will trigger the elevator.
Unfortunately I do not know how to actually use python scripts in Blender or 2ds Max (you should always mention which version of which tool you are using). For PyPRP, there are a bunch of tutorials available, see
http://www.guildofwriters.org/wiki/Using_SDL_States
http://www.guildofwriters.org/wiki/PyPRP#Archive

Re: SDL state trouble

PostPosted: Fri Mar 01, 2013 8:34 am
by D'Lanor
You should be able to do all of that with Global Python scripts. I would use SDLBoolToggle for the elevator lever and SDLBoolSet for each of the buttons. That way the buttons only have effect when the state actually changes.
For sync reasons it is a good idea to connect all of your events to the same SDL variable but be careful with the avatar animations. If each button and lever has its own oneshot you don't want to put them all into a responder which responds to the SDL state.

There is not much else to say without seeing the setup of your responders etc. Can you post your current Alcscript?

Re: SDL state trouble

PostPosted: Sat Mar 02, 2013 1:22 pm
by Render
Thanks for responding both guys!
@ D'Lanor, do I understand correctly that using one SDL and different responders for the three buttons/lever I will be able to stay in sinc?
If so, I don't need the modified BoolTagRespond you created in 2010?
I will try that and if I can't figure it out, I will send you my Alcscript via PM (don't want to spoil yet)

Re: SDL state trouble

PostPosted: Sat Mar 02, 2013 2:40 pm
by diafero
Everything using the same SDL variable inside the same age is automatically kept in sync by the game - for everyone in the age, i.e. one player changing the SDL state will trigger reactions for all players.

Re: SDL state trouble

PostPosted: Sun Mar 03, 2013 5:25 am
by Render
Still no luck, I can't get this to work.
D'Lanor, I have sent you a PM with my Alcscript!
Hopefully you'll be able to show me where I am going wrong.