[Fixed] GiveInventory Puzzleitems

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.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [Fixed] GiveInventory Puzzleitems

by randi » Thu Nov 20, 2003 4:53 pm

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

by Graf Zahl » Mon Nov 17, 2003 3:41 pm

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.

by HotWax » Mon Nov 17, 2003 3:14 pm

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...

by Graf Zahl » Mon Nov 17, 2003 3:11 pm

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!

by HotWax » Mon Nov 17, 2003 3:06 pm

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.

by Graf Zahl » Mon Nov 17, 2003 1:11 pm

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;
		}
	}

by HotWax » Mon Nov 17, 2003 12:54 pm

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.

GiveInventory Puzzleitems

by Graf Zahl » Mon Nov 17, 2003 7:28 am

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.

Top