697 Commits
Author SHA1 Message Date
claudeandClaude Opus 5.5 9e28969629 Add ledge mantling
Ashlar checks / tooling (push) Successful in 5s
New [Game] mantling setting, on by default, with mantle max height (1.1
times the actor's height above its feet) and mantle duration (0.4 s).
When the player jumps or falls into a wall while moving towards it
(within 60 degrees), the movement solver casts the player's collision
shape up, across the edge and down. If it finds a surface flat enough to
stand on, above the feet and within reach, with headroom and room on top,
the player moves up, across and onto it along that checked path. Movement
and jump input are ignored meanwhile, and the climb ends any fall without
fall damage. No animation is needed. A script move or teleport, noclip or
paralysis cancels a climb.

Lua: self.controls.mantle (true by default) vetoes climbs while false,
and the actor's scripts get an AshlarMantle event with the ledge height
when one starts. The engine logs "Ashlar mantle:" lines at verbose level.
Player only; with the setting off nothing changes.

The geometry rules (reach, headroom, room on top, slope, too high, too
low) and the climb path are in mwphysics/mantle.cpp, apart from the
physics calls, with unit tests. The new mantle scenario uses a CC0 box
mesh written for it: the player climbs an 80 unit ledge, doesn't climb it
with the Lua veto, and doesn't climb a 240 unit wall.

Closes #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 15:44:40 -05:00
claudeandClaude Opus 5.5 a691315db7 Add a stamina-driven sprint
Ashlar checks / tooling (push) Successful in 9s
New [Game] sprint setting, on by default, with sprint speed multiplier
(1.4 times run speed), sprint fatigue drain (10 per second on top of
running, halved at Athletics 100) and sprint fatigue threshold (0.1 of
maximum fatigue to start). A sprint ends when fatigue falls below 1% of
maximum; regeneration keeps fatigue just above 0 while running, so
exactly 0 is never reached.

Sprint is engine action 52, Lua input.ACTION.Sprint and the player's
'Sprint' Lua action, with self.controls.sprint. Defaults are Left Alt
and D-pad up, because L3 is already Sneak. Sprinting needs forward
movement within 45 degrees, and isn't possible while sneaking, in the
block stance, swimming, levitating, knocked down or paralyzed. Pressing
Use with a weapon or spell ready ends the sprint until Sprint is
released, so no attack starts while sprinting. A sprint counts as
running for animations, Athletics and the running fatigue cost. AI
doesn't sprint. With the setting off the control does nothing.

The rules are in mwmechanics/sprint.cpp with unit tests. The movement
scenario gains sprint, tiredsprint and sprintuse phases, run in a
circle from the start point so the player stays on land.

Closes #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 04:12:57 -05:00
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
claudeandClaude Opus 5.5 78f1f9516d Let the player block with a weapon, and raise the shield while blocking
Holding Block now works without a shield: with a drawn melee weapon the
player parries melee hits from the front. A parry lets [Game] 'weapon
block damage' (default 0.5) of the damage through, and the weapon takes
the rest as wear. It costs fatigue scaled by Block skill and trains
Block like a shield block. A shield still blocks the whole hit.

While in the stance with a shield, the left arm holds the shield raised
using the shield group's "block start" to "block hit" keys. Animations
without those keys are left alone.

Requested by Eric during a playtest of #19.

Refs #19
Refs #23

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:28:09 -05:00
claudeandClaude Opus 5.5 9be251af0a Add active blocking for the player
With [Game] 'real time combat' on, the player blocks by holding the new
Block action instead of relying on the classic block roll. Holding Block
with a shield equipped and the weapon drawn raises the block stance: no
new attacks start, movement slows to [Game] 'block stance speed'
(default 0.5), and every melee hit inside the fCombatBlockLeftAngle to
fCombatBlockRightAngle arc is blocked with no roll. Shield durability,
fatigue loss and Block skill training work as before, but the fatigue
cost now falls with Block skill, to half at 100. Without the stance the
player doesn't block. NPCs and creatures keep the classic roll (#20).

Block is engine action 51, exposed to Lua as input.ACTION.Block and as
the player's 'Block' Lua action, with self.controls.block. Defaults are
the middle mouse button and D-pad down, which nothing else uses. With
the setting off, behavior is unchanged.

The pure rules (arc, stance gate, fatigue scaling) live in the new
mwmechanics/activeblock.cpp with unit tests.

Closes #19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:01:43 -05:00
Alexei Kotov 62e338219b Merge branch 'moreweatherstuff' into 'master'
Add weathers to openmw.content

See merge request OpenMW/openmw!5723
2026-10-29 09:13:09 +03:00
Evil Eye bbf635675d Add weathers to openmw.content 2026-10-22 22:25:33 +02:00
blagish a2a95fb64c Move misplaced NPC record fields out of CreatureRecord docs 2026-10-22 17:08:12 +04:00
blagishandCole Green 421bfd59ff Don't roll consumed ingredient effects twice 2026-10-19 12:06:34 -05:00
blagish 0d4dc90577 Minor description changes 2026-10-19 12:31:58 +04:00
blagish 08e1e7fb74 Read MWScript variables without case sensitivity 2026-10-19 12:31:58 +04:00
blagish 23b3e0fef8 Add Lua API to run dialogue result scripts 2026-10-19 12:31:58 +04:00
blagish e7bbd3c189 Add Lua API to run local MWScripts 2026-10-19 12:31:58 +04:00
blagish c037e20e6f Add Lua API to pause and resume local MWScripts 2026-10-19 12:31:58 +04:00
blagish 11d8b36f00 Add Lua API to stop global MWScripts 2026-10-19 12:31:58 +04:00
blagish edcb24a512 Add Lua API to start global MWScripts 2026-10-19 12:31:58 +04:00
nox7 39c7def396 Document that ui.getElements now returns elements in rendered order when on an overlapping MyGUI layer 2026-10-05 10:14:03 -05:00
Alexei Kotov baba267c20 Merge branch 'cursor-rotation' into 'master'
Missing Lua cursor feature - rotation

See merge request OpenMW/openmw!5651
2026-10-03 22:48:07 +03:00
nox7 1719cf6e75 Document clockwise movement. Use radians instead of degrees. Swap float usage to double 2026-10-02 06:56:44 -05:00
nox7 d3df056187 Docs 2026-10-02 06:33:53 -05:00
nox7 998f7ecc80 Add missing cursor prop to widgets. Fix ui cursor docs and broken mlink 2026-10-01 15:53:03 -05:00
nox7 b6fe8e755c Dupe calling clarification 2026-09-21 19:05:37 -05:00
nox7 2d7abc8ca7 Update docs with new cursor size max and info on dupe calling 2026-09-21 19:05:37 -05:00
nox7 5ac61e001b Add getCursor(), but also properly revert back to the original engine cursor if the Lua cursor is set to nil 2026-09-21 19:03:59 -05:00
nox7 b3a0227e44 Add Lua custom cursor registration 2026-09-21 19:03:58 -05:00
nox7 78ef775562 Add setCursorPosition and getCursorPosition 2026-09-21 19:03:58 -05:00
nox7 31909fbde2 Disable player controls when the Lua API requests mouse release 2026-09-21 19:03:58 -05:00
nox7 75a7c2c10a Change names of cursor visibility methods 2026-09-21 19:03:58 -05:00
nox7 ce0b469e6a Update docs 2026-09-21 19:03:58 -05:00
nox7 9e7a55e196 First pass with basic Lua bindings for controlling cursor mode and visibility 2026-09-21 19:03:58 -05:00
nox7 f64ceb52ad Document new async methods for timers 2026-09-18 13:54:43 -05:00
Dave CorleyandCole Green abf127af53 CLEANUP: Rename to hasBeenLoaded and clarify documentation 2026-09-15 21:23:49 -05:00
Dave CorleyandCole Green 85723fb731 FEAT: Add bind to check if a cell has been loaded already
CLEANUP: Improve isLoaded docstring
2026-09-15 21:23:49 -05:00
Bret Curtis fb8f8b8c2c Add openmw.debug.takeScreenshot() and configurable test resolution
Lua had no way to fire a screenshot. Also stops integration_tests.py merging a
caller's --config settings.cfg into the generated one, which made a same-layer
duplicate that openmw rejects, and unhardcodes the 640x480 test window.
2026-09-12 18:20:20 +02:00
Alexei Kotov a9d999e422 Merge branch 'doc/addGlow' into 'master'
DOC: addGlow was missing

See merge request OpenMW/openmw!5577
2026-09-08 12:45:49 +03:00
Dave Corley dae4a3977d DOC: addGlow was missing 2026-09-04 12:16:21 -05:00
Dave Corley 0a520521cd CLEANUP: Save state mutation should be gated behind a function and not contextually mutable 2026-09-04 11:19:32 -05:00
Evil Eye 63ca6d9834 Add skills to openmw.content 2026-09-03 17:35:59 +02:00
Evil Eye 69d2a9d5a9 Add attributes to openmw.content 2026-09-03 17:35:57 +02:00
Evil Eye 6aaeb27367 Remove types.Book.SKILL enum 2026-09-03 17:34:17 +02:00
nox7andEvil Eye 97f3f11d9c Remove word 'normalized' 2026-09-03 17:26:54 +02:00
nox7andEvil Eye 81f90ec660 Use preciseX and preciseY from SDL to account for fractional scrolling on high-precision devices 2026-09-03 17:26:54 +02:00
nox7andEvil Eye 1ccc932e18 Switch to using SDL wheel event instead of MyGui 2026-09-03 17:26:53 +02:00
nox7andEvil Eye 557480e651 Document mouse wheel event on widget 2026-09-03 17:26:53 +02:00
ThomasandEvil Eye f2e262264a Expose the focus ray to Lua 2026-09-03 17:16:15 +02:00
Evil EyeandAlexei Kotov 656cc2a5b4 Document sys::default being a thing 2026-08-26 23:09:03 +03:00
Evil EyeandAlexei Kotov 6486e56c70 Address feedback 2026-08-26 23:09:03 +03:00
Evil EyeandAlexei Kotov c1bc5a3d16 Add world space filter 2026-08-26 23:09:03 +03:00
Evil EyeandAlexei Kotov 48ac39fdfd Add world.getObjectsByRecordId 2026-08-26 23:09:03 +03:00
Andrzej GłuszakandAlexei Kotov 06102ac6c1 Add apparatus to openmw.content 2026-08-26 17:29:27 +03:00