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
Search found 9 matches
- Fri Mar 10, 2017 12:53 am
- Forum: Modding help
- Topic: Saving Data
- Replies: 4
- Views: 1580
- Fri Mar 10, 2017 12:30 am
- Forum: Modding help
- Topic: Saving Data
- Replies: 4
- Views: 1580
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 how ...
Sorry, I guess I miss worded it, I'm not the best with introductory posts. I meant how ...
- Fri Mar 10, 2017 12:24 am
- Forum: Modding help
- Topic: Saving Data
- Replies: 4
- Views: 1580
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! 

- Fri Mar 10, 2017 12:18 am
- Forum: Modding interface requests
- Topic: Factorio API Ideas
- Replies: 16
- Views: 5426
Re: Factorio API Ideas
Thank you that actually helped me understand the factorio api doc a little more.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.
- Thu Mar 09, 2017 11:19 pm
- Forum: Modding interface requests
- Topic: Factorio API Ideas
- Replies: 16
- Views: 5426
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 ...
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 ...
- Thu Mar 09, 2017 8:09 am
- Forum: Modding interface requests
- Topic: Factorio API Ideas
- Replies: 16
- Views: 5426
Re: Factorio API Ideas
This doesn't work, all the values in that array are nil. What am I missing?Klonan wrote: You can easily modify the technologies of a force:
http://lua-api.factorio.com/latest/LuaF ... chnologies
- Thu Mar 02, 2017 10:17 pm
- Forum: Modding interface requests
- Topic: Factorio API Ideas
- Replies: 16
- Views: 5426
Re: Factorio API Ideas
Then that solves that problem, thank you.
- Thu Mar 02, 2017 10:16 am
- Forum: Modding interface requests
- Topic: Factorio API Ideas
- Replies: 16
- Views: 5426
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 ...
- Thu Mar 02, 2017 8:28 am
- Forum: Modding interface requests
- Topic: Factorio API Ideas
- Replies: 16
- Views: 5426
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 ...
New Ideas
"Disable" widgets so that users cannot interface with them, but is still visible, just faded.
New events such as, on_player_open ...