[SOLVED][ACS] Odd "BUG" String Array in Hexen

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Kan3x
Posts: 62
Joined: Tue Nov 08, 2022 4:19 pm

[SOLVED][ACS] Odd "BUG" String Array in Hexen

Post by Kan3x »

Hello

I'm having a very odd "bug" in Hexen with this pretty simple script in ACS

Code: Select all

script "Slows_Remove" (void) { //Removes the slow-down factor from the player in about 1.2 seconds
	str slows[5] = { "BowSlow1", "BowSlow2", "BowSlow3", "BowSlow4", "BowSlow5" };
	Log(s:slows[0]);
	for(int bs = 0; bs <= 4; bs++) {
		Log(s:slows[bs]);
		if(CheckInventory(slows[bs])) {
			TakeInventory(slows[bs], 1);
		}
		Delay(10);
	}
}
This script should just remove the 5 powerups stated in the string array and it works perfectly fine... in Doom... but in Hexen, for reasons quite mysterious to me, those strings get read respectively:
"Spawn09", "Spawn10" , "FireDemonAttack", "Spawn08", "the door is locked"

Now... WTH????

Of course, this means that the script won't remove any of those powerups.

Can any of you help me here? D:
Last edited by Kan3x on Thu May 29, 2025 10:25 am, edited 1 time in total.
User avatar
phantombeta
Posts: 2159
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: [ACS] Odd "BUG" String Array in Hexen

Post by phantombeta »

Is this in a mod? If so, make sure your ACS file is correctly set up as a library, otherwise, issues like these can happen with strings.
Kan3x
Posts: 62
Joined: Tue Nov 08, 2022 4:19 pm

Re: [ACS] Odd "BUG" String Array in Hexen

Post by Kan3x »

phantombeta wrote: Wed May 28, 2025 5:19 pm Is this in a mod? If so, make sure your ACS file is correctly set up as a library, otherwise, issues like these can happen with strings.
and it worked! Thank you a lot!

Although, may I ask you why does this happen only in Hexen and not in Doom (or why does this happen at all)?
User avatar
phantombeta
Posts: 2159
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: [ACS] Odd "BUG" String Array in Hexen

Post by phantombeta »

If you don't mark it as a library, it uses the level's string table instead for some reason, which will have other stuff already in it. This doesn't break in Doom because Doom didn't have ACS, only Hexen did.
Kan3x
Posts: 62
Joined: Tue Nov 08, 2022 4:19 pm

Re: [ACS] Odd "BUG" String Array in Hexen

Post by Kan3x »

phantombeta wrote: Thu May 29, 2025 10:42 am If you don't mark it as a library, it uses the level's string table instead for some reason, which will have other stuff already in it. This doesn't break in Doom because Doom didn't have ACS, only Hexen did.
I see, thank you very much!
Post Reply

Return to “Scripting”