luaPlayer:settings
luaPlayer:settings
luaPlayer:settings -- just a simple shortcut that returns settings.get_player_settings(player)
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: luaPlayer:settings
Not to say that you idea is bad, but, if you have settings.get_player_settings(player), why would you need to do game.players[player_index].settings?
Q: does get_player_settings take player, or player_index?
if it takes index, there's no real need to add settings to LuaPlayer, however, if it takes player directly, then I can see how it could really cut things down to use player.settings.
Q: does get_player_settings take player, or player_index?
if it takes index, there's no real need to add settings to LuaPlayer, however, if it takes player directly, then I can see how it could really cut things down to use player.settings.
Re: luaPlayer:settings
get_player_settings() takes a luaPlayer, an index or a name
Usually by time I need a settings I already have the player so being able to do
is a lot quicker and cleaner then doing
Usually by time I need a settings I already have the player so being able to do
Code: Select all
player.settings["mod-seting-name"].value
Code: Select all
settings.get_player_settings(player)["mod-setting-name"].value
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: luaPlayer:settings
that sounds like what you want is actually already in there
note: I haven't edited any of my scripting at all in 0.15, everything from 0.14 just seemed to work (Except for magical inserter dancing when you press SHIFT + R, because it triggers both the new base game's rotate left, and my script's rotate the input postion. this can be fixed by redefining either hotkey)
note: I haven't edited any of my scripting at all in 0.15, everything from 0.14 just seemed to work (Except for magical inserter dancing when you press SHIFT + R, because it triggers both the new base game's rotate left, and my script's rotate the input postion. this can be fixed by redefining either hotkey)
Re: luaPlayer:settings
I fixed the empty note for 0.15.11. It just says it can be come invalid if the player is removed.
If you want to get ahold of me I'm almost always on Discord.
Re: luaPlayer:settings
Ohhh I missed that ! ThanksMooncat wrote:How about LuaPlayer::mod_settings?
I think it was added in 0.15.7.
Note: empty note. lol