Commit Graph
2165 Commits
Author SHA1 Message Date
Fabian Woltermann ec494f0229 Change the model anim type enums to a enum class 2020-06-21 14:51:43 +02:00
Goober5000 803363f364 Merge pull request #2482 from Goober5000/fix_argument_detection
fix argument detection in sexps
2020-06-17 19:30:52 -04:00
Goober5000 3c17765ba0 fix argument detection in sexps
The previous method worked for FSO, but not FRED.  This method works for both.
2020-06-17 16:07:22 -04:00
wookieejedi f5c8126783 Fix new version of disarmed-delay
Boolean needs to be false not true since `disarmed-delay` is not checking disabled status.
2020-06-17 12:32:52 -04:00
Goober5000 b7e4f5c3c6 Merge pull request #2475 from Goober5000/time_docked_and_cargo
upgrade time-docked and various cargo sexps
2020-06-16 15:33:44 -04:00
Goober5000 899e0c9967 Merge pull request #2476 from Goober5000/weapons_depleted
some more sexp upgrades
2020-06-16 14:15:12 -04:00
Goober5000 3a5884e2c2 fix some sexps
Fix the waypoints-done-delay sexp to work for both ships and wings.

Also, fix the set-object-speed sexp (which is deprecated anyhow) to work for all ships in a wing, not just the wing leader.
2020-06-15 21:13:01 -04:00
Goober5000 e026558b21 some more sexp upgrades
* Merge primary and secondary weapons depleted
* Upgrade the nav/autopilot sexps
2020-06-15 01:32:13 -04:00
Goober5000 a034c3e8da upgrade time-docked and various cargo sexps 2020-06-15 00:33:49 -04:00
Goober5000 7f1d21e69a Merge pull request #2472 from Goober5000/time_sexps
merge and upgrade the time sexps
2020-06-14 23:43:55 -04:00
Goober5000 dc30a7834a Merge pull request #2470 from Goober5000/combine_goal_sexps
combine goal sexps
2020-06-14 23:25:46 -04:00
Goober5000 095a392d5d Merge pull request #2471 from Goober5000/combine_other_sexps
combine and upgrade more sexps
2020-06-14 22:24:31 -04:00
Goober5000 aedf541e37 combine hits-left and sim-hits-left 2020-06-14 14:35:15 -04:00
Goober5000 426498efa4 merge and upgrade the time sexps 2020-06-14 14:29:45 -04:00
Goober5000 63d40b7edc combine and upgrade more sexps
This combines the alt-name and callsign sexps, as well as the ship-class and ship-type sexps.
2020-06-14 14:21:31 -04:00
Goober5000 75d8116451 combine goal sexps 2020-06-14 14:12:36 -04:00
Goober5000 b59da60027 also combine gse_recharge 2020-06-14 14:07:37 -04:00
Goober5000 63ccb84299 combine is_ship_stealthy and is_friendly_stealth_invisible, and fix a spelling mistake 2020-06-14 14:02:05 -04:00
Goober5000 1861065495 add these tweaks to keep the major merges in optimum shape 2020-06-13 21:37:13 -04:00
Goober5000 3ecc0062ab small tweak 2020-06-13 15:16:59 -04:00
Goober5000 ff1e328c60 tweak sexp name 2020-06-13 15:07:32 -04:00
Goober5000 bfc8075226 upgrade the objective sexps 2
There's another chunk of objective sexps farther down in sexp.cpp, so this PR addresses those.
2020-06-13 15:06:21 -04:00
Goober5000 ec31c969a0 Merge pull request #2448 from Goober5000/upgrade_objective_sexps
upgrade the objective sexps
2020-06-13 14:59:15 -04:00
Goober5000 8b0e64fa39 Merge pull request #2464 from Goober5000/shut_up_wesley
fix a couple things with mainhall intercom sounds
2020-06-13 14:55:05 -04:00
Goober5000 6771462206 Merge pull request #2452 from Goober5000/upgrade_distance_sexps
fix the way SEXPs check ship distances
2020-06-13 14:50:29 -04:00
Goober5000 67ed3a4c7b fix a couple things with mainhall intercom sounds
As noticed in issue #2458, intercom sounds did not stop when pausing the game or loading a mission.  I fixed this by augmenting `main_hall_stop_ambient()` to also stop the intercom.

Additionally, it turns out that the intercom delays were not being calculated correctly due to a very bizarre random number formula.  I overloaded `rand32()` to add a min/max variant and used this instead.
2020-06-12 23:13:11 -04:00
Goober5000 1d54eb1755 do not cache argument nodes because the action nodes aren't flushed 2020-06-12 14:55:38 -04:00
Goober5000 49801a152e move from sexp.h to sexp.cpp, and friendlier-ize arg_item 2020-06-12 00:51:50 -04:00
Goober5000 d182b2d951 cache on the argument node
When special arguments are used, the current node cannot be cached because it always contains "<argument>".  So this feature adds the ability to forward the caching to the SEXP node that contains the value being referenced.  To enable this, the internal argument list now contains both the argument text and the node being referenced.  (If there is no node to reference, such as with `for-counter`, the reference will be -1.)
2020-06-12 00:26:31 -04:00
Goober5000 f962804b30 fix compact_multitext_string
This is a follow-up to PR #2373.  Tomimaki noticed that the first character was truncated in the cutscene description, and it turned out that the algorithm was slightly wrong.
2020-06-09 19:11:34 -04:00
Goober5000 dcbb528d04 change sexp names 2020-06-08 11:52:16 -04:00
Goober5000 156bc2c5d4 fix the way SEXPs check ship distances
Retail has a hud_find_target_distance function that returns the distance between the player position and a bounding box.  This is useful for the HUD because it shows the distance to the perimeter of an object like a jump node or a large ship.  However, this function was re-used for the `distance` SEXP, resulting in the awkward situation where the distance is measured from one ship's center to another ship's bounding box.  This can lead to unexpected results and it also means that the SEXP returns a different distance when the arguments are swapped.

This PR deprecates the original SEXP and introduces the new SEXPs `center-distance` and `bbox-distance` which use consistent methods for both ships.  It also renames the `distance-ship-subystem` SEXP to `center-distance-subsystem` and adds a new `bbox-distance-subsystem` SEXP.
2020-06-07 22:36:46 -04:00
m!m c3ac0a3461 Merge pull request #2421 from asarium/feature/luaExecutors
Add feature to execute Lua coroutines at specific points
2020-06-07 12:04:44 +02:00
Goober5000 f0fea13d04 address parameter shadowing noticed by clang 2020-06-07 01:00:29 -04:00
Goober5000 2eea3d3aa8 this is good to have as well 2020-06-07 00:43:18 -04:00
Goober5000 af187f7fbf add the change in function calls 2020-06-07 00:40:20 -04:00
Goober5000 09183fee12 upgrade the objective sexps
Another - hopefully bite-size - sexp upgrade stage.  This takes the objective SEXPs (those which are primarily concerned with the mission log) and upgrades them to use the ship registry.
2020-06-07 00:22:33 -04:00
asarium 614a636ed5 Fix clang-tidy issues
Not sure why travis saw these since I didn't change anything there but
fixing these is also good.
2020-06-06 23:24:08 +02:00
asarium 016c07dc3a Add feature to execute Lua coroutines at specific points
This adds a mechanism for running generic operations at specific points
of the frame execution. This can be used by any part of the code an not
just Lua since it simply executes std::functions. It also adds an
"execution context" concept that specifies in which situation an
operation should be executed.

This is then used by the Lua Coroutines code for resuming coroutines at
specific points instead of always when the awaited promise resolves.
2020-06-06 21:29:48 +02:00
Goober5000 716cd15281 address feedback 2020-06-06 13:55:00 -04:00
Goober5000 56f3ffae11 convert to p_objp to be consistent 2020-06-06 13:55:00 -04:00
Goober5000 6d53697725 upgrade get_player_from_ship_node
This PR upgrades the function, and the sexps that use it, to take advantage of the new sexp caching.  It also makes `script_eval_multi` more robust in the face of players who might be respawning.
2020-06-06 13:54:59 -04:00
Goober5000 1b11d0d6a9 Merge pull request #2437 from Goober5000/oswpt_and_ship_flag_refactor
another stage of the sexp refactor
2020-06-06 13:53:42 -04:00
asarium 04174e00f8 Ensure Lua functions are executed in correct state
This will ensure that Lua functions will always be executed in the
correct Lua state. Since we now have multiple threads (which are
different lua_State objects) it is possible that the current code could
execute a Lua function in the main state instead of the thread that is
currently executing. This can lead to weird behavior and probably also
to issues inside Lua.
2020-06-06 14:00:23 +02:00
Goober5000 13acf77f5a address feedback 2020-06-05 21:34:50 -04:00
Goober5000 f7b43e5fd0 convert to p_objp to be consistent 2020-06-04 13:06:06 -04:00
Goober5000 77d26970ff and another one 2020-06-04 01:58:35 -04:00
Goober5000 57d2cb2871 deal with clang 2020-06-04 01:28:21 -04:00
Goober5000 a5be6ed2ea another stage of the sexp refactor
This PR uses `eval_ship` and `eval_wing` to optimize `object_ship_wing_point_team` and `sexp_deal_with_ship_flags`.  The API changed a bit, but to ensure compatibility, there are fields and functions to support the old behavior.  These are temporary and will be removed when all changes have been merged via PRs.
2020-06-04 00:44:32 -04:00
Goober5000 f948687ce7 Merge pull request #2429 from Goober5000/beam_turret_sexp_consolidation
consolidate several sexps related to beams and turrets
2020-06-02 17:07:48 -04:00