How to announce when secret found?

Discuss all aspects related to modding Zandronum here.
Post Reply
foxx
New User
Posts: 5
Joined: Fri Nov 06, 2015 9:10 pm

How to announce when secret found?

#1

Post by foxx » Fri Nov 06, 2015 9:17 pm

Anyone have some ideas on an ACS script that would announce to the server console when a secret area is found, preferably with the sector tag of the secret area but not absolutely required? I understand from an IRC suggestion that secrets apparently affect map info. The suggestion was to possibly continuously query that in some way but I'm pretty limited on my ACS knowledge so if someone could point me at how to do that I'd be quite grateful. I need to do this in a fairly generic way so I've been building a PK3 that will have the compiled ACS that needs to run.

In this case it doesn't need to be fancy, and I understand there may be some issues with running "real-time" so it might just have to poll every, say, second or so. This is a pretty limited case so it's not the end of the world if it causes some performance degredation, I'll be running this on pretty modern hardware with Zandronum 3.0+ (thank you SO much for named scripts! Seriously cannot thank you enough, I REALLY needed that). It just has to dump something to the console that says, "secret found," or something along those lines.

UPDATE:
So as not to bump my own thread I'm just editing this. Digging around more in the ACS documentation do you think I'd be able to do something like this:

Code: Select all

script "Secret Found" ENTER
{
    int secret = 0;
    int oldsecret = -1;
    while (TRUE)
    {
        secret = <some function that checks MAPINFO secret amount>
        if ( secret > oldsecret )
        {
            Log (s:"Players uncovered a secret!");
            oldsecret = secret;
        }
        Delay (1); // Wait for next frame
    }
}
Last edited by foxx on Sat Nov 07, 2015 7:49 am, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

RE: How to announce when secret found?

#2

Post by Ænima » Sat Nov 07, 2015 12:21 am

Code: Select all

script 101 OPEN
{
int oldsecretcount;
int newsecretcount;

oldsecretcount = GetLevelInfo(LEVELINFO_FOUND_SECRETS);

while (newsecretcount <= oldsecretcount)
{
delay(2);
newsecretcount = GetLevelInfo(LEVELINFO_FOUND_SECRETS);
}

// hudmessagebold "YAY YOU FOUnD ONE" or whatever you wanna do

restart;
}
Last edited by Ænima on Sat Nov 07, 2015 12:25 am, edited 1 time in total.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

foxx
New User
Posts: 5
Joined: Fri Nov 06, 2015 9:10 pm

RE: How to announce when secret found?

#3

Post by foxx » Sat Nov 07, 2015 7:46 am

That's glorious, exactly what I needed! Thanks so much, that's a big obstacle out of my way!

Post Reply