Im using GZdoom, doom builder, doom in hexen format, and slade.
Hello! Thank you for helping me answer my question.
I recently got back into doom modding and I got stuck on this feature for my map,
so basically I want the player to have to pick up two "key" weapons before he can exit his apartment.
How i've done this is by checking the players inventory in a script every time he presses "E" on his front door, and if he has both items he can leave to the next map.
But, here's my problem: The script will only run once, not every time he presses "E" on the door to check for the items.
script 8 (void) {
if (CheckInventory("Keys")) {
ActivatorSound("DOOROPEN",127);
print(s:"Leaving...");
delay(30);
ClearInventory();
GiveInventory("Fist", 1);
Exit_Normal(0);
}
else {
print(s:"I need to get my keys before I go out.\nOh yeah, also my to-do list.");
}
}
Ive tried everything I could find and have scoured the Zdoom wiki, pls help.
Question
Redfive11
Im using GZdoom, doom builder, doom in hexen format, and slade.
Hello! Thank you for helping me answer my question.
I recently got back into doom modding and I got stuck on this feature for my map,
so basically I want the player to have to pick up two "key" weapons before he can exit his apartment.
How i've done this is by checking the players inventory in a script every time he presses "E" on his front door, and if he has both items he can leave to the next map.
But, here's my problem: The script will only run once, not every time he presses "E" on the door to check for the items.
How can I fix this?
Code:
script 1 OPEN {
ConsoleCommand("screenblocks 12");
ClearInventory();
GiveInventory("Fist", 1);
Line_SetBlocking (1,BLOCKF_PLAYERS,1);
SetMusic("D_BATH");
print(s:"ahhh");
delay(100);
ActivatorSound("FLUSH",127);
print(s:"*FLSHHH*");
delay(25);
ChangeFloor(1,"FWATER1");
delay(10);
Line_SetBlocking (1,0,BLOCKF_PLAYERS);
}
*some more non-important code here*
script 8 (void) {
if (CheckInventory("Keys")) {
ActivatorSound("DOOROPEN",127);
print(s:"Leaving...");
delay(30);
ClearInventory();
GiveInventory("Fist", 1);
Exit_Normal(0);
}
else {
print(s:"I need to get my keys before I go out.\nOh yeah, also my to-do list.");
}
}
Ive tried everything I could find and have scoured the Zdoom wiki, pls help.
Share this post
Link to post
5 answers to this question
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.