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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Thaler
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#13
RE: Thaler

I know its not your mod Neelke, but that is ridiculously inefficient coding.
I could be wrong, but something like this would could work too.

PHP Code: (Select All)
//This is untested

void CheckCoins(string &in asTimer)
{
RemoveItem("Coin_*");  //This is the only thing I worry about. Whether wildcard (*) can be used in Inventory.
GiveItemFromFile("Coin_"+GetGlobalVarInt("Coins"), "Coin_"+GetGlobalVarInt("Coins")+".ent");
AddTimer("Recheck"0.1f"CheckCoins");


Edit: Another way to do it, using psuedocode as a reference:

BEGIN
For int = 0 to 300 step 10
   RemoveItem("coin_"+int)
Next
GiveItem("coin_"+coin_count, "coin_"+coin_count+".ent")
REPEAT

Edit 2: Both methods can actually be done without a Timer, for even MORE efficiency! The value changes twice. When you get coins, or when you lose coins. Thus, when you pick up a Thaler thingy, call the code. When you lose thalers, like when you open a box that needs them, call the code. That way, it changes when appropriate and executes the normal amount of times to avoid a constant 0.1 second timer.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 02-17-2015, 05:11 PM by Romulator.)
02-17-2015, 02:16 PM
Find


Messages In This Thread
Thaler - by User01 - 02-16-2015, 12:26 PM
RE: Thaler - by Ongka - 02-16-2015, 12:38 PM
RE: Thaler - by User01 - 02-16-2015, 12:49 PM
RE: Thaler - by Neelke - 02-16-2015, 02:41 PM
RE: Thaler - by Mudbill - 02-16-2015, 04:41 PM
RE: Thaler - by FlawlessHappiness - 02-16-2015, 05:40 PM
RE: Thaler - by User01 - 02-17-2015, 10:59 AM
RE: Thaler - by FlawlessHappiness - 02-17-2015, 11:16 AM
RE: Thaler - by User01 - 02-17-2015, 11:53 AM
RE: Thaler - by FlawlessHappiness - 02-17-2015, 12:05 PM
RE: Thaler - by Neelke - 02-17-2015, 01:04 PM
RE: Thaler - by FlawlessHappiness - 02-17-2015, 02:11 PM
RE: Thaler - by Romulator - 02-17-2015, 02:16 PM
RE: Thaler - by FlawlessHappiness - 02-17-2015, 03:01 PM



Users browsing this thread: 1 Guest(s)