Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tinderbox Scripting Question
Author Message
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #1
Tongue Tinderbox Scripting Question
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

(This post was last modified: 05-26-2011 02:04 AM by Kyle.)
05-26-2011 02:02 AM
Find all posts by this user Quote this message in a reply
Anxt Offline
Senior Member

Posts: 588
Joined: Mar 2011
Reputation: 10
Post: #2
RE: Tinderbox Scripting Question
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.

(This post was last modified: 05-26-2011 03:15 AM by Anxt.)
05-26-2011 03:12 AM
Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #3
RE: Tinderbox Scripting Question
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... :/

05-26-2011 03:25 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)