Page 1 of 1

Saving Data

Posted: Fri Mar 10, 2017 12:24 am
by Karutoh
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! :)

Re: Saving Data

Posted: Fri Mar 10, 2017 12:24 am
by Rseding91
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).

Re: Saving Data

Posted: Fri Mar 10, 2017 12:30 am
by Karutoh
Rseding91 wrote: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 would I be able to save any type of data, like for example a player role in the type of a string such as "owner", "creator", "admin", "moderator", etc... Or maybe an array of players names, or a boolean?

Re: Saving Data

Posted: Fri Mar 10, 2017 12:46 am
by DaveMcW

Code: Select all

global.roles[force][player_index] = "owner"
Everything you care about saving when an event ends should be in the global table.

Re: Saving Data

Posted: Fri Mar 10, 2017 12:53 am
by Karutoh
DaveMcW wrote:

Code: Select all

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