Commit Graph
2572 Commits
Author SHA1 Message Date
Goober5000 29edfeedea display category name 2022-07-24 15:08:49 -04:00
Goober5000 8cf20b0175 prevent too many dynamic SEXPs from breaking the SEXP system
SEXP categories will not support more than 256 SEXPs; this is why the CHANGE2 category had to be created when CHANGE got full.  Unfortunately, dynamic SEXPs will count toward this limit, so mysterious errors will occur for the ones whose category indexes roll over.  The problem is not easily fixable, but at least the engine can detect the situation, warn about it, and refrain from adding any problematic SEXPs.

Since too many *total* SEXPs would cause a similar problem, this adds a warning for that case too.
2022-07-24 15:06:13 -04:00
Asteroth a79dd70138 bug fix for not present ships in clear-goals 2022-07-14 16:19:37 -04:00
Joshua Glatt 8645210c0a Fix type checking and FRED help for containers in special argument lists (#4486) 2022-07-13 19:52:21 -07:00
Asteroth 622ae3ef2c Fix some bugs with maneuvers (#4483)
* split ai_control_info_check and player-not-use-ai wipes maneuvers

* remove redundant flag upkeep and clarify logic
2022-07-13 00:08:08 -04:00
Joshua Glatt 1768f5bb1b Handle syntax checking and caching for nodes with dynamic values (#4460) 2022-07-03 23:57:54 -07:00
Goober5000 eb69133a57 refine SEXP error reporting
Sync the "mission save" and "error reporting" versions of the SEXP variable string.  Also use `stuff_sexp_text_string` to print the "bad node" token rather than `Sexp_nodes[bad_node].text`, so that a human-readable token is displayed instead of a magic number like 26.

Related to #4226, as the generated error message is formatted differently enough to be confusing.
2022-06-30 02:50:08 -04:00
Goober5000 43f8b123a8 better handling of invalid message sources
Another bug discovered by Durandal.  The message sender was a variable containing an invalid value, and the game crashed.  This handles it more gracefully.

Tested and verified.
2022-06-25 15:56:52 -04:00
Goober5000 d7f0051394 fix clearing a skybox model when it isn't the mission default
The previous way to clear a skybox was to set it to "default", and if the mission had no skybox then it would be cleared.  The skybox code can correctly handle the lack of a skybox, but if you pass an empty string to the skybox preloader it fails with a file not found error.  This fixes the preloader, and also adds "none" as an explicit no-skybox parameter.
2022-06-20 02:33:25 -04:00
Joshua Glatt fa29b91e68 Disallow Replace Container Data with special argument list (#4392) 2022-06-14 21:03:11 -07:00
John Fernandez b3f0016d0e Remove a pointless assert 2022-06-11 15:02:09 -04:00
Joshua Glatt bd864baead Clean up list modifier code (#4363) 2022-06-10 17:31:25 -07:00
Goober5000 3ad92cce4e tweak strdup handling for argument vector (#4307)
* tweak strdup handling for argument vector
Follow-up to #4293
2022-06-05 18:58:11 -05:00
Joshua Glatt b893075efe Detect concurrent container modification (#4330)
* add node subtype for container names

* clean up and port changes to qtFRED

* fix parsing when container is the last argument

* fix serializing container name nodes

* fix parsing again

* disallow spaces in container names

* check for spaces and & chars while parsing container names

* early WIP for trying to get list containers of strings working as argument options

* indicate which SEXPs will be supported for now

* clean up

* add FRED/qtFRED support

* remove [in]validate-argument from supported SEXPs

* support map containers with string keys

* update FRED and qtFRED

* clean up

* update FRED help text

* revert some unneeded changes

* fix style

* remove added assertion

* backport useful changes from PR #4263 and then some

* clean up backport

* move condition_node evaluation outside of argument loop

* fix does_blank_of_op_support_container_args()

* fix assertion

* add OPF_DATA_OR_STR_CONTAINER and use restore old behavior of OPF_ANYTHING

* revert some unnecessary changes

* fix CI

* detect attempts to modify container while it is being used as special argument (WIP)

* evaluate conditional for each loop

* update placeholder text for new SEXP arg type

* finish/clean up
2022-06-05 08:47:51 -05:00
Goober5000 e3ad6664e0 Cached subsystem indexing (#4316)
* add subsystem indexer and ensure that ship_get_indexed_subsys and ship_get_first_subsys are independent

* also add reverse lookup from subsys to index

* update indexer to accommodate subsystem pointers being changed

* use clearer function names, and fix the type of subsys_list_indexer

* add assertions

* address latest feedbcak
2022-06-05 08:44:54 -05:00
JohnAFernandez abb8bbaf68 Merge pull request #4264 from notimaginative/multi_sexp_fixes
Multi sexp fixes
2022-06-05 00:55:03 -04:00
Tyler Blount e38c30bca6 Merge pull request #4346 from Kiloku/fix_line_endings
Fix line endings in the core codebase
2022-06-03 19:11:41 -07:00
Joshua Glatt 1f625f3a7f Support using containers with random-multiple-of SEXP (#4326) 2022-06-03 17:09:24 -07:00
EatThePath 91b516c1c4 Merge pull request #4208 from EatThePath/weapon_lights
Weapon lights
2022-06-03 13:01:15 -05:00
kiloku b7e99089d7 Fix line endings in the core codebase 2022-06-03 13:31:09 -03:00
Joshua Glatt 6bfe6071d0 Add apply-container-filter SEXP (#4333) 2022-06-02 07:12:38 -07:00
Joshua Glatt 151bfd2f26 Support using string-valued containers in some when-argument SEXPs (#4305) 2022-06-01 07:57:15 -07:00
Joshua Glatt c5be6095b2 Fix is_for_op() to follow existing conventions (#4322) 2022-05-29 10:42:33 -07:00
BMagnu f193c5233d Add LuaAI validity callbacks (#4304)
* Add callback for user specified availability status

* Add target restrict hook

* Fix Restrict hook and add not self restrict type

* Fix documentation

* Fix typo

* scope the ai achievability enum

* fix scoped achievabiliy
2022-05-28 21:18:28 +09:00
Joshua Glatt 84023002db Add for-container-data and for-map-container-keys SEXPs (#4296) 2022-05-26 21:39:14 -07:00
Joshua Glatt 3fb034ab7f Add container name subtype to Sexp_nodes (#4299) 2022-05-25 21:26:05 -07:00
Goober5000 53aec7e4e4 Merge pull request #4293 from Goober5000/for_operator_memory_fixes
fix some memory management problems in the for-* operators
2022-05-24 11:18:37 -04:00
BMagnu cfb5a04aa9 Activate LuaAI custom message parsing (#4303)
* Add parsing for specifying order accept messages

* Write out acknowledge in comment
2022-05-23 20:44:54 +00:00
Joshua Glatt c8ace18317 Add copy-container SEXP (#4291) 2022-05-23 08:55:27 -07:00
Goober5000 54413fa0fb fix some memory management problems in the for-* operators
1) In `for-counter`, when `just_count` is true there is a memory leak, since the code never enters `test_argument_vector_for_condition`, but for the same reason, duplicating the string is not necessary in that case, so just add a blank string
2) Remove unnecessary `vm_strdup` calls from the other for-* operators
3) `const`ify argument management
2022-05-22 22:55:12 -04:00
Taylor Richards 5e79021da3 use SCP_string for constructing multi/event log lines (#4284) 2022-05-18 13:56:37 -04:00
BMagnu 5c4be3d392 LuaAI (#4198)
* Basic LuaAI

* LuaAI Player Order Support

* Add Player Order Target Restricts

* Fix init order

* Add AI helper API

* Fix subcategory stuff

* Fix Compiler Warnings

* Remove AI Mode switch Int3's

* Fix Lua docs

* Compiler warnings 2

* Clang Tidy

* Incorporate Feedback

* Incorporate Feedback 2

* Incorporate Feedback 3

* Incorporate Feedback 4

* Clang Tidy
2022-05-16 18:36:34 +09:00
David Gibson 7dbb831efa Addressed some memory management problems in new weapon color code 2022-05-14 18:37:38 -05:00
Taylor Richards 4587c33e05 enable newer options of subtitle sexps for multi 2022-05-14 19:23:20 -04:00
Naomi Coffman 2ffa4ca982 Document how cancelling interacts with is-destroyed-delay and friends 2022-05-14 07:46:56 -04:00
Naomi Coffman f8fdda34a6 Fix shadowing 2022-05-13 22:19:01 -04:00
Naomi Coffman 798f1c8c2f Fix documentation typo 2022-05-13 21:50:01 -04:00
Naomi Coffman 1228a56e42 Add cancel-future-waves 2022-05-13 21:46:39 -04:00
Goober5000 3d646e591d Merge pull request #4258 from Baezon/fix-sun-position-compensation-math
Correct sun position compensation math
2022-05-12 20:02:05 -04:00
Goober5000 e534adf107 Merge pull request #4159 from Goober5000/test_replace
guard against off-by-one errors in replace_one and replace_all
2022-05-11 22:11:39 -04:00
Goober5000 e21575558e Merge pull request #4249 from Goober5000/fix_change_alt_name
fix assignment of alt-name when using the hash
2022-05-11 19:15:56 -04:00
Asteroth 2e37aceab9 correct sun math 2022-05-11 14:13:39 -04:00
Joshua Glatt e44456333e Fix clear-container SEXP (#4255) 2022-05-10 21:39:59 -07:00
Goober5000 71a861bd6f more feedback, a fix, and a new test case 2022-05-10 00:30:48 -04:00
Goober5000 55be80dd6a address feedback 2022-05-09 21:00:21 -04:00
Joshua Glatt 6f8e60eb17 SEXP containers, Part 8: Change SEXPs (#3862) 2022-05-08 20:15:59 -07:00
Goober5000 ba88b01f51 fix assignment of alt-name when using the hash
Alt-names with hashes that were added by the `change-alt-name` sexp used to have their hashes truncated properly.  This most likely broke when hash truncation was moved from the HUD code to the "display name" code.  This PR truncates hashes in the same way as truncation elsewhere.
2022-05-08 21:53:13 -04:00
Joshua Glatt a654b61d0c SEXP containers, Part 7: Status SEXPs (#3861) 2022-05-08 08:15:59 -07:00
David Gibson 6c473e7c09 pareshi for HDR colors 2022-05-07 17:21:28 -05:00
David Gibson e3927104bb Implemented optional parse into bool parsehi 2022-05-07 17:21:28 -05:00