Da Snoop Posted May 18, 2001 I want to use two switches in a decission (if). For example: the player must flip main generator and then operate switch near pit to raise the bridge. If the player won't switch on the generator, the switch controlling the bridge will do nothing. If generator is turned on, the bridge-switch will rise the bridge. I think that this is possible, but I don't know the variables. How to declare two switches? How does ZDoom recognize, that I mean "these" two switches, not the other? Variable sw1 or sw2 etc., used in some tutorial, doesn't work. BTW: What are all variables, supported by ZDoom or how to make my own variable (mytexture, mysound etc.)? Thanx for help. :-} 0 Share this post Link to post
Lazer Posted May 18, 2001 It is somewhat tricky to do. I know how to do it without scipting. You simply make a see-through door 1 pixel away from the switch that raises the bridge, then make the "power generator switch" open the see-through door. This lets you activate the switch now. I haven't tried it, but it should work. 0 Share this post Link to post
loser Posted May 18, 2001 With ACS scripts, this is easy to implement. Write two scripts, something like: int generator; // declaration script 10 ( void ) { generator = 1; print ( s: "Generator on" ); } script 11 ( void ) { if ( generator != 0 ) { // raise or lower the floor, etc... } } Then assign script 10 to the generator switch, and script 11 to the bridge switch (ACS_Execute special, first parameter is the script number). 0 Share this post Link to post
Wildman Posted May 18, 2001 Loser (who isn't :) hit the nail on the head. His scripts should work just fine. I just wanted to mention the ACS Script Primer I have on the ZDoom Knowledge Base. It will give you an introduction to scripting that may help you. 0 Share this post Link to post
Lüt Posted May 19, 2001 loser said:With ACS scripts, this is easy to implement. Write two scripts, something like: int generator; // declaration script 10 ( void ) { generator = 1; print ( s: "Generator on" ); } script 11 ( void ) { if ( generator != 0 ) { // raise or lower the floor, etc... } } Then assign script 10 to the generator switch, and script 11 to the bridge switch (ACS_Execute special, first parameter is the script number). How can that work, at least half the stuff the game needs to know is missing? 0 Share this post Link to post