[Fixed] GiveInventory Puzzleitems

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

GiveInventory Puzzleitems

Post by Graf Zahl »

With giveinventory it's impossible to have more than one puzzleitem of a kind. When you have more than one the amount gets reset to 1 each time giveinventory is called.
I wonder why because it's no problem to pick up more than one normally.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Just to hazard a guess, I'd say this is probably intentional so that an ACS script doesn't have to check to see if the player has a particular puzzle item already before giving it to him -- it can just assume he doesn't have the item and give it to him and if he already has it, it won't give him an extra.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Deathkings has levels where you can collect more than one item of the same kind.
But you cannot do that if scripts are involved to give you the items.
And you don't think this looks right, do you?

Code: Select all

	for (i = 0; i < NUMARTIFACTS; ++i)
	{
		if (strcmp (ArtifactNames[i], type) == 0)
		{
			int maxCount;

			if (i >= arti_firstpuzzitem)
			{
				maxCount = 1;
			}
			else if (gameinfo.gametype == GAME_Heretic)
			{
				maxCount = 16;
			}
			else
			{
				maxCount = 25;
			}
			player->inventory[i] = MIN(player->inventory[i]+amount, maxCount);
			return;
		}
	}
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Graf Zahl wrote:And you don't think this looks right, do you?
What's wrong with it? It appears that puzzle items are specifically singled out and restricted to only having 1 at a time, obviously an intentional change.

Does Deathkings actually behave differently than the original? If so, then this would seem to be a bug. If not, this is probably here for compatibility.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

They are not! That's the point. They are restricted to 1 only in coop when picked up but the code above restricts them to 1 all the time and what's worse it *TAKES THEM AWAY* if you already have them!
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Graf Zahl wrote:They are not! That's the point. They are restricted to 1 only in coop when picked up but the code above restricts them to 1 all the time and what's worse it *TAKES THEM AWAY* if you already have them!
It would do the same thing in Heretic if you managed to get 20 of an item and then picked another one up which ran through the above code. 16 is less than 21, so it would "steal" 4 items from you instead of giving you 1 more. I'd say the code giving you more than 1 is the code at fault, UNLESS as you say you should be able to get more than 1, in which case the code above is very odd indeed...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

The thing is it's impossible to get more than 16 artifacts in Heretic or more than 25 in Hexen at all but you *can* get more than one puzzleitem at a time. Deathkings would be close to unplayable if it weren't so. There are at least 3 puzzles that require multiple puzzle items of the same type.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

My bad. I thought Hexen restricted you to only one of each puzzle item.

Return to “Closed Bugs [GZDoom]”