* Correct `get_object_data` indexes
Currently they are raw offset pointers. This does not work with CE since pointers are wide (64bit) on some (most) platforms. So, we can treat these offsets like constants and return the appropriate fields instead.
There are already used for the most part as enum constants:
* Implement `set_unique_id`
* save/load watermark, including compat with previous saves (would be `0`)
* metarule to set and reset unique_id
* inventory stacking rules
* Sfall-like sound system
(I would like a better name for this system, but the opcodes themselves are called `play|stop_sfall_sound` and I can't think of a better name)
This is a sound management system very similar to Sfall's. With a few differences:
* No support for new sound formats yet. Support for at least ogg+wav will come next
* Does support reading from .dat files, hence playing any sound effect in the base game
* Support mode=3 for speech volume. This exists in Sfall but is ignored when called from the opcode.
Also, change GaplessMusic to use this system to play the "wind2" loading sound. This restores the "vanilla" feel map transitions, so I think it's reasonable to make GaplessMusic=1 the default. I can't imagine someone wanting to change it to 0 unless they are ultra purists
* Sfall saved arrays support
* Add "...all_arrays..." special case for a list of saved arrays
* Adjust error message on load fail
* Fix crash in GetArrayKey when index == size
* chore: auto-format with clang-format
* Update sfall compatibility md
* Add keyIndex for Assoc Arrays for O(1) key lookups
* Review feedback, more error logging
* Fix build, increase ARRAY_MAX_STRING to 1024 to match sfall, fix gl_test_arrays triggering dynamic string block merge failure, prevent potential string buffer corruption on very long strings
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Implement HOOK_RESTTIMER
Et tu + other mods use this
* PR comments + missing doc for ce-dat-tool
* chore: auto-format with clang-format
* document timer wrap
* cleanups
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* `set/remove_script` and `HOOK_STDPROCEDURE{_END}`
These were implemented together as I thought HOOK_STDPROCEDURE would be useful for testing set_script.
* Implement HOOK_CALCAPCOST
An opcode a day keeps the stimpak away.
https://sfall-team.github.io/sfall/hook-types/#calcapcost
Same as Sfall, but also calls the hook on game load to display the correct AP cost on load.
Also fix a minor bug where the attack mode of the current hand sometimes leaked when loading a save game. Normally attack mode (burst/reload/&c) isn't saved. But if you are in aimed mode (say), and load a game with the same weapon equipped, the attack mode will persist. This is pretty weird, so changed it to always be in the default mode when loading a save.
* test script
* PR comments
* doc tweaks