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

Re: Can a script tell Morrowind and OpenMW apart?

Post by Daimanta »

I used the fact that Morrowind stores Global longs(int32) as floats. This means that do no span the entire 32-bit space and have a smaller limit. First I declare a global 'openmwchecker'. The I use the following script

Code: Select all

Begin openmwtest

set openmwchecker to 2147483521 ;this is one larger than the actual limit Morrowind can handle but OpenMW manages
if (openmwchecker == 2147483521)
	MessageBox, "OpenMW"
else
	MessageBox, "Morrowind"	
endif

End
The used branches can ofcourse be used to set a real global variable to indicate if you are running Morrowind or OpenMW and act accordingly.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Can a script tell Morrowind and OpenMW apart?

Post by sjek »

nice .p
have you tried yet in practise.
Daimanta
Posts: 4
Joined: 05 Oct 2018, 20:05

Re: Can a script tell Morrowind and OpenMW apart?

Post by Daimanta »

I did try it after I read about the limitation of globals in Morrowind Scripting for Dummies. I was quite happy to see it work.
Naugrim
Posts: 172
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: Can a script tell Morrowind and OpenMW apart?

Post by Naugrim »

sjek wrote: 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."
I am not going that far, I am just thinking in something like checking for `CYGWIN_VERSION` env var to see if your are running in Cygwin or another Bash. Version of course should not be used to support backward compatibility.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Can a script tell Morrowind and OpenMW apart?

Post by Chris »

Daimanta wrote: 06 Oct 2018, 12:42 I was actually wondering if a standardised way of telling Morrowind and OpenMW apart to make Morrowind mods compatible with OpenMW.
OpenMW should already be compatible with Morrowind mods. If you found a situation where it isn't, it's likely a bug and should be reported. Trying to work around it in the mod will potentially cause more problems or confusion as OpenMW continues to improve compatibility.
User avatar
wareya
Posts: 338
Joined: 09 May 2015, 13:07

Re: Can a script tell Morrowind and OpenMW apart?

Post by wareya »

There are a lot of things that probably won't ever get fixed, like actors being able to move freely when already inside of a piece of geometry, which some mannequins in some mods accidentally do and vibrate like hell in OpenMW because of it.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Can a script tell Morrowind and OpenMW apart?

Post by Chris »

Perhaps, though that's a more general issue in the mod that can be fixed to work in both (i.e. moving it out of the geometry), without having to differentiate between OpenMW and vanilla. The actual number of cases where OpenMW is willfully different with vanilla-compatible content is relatively quite small, and even then is generally to fix something that didn't work in vanilla to begin with (e.g. accessing unloaded object instances, or being able to use a variable in places where vanilla needs a constant).
Naugrim
Posts: 172
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: Can a script tell Morrowind and OpenMW apart?

Post by Naugrim »

How about TES3MP?
I know at least of this mod (https://www.nexusmods.com/skyrim/mods/76455/) that will benefit from knowing exactly where it runs. Right now it offers two version depending on whether you are in MP or normal OpenMW. Having a way to distinguish would allow for a a more simple installation.

I know, someone may say that after 1.0 Multiplayer will be merged into master, but imho, it does not hurt to provide this feature right in the meantime.
terabyte25
Posts: 55
Joined: 26 Jul 2018, 12:58

Re: Can a script tell Morrowind and OpenMW apart?

Post by terabyte25 »

Naugrim wrote: 09 Oct 2018, 19:24 How about TES3MP?
I know at least of this mod (https://www.nexusmods.com/skyrim/mods/76455/) that will benefit from knowing exactly where it runs. Right now it offers two version depending on whether you are in MP or normal OpenMW. Having a way to distinguish would allow for a a more simple installation.

I know, someone may say that after 1.0 Multiplayer will be merged into master, but imho, it does not hurt to provide this feature right in the meantime.
https://github.com/TES3MP/openmw-tes3mp/pull/473

Until OpenMW does this, don't expect much.
Naugrim
Posts: 172
Joined: 08 Jan 2016, 01:32
Location: Spain

Re: Can a script tell Morrowind and OpenMW apart?

Post by Naugrim »

terabyte25 wrote: 09 Oct 2018, 22:43
https://github.com/TES3MP/openmw-tes3mp/pull/473

Until OpenMW does this, don't expect much.
I have to agree with David there, TES3MP should not do this and not sure the method is the best solution, it is too specific for my taste.
However, seeing a 100% parity with vanilla is impossible and other forks may appear, for me it is clear that OpenMW should provide a generic method to identify the engine so modders can add fixes, warnings or configuration options.
Post Reply