HeroEngine Forums

HeroEngine Support => General Discussion => Topic started by: FI-ScottZ on Oct 06, 17, 02:35:39 PM

Title: player.ini
Post by: FI-ScottZ on Oct 06, 17, 02:35:39 PM
Thusfar, we have been storing and retrieving local player preferences in their Local Repository Cache via the client-side external functions SaveLocalRepositoryData() and LoadLocalRepositoryData() respectively.  However, that means that if we put out a new version of the LRC for download, their settings are wiped out.  We would prefer to store them in a text file but are unsure how.

I see there is a file in the install folder called player.ini which has lines in it as such:


It seems like that would be an ideal place to put user settings, but I don't know how or even if we can access it via HeroScript. I cannot find any reference to is in the HeroWiki.

Does anyone have any insight into this?

As a fallback, I can imagine we can write our own external functions to write to and read from a text file, but it would be nice if this was already available somehow.
Title: Re: player.ini
Post by: FI-ScottZ on Oct 06, 17, 02:51:05 PM
I have found there are these "Settings" functions:


although there is no documentation on them, either in the wiki or the _ExternalFunctions script.  I guess I can use those, but I still would like to know where they get stored.

When I tested it out in HeroBlade, I did not see any file getting made or modified in the HeroBlade installation folder.
Title: Re: player.ini
Post by: GlorianLanTarini on Oct 07, 17, 01:16:38 AM
Hello, Scott.
How about this algorithm?

It is simple and effective. And I use something very similar for user language settings. Only, I don't call to the server if it can't find LRC settings, but take user OS language as default.

By the way, this algorithm allows the user to use same settings on different computers. And you can decide which settings are hardware-independent, and which are not. Excellent for key binding and player's macros (if you allow it).
Title: Re: player.ini
Post by: FI-ScottZ on Oct 08, 17, 09:34:28 PM
Thanks for that idea, GlorianLanTarini.

But I was wanting to not have the settings affect the LRC at all. I found that the "Settings" external functions do not affect it, so that is what I went with, with good results.

Agreed, some settings would be good to store server side for migration to other computers. But this application is more for things that will often be specific to one's current hardware, like dealing with resolution, volumes, etc. Those things a user might want to be local to a particular pc setup and not used at every pc they log in with.