warning for C-like variable comparison in the CS verifier

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
Post Reply
User avatar
asmo
Posts: 229
Joined: 18 Sep 2014, 21:20

warning for C-like variable comparison in the CS verifier

Post by asmo » 22 Oct 2015, 00:56

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
Last edited by asmo on 22 Oct 2015, 10:50, edited 2 times in total.
gentoo Linux - rolling release

wheybags
Posts: 207
Joined: 21 Dec 2012, 19:41

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

Post by wheybags » 22 Oct 2015, 01:25

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.

User avatar
asmo
Posts: 229
Joined: 18 Sep 2014, 21:20

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

Post by asmo » 22 Oct 2015, 01:27

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)
gentoo Linux - rolling release

User avatar
Zini
Posts: 5536
Joined: 06 Aug 2011, 15:16

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

Post by Zini » 22 Oct 2015, 08:41

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.

User avatar
asmo
Posts: 229
Joined: 18 Sep 2014, 21:20

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

Post by asmo » 22 Oct 2015, 10:46

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
gentoo Linux - rolling release

Post Reply