Page 1 of 1

2.6.1 cfg corruption + fix

Posted: February 23rd, 2011, 11:12 am
by Hirato
Version 2.6.1 of sandbox introduces a new cubescript parser.
While it works well, it changes a few things some of our scripts depend on.

This results in one of our scripts producing some variant of the following, which is saved in the cfg.

Code: Select all

"guirolloverimgpath" = [packages/base//fps/DTFTA]
For those not familiar with cubescript, "fps/DTFTA]" is essentially a comment.
This means that the ] isn't parsed and that the whole cfg is therefor rendered null and void.

As for the script that generated it, the problem itself is that "" isn't interpreted as false with the new parser.
This is a bug and has recently been fixed upstream - we'll be importing the changes into our SVN soon.

The Workaround
If you're using the menus to load maps, I'm certain you're absolutely sick of this.
So without further ado, the workaround.

First, open data/menus.cfg

Next, look for the following code

Code: Select all

showmapshot = [
	guibar
	guilist [
		guiimage (format "packages/base/%1%2%3" $arg1 (if $arg1 [result "/"]) (at $guirollovername 0)) $guirolloveraction 5 1 "data/sandboxlogo"
		guitext $guirollovername
	]
]
Now, replace it with the following

Code: Select all

showmapshot = [
	guibar
	guilist [
		if $numargs [
			guiimage (format "packages/base/%1/%2" $arg1 (at $guirollovername 0)) $guirolloveraction 5 1 "data/sandboxlogo"
		] [
			guiimage (format "packages/base/%1" (at $guirollovername 0)) $guirolloveraction 5 1 "data/sandboxlogo"
		]
		guitext $guirollovername
	]
]
Now save the file, and you're done.
This will hopefully mean the end of these issues.

To the afflicted
If you are affected, please delete your config_*.cfg files or follow the main menu to options and click "restore defaults"

Re: 2.6.1 cfg corruption + fix

Posted: February 23rd, 2011, 3:23 pm
by Leo_V117
I was beginning to think that the corruptions were down to errors within custom scripts and codes... not the stock codes.

Well, if you say it fixes it... then it fixes it! :D

Are you gonna apply this to the SVN?

Re: 2.6.1 cfg corruption + fix

Posted: February 23rd, 2011, 3:28 pm
by Hirato
no, I'll be importing appropriate fixes from upstream soon though.

For other reasons, the stock scripts would most likely need to be re-examined and modified to use cubescript correctly.

Re: 2.6.1 cfg corruption + fix

Posted: June 25th, 2011, 11:35 pm
by Thunder28X
Hirato wrote:Version 2.6.1 of sandbox introduces a new cubescript parser.
While it works well, it changes a few things some of our scripts depend on.

This results in one of our scripts producing some variant of the following, which is saved in the cfg.

Code: Select all

"guirolloverimgpath" = [packages/base//fps/DTFTA]
For those not familiar with cubescript, "fps/DTFTA]" is essentially a comment.
This means that the ] isn't parsed and that the whole cfg is therefor rendered null and void.

As for the script that generated it, the problem itself is that "" isn't interpreted as false with the new parser.
This is a bug and has recently been fixed upstream - we'll be importing the changes into our SVN soon.

The Workaround
If you're using the menus to load maps, I'm certain you're absolutely sick of this.
So without further ado, the workaround.

First, open data/menus.cfg

Next, look for the following code

Code: Select all

showmapshot = [
	guibar
	guilist [
		guiimage (format "packages/base/%1%2%3" $arg1 (if $arg1 [result "/"]) (at $guirollovername 0)) $guirolloveraction 5 1 "data/sandboxlogo"
		guitext $guirollovername
	]
]
Now, replace it with the following

Code: Select all

showmapshot = [
	guibar
	guilist [
		if $numargs [
			guiimage (format "packages/base/%1/%2" $arg1 (at $guirollovername 0)) $guirolloveraction 5 1 "data/sandboxlogo"
		] [
			guiimage (format "packages/base/%1" (at $guirollovername 0)) $guirolloveraction 5 1 "data/sandboxlogo"
		]
		guitext $guirollovername
	]
]
Now save the file, and you're done.
This will hopefully mean the end of these issues.

To the afflicted
If you are affected, please delete your config_*.cfg files or follow the main menu to options and click "restore defaults"
It didn't work. I replaced the code and started up RPG mode and it didn't work, so I used FPS mode to restore to defaults and it still didn't work. Does this mean I'll have to re-install Sandbox entirely?

Re: 2.6.1 cfg corruption + fix

Posted: June 26th, 2011, 2:50 am
by Hirato
Thunder28X wrote:It didn't work. I replaced the code and started up RPG mode and it didn't work, so I used FPS mode to restore to defaults and it still didn't work. Does this mean I'll have to re-install Sandbox entirely?
Hirato wrote:To the afflicted
If you are affected, please delete your config_*.cfg files or follow the main menu to options and click "restore defaults"
*ahem*
If you're having trouble finding the cfg files, check ~/.platinumarts (Linux), VirtualStore (Windows) or the my_stuff sub folder (Windows)
Also reinstalling sandbox will not help if you have old configuration files lying about.

Re: 2.6.1 cfg corruption + fix

Posted: June 26th, 2011, 4:23 pm
by Thunder28X
Ahhh I see what happened now. Thank you very much! :)