Frictional Games Forum (read-only)
Anyone figure out how to know the players tinderbox count? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Anyone figure out how to know the players tinderbox count? (/thread-6359.html)



Anyone figure out how to know the players tinderbox count? - Shev - 01-23-2011

Is there a way to figure out how many tinderboxes the player has?

I was trying to make it so the player can get 10 tinderboxes, however only if he has less than 10 tinderboxes, and I'm having issues with the later.

I even tried doing GiveItemFromFile("tinderbox"+i, "tinderbox.ent"); and have it look for the tinderboxes with whatever number i was, however that didn't work. Yeah I'm kinda stuck here.


RE: Anyone figure out how to know the players tinderbox count? - Frontcannon - 01-23-2011

There is no function that keeps track of this number that I know of, I think you'll have to use a variable counter in a callback function every time the player picks up a tinderbox.


RE: Anyone figure out how to know the players tinderbox count? - Shev - 01-24-2011

And ontop of it, it doesn't save the names of the tinderbox you have apparently :\


RE: Anyone figure out how to know the players tinderbox count? - Tottel - 01-24-2011

Hmmm, you could use a loop to delete your tinderboxes one-by-one. Incrementing a counter every time you delete one. Once you're out of tinderboxes in your inventory, you have your total amount.

Obviously, you give the player back this amount then. Smile
Hope that helps.


RE: Anyone figure out how to know the players tinderbox count? - Shev - 01-24-2011

(01-24-2011, 02:36 AM)Tottel Wrote: Hmmm, you could use a loop to delete your tinderboxes one-by-one. Incrementing a counter every time you delete one. Once you're out of tinderboxes in your inventory, you have your total amount.

Obviously, you give the player back this amount then. Smile
Hope that helps.

That is a good idea, but how do I know when its out of tinderboxes script wise?


RE: Anyone figure out how to know the players tinderbox count? - Tottel - 01-24-2011

if (HasItem("tinderboxes") == false)

Or something like that; I'm not sure about that the name.