Page 1 of 1

How to announce when secret found?

Posted: Fri Nov 06, 2015 9:17 pm
by foxx
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
    }
}

RE: How to announce when secret found?

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

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;
}

RE: How to announce when secret found?

Posted: Sat Nov 07, 2015 7:46 am
by foxx
That's glorious, exactly what I needed! Thanks so much, that's a big obstacle out of my way!