Search found 144 matches

by doktorstick
Sat Aug 13, 2016 4:39 am
Forum: Modding help
Topic: Proper way to initialize a cache to "game" table?
Replies: 4
Views: 695

Re: Proper way to initialize a cache to "game" table?

Thanks for the response. Minor misunderstanding. I'm not storing the cache in game ; it's in the top-level "local". It's basically a lookup table on some static computations from game.entity.prototypes . Since the data is static and cannot change during run-time, I don't see a need to stor...
by doktorstick
Sat Aug 13, 2016 2:37 am
Forum: Implemented mod requests
Topic: util.timestamp() for performance debugging
Replies: 8
Views: 1273

util.timestamp() for performance debugging

Howdy. I would like a debugging API to help identify performance bottlenecks. For instance: t1 = util.timestamp() do_order_n_cubed_operations() print ("function took", util.timestamp() - t1, "nanoseconds") Optimally, it would measure only the time my code spent running, but if it...
by doktorstick
Sat Aug 13, 2016 2:30 am
Forum: Modding help
Topic: Proper way to initialize a cache to "game" table?
Replies: 4
Views: 695

Proper way to initialize a cache to "game" table?

Howdy. What's the proper way to initialize a cache to the game table? I cannot do it in on_load since game doesn't exist, yet. Right now, I've resorted to doing: local hacked_cache = nil script.on_event ( defines.events.on_tick, function (event) if hacked_cache == nil then build_hacked_cache() end ....
by doktorstick
Sat Aug 13, 2016 2:06 am
Forum: Modding help
Topic: "On_load" causing the save to be out of sync and cant load.
Replies: 11
Views: 1506

Re: "On_load" causing the save to be out of sync and cant load.

I'm relatively new to modding and this forum (my first post, actually), but I've spent a bit of time experimenting. My statements below are from my observations and I fully welcome any course corrections where I'm off-base. :D I'm not sure what I can tell you as an end user, but as a modder, the ans...

Go to advanced search