Dropping Keycards
Posted: Fri Jul 17, 2015 6:28 am
Hello! I want it that every time you take a teleporter, you lose all of the keycards you had.
(FYI I am using Doom in Hexen Format)
(FYI I am using Doom in Hexen Format)
Leading the way in newschool multiplayer Doom online
https://zandronum.com/forum/
What? Of course they can be removed. Just use takeinventory using acs.Fused wrote: I'm not sure if keys can be removed after being grabbed, but perhaps change the keys to inventory items and check for those at locked doors. Those can definitely be removed from the player's inventory.
Code: Select all
function int abs (int a)
{
if (a < 0)
return -a;
return a;
}
script 123 ENTER
{
int dx, dy, prevx, prevy;
while (true)
{
prevx = GetActorX (0);
prevy = GetActorY (0);
delay (1);
dx = GetActorX (0) - prevx;
dy = GetActorY (0) - prevy;
// Check if player moved faster than he is moving
if (abs (dx) > abs (GetActorVelX (0)) || abs (dy) > abs (GetActorVelY (0)))
{
TakeInventory ("RedCard", 1);
TakeInventory ("BlueCard", 1);
TakeInventory ("YellowCard", 1);
TakeInventory ("RedSkull", 1);
TakeInventory ("BlueSkull", 1);
TakeInventory ("YellowSkull", 1);
}
}
}
That just removes any keycard I grab.Dusk wrote: Maybe something like this for a global solution? Haven't tested but should work in theory..
Code: Select all
function int abs (int a) { if (a < 0) return -a; return a; } script 123 ENTER { int dx, dy, prevx, prevy; while (true) { prevx = GetActorX (0); prevy = GetActorY (0); delay (1); dx = GetActorX (0) - prevx; dy = GetActorY (0) - prevy; // Check if player moved faster than he is moving if (abs (dx) > abs (GetActorVelX (0)) || abs (dy) > abs (GetActorVelY (0))) { TakeInventory ("RedCard", 1); TakeInventory ("BlueCard", 1); TakeInventory ("YellowCard", 1); TakeInventory ("RedSkull", 1); TakeInventory ("BlueSkull", 1); TakeInventory ("YellowSkull", 1); } } }