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 » 05 Oct 2018, 20:07

As asked in the title. Could you build a script that would differentiate between Morrowind and OpenMW?

User avatar
Capostrophic
Posts: 458
Joined: 22 Feb 2016, 20:32

Re: Can a script tell Morrowind and OpenMW apart?

Post by Capostrophic » 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.
shitty lingua anglica grammar ftw

User avatar
Pop000100
Posts: 69
Joined: 18 Aug 2014, 21:17
Location: Loitering around Gnisis.

Re: Can a script tell Morrowind and OpenMW apart?

Post by Pop000100 » 06 Oct 2018, 05:27

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: 424
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek » 06 Oct 2018, 07:30

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.
"life is crazy"
"craziness has beauty which only crazies understand" some movie clip in the head.
https://wiki.openmw.org/index.php?title=Testing

Naugrim
Posts: 147
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: Can a script tell Morrowind and OpenMW apart?

Post by Naugrim » 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?

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.
My opinions are my own. I am just a thankful user of OpenMW with no affiliation with the dev team.

User avatar
sjek
Posts: 424
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek » 06 Oct 2018, 09:46

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."
"life is crazy"
"craziness has beauty which only crazies understand" some movie clip in the head.
https://wiki.openmw.org/index.php?title=Testing

User avatar
ap0
Posts: 276
Joined: 11 Aug 2011, 18:47
Contact:

Re: Can a script tell Morrowind and OpenMW apart?

Post by ap0 » 06 Oct 2018, 09:58

Ideally, this should not be possible :)

Why would you want to do such thing?

User avatar
sjek
Posts: 424
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek » 06 Oct 2018, 10:58

ap0 wrote:
06 Oct 2018, 09:58
Why would you want to do such thing?
Reference unloaded cells or modding for vanilla .?
"life is crazy"
"craziness has beauty which only crazies understand" some movie clip in the head.
https://wiki.openmw.org/index.php?title=Testing

Daimanta
Posts: 4
Joined: 05 Oct 2018, 20:05

Re: Can a script tell Morrowind and OpenMW apart?

Post by Daimanta » 06 Oct 2018, 12:42

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: 424
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek » 06 Oct 2018, 13:46

In all ears
What did you use .?
"life is crazy"
"craziness has beauty which only crazies understand" some movie clip in the head.
https://wiki.openmw.org/index.php?title=Testing

Post Reply

Who is online

Users browsing this forum: psi29a and 7 guests