Can a script tell Morrowind and OpenMW apart?

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Daimanta
Posts: 4
Joined: 05 Oct 2018, 20:05

Can a script tell Morrowind and OpenMW apart?

Post by Daimanta »

As asked in the title. Could you build a script that would differentiate between Morrowind and OpenMW?
User avatar
Capostrophic
Posts: 794
Joined: 22 Feb 2016, 20:32

Re: Can a script tell Morrowind and OpenMW apart?

Post 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.
User avatar
Pop000100
Posts: 82
Joined: 18 Aug 2014, 21:17
Location: Loitering around Gnisis.

Re: Can a script tell Morrowind and OpenMW apart?

Post 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.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post 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.
Naugrim
Posts: 172
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: Can a script tell Morrowind and OpenMW apart?

Post 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.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post 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."
User avatar
jvoisin
Posts: 303
Joined: 11 Aug 2011, 18:47
Contact:

Re: Can a script tell Morrowind and OpenMW apart?

Post by jvoisin »

Ideally, this should not be possible :)

Why would you want to do such thing?
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek »

ap0 wrote: 06 Oct 2018, 09:58 Why would you want to do such thing?
Reference unloaded cells or modding for vanilla .?
Daimanta
Posts: 4
Joined: 05 Oct 2018, 20:05

Re: Can a script tell Morrowind and OpenMW apart?

Post 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?
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek »

In all ears
What did you use .?
Post Reply