Search found 9 matches

by Karutoh
Fri Mar 10, 2017 12:53 am
Forum: Modding help
Topic: Saving Data
Replies: 4
Views: 1433

Re: Saving Data

global.roles[force][player_index] = "owner" Everything you care about saving when an event ends should be in the global table. Everything that's not local is automaticly put in the global table, correct? Nevermind, I just re-read this . Thank you all for the help, I really appreciate it! :D
by Karutoh
Fri Mar 10, 2017 12:30 am
Forum: Modding help
Topic: Saving Data
Replies: 4
Views: 1433

Re: Saving Data

There is no "owner" of a force: just players on a given force. Actually the force doesn't even need to have a player in it. Forces can exist without any players (such as the enemy force and neutral force). Sorry, I guess I miss worded it, I'm not the best with introductory posts. I meant ...
by Karutoh
Fri Mar 10, 2017 12:24 am
Forum: Modding help
Topic: Saving Data
Replies: 4
Views: 1433

Saving Data

So right now I'm making a mod called "Factions". Right now I'm unable to save who is the owner of a force. Is there a way to do this, or no? If so, please let me know how! :)
by Karutoh
Fri Mar 10, 2017 12:18 am
Forum: Modding interface requests
Topic: Factorio API Ideas
Replies: 16
Views: 4676

Re: Factorio API Ideas

Rseding91 wrote:The technologies table keys are strings - there aren't any prototypes with integer names so when you try to index it with 1, 2, 3 and so on it doesn't find any result and returns nil.
Thank you that actually helped me understand the factorio api doc a little more.
by Karutoh
Thu Mar 09, 2017 11:19 pm
Forum: Modding interface requests
Topic: Factorio API Ideas
Replies: 16
Views: 4676

Re: Factorio API Ideas

Are you trying to iterate it with ipairs? Because that doesn't work per what the API docs page says about the "LuaCustomTable" type. No I was using... for i = 0, #ply.force.technologies, 1 do game.print(ply.force.technologies[i]); end I recently just did... for i, t in pairs(ply.force.tec...
by Karutoh
Thu Mar 09, 2017 8:09 am
Forum: Modding interface requests
Topic: Factorio API Ideas
Replies: 16
Views: 4676

Re: Factorio API Ideas

Klonan wrote: You can easily modify the technologies of a force:
http://lua-api.factorio.com/latest/LuaF ... chnologies
This doesn't work, all the values in that array are nil. What am I missing?
by Karutoh
Thu Mar 02, 2017 10:17 pm
Forum: Modding interface requests
Topic: Factorio API Ideas
Replies: 16
Views: 4676

Re: Factorio API Ideas

Then that solves that problem, thank you.
by Karutoh
Thu Mar 02, 2017 10:16 am
Forum: Modding interface requests
Topic: Factorio API Ideas
Replies: 16
Views: 4676

Re: Factorio API Ideas

[*]Change game.merge_forces(string source, string destination) to game.merge_forces(string source, string destination, bool mergeResearch) . This will allow you to merge research as well.[/*] Mergeing can be done in several ways and makes no sense to introduce just one. Such a merge needs to be pro...
by Karutoh
Thu Mar 02, 2017 8:28 am
Forum: Modding interface requests
Topic: Factorio API Ideas
Replies: 16
Views: 4676

Factorio API Ideas

If you as the reader have a few more ideas or one of these ideas already exist within the game, feel free to make a reply. I'll think of more later. New Ideas "Disable" widgets so that users cannot interface with them, but is still visible, just faded. New events such as, on_player_open_in...

Go to advanced search