Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone figure out how to know the players tinderbox count?
Shev Offline
Member

Posts: 238
Threads: 25
Joined: Dec 2010
Reputation: 0
#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
Frontcannon Offline
Senior Member

Posts: 538
Threads: 10
Joined: Jul 2010
Reputation: 2
#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
Shev Offline
Member

Posts: 238
Threads: 25
Joined: Dec 2010
Reputation: 0
#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
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#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
Shev Offline
Member

Posts: 238
Threads: 25
Joined: Dec 2010
Reputation: 0
#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
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)