Defaults.cs
by Tim Heldna · in Torque Game Engine · 07/06/2006 (8:52 am) · 6 replies
example\common\defaults.cs
In 1.4, the above file seems to be brute forcing certain pref values when it shouldn't be.
Certain changes I make in my options GUI aren't being saved.
Upon exiting and re-entering a game they get overwritten with the values in common\defaults.cs.
So any pref information stored in client\prefs.cs is being overwritten with the default prefs set in common\defaults.cs.
If I stop common\defaults.cs from executing everything works perfectly.
Is this the right way of fixing this or will this break something that I haven't come across yet? I don't see how that file is needed anyhow when you already have a client\defaults.cs.
Please explain.
In 1.4, the above file seems to be brute forcing certain pref values when it shouldn't be.
Certain changes I make in my options GUI aren't being saved.
Upon exiting and re-entering a game they get overwritten with the values in common\defaults.cs.
So any pref information stored in client\prefs.cs is being overwritten with the default prefs set in common\defaults.cs.
If I stop common\defaults.cs from executing everything works perfectly.
Is this the right way of fixing this or will this break something that I haven't come across yet? I don't see how that file is needed anyhow when you already have a client\defaults.cs.
Please explain.
About the author
#2
I have fixed this problem which is when I noticed that every time I exited and re-started my game my player name was reset to "fresh meat".
Common\defaults.cs is where the value is incorrectly overwriting the $pref::Player::Name value in any and all pref files!
You do not need common\defaults.cs as this task is being performed in client\defaults.cs
It seems that the common\defaults.cs file was added by mistake by GG with the new creator setup in 1.4.
07/06/2006 (10:06 am)
Quote:Without a single doubt.
Are you certain that's what's happening?
Quote:This problem stems from a problem in guiTextEditCtrl.cc, in 1.4.
the player name doesn't get reloaded properly on the server selection menu anymore
I have fixed this problem which is when I noticed that every time I exited and re-started my game my player name was reset to "fresh meat".
Common\defaults.cs is where the value is incorrectly overwriting the $pref::Player::Name value in any and all pref files!
You do not need common\defaults.cs as this task is being performed in client\defaults.cs
It seems that the common\defaults.cs file was added by mistake by GG with the new creator setup in 1.4.
#3
08/08/2006 (7:13 pm)
There isn't an example/common/defaults.cs in TGE 1.4 (nor has there ever been according to our SVN logs).
#4
Why else would you have?
The example/common/defaults.cs file isn't there to begin with, it is generated. I'm not sure when and where it happens, perhaps running a dedicated server is the culprit. Either way, every time I delete the file it magically reappears.
You should look into this more thoroughly, please.
08/09/2006 (12:26 am)
Trust me, it's there.Why else would you have?
//-----------------------------------------------------------------------------
// Load up defaults console values.
//exec("./defaults.cs");
//-----------------------------------------------------------------------------Inside of example/common/main.csThe example/common/defaults.cs file isn't there to begin with, it is generated. I'm not sure when and where it happens, perhaps running a dedicated server is the culprit. Either way, every time I delete the file it magically reappears.
You should look into this more thoroughly, please.
#5
i didn't know that a defaults.cs was generated!
typically defaults.cs is exec'd before prefs.cs, and thus prefs.cs overrides defaults.cs.
maybe try blowing away *.dso in the entire project ?
also, if your above quote is accurate,
it seems to be 100% no-ops.
which, yeah, seems weird.
08/09/2006 (2:43 am)
Hey tim -i didn't know that a defaults.cs was generated!
typically defaults.cs is exec'd before prefs.cs, and thus prefs.cs overrides defaults.cs.
maybe try blowing away *.dso in the entire project ?
also, if your above quote is accurate,
it seems to be 100% no-ops.
which, yeah, seems weird.
#6
Launch a fresh virgin install of TGE 1.4 and type in a player name. Now quit, and restart. Where did your player name go? It's now blank?
Ok, so this stems from several bugs in guiTextEditCtrl.cc.
Here's a resource with a community fix.
Fix for guiTextEditCtrl.cc
I know two things for certain.
1) example/common/main.cs is trying to execute a default.cs file when it shouldn't be. Regardless of whether the default.cs file is there or not, that line shouldn't be there.
2) Some bugs in guiTextEditCtrl.cc are contributing to the problem.
As to why I'm seeing the file and no-one else is? Only two things come to mind.
1) Either someone else on my team noticed the console warning and just copy / pasted the starter.fps/client/defaults.cs file in there to alleviate console spam.
2) I'm performing a unique series of events that results in the file being generated.
08/09/2006 (7:49 am)
Something is definitely wrong.Launch a fresh virgin install of TGE 1.4 and type in a player name. Now quit, and restart. Where did your player name go? It's now blank?
Ok, so this stems from several bugs in guiTextEditCtrl.cc.
Here's a resource with a community fix.
Fix for guiTextEditCtrl.cc
I know two things for certain.
1) example/common/main.cs is trying to execute a default.cs file when it shouldn't be. Regardless of whether the default.cs file is there or not, that line shouldn't be there.
2) Some bugs in guiTextEditCtrl.cc are contributing to the problem.
As to why I'm seeing the file and no-one else is? Only two things come to mind.
1) Either someone else on my team noticed the console warning and just copy / pasted the starter.fps/client/defaults.cs file in there to alleviate console spam.
2) I'm performing a unique series of events that results in the file being generated.
Torque Owner Paul /*Wedge*/ DElia