Page 1 of 1

Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 9:45 am
by Jacob
Okay, apparently the demons don't like my ACS script in multiplayer Zandronum. I wrote a kill count script for my Zandronum (version 1.0-150322-1931) multiplayer Doom 2 with Brutal Doom (brutalv20b.pk3) server. It requires 99% kills to advance to the next level, so I thought I'd be nice and write a convenient kill count script for my users. The weird thing is that is works just find in single-player ZDoom but not in Zandronum, whether offline or online. I'm guessing that there's something about the way the client parses the strings... or something?

As per the screenshot, on MAP01 of Doom 2, instead of saying "X monsters killed. Y more to progress.", I get a message like "8POWERINVULNERABLE27GOFATALITY19KICKING". You'll notice that the second number -- in this case, 27 -- is the number of enemies on the map. So what's the first number? It's the number killed! Those two things are showing up as they should. The text string parts, however, turn out quite bizarre.

I've included two screen shots for comparison. The first one is how it looks when I run in ZDoom (single player) on my PC, and the second is what it looks like in my game server in Zandronum. I'm wondering how I can fix this issue.

Also, the ACS script KILLRATIO.ACS reads as such:

Code: Select all

#include "zcommon.acs"

script 1 OPEN
{
    do
    {
        
        int mtotal = GetLevelInfo (LEVELINFO_TOTAL_MONSTERS);
        int mkilled = GetLevelInfo (LEVELINFO_KILLED_MONSTERS);
        int difference = (mtotal - mkilled);

		HudMessage (d:mkilled, s:" out of ", d:mtotal, s:" monsters killed.\n", d:difference, s:" more to progress.\n"; HUDMSG_PLAIN, 1, CR_white, 0, 0, 0);

        delay(15);
        
    } until (mkilled == mtotal);
}	
Thanks,

Jacob
ss_normal.png
weird message ss.png

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 10:08 am
by Jacob
Just thought of something: maybe it doesn't approve of/require the specification of the string (s:) datatype mixed in with the decimal datatypes in such a way? Let me check the ZDoom ACS docs for reference.

(Going into real-time, stream-of-conciousness mode... excuse my thinking in ASCII format...)

Looking at http://zdoom.org/wiki/HudMessage, my syntax should be correct. I don't quite understand the rendering difference in one client vs another. It's not like I'm attempting to print a string as a decimal, decimal as hex or something rediculous like that...

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 11:17 am
by Lollipop
You play with zan 1.0? Try using 2.1.2 or whatever the newedt stable is, or try a 3.0 build. I think your zan is simply too outdated.
If that doesn't fix it, then try different combinations of function input to see how it reacts.

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 12:36 pm
by Jacob
No, sorry... it's Zandronum 2.1.2. The v 1.0 is just Doomseeker.

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 6:50 pm
by Lollipop
Okay.
I do not know then why it takes the wrong strings from the string table. Can someone who knows the source code provide some insight?

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 7:16 pm
by Fused
Work for me both offline and online.
[spoiler]Image[/spoiler]

Perhaps your do-until loop messes up because the variables you check for are defined within the loop itself or something.
There's a very big chance it works for me because there is a different problem somewhere else, soince I can't actually reproduce this try the code below and see what happends.

Code: Select all

script 1 OPEN
{
    while(TRUE)
    {
		int mtotal = GetLevelInfo (LEVELINFO_TOTAL_MONSTERS);
        int mkilled = GetLevelInfo (LEVELINFO_KILLED_MONSTERS);
        int difference = (mtotal - mkilled);
		
        if(mkilled >= mtotal) break;
		
		SetFont("smallfont");
		HudMessage (d:mkilled, s:" out of ", d:mtotal, s:" monsters killed.\n", d:difference, s:" more to progress.\n"; HUDMSG_PLAIN, 1, CR_white, 0, 0, 0);
        delay(15);
	}
	
	HudMessage (s:"All monsters killed."; HUDMSG_PLAIN, 1, CR_white, 0, 0, 0);
}   

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Wed Jun 08, 2016 7:35 pm
by SwordGrunt
"Gofatality" is probably a string in Brutal Doom's ACS. Your string table is somehow conflicting with Brutal Doom's. If you're using an ACS library via LOADACS then your script is missing the #library at the top and this is what causes the conflict.

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Thu Jun 09, 2016 6:23 am
by Jacob
SwordGrunt wrote:"Gofatality" is probably a string in Brutal Doom's ACS. Your string table is somehow conflicting with Brutal Doom's. If you're using an ACS library via LOADACS then your script is missing the #library at the top and this is what causes the conflict.
I was guessing that such a conflict was occuring as well. Mmmm... but I'm not sure how to properly do this as to incorporate both BD2 and my ACS script. Could you please explain this a little bit more?
Fused wrote:Work for me both offline and online.
Fused wrote: Perhaps your do-until loop messes up because the variables you check for are defined within the loop itself or something.
There's a very big chance it works for me because there is a different problem somewhere else, since I can't actually reproduce this try the code below and see what happens.
Then I think you either forgot to include the Brutal Doom lump or did something different than what I did in your implementation of BD2 and the Kill Ratio ACS script. Not sure, but I'm guessing it's the former, since such details weren't specified and it seems an easy enough mistake... but I could be completely off again, too. It just seems to me that if they were included you should have arrived at such a conflict, unless you'd reconstructed the problem from scratch and had no error. In that case, I'd really like to know what you did! Maybe you actually did it right to begin with!

The variable are assigned values within the loop because, if you assign then at the start of the script (outside of the loop), then it won't continue to update the vars. Or at least, that was an issue and very basic mistake in my own program when I first began writing the script. That's why the assignments were placed as such.

Thanks for your input everyone. Sorry about all the verbosity herein... but I like to explore every permutation and account for all possible sources of SNAFU.

Re: Weird ACS script output. 8POWERINVULNERABLE27GOFATALITY19KICKING - Huh?!?

Posted: Sat Jun 11, 2016 4:35 am
by SwordGrunt
Try reading this: http://zdoom.org/wiki/LOADACS

The lack of #library is what causes the conflict as explained in that yellow box.

Your script should have its first line as:

#library "myscript"

Assuming the acs lump is named myscript(.o) and listed as such in the LOADACS(.txt) file.