Frictional Games Forum (read-only)

Full Version: Tinderbox count?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
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.
So there isn't already one I can already use?
Not really. Although its very easy to make one, so it shouldn't be too much of an issue.
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
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.
Thanks for your help :3
Any time Smile
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.
Don't forget you need to subtract 1 when you use a tinderbox.
Pages: 1 2