Reloading INI values

Discussions about Coding and Scripting
User avatar
Barbie
Godlike
Posts: 2956
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Reloading INI values

Post by Barbie »

I noticed that my game controller class MonsterHuntSB expands TeamGamePlus the INI file settings are not reloaded with a new match. Does class'Object'.ResetConfig() this job?
"If Origin not in center it be not in center." --Buggie
Deaod
Average
Posts: 49
Joined: Fri Jul 10, 2020 9:22 am

Re: Reloading INI values

Post by Deaod »

No, you cannot reload the content of INI files from disk. ResetConfig() will instead reset all properties to their default value.

You will need to restart the process to apply settings changes that were done outside the game.
User avatar
Barbie
Godlike
Posts: 2956
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Reloading INI values

Post by Barbie »

Thanks for answer!
Deaod wrote: Wed Nov 20, 2024 3:35 pm You will need to restart the process to apply settings changes that were done outside the game.
So INI values of the game controller are only read if the process "ucc" is started? That would be bad…
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 3230
Joined: Sat Mar 21, 2020 5:32 am

Re: Reloading INI values

Post by Buggie »

Since 469d you can use special console command for reload config from the disk:

https://github.com/OldUnreal/UnrealTour ... issues/480

RELOADCFG [class/object] – Reloads the config for the specified class or object.
RELOADCONFIG [class/object] – Reloads the config for the specified class or object.
User avatar
Barbie
Godlike
Posts: 2956
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Reloading INI values

Post by Barbie »

It should be mentioned that only the combination of

Code: Select all

ResetConfig(); // load default values
ConsoleCommand("RELOADCONFIG"); // load values from INI file
gives the result like a restarted process.

(If a setting is not defined in the INI file, ConsoleCommand("RELOADCONFIG") does of course not reset it.)
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 3230
Joined: Sat Mar 21, 2020 5:32 am

Re: Reloading INI values

Post by Buggie »

Did you try specify object name or class name? Instead of reload whole world.
User avatar
Barbie
Godlike
Posts: 2956
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Reloading INI values

Post by Barbie »

IMO is a command without a given outer concerning self, so ResetConfig(); should be the same as self.ResetConfig();. Or am I on the wrong track?
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 3230
Joined: Sat Mar 21, 2020 5:32 am

Re: Reloading INI values

Post by Buggie »

RELOADCFG [class/object] – Reloads the config for the specified class or object.
RELOADCONFIG [class/object] – Reloads the config for the specified class or object.

You can specify class name or object name.
User avatar
Barbie
Godlike
Posts: 2956
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Reloading INI values

Post by Barbie »

Are the brackets [] part of the command or indicate they "optional value"?
"If Origin not in center it be not in center." --Buggie
Buggie
Godlike
Posts: 3230
Joined: Sat Mar 21, 2020 5:32 am

Re: Reloading INI values

Post by Buggie »

optional value.