Script issues

General discussion regarding the OpenMW project.
For technical support, please use the Support subforum.
User avatar
Arakhor
Posts: 37
Joined: 17 Aug 2017, 11:25
Location: UK

Script issues

Post by Arakhor »

Bearing in mind that my only knowledge of MW code is practical experience over the last 15 years, what is stopping normal (non-MWSE) script from something working in OpenMW? Antares' Sorting Urns mod doesn't sort through your ingredients, the Detect Humanoids mod (a pre-MCP workaround for the Detect Animals bug) isn't working and teleportation mods seem to be all out of charge.

However, other scripted mods I'm using appear to be working so far. Is there a layman's explanation for this (beyond "spooky script sorcery")?
User avatar
DestinedToDie
Posts: 1181
Joined: 29 Jun 2015, 09:08

Re: Script issues

Post by DestinedToDie »

From what I've heard, it's mostly spooky script sorcery, but not spooky in the way that we don't quite understand why it doesn't work. More in the way of using incorrect syntax, human errors such as mistakenly using an undefined value due to mistyping the name of a defined one and finally making use of some extremely quirky engine behavior that even the Morrowind developers never used.

Morrowind seldom tells you that your script has errors in it and runs pretty much everything regardless, but OpenMW is strict and quick to reject running the entire script if it has even a small error. On the bright side, OpenMW-CS immediately lets you know about a faulty line as you're writing scripts.
Loriel
Posts: 179
Joined: 28 May 2015, 00:44

Re: Script issues

Post by Loriel »

The log should identify where the problem lies.

Opening the mod in the OpenMW-CS and running "verify" should also list (nearly all ) the errors and warnings (including rather a lot from the basic Morrowind game).

Most teleport mods use MWSE, so won't work in OpenMW. CD Cooley's one has separate problems, discussed starting at viewtopic.php?f=40&t=4390#p48096

I don't think the other two mods you mention have been covered in compatibility testing - I will try to look at them later

Loriel
User avatar
Arakhor
Posts: 37
Joined: 17 Aug 2017, 11:25
Location: UK

Re: Script issues

Post by Arakhor »

I opened up the sorting mod and boy, there are a lot of "default" errors, as you said. (I assume that fixing those is off in the halcyon days of a post-1.0 release.)

It flagged the script as having a bunch of unexpected parentheses. Maybe I'll trying removing them as directed and see if that works (unlikely as that is).
Loriel
Posts: 179
Joined: 28 May 2015, 00:44

Re: Script issues

Post by Loriel »

Yes, I think the relevant errors are in the script S_sorter_script2 - lines which have a spurious ")" at the end - like:

Code: Select all

 player ->  removeitem  ingred_bc_ampoule_pod 1 )
Basically similar lines repeated in the latter third of the file.

It should work after those fixes, but I haven't tried it yet.

I haven't identified any errors in the "Detect Humanoid" mod yet.

I don't know what the solution is to the warnings and errors in the basic game - perhaps a mod which overwrites them with "correct" code, or perhaps an "ignore" list for the verify process. It would make checking easier if they could be filtered out!

Loriel
User avatar
Arakhor
Posts: 37
Joined: 17 Aug 2017, 11:25
Location: UK

Re: Script issues

Post by Arakhor »

The "Teleportation Spells" mod has a simple script which checks for the requisite spell being cast (a dummy Detect Animal effect) and then uses the Position function to take you to that cell. Given that OMW-CS didn't spot any errors, I guess it's the Position function at fault?
Attachments
Teleportation Spells.zip
(3.19 KiB) Downloaded 182 times
Loriel
Posts: 179
Joined: 28 May 2015, 00:44

Re: Script issues

Post by Loriel »

Arakhor wrote: 17 Aug 2017, 13:24 The "Teleportation Spells" mod has a simple script which checks for the requisite spell being cast (a dummy Detect Animal effect) and then uses the Position function to take you to that cell. Given that OMW-CS didn't spot any errors, I guess it's the Position function at fault?
Yes, I find Positioncell (which takes the cell name as an extra argument) to be more reliable. See how that is used in the "Teleport Ring" mod at https://wiki.openmw.org/index.php?title ... usive_mods (expand Table 5 if necessary) - haven't yet tested it personally, but it is reported as working.

Loriel
User avatar
Arakhor
Posts: 37
Joined: 17 Aug 2017, 11:25
Location: UK

Re: Script issues

Post by Arakhor »

With the removal of the errant commas in the Sorting Urns script, it now works fine! :mrgreen:

I've attached my copy below, which I (long ago!) merged into Nymeria's Mage Guild fix.
Attachments
Sorting Urns and Nymeria's MG fix.zip
(6.27 KiB) Downloaded 174 times
User avatar
silentthief
Posts: 456
Joined: 18 Apr 2013, 01:20
Location: Currently traversing the Ascadian Isles

Re: Script issues

Post by silentthief »

DestinedToDie wrote: 17 Aug 2017, 12:21 From what I've heard, it's mostly spooky script sorcery, but not spooky in the way that we don't quite understand why it doesn't work. More in the way of using incorrect syntax, human errors such as mistakenly using an undefined value due to mistyping the name of a defined one and finally making use of some extremely quirky engine behavior that even the Morrowind developers never used.

Morrowind seldom tells you that your script has errors in it and runs pretty much everything regardless, but OpenMW is strict and quick to reject running the entire script if it has even a small error. On the bright side, OpenMW-CS immediately lets you know about a faulty line as you're writing scripts.
In addition to spooky sorcery, there was talk of *some* extended scripting. Not support for all of MWSE -- but functional equivalents for certain script/code.

Check this link for what I am talking about: http://wiki.openmw.org/index.php?title=MWSE which is from this link discussing this --> viewtopic.php?f=3&t=1799

(Dunno how accurate this page is -- as in if they are all still having "Not started" status and also bear in mind that unless things have changed this is not a pre-v1 priority)

ST
User avatar
Arakhor
Posts: 37
Joined: 17 Aug 2017, 11:25
Location: UK

Re: Script issues

Post by Arakhor »

Sadly, switching the teleportation code from Position to PositionCell hasn't worked, even though it works perfectly in the console and OMW-CS still doesn't throw any errors. I've included the script below in case anyone has any ideas.
Spoiler: Show
Post Reply