SDL state trouble

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

SDL state trouble

Postby Render » Wed Feb 27, 2013 4:55 am

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.
User avatar
Render
 
Posts: 55
Joined: Thu Jul 28, 2011 7:37 am

Re: SDL state trouble

Postby Render » Wed Feb 27, 2013 1:20 pm

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?
User avatar
Render
 
Posts: 55
Joined: Thu Jul 28, 2011 7:37 am

Re: SDL state trouble

Postby diafero » Fri Mar 01, 2013 6:32 am

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
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: SDL state trouble

Postby D'Lanor » Fri Mar 01, 2013 8:34 am

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?
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: SDL state trouble

Postby Render » Sat Mar 02, 2013 1:22 pm

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)
User avatar
Render
 
Posts: 55
Joined: Thu Jul 28, 2011 7:37 am

Re: SDL state trouble

Postby diafero » Sat Mar 02, 2013 2:40 pm

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.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: SDL state trouble

Postby Render » Sun Mar 03, 2013 5:25 am

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.
User avatar
Render
 
Posts: 55
Joined: Thu Jul 28, 2011 7:37 am


Return to Scripting

Who is online

Users browsing this forum: No registered users and 6 guests