How to change AudioDevice value in a config?

Discussions about Coding and Scripting
User avatar
sektor2111
Godlike
Posts: 6410
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: How to change AudioDevice value in a config?

Post by sektor2111 »

JackGriffin wrote:I get the whole 'lets tinker with this' idea but why would you ever want to try to force a change for this via script?
Here you are right... in several points. If changing console, net-driver, audio-driver are doable easily using INT files, it's not the same with changing GameEngine to XC_GameEngine.
However we have lazy people (even too many) because it's a "hard" management:
- press tilde and open console;
- input "preferences" which means typing letters;
- access and set classes from there;
- close window;
- close console.
For some of them is handly to do 3 mouse clicks rather that typing commands - of course, posting in forums is easier than writing INI files... and reading a doc (at least this is what I see).

Changing "GameEngine" doesn't work. It's shown as a trasient and has whatever properties but not even after a game restart is not OK. Also at saving config looks like INI is rammed with word "class" messing up with a game-crash. I was trying to prevent editing INI manually and getting data using INT (as Audio does) but I don't have luck. UScript is doing nasty things with main INI file,... Or there is a trick to be used in those INTs ?
Chris
Experienced
Posts: 134
Joined: Mon Nov 24, 2014 9:27 am

Re: How to change AudioDevice value in a config?

Post by Chris »

It sure looks like the engine is missing a few things here.
"set ini:" is supposed to do exactly what it says, but apparently it doesn't always.
I wonder what Higor has to say about this.

Maybe a solution would be to have a native function that handles and edits the ini outside the engine methods.
After that, let the game restart, which can also be done inside the function.
Something like:
"native final function /*void*/ SetIniProperty(String Package, String tClass, String Member, String Value, optional bool restart/*=false*/);
native final function string GetIniProperty(String Package, String tClass, String Member);"

I could get this done in a couple of minutes and give some feedback if successful or not.
Post Reply