PhilibusMo Posted December 22, 2009 As the title says: Question 1: How do you create a level exit (both switch and walk over)? I can't work it out and it seems like it should be so obvious. Is it possible to have an exit switch that requires a key to activate? 0 Share this post Link to post
EarthQuake Posted December 22, 2009 Hexen format uses what's called linedef specials. You can specify the arguments for each special (like for doors, the speed, delay, etc). You then specify an activation type (walkover, shootable, use). In Doom in Hexen, the exit special is called Exit_Normal. It's number is 243, and it doesn't have arguments you need to worry about. About requiring the exit switch to directly require a key, you would have to use scripting. The script might look like: Script 255 (void) { If (CheckInventory("YellowCard")) Exit_Normal(0); Else Print(s:"You need a yellow keycard to exit..."); }You'd then compile the script into your map, and use ACS_Execute (type 80) in your map to call the script, and set the "script" argument to 255, so it executes the correct script. Note that linedef specials can be set directly on lines in-game, or can be used in scripts. Usually when you want to do multiple actions at once or check for certain conditions, that's when you'd use a script. You can learn all about this stuff on the ZDoom Wiki. 0 Share this post Link to post
Enjay Posted December 22, 2009 Of course, you could use a line type 83 (Script execute requiring keycard) and set the key argument to the appropriate value, thereby removing the need for the inventory check in the script. [edit] Oh, and in case it isn't clear, all lindef specials in ZdoomHexen format can have their activation type set separately to their action. So, unlike Doom format with W1, WR, D1, DR, S1, SR etc actions tied to what the line does, the activation type and lindef special are set independently. So, both a switch and walk exit line would have the same special but would have different activation types. [/edit] 0 Share this post Link to post
EarthQuake Posted December 22, 2009 Enjay said:Of course, you could use a line type 83 (Script execute requiring keycard) and set the key argument to the appropriate value, thereby removing the need for the inventory check in the script. Haha, I forgot all about that. Thanks for mentioning it. :) But yeah, the whole idea with linedef specials is that you have a small group of line types, with various options for "tweaking" them, instead of having thousands of specific ones to cover all the different combinations of "tweaks". 0 Share this post Link to post
PhilibusMo Posted December 22, 2009 Script 255 (void) { If (CheckInventory("BlueCard")) Exit_Normal(0); Else Print(s:"You need a blue keycard to start the boat..."); } every time I try ro compile the above script in Doombuilder 2 I get the error: Function: exit_normal is used but not defined. what does this mean? and am I using the correct script if by pressing the button I want to exit to map31 (secret level, if that wasn't obvious). 0 Share this post Link to post
Graf Zahl Posted December 22, 2009 You forgot to #include "zcommon.acs" 0 Share this post Link to post
Enjay Posted December 22, 2009 Also, as I said, your script could be reduced: #include "zcommon.acs" Script 255 (void) { Exit_Normal(0); }Then run it with a line type 83 and the following arguments first = 255 (script number) second = 0 third = 0 fourth = 0 fifth = 2 (code for the blue card) 0 Share this post Link to post
PhilibusMo Posted December 23, 2009 Thanks Enjay but to have the custom text string I think I need the longer script, anyway I have it working now except it takes me to MAP10 (from MAP09) rather than MAP31. What do I need to do to rectify this? Current script: #include "zcommon.acs" Script 255 (void) { If (CheckInventory("BlueCard")) Exit_Secret(31); Else Print(s:"You need a blue keycard to start the boat..."); } 0 Share this post Link to post
Graf Zahl Posted December 23, 2009 Exit_Normal and Exit_Secret go to the maps specified in MAPINFO. If you want to go to a specific map you can use Teleport_NewMap instead. That one is basically the same but you can specify the map to go to as parameter. 0 Share this post Link to post
PhilibusMo Posted December 23, 2009 Thats brilliant, got it all working now. Thanks. Now just need to master that pesky breakable glass... 0 Share this post Link to post
Kyka Posted December 23, 2009 Agent_Spork's "Ultimate Simplicity" has a good example of breaking glass on level 10, so have a look there maybe.. Also the first level of ZPACK has this effect also. 0 Share this post Link to post
Graf Zahl Posted December 23, 2009 PhilibusMo said:Thats brilliant, got it all working now. Thanks. Now just need to master that pesky breakable glass... ZDoom has a built in GlassBreak line special which could do most of the work: http://zdoom.org/wiki/GlassBreak 0 Share this post Link to post