Subatomic Posted February 3, 2016 Would it be possible, perhaps through scripting, to make a teleporter only usable if the player has a keycard? So if they don't have it, nothing happens when they walk over the teleporter's linedefs. If they do have the key, the teleporter works as normal. If it is possible, I'd also like to make sure the "you need a key to use that" message appears as well, so the player understands why the teleporter isn't working. 0 Quote Share this post Link to post
T_Silverwolf Posted February 3, 2016 Hey there! It most definitely should be under Zdoom's expanded ACS functionality: http://zdoom.org/wiki/ACS Though I'm not sure what the exact commands would look like (I haven't had time to study it), I imagine your script would look like this: script 100 (void) { if (has redkey) == 1 { Teleport (TID); Prints("You're teleported to a new location!"); } elseif (has redkey) <= 0 { Prints("This teleporter requires a redkey!"); } } So then you'd attach this script to the lines that're meant to be the teleport, add "ACS_EXECUTE: 100, 0,0,0" to the linedef(s) in question. This will trigger when the player walks over the line (make sure it's front is facing outward from the center of the area there like you would a regular teleport) You can add other checks, such as if the player has already triggered this and so on. Hope this helps in some way, feel free to post questions if you have them! -T 0 Quote Share this post Link to post
TimeOfDeath Posted February 3, 2016 keytele.wad (zdoom) script 1 (void) {if (CheckInventory("RedSkull")>0) Teleport(1); else Print(s:"You need a key to use that");} 0 Quote Share this post Link to post
Subatomic Posted February 3, 2016 Wow, that's much more simple to achieve than I expected. Thanks for the responses and the example script. Much appreciated! 0 Quote Share this post Link to post
scifista42 Posted February 3, 2016 You can also use ACS_LockedExecute, which will make the script execute only if the player has a given key when the linedef action is activated, and automatically display a message "You need the X key to activate this object" when the player doesn't have it. If you use this method, the script should contain only the teleportation action itself, nothing else. The advantage of this method is that the line with this action will appear colored on the automap according to the key's color, just like locked doors do. 0 Quote Share this post Link to post
Subatomic Posted February 3, 2016 scifista42 said:The advantage of this method is that the line with this action will appear colored on the automap according to the key's color, just like locked doors do. Interesting, I'll look into this a bit more. I like the idea of having the automap lines properly color-coded. It'd be a helpful visual clue for players. 0 Quote Share this post Link to post
TimeOfDeath Posted February 3, 2016 Here's a vanilla method: vkeytele.zip 0 Quote Share this post Link to post
Edward850 Posted February 3, 2016 And here's the UDMF method, because any line action can have a lock in UDMF without the need of scripts: udmflock.wad 0 Quote Share this post Link to post
VGA Posted February 3, 2016 TimeOfDeath said:Here's a vanilla method: vkeytele.zip Why isn't the teleporter working initially? Is the barrel blocking the exit, so the engine doesn't do the teleport? Another question, are those linedefs around the barrel to show the radius? Anyway, this screws up all teleport exits as-is. Check out the start of MAP02. 0 Quote Share this post Link to post
Fonze Posted February 4, 2016 *Taking notes* I'm not at my comp to look at this right now, but if that vanilla method from ToD uses a series of barrels, one of which is crushed via trigger lines around the key as I think I'm inferring right now that's very innovative and impressive! I love the mechanics of Doom and to me that's pretty damn cool right there. Scripting is cool, but making stuff work without it is so much more-so to me. Great stuff! 0 Quote Share this post Link to post
40oz Posted February 4, 2016 What is it about your map that makes things like blocking your teleport with a locked door that requires a key out of the question? A teleport that is inactive until you're holding a key card doesn't make sense to me. A key card unlocking access to a teleport sounds more logical to me from a players perspective. 0 Quote Share this post Link to post
Subatomic Posted February 4, 2016 @40oz: The "key" I'm using is a custom item I've added. Think of it as a magical artifact. When the player carries it, this is what grants them the ability to use teleportation. It's not just a vanilla key card, which I agree wouldn't make much sense. I said key card in my original post for the sake of simplicity. 0 Quote Share this post Link to post
printz Posted February 4, 2016 Beware of this gameplay feature: without the key, the player is free to pass the teleportation line. With the key, the player will be forced to take the teleporter (unless employing dirty speedrunning tricks). 0 Quote Share this post Link to post
scifista42 Posted February 4, 2016 printz said:without the key, the player is free to pass the teleportation line. Not if the line is flagged as "Impassable" or "Block Players", and is using "Player Bumps" trigger to activate the (locked) teleportation action or script. 0 Quote Share this post Link to post
TimeOfDeath Posted February 5, 2016 VGA said:Why isn't the teleporter working initially? The teleporter destination isn't in the target sector initially. There's dehacked that makes the teleporter destination shootable, so when the barrel gets crushed the explosion pushes it into the target sector. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.