Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tinderbox Scripting Question
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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
Anxt Offline
Senior Member

Posts: 588
Threads: 12
Joined: Mar 2011
Reputation: 10
#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
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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




Users browsing this thread: 1 Guest(s)