Pickup Bug

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
Boingo the Clown
Posts: 102
Joined: Sat Dec 03, 2005 17:40
Location: North of New York, West of Montreal, East of Toronto, and South of Hell
Contact:

Pickup Bug

Post by Boingo the Clown »

I was play testing DeiMWolf, and I noticed this peculiar bug with the treasure pickups I had created.

All pickups work fine when first starting the game, but after the game has been playing a while, some of the pickups quit working. That is to say, they no longer disappear when run over, and they can no longer count towards the items found count.

AFADooMer was kind enough to let me try the beta version of his Wolf3D project, and I found the same thing while tryin it out. The problem was even more pronounced, due to the fact his mod awards points. When the treasures stopped being picked up, they still continued to give points. I rolled the score counter over multiple times during my test run.

Since this happens with both mods, I have decided that it must be a bug within GZDooM itself, rather than a mistake in the mods.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Maybe. Can you send me the mod so I can check what is happening?
AFADoomer
Posts: 43
Joined: Fri Sep 02, 2005 3:23

Re: Pickup Bug

Post by AFADoomer »

Boingo the Clown wrote: AFADooMer was kind enough to let me try the beta version of his Wolf3D project, and I found the same thing while tryin it out. The problem was even more pronounced, due to the fact his mod awards points. When the treasures stopped being picked up, they still continued to give points. I rolled the score counter over multiple times during my test run.
Which map/location? I've played through a good chunk in one sitting and never had problems.

[edit] OK, I think I've found the problem...
In the case of my treasure code, the pickup script gets run even though you've reached the max pickup amount... But the item doesn't disappear, so it gets run continuously.

Example:

Code: Select all

ACTOR Cross : CustomInventory 21052
{
	+COUNTITEM
	+AUTOACTIVATE
	Inventory.DefMaxAmount
	Inventory.PickupSound "pickups/cross"
	Inventory.PickupMessage "Cross"
	States
	{
	Spawn:
		TREA A -1
		Loop
	Pickup:
		TREA A 0 ACS_ExecuteAlways(700, 0, 100)
		Stop
	}
}
This can be fixed by raising the max amount, of course... But I don't think it should exibit the current behavior of running the pickup frames over and over again...

On a possibly related note, this script causes a crash (see attached):

Code: Select all

ACTOR BlueKey : CustomInventory 21044
{
	+AUTOACTIVATE
	Inventory.Amount 1
	Inventory.PickupSound "pickups/key"
	Inventory.PickupMessage "Blue Key"
	States
	{
	Spawn:
		KEYS B -1
		Loop
	Pickup:
		KEYS B 0 A_GiveInventory("BlueCard", 1)
	}
}
It worked fine when I was inheriting from 'Inventory' before the code was changed.
Last edited by AFADoomer on Sat Jan 14, 2006 19:59, edited 1 time in total.
User avatar
Boingo the Clown
Posts: 102
Joined: Sat Dec 03, 2005 17:40
Location: North of New York, West of Montreal, East of Toronto, and South of Hell
Contact:

Post by Boingo the Clown »

Here is an example of one of my treasures. The others are the same, except for the sprites.
ACTOR Chalice1 : Inventory 6082
{
+COUNTITEM
+AUTOACTIVATE
Inventory.DefMaxAmount
Inventory.PickupSound "CHALICE"
Inventory.PickupMessage "Picked up a Chalice"
scale 0.16
States
{
Spawn:
PTN2 A -1
Loop
}
}
If what AFADooMer is true, and it is from reaching a preset maxium, is it possible to increase this maximum, or perhaps to reset the amounts to 0 at the beginning of each level?
User avatar
TheDarkArchon
Posts: 1000
Joined: Wed Jul 06, 2005 11:58
Location: What's that fucking smell
Contact:

Post by TheDarkArchon »

AFADoomer:

Code: Select all

ACTOR BlueKey : CustomInventory 21044
{
   +AUTOACTIVATE
   Inventory.Amount 1
   Inventory.PickupSound "pickups/key"
   Inventory.PickupMessage "Blue Key"
   States
   {
   Spawn:
      KEYS B -1
      Loop
   Pickup:
      KEYS B 0 A_GiveInventory("BlueCard", 1)
      Stop
   }
}
You forgot to stop the pickup state.

Boingo: He's correct. The predefined maximum is 25, IIRC. To increase this, use "Inventory.MaxAmount (number)" instead of "Inventory.DefMaxAmount".
User avatar
Boingo the Clown
Posts: 102
Joined: Sat Dec 03, 2005 17:40
Location: North of New York, West of Montreal, East of Toronto, and South of Hell
Contact:

Post by Boingo the Clown »

TheDarkArchon wrote:Boingo: He's correct. The predefined maximum is 25, IIRC. To increase this, use "Inventory.MaxAmount (number)" instead of "Inventory.DefMaxAmount".
So if I change it to something like:

Inventory.MaxAmount (2048)

That would fix the problem?
AFADoomer
Posts: 43
Joined: Fri Sep 02, 2005 3:23

Post by AFADoomer »

Ah. Thanks.

For the Pickup state, the final 'Stop' needs to be 'Fail' in order to stop the infinite-pickup problem on all of these.

So this is our bug, not a bug in GZDoom.

Is there any way to have an item allowed to be picked up an infinite number of times, other than setting the max amount to a huge number?

i.e.
Inventory.MaxAmount 4096
User avatar
Boingo the Clown
Posts: 102
Joined: Sat Dec 03, 2005 17:40
Location: North of New York, West of Montreal, East of Toronto, and South of Hell
Contact:

Post by Boingo the Clown »

I changed my decorate lump from
ACTOR Chalice1 : Inventory 6082
{
+COUNTITEM
+AUTOACTIVATE
Inventory.DefMaxAmount
Inventory.PickupSound "CHALICE"
Inventory.PickupMessage "Picked up a Chalice"
scale 0.16
States
{
Spawn:
PTN2 A -1
Loop
}
}
to
ACTOR Chalice1 : Inventory 6082
{
+COUNTITEM
+AUTOACTIVATE
Inventory.Amount 0
Inventory.PickupSound "CHALICE"
Inventory.PickupMessage "Picked up a Chalice"
scale 0.16
States
{
Spawn:
PTN2 A -1
Loop
}
}
That appears to have fixed the problem.

Sorry for the false alarm.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Exactly. Setting the max amount to 0 makes it not go into the inventory and in combination with +AUTOACTIVATE is the intended way to create pickup items like Doom's that get used immediately.
Locked

Return to “GZDoom”