Commit Graph

6 Commits

Author SHA1 Message Date
PatR
cd9f145dba fix leaving the tutorial levels
While running the tutorial, the Save command is disabled.  When the
tutorial was extended to two levels, stashing and restoring the
hero's equipment stopped working as intended if player entered the
second level.  The attempted fix for that broke re-enabling Save
even if the player left the tutorial without entering its second
level.

This seems to fix things, but I'm flailing around with barely a clue
here.  A couple of simpler attempts didn't work and I haven't figured
out why, so this is a bit more complex than what I wanted.

Reorganizing nhl_callback() isn't part of the fix, just avoids use
of some redundant code.
2023-06-23 15:19:36 -07:00
Pasi Kallinen
fc7a32b86e Tutorial level
Add a tutorial level to teach commands to new players.
Very much a WIP.

Breaks save and bones compat.
2023-03-01 14:00:29 +02:00
Pasi Kallinen
5d659cf1f6 Tips and option to disable them
Adds a more general way to handle gameplay tips, and adds
a boolean option "tips", which can be used to disable all
tips.  Adds a helpful longer message when the game goes
into the "farlook" mode.

Also adds a lua binding to easily show multi-line text
in a menu window.

Breaks save compat.
2023-02-19 15:56:18 +02:00
Pasi Kallinen
6abb12aee0 Lua: Persistent variables
Add a way for the lua scripts to set and retrieve variables
that are persistent - saved and restored with the game.

Invalidates saves.
2023-01-15 10:34:45 +02:00
nhmall
0602a3b89f update lua file headers 2022-05-10 11:26:52 -04:00
Pasi Kallinen
29868036f1 Lua: nhcore script with function callbacks
Adds possible callbacks for "start_new_game", "restore_old_game",
"moveloop_turn", and "game_exit" which when defined, will be called
from core code at the appropriate time.

Adds lua hooks for dump_fmtstr (only if DUMPLOG), dnum_name, u.moves,
u.uhave_amulet, and u.depth.
2021-05-21 21:24:59 +03:00