Page 1 of 1

warning for C-like variable comparison in the CS verifier

Posted: 22 Oct 2015, 00:56
by asmo
Here's the snippet:

Code: Select all

    if ( asmo_conmer_global_script.s_on_drop == 1 )
        asmo_conmer_global_script.s_on_drop == 0
        if ( asmo_conmer_global_script.s_active_chest == 1 ) ; active chest1 ?
The CS does not complain about: other_known_script.variable == <something>. Clearly the wrong syntax, it should have been set script.variable to value.

At least the game states the script name and object:

Code: Select all

Execution of script asmo_conmer_chest2_script failed:
unknown ID: asmo_conmer_chest1
That object is within another (sub-) if-block.

Is this a bug and if so, worth to create an issue report?

EDIT: changed subject to a more precise description

Re: Wrong(?) script syntax not found by CS verifyer

Posted: 22 Oct 2015, 01:25
by wheybags
I'm not sure about in mwscript, but in pretty much every other language that's a valid statement, it's just a boolean expression, whose value is discarded.

Re: Wrong(?) script syntax not found by CS verifyer

Posted: 22 Oct 2015, 01:27
by asmo
wheybags wrote:I'm not sure about in mwscript, but in pretty much every other language that's a valid statement, it's just a boolean expression, whose value is discarded.
When you do

Code: Select all

abc == 1 ; abc is in the same script
you get a warning by the script verifier. Namely:

Code: Select all

Error | (line) 9 | Unexpected name (abc)

Re: Wrong(?) script syntax not found by CS verifyer

Posted: 22 Oct 2015, 08:41
by Zini
We had to make a lot of allowances to work around broken scripts in major content files (including the official ones) and that may be just one of these cases (we will add a way post 1-0 to disable these workarounds). Still it should produce a warning.

Re: Wrong(?) script syntax not found by CS verifyer

Posted: 22 Oct 2015, 10:46
by asmo
Zini wrote:We had to make a lot of allowances to work around broken scripts in major content files (including the official ones) and that may be just one of these cases.
:roll: Looks like BethSoft really created a perfect game atmosphere while the implementation was somewhat ... weak.
Still it should produce a warning.
https://bugs.openmw.org/issues/2971