Page 2 of 3

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 13:56
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 15:26
by sjek
nice .p
have you tried yet in practise.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 17:05
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 18:48
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 06 Oct 2018, 18:59
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 07 Oct 2018, 08:57
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 07 Oct 2018, 19:31
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).

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 09 Oct 2018, 19:24
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 09 Oct 2018, 22:43
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.

Re: Can a script tell Morrowind and OpenMW apart?

Posted: 10 Oct 2018, 06:53
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.