Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone figure out how to know the players tinderbox count?
Author Message
Shev Offline
Member

Posts: 236
Joined: Dec 2010
Reputation: 0
Post: #1
Anyone figure out how to know the players tinderbox count?
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.

i spam meme 4 raeg
01-23-2011 07:40 PM
Find all posts by this user Quote this message in a reply
Frontcannon Offline
Senior Member

Posts: 538
Joined: Jul 2010
Reputation: 0
Post: #2
RE: Anyone figure out how to know the players tinderbox count?
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.


╔═════════════════╗
☺ Smoke weed everyday ☺
╚═════════════════╝
01-23-2011 10:02 PM
Find all posts by this user Quote this message in a reply
Shev Offline
Member

Posts: 236
Joined: Dec 2010
Reputation: 0
Post: #3
RE: Anyone figure out how to know the players tinderbox count?
And ontop of it, it doesn't save the names of the tinderbox you have apparently :\

i spam meme 4 raeg
01-24-2011 12:22 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Senior Member

Posts: 307
Joined: Nov 2010
Reputation: 0
Post: #4
RE: Anyone figure out how to know the players tinderbox count?
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.
01-24-2011 02:36 AM
Find all posts by this user Quote this message in a reply
Shev Offline
Member

Posts: 236
Joined: Dec 2010
Reputation: 0
Post: #5
RE: Anyone figure out how to know the players tinderbox count?
(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?

i spam meme 4 raeg
01-24-2011 03:16 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Senior Member

Posts: 307
Joined: Nov 2010
Reputation: 0
Post: #6
RE: Anyone figure out how to know the players tinderbox count?
if (HasItem("tinderboxes") == false)

Or something like that; I'm not sure about that the name.
01-24-2011 10:38 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)