[Solved] How to script the difficulty?

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
dlshcbmuipmam
Posts: 6
Joined: 06 Dec 2018, 15:43

[Solved] How to script the difficulty?

Post by dlshcbmuipmam » 13 Jul 2019, 23:30

I am trying to understand how to implement a script to scale the difficulty with the character level. It can be done in tes3mp [1], seems like a simple lua script will do the job. However, the wiki page of scripting [2] is not that clear. And the documentation [3] on scripting in openmw-cs is non-existent.


I guess I just have to write a simple lua/python script, than load it by aliasing openmw to openmw script-run=... . Here are my questions -

System: Windows 10, normally I use MSYS2(mingw64) shell to manage dependencies.

1. The script in [1] doesn't have the omw prefix mentioned in [2], could anyone provide the correct lua script that works with script-run=...?
2. What exactly are the required dependencies? Must I have lua5.1? What about lua5.3? Can openmw (built by MSVC) use the lua library in the MSYS2 repo(which means it should be built by mingw)?
3. Can I do this without external lua scripting? It seems like I can create a simple mod for this, if so, can anyone provide some simple instructions?

[1]: https://www.reddit.com/r/tes3mp/comment ... _level_up/
[2]: https://wiki.openmw.org/index.php?title ... ion#Github
[3]: https://openmw.readthedocs.io/en/stable ... index.html

User avatar
AnyOldName3
Posts: 1498
Joined: 26 Nov 2015, 03:25

Re: How to script the difficulty?

Post by AnyOldName3 » 14 Jul 2019, 02:32

OpenMW only has MWScript - the experimental Lua and Python bindings were only a proof-of-concept and weren't very useful, so never got merged.

You can either implement what you want in MWScript (which may turn out to be difficult or impossible as it's generally considered to be an awful language with more gotchas than even JavaScript) or implement it in TES3MP Lua. When OpenMW eventually gets Lua support, it will be either very similar or identical to TES3MP Lua, so you can consider that a prototype for what we'll have in the future.
AnyOldName3, Master of Shadows

dlshcbmuipmam
Posts: 6
Joined: 06 Dec 2018, 15:43

Re: How to script the difficulty?

Post by dlshcbmuipmam » 14 Jul 2019, 09:02

AnyOldName3 wrote:
14 Jul 2019, 02:32
OpenMW only has MWScript - the experimental Lua and Python bindings were only a proof-of-concept and weren't very useful, so never got merged.

You can either implement what you want in MWScript (which may turn out to be difficult or impossible as it's generally considered to be an awful language with more gotchas than even JavaScript) or implement it in TES3MP Lua. When OpenMW eventually gets Lua support, it will be either very similar or identical to TES3MP Lua, so you can consider that a prototype for what we'll have in the future.
Thanks for the clarification. In that case, it is easier to add a setting and modify the apps/openmw/mwmechanics/difficultyscaling.cpp directly. I think it works quite well. Should I submit a PR on this or just keep it personal?

User avatar
lysol
Posts: 1307
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: How to script the difficulty?

Post by lysol » 17 Jul 2019, 13:04

I would guess it's better to keep it personal for now since it will probably just get replaced once Lua gets added. But correct me if I'm wrong anyone. Thanks for the thought anyway. I'm marking this as solved for now.
Normal mapped texture replacers, exclusive for OpenMW:
My Nexus page

Post Reply