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
Tinderbox count?
Moonsun Offline
Junior Member

Posts: 5
Threads: 1
Joined: Apr 2011
Reputation: 0
#1
Tinderbox count?

Tinderboxes will count toward a 'score' at the end of my custom story, but I want it to say how many Tinderboxes you have once you die, or inside of the credits, so the player doesn't have to constantly check how many they have.

So my question is, what's the variable for how many tinderboxes you have called?
04-26-2011, 03:51 AM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#2
RE: Tinderbox count?

You can make one yourself, and in your script file tell it to add 1 every time the player picks up a tinderbox.
Make it a GlobalVarInt.

(This post was last modified: 04-26-2011, 03:57 AM by Anxt.)
04-26-2011, 03:57 AM
Find
Moonsun Offline
Junior Member

Posts: 5
Threads: 1
Joined: Apr 2011
Reputation: 0
#3
RE: Tinderbox count?

So there isn't already one I can already use?
04-26-2011, 03:58 AM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#4
RE: Tinderbox count?

Not really. Although its very easy to make one, so it shouldn't be too much of an issue.

04-26-2011, 04:13 AM
Find
Moonsun Offline
Junior Member

Posts: 5
Threads: 1
Joined: Apr 2011
Reputation: 0
#5
RE: Tinderbox count?

Very easy? The only way I can think of is putting a playerinteractcallback onto all the tinderboxes I have... Is your way easier than that? Confused
04-26-2011, 04:28 AM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#6
RE: Tinderbox count?

You would end up doing that, yes, but there is a very easy way to do it:

In your OnStart:

SetEntityPlayerInteractCallback("tinderbox_*", "Tindercounter", false);



Then:

void Tindercounter(string &in asEntity)
{
AddGlobalVarInt("TinderCount", 1);
}



That will add 1 to the variable every time you pick one up. Just add it to every map and it will continue counting up every time you pick one up.

04-26-2011, 05:02 AM
Find
Moonsun Offline
Junior Member

Posts: 5
Threads: 1
Joined: Apr 2011
Reputation: 0
#7
RE: Tinderbox count?

Thanks for your help :3
04-26-2011, 05:22 AM
Find
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#8
RE: Tinderbox count?

Any time Smile

04-26-2011, 05:32 AM
Find
Moonsun Offline
Junior Member

Posts: 5
Threads: 1
Joined: Apr 2011
Reputation: 0
#9
RE: Tinderbox count?

One more question, how do you actually get the amount of tinderboxes to appear in loading screens and such? Right now I have SetupLoadScreen in the OnLeave(), and SetDeathHint in the OnStart() with the text category and entry in both, but I have no idea how to get it to show the amount of tinderboxes you have.
04-26-2011, 06:55 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#10
RE: Tinderbox count?

Don't forget you need to subtract 1 when you use a tinderbox.
04-26-2011, 08:17 AM
Find




Users browsing this thread: 1 Guest(s)