Micro wrote:
I don't have internet right now, but the last time I played it was still an issue. The source I had was from Helix's started kit. I tried several versions of TWX, and mombot on several different servers, and it always saved "$MULTIPLE_PHOTONS" = "1" instead of "$MULTIPLE_PHOTONS" = "True" in the twx config file. If I changed this manually, it worked fine.
As far as I know, TRUE=1, and that's how it's saved in .cfg.
I did a little testing to confirm, using twx 2.05:
test script:
Code:
setVar $TRUTH TRUE
saveVar $TRUTH
loadVar $TRUTH
echo "*$TRUTH: " & $TRUTH
setVar $strTRUTH "TRUE"
saveVar $strTRUTH
loadVar $strTRUTH
echo "*$strTRUTH: " & $strTRUTH
setVar $intTRUTH 1
saveVar $intTRUTH
loadVar $intTRUTH
echo "*$intTRUTH: " & $intTRUTH
halt
output:
Code:
$TRUTH: 1
$strTRUTH: TRUE
$intTRUTH: 1
twx cfg file:
Code:
$TRUTH=1
$STRTRUTH=TRUE
$INTTRUTH=1
now try to use those vars:
Code:
if ($intTRUTH)
echo "*($intTRUTH)"
end
if ($TRUTH)
echo "*($TRUTH)"
end
if ($strTRUTH)
echo "*($strTRUTH)"
end
output:
Code:
($intTRUTH)
($TRUTH)Script run-time error in 'ACTEST.TS': 'TRUE' is not a number, line 26
Script terminated: scripts\actest.ts
hmm, it's not recognizing $STRTRUTH=TRUE, only $STRTRUTH=1. The problem is it's treating TRUE as "TRUE".
Even if I try
Same result, 'TRUE' is not a number.
If I'm right, loadVar $var is (incorrectly?) assigning the value "TRUE" instead of "1" when we have the line $VAR=TRUE in the .cfg.
Possibly, there was a change made to both saveVar and loadVar that saves/loads as 1 instead of TRUE, which would make sense to me except that it breaks when there are already vars saved in the config, or if any of the scripts use SaveVar "TRUE" (which is sort of wrong, but would have worked in previous versions) instead of SaveVar TRUE.
At least, that's how it looks to me. I could be completely wrong... hopefully EP will be able to shed light when he reads this.