Isle wrote:you could use a map variable
Code: Select all
int RedKeyLine;
Script 9 (void)
{
if (CheckInventory("Redcard") && RedKeyLine)
{
RedKeyLine = 1;
Spawnspot("NAMIDARKIMP",9, 4, 180);
while (ThingCount(T_NONE, 4) > 0) delay(30);
Spawnspot("NAMIDARKIMP",9, 4, 180);
}
}
Could you explain this code before I implement it? I always like to know exactly what the code is doing and why rather than just copy and pasting...
Also @Morpheus, it doesn't cause a runaway error. What seems to happen is that when you run over the linedef without the key it tries to activate the script, but can't because you don't have the Red key and then terminates it because it isn't repeatable. I can't make it repeatable because then you can spawn enemies ad infinitum and that would just be stupid, but my If code doesn't seem to work
I mean, essentially I can just make a code where you pick up the red key and it spawns monsters, but this code has become a conundrum and I would really like to know how to get it to work for future reference. I just don't understand why the if/else statement isn't working where I have a previous if/else statement using the Red Keycard that works perfectly...it makes no sense...
EDIT: Just to clarify, by terminate I mean, when you run over the line without the key, even if you come back with the keycard and run over the line, it wont run the script (whereas if you idclip over the line and then give yourself the keycard and run over it, it runs the script...