Local Variable on items you have two or more of not working correctly in OpenMW

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
LegoManIAm94
Posts: 10
Joined: 06 Nov 2019, 01:33

Local Variable on items you have two or more of not working correctly in OpenMW

Post by LegoManIAm94 »

I made a post on the issues I am having to get my Duel Wielding mod to work in OpenMW. With more research it will appear OpenMW has some issues when dealing with local variables. I made a simple mod here which has this script that I put on the "iron longsword" weapon.

Code: Select all

begin localvariabletestscript

short mylocalvariable
short onpcequip

if ( onpcequip == 1 )
	set mylocalvariable to 1
else
	set mylocalvariable to 0
endif

if ( mylocalvariable == 1 )
	messagebox, "hello world"
endif

end
This script will spam the message "hello world" when you have a Iron Longsword equipped. This simple mod works in the original Morrowind engine but in OpenMW, if you have 2 or more Iron Longswords in your inventory and you equip one of the Iron Longsword, it will continue to spam the "hello world" message after you unequip the Iron Longsword.

To use this demo ESP file, add iron longsword to your inventory with player->additem "iron longsword" 1
Last edited by LegoManIAm94 on 23 Nov 2019, 23:41, edited 1 time in total.
User avatar
Capostrophic
Posts: 794
Joined: 22 Feb 2016, 20:32

Re: Local Variable on items you have two or more of not working correctly in OpenMW

Post by Capostrophic »

You haven't actually attached a file but no worries. The script works for me in 0.46.0 - scripted items no longer stack to prevent such issues - and the iron longsword successfully stops spamming "hello world" even when it's unequipped and there's another longsword in the inventory however there seem to be other issues in the patched mod?.. Not sure. Anyway, this should already be fixed.
LegoManIAm94
Posts: 10
Joined: 06 Nov 2019, 01:33

Re: Local Variable on items you have two or more of not working correctly in OpenMW

Post by LegoManIAm94 »

How do you get the 0.46.0 version? I am on Linux (Manjaro). I have 0.45.0.
User avatar
AnyOldName3
Posts: 2676
Joined: 26 Nov 2015, 03:25

Re: Local Variable on items you have two or more of not working correctly in OpenMW

Post by AnyOldName3 »

You can build it yourself, or download a nightly. I don't know if we have nightlies that work specifically with Manjaro (it's based on Arch, and I know we've had problems with Arch packagers using the wrong versions of our dependencies), but our generic Linux and Flatpak nightlies should work.
LegoManIAm94
Posts: 10
Joined: 06 Nov 2019, 01:33

Re: Local Variable on items you have two or more of not working correctly in OpenMW

Post by LegoManIAm94 »

This is no longer a issue after testing this mod in nightly build 2019-11-24.
Post Reply