Page 1 of 3

Can a script tell Morrowind and OpenMW apart?

Posted: 05 Oct 2018, 20:07
by Daimanta
As asked in the title. Could you build a script that would differentiate between Morrowind and OpenMW?

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 05 Oct 2018, 20:34
by Capostrophic
Morrowind only uses the compiled bytecode of a script. OpenMW only uses the source of a script. You could base something off that.
Also, TESCS compiler "eats" some script mistakes OpenMW considers unacceptable.
As for the script itself, any other discrepancies that are not caused by Morrowind scripting and compiler limitations are considered bugs that should be fixed, and mwscript implementation will be honed and improved ad aeternam even when there's a Lua-based scripting system.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 05:27
by Pop000100
Capostrophic wrote: 05 Oct 2018, 20:34 Morrowind only uses the compiled bytecode of a script. OpenMW only uses the source of a script. You could base something off that.
Also, TESCS compiler "eats" some script mistakes OpenMW considers unacceptable.
As for the script itself, any other discrepancies that are not caused by Morrowind scripting and compiler limitations are considered bugs that should be fixed, and mwscript implementation will be honed and improved ad aeternam even when there's a Lua-based scripting system.
Capostrophic he was asking if a script is able to test Morrowind versions not the difference in execution, how ever that difference may give you the opening to use to check. Read the MSFD 9.0, most importantly the limits of script editor and pitfalls section.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 07:30
by sjek
Something like

Code: Select all

if ( player->getdistance "a_ex_de_shack_door" ) >= (player->GetAlchemy) 
    MessageBox, "This is a simple message" 
endif
Which prefers to a door in dagon fell. vanilla can't load references in unloaded cells and (player->GetAlchemy) shouldn't work as it's second clause in if. Little rusty thought. Openmw spams message anywhere in exterior cells if not next to that door.

another one could be tied to an item and do some onactivate magic.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 09:03
by Naugrim
Woudln't it be possible for OpenMW to inject an environment variable so that scripts can check the engine and even version?

That means that aiming for original Morrowind is left with an un-elegant "check if variable does not exist", but at least is cleaner that resorting to hacks.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 09:46
by sjek
Naugrim wrote: 06 Oct 2018, 09:03 Woudln't it be possible for OpenMW to inject an environment variable so that scripts can check the engine and even version?
are you referring using version specifig behaviour for mods .?
if some feature got support as a mod and labeled as bug that will need to see case by case. flying fishes and ribbing clothing from all in vardenfell were read but went down as bugs .p
there shouldn't be any resrictions on distributiing older openmw version with mod...
Naugrim wrote: 06 Oct 2018, 09:03 That means that aiming for original Morrowind is left with an un-elegant "check if variable does not exist", but at least is cleaner that resorting to hacks.
in 1.0 the fileformat can be changed to include the scripting version and original is reserved as version 0
https://gitlab.com/OpenMW/openmw/blob/m ... ge-version
"The version can be selected from a combo box in the script subview."

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 09:58
by jvoisin
Ideally, this should not be possible :)

Why would you want to do such thing?

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 10:58
by sjek
ap0 wrote: 06 Oct 2018, 09:58 Why would you want to do such thing?
Reference unloaded cells or modding for vanilla .?

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 12:42
by Daimanta
Thanks for the replies. I was actually wondering if a standardised way of telling Morrowind and OpenMW apart to make Morrowind mods compatible with OpenMW. Since there appears to be no way to do it an a standardised manner I have been able to devise my own script to accurately tell Morrowind and OpenMW apart. Anybody interested in the result?

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 13:46
by sjek
In all ears
What did you use .?