DiD-inspired Lua code for skipping moves and delays on dialog skip

Discussion of Lua and LuaWML support, development, and ideas.

Moderator: Forum Moderators

Post Reply
User avatar
Jarom
Posts: 110
Joined: January 4th, 2015, 8:23 pm
Location: Green Isle, Irdya or Poland, Earth - I'm not quite sure

DiD-inspired Lua code for skipping moves and delays on dialog skip

Post by Jarom »

When working on animation-filled cutscene-style scenario with Hejnewar, we decided to use DiD code that skips animations etc when dialogs are skipped. However, the code not only didn't work well with current development version, but also didn't cover our needs, as we used [move_unit] tag a lot and sometimes end turn mid-dialogue. Therefore we rewrote this code for our case, and decided to share it here for future use and possibly improvement discussion.

Hejnewar suggests it could be integrated with core, which I support - I think it could be doable by adding a key like skip_with_messages=yes to some tags - opinions on this matter are encouraged. List of tags that could benefit from such key might be pretty long.
skip.lua
(4.74 KiB) Downloaded 74 times
Attached version is ready to use after including in _main.cfg and covers:
- [sound],[delay] tags - fixed DiD version
- [move_unit] - basically copied from core with minor changes, probably could be improved for this case
- custom [save_skip_messages], [carry_skip_messages] - carry wesnoth.interface.is_skipping_messages state between events, e.g. in case of [end_turn] mid-dialogue, if no other uses are found, then [save_skip_messages] functionality could be moved to [end_turn] tag
Post Reply