Files
ashlar/files/lua_api
claudeandClaude Opus 5.5 4e152c7c4e Add active blocking for NPCs and creatures
With real time combat and the new [Game] 'ai active blocking' setting
(on by default), NPCs and creatures block through the same stance and
arc rules as the player instead of the classic roll.

In combat, an actor with a shield ready and its weapon drawn raises the
stance when an enemy in front of it winds up a melee attack within
reach. Whether it reacts is rolled once per wind-up (10% at 0 Block
skill and agility, up to 90%, scaled by fatigue), and its reaction
delay falls from 0.6 s to 0.15 s with skill. It keeps the block up for
half a second after the wind-up ends so it catches the swing, drops it
after two seconds at most so a held wind-up can't pin it, and starts
no attacks while blocking.

The decision lives in mwmechanics/aiblock.cpp. Combat AI sets a
separate, unsaved CreatureStats flag that is cleared every frame before
AI runs, so a block never outlives the combat package and a Lua block
request is left alone. Actors without a shield never block, and a
creature blocks only if it can carry a shield.

Closes #20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 04:31:38 -05:00
..
2026-03-01 20:58:14 +01:00
2022-09-16 00:53:24 +01:00
2022-09-16 00:53:24 +01:00
…
…
2022-09-16 00:53:24 +01:00
2022-09-16 00:53:24 +01:00
2023-08-28 02:37:52 +08:00

Files in this directory describe OpenMW API for Lua Development Tools (LDT).

*.doclua files are taken (with some modifications) from LDT distribution and are distributed under MIT license. Openmw-specific docs (openmw/*.lua) are under GPLv3 license.

To get a Lua IDE with integrated OpenMW documentation and code autocompletion do the following:

  1. Install and run LDT.
  2. Press File / New / Lua Project in menu.
  3. Specify project name (for example the title of your omwaddon)
  4. Set Targeted Execution Environment to No Execution Environment, and Target Grammar to lua-5.1.
  5. Press Next, choose the Libraries tab, and click Add External Source Folder. Then specify there the path to this directory.
  6. Press Finish.