Frictional Games Forum (read-only)
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: Tinderbox count? (/thread-7641.html)

Pages: 1 2


Tinderbox count? - Moonsun - 04-26-2011

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?


RE: Tinderbox count? - Anxt - 04-26-2011

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.


RE: Tinderbox count? - Moonsun - 04-26-2011

So there isn't already one I can already use?


RE: Tinderbox count? - Anxt - 04-26-2011

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


RE: Tinderbox count? - Moonsun - 04-26-2011

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


RE: Tinderbox count? - Anxt - 04-26-2011

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.


RE: Tinderbox count? - Moonsun - 04-26-2011

Thanks for your help :3


RE: Tinderbox count? - Anxt - 04-26-2011

Any time Smile


RE: Tinderbox count? - Moonsun - 04-26-2011

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.


RE: Tinderbox count? - Tottel - 04-26-2011

Don't forget you need to subtract 1 when you use a tinderbox.