[2.1.7] Reloding effect doesn't work properly

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

[2.1.7] Reloding effect doesn't work properly

Post by The NUtcracker »

It's only on the easiest difficulty. Not as though this would really effect anyone, as almost every doomer plays UV. :D

What happens is it doesn't take out enough ammo when you reload.
Let's say you have a reloading pistol that has 6 bullets in it and you reload it. When you do, it only takes 3 ammo from your inventory.

But, as I said, this is only the easiest skill level.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

My reloading stuff works absolutely fine. It's probably a problem with how you set yours up.
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

Was it on easiest skill (I'm too young too die!)?

That's the only skill that has the problem.
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

Yes.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

This is directly related to the ammo doubling in this skill and can't be changed because it would break the skill level as it is.
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

@Zippy I'm uploading a video of me demonstrating the bug in Zen dynamics. Watch the ammo that is loaded into the gun. It loads 6 bullets into the gun, but only 3 were taken out of your inventory. The recording was in GZDoom, but I tried it in ZDoom, and the exact same thing happened.
User avatar
randi
Site Admin
Posts: 7750
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Without seeing your implementation, the only thing I can conclude is that you didn't account for the double ammo players receive in baby and nightmare modes.
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

User avatar
Penguinator
Posts: 625
Joined: Mon May 22, 2006 6:55 pm
Location: Hell

Post by Penguinator »

The NUtcracker wrote:Done: http://www.sendspace.com/file/91oam3
I didn't download that as my computer is about to explode from lack of RAM but did you even see randy and Graf's posts. Now that you think about it, their reasons make perfect sense....
User avatar
hideousdestructor
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by hideousdestructor »

Apparently it happens anytime you have A_GiveInventory and ammo... I haven't tried it yet, but I suppose substituting an ACS equivalent would fix this?
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

none wrote: didn't download that as my computer is about to explode from lack of RAM but did you even see randy and Graf's posts. Now that you think about it, their reasons make perfect sense....
That wasn't the point of posting it. I posted it to prove to Zippy that the bug does exist. Didn't you read my post? Or did I forget to mention it in my post?
User avatar
randi
Site Admin
Posts: 7750
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

And we're saying this is a bug with your implementation, not with ZDoom.
User avatar
hideousdestructor
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Post by hideousdestructor »

Well, I just tested the ACS and it does the same thing. And simply dividing the number by two doesn't work since that rounds down to zero, so the only thing left is a script that checks the skill and then takes away one unit of ammo...
User avatar
The NUtcracker
Posts: 843
Joined: Sun Jan 14, 2007 9:12 pm
Location: South Dakota
Contact:

Post by The NUtcracker »

randy wrote:And we're saying this is a bug with your implementation, not with ZDoom.
*groans* I hate it when I forget to put something in my posts. (in this case, it was that I understand that it wasn't ZDoom's doing.)
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Post by Zippy »

Vaecrius wrote:Well, I just tested the ACS and it does the same thing.
For reference, this is basically what I use, and I have tested it (in 2.1.7 and SVN r492, which is the latest I have), and it does work correctly on all skill levels:

Code: Select all

if ( weapon == PISTOL ) {
	missing = PISMAX - CheckInventory("PistolAmmo");
	// Either you have enough backup ammo to fill what is missing
	// or you don't
	if ( CheckInventory("Clip") >= missing ) {
		// Have enough to fill
		TakeInventory("Clip",missing);
		GiveInventory("PistolAmmo",PISMAX);
	} else {
		// Don't have enough to fill
		GiveInventory( "PistolAmmo", CheckInventory("Clip") );
		TakeInventory("Clip",PISMAX);
	}
}
Post Reply

Return to “Closed Bugs [GZDoom]”