Frictional Games Forum (read-only)

Full Version: Tinderbox Scripting Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been wondering if there is some way you can record how many tinderboxes the player currently have and also be able to remove a tinderbox.

If you must have an idea on what this script is supposed to do, I'll tell.

It deals with trying to burn an object that has no standard lamp settings and if anyone is thinking about editing the object, in the model editor, you might as well not try to post it. Tongue

Thank you in advance. Smile
For each tinderbox throughout your map, add an interact callback which adds to a global var, then do the following:

for(int i = 0; i >= GetGlobalVarInt("Tindercount"); i++)
{ RemoveItem("tinderbox_"+i);
}

Then, say AddGlobalVarInt("Tindercount", -1) *if that works*

Then use

for(int i = 0; i > GetGlobalVarInt("Tindercount"); i++)
{ GiveItem("tinderbox_"+i);
}

It may not work that way, but I suppose it is worth a shot.

Edit: If subtracting one from Tindercount doesn't work that way, you could set up two callbacks for the same object, one of which only works if Tindercount is >=1, and name it Tindercount2 or something, then use that for the GiveItem function.
Alright, thanks. This helps. Didn't test it yet.

I completely forgot about the RemoveItem command or else I probably would have never posted this thread... :/