Page 1 of 1

Monster Events problem I have. Help?

Posted: Thu Jul 28, 2016 2:01 pm
by TheSoldiersShadow
So i'm making a wad right now, and I would like to know how I can make a script execute for killing 6 cyberdemons. Now, this question has already been answered many times already. IDTag Cyberdemons, do some ACS and so on. But here's the problem: The cyberdemons only spawn when I pick up a megasphere, so how im I suppose to Tag them if they're not even spawned in?

Image
Image

If any of you would know an ACS code for this, please let me know what to put. I'm not very good with ACS. Thank you all!

P.S. This is the ACS I have for the wad, just in case it would help solve this in any way. (Tags 8 and 9 are used for something else)

Code: Select all

#include "zcommon.acs"

script 1 (void)
{
    Thing_SpawnFacing(4, 114, 0, 999);
    
    Thing_SpawnFacing(5, 114, 0, 999);
    
    Thing_SpawnFacing(6, 114, 0, 999);
    
    Thing_SpawnFacing(7, 114, 0, 999);
    
    Thing_SpawnFacing(10, 114, 0, 999);
    
    Thing_SpawnFacing(11, 114, 0, 999);
}

Re: Monster Events problem I have. Help?

Posted: Thu Jul 28, 2016 4:22 pm
by Chl
Use [wiki]Spawn[/wiki] instead. That lets you assign a tid.

Re: Monster Events problem I have. Help?

Posted: Thu Jul 28, 2016 11:17 pm
by TheSoldiersShadow
Chl wrote:Use [wiki]Spawn[/wiki] instead. That lets you assign a tid.
So do I have to replace my whole ACS? If so, what do I do?

I'm sorry, but I am NOT intelligent when it comes to ACS.

Re: Monster Events problem I have. Help?

Posted: Fri Jul 29, 2016 3:40 am
by KeksDose
They have tid 999 as soon as they are spawned. Before that, you should not try to count them. Thing_SpawnFacing works just as you thought it would, no need to replace anything.

Just start the counting when they are spawned instead of using an open-script. You can keep your script 1 the way it is and just append this:

Code: Select all

while(ThingCount(T_CYBERDEMON, 999) > 0)
     Delay(const:30);

// Now do something when the cyberdemons are dead.   

Re: Monster Events problem I have. Help?

Posted: Mon Aug 01, 2016 4:21 pm
by TheSoldiersShadow
KeksDose wrote:They have tid 999 as soon as they are spawned. Before that, you should not try to count them. Thing_SpawnFacing works just as you thought it would, no need to replace anything.

Just start the counting when they are spawned instead of using an open-script. You can keep your script 1 the way it is and just append this:

Code: Select all

while(ThingCount(T_CYBERDEMON, 999) > 0)
     Delay(const:30);

// Now do something when the cyberdemons are dead.     
So if I wanted to make Doomguy teleport to a MapSpot, would I use TeleportDest, or something else? What would be the code for it? The wiki pages are quite hard to understand for me.

Thank you for replying, btw. I really do appreciate it.

Re: Monster Events problem I have. Help?

Posted: Wed Aug 03, 2016 3:17 am
by KeksDose
You should use a TeleportDest. While MapSpot seems to work with teleport specials, it is actually unintended behaviour and has broken old maps before. Not sure about the details here, but using TeleportDest is the absolute safest bet!

You want to teleport when the Cyberdemons are killed, right? Picking up the Mega Sphere should make the player the activator. Then you can append the counting-loop and finally use [wiki=Teleport]Teleport[/wiki]. Like so:

Code: Select all

script 1 (void)
{
    // Here goes the stuff you had before already.
    ...
    // Then the counting:

    while(ThingCount(T_CYBERDEMON, 999) > 0)
        Delay(const:30);
    Teleport(50, 0, 0);
} 
The script will teleport you to a destination of tid 50.

Re: Monster Events problem I have. Help?

Posted: Wed Aug 03, 2016 10:44 pm
by TheSoldiersShadow
KeksDose wrote:You should use a TeleportDest. While MapSpot seems to work with teleport specials, it is actually unintended behaviour and has broken old maps before. Not sure about the details here, but using TeleportDest is the absolute safest bet!

You want to teleport when the Cyberdemons are killed, right? Picking up the Mega Sphere should make the player the activator. Then you can append the counting-loop and finally use [wiki=Teleport]Teleport[/wiki]. Like so:

Code: Select all

script 1 (void)
{
    // Here goes the stuff you had before already.
    ...
    // Then the counting:

    while(ThingCount(T_CYBERDEMON, 999) > 0)
        Delay(const:30);
    Teleport(50, 0, 0);
}
The script will teleport you to a destination of tid 50.
Everything works! :D Thank you for the help! I really do appreciate it!