Commit Graph
2296 Commits
Author SHA1 Message Date
Goober5000 88c1d8a02a consolidate model instance code 2020-12-18 01:32:43 -05:00
Goober5000 b90fc2b3ad numeric to boolean 2020-12-08 19:54:31 -05:00
Goober5000 3fdc5a3784 cur_turn_rate -> current_turn_rate 2020-12-08 12:33:29 -05:00
z64555 761f50989e Partially revert refactoring.
*  Can't simply use the previous fade_out color as the default, because of an edge-case with legacy usage.  The refactor would disallow setting the fadout to black.
2020-12-07 17:07:17 -06:00
z64555 464c867bb5 Save fade-out color, even if its black.
Refactor sexp_fade, and make the Fade_out color init to black on mission load, instead of init on game start.
2020-12-07 16:33:29 -06:00
Goober5000 5f87f1da47 Merge pull request #2948 from MageKing17/bugfix/turret-change-weapon-4th-bank-fix
Fix turret-change-weapon comparing sec_slot to max primary banks.
2020-12-02 00:24:54 -05:00
MageKing17 edcc3b7d59 Fix turret-change-weapon comparing sec_slot to max primary banks.
We should compare `sec_slot` to `MAX_SHIP_SECONDARY_BANKS`, not `MAX_SHIP_PRIMARY_BANKS`.
2020-12-01 18:36:02 -08:00
Goober5000 958237f95c don't flush the tree when evaluating the *-argument conditionals
This is a follow-up to PR #2942.  Given that the short-circuiting is now explicitly skipped for node trees containing the special argument, it should no longer be necessary to flush the conditional branch of the sexp tree.  (The .cache field is already skipped for special-arg nodes.)

The sexp tree is still explicitly flushed for `every-time` and `every-time-argument`.
2020-12-01 16:31:11 -05:00
Goober5000 bd3b0fc893 Merge pull request #2938 from MageKing17/feature/first-of-sexp
Add "first-of" SEXP that behaves like "any-of" with a cap.
2020-12-01 16:22:33 -05:00
Phantom Hoover 909f4e9642 Don't short circuit eval_sexp on nodes which contain the special argument. 2020-11-29 20:49:12 +00:00
Fabian Woltermann 743bd306fe Merge pull request #2934 from PhantomHoover/fix/allow-treason-broken
Remove erroneous call to CDR.
2020-11-28 09:28:29 +01:00
MageKing17 764b141175 Add "first-of" SEXP that behaves like "any-of" with a cap.
It takes a number as a maximum number of arguments that can be evaluated in a single call, but otherwise behaves very similarly to `any-of`; alternatively, if the number is 1, it's like an `in-sequence` that also skips arguments that don't satisfy the condition instead of just invalid ones.
2020-11-27 17:18:34 -08:00
Fabian Woltermann 7be6f8adf4 Remove extraneous call to CDR 2020-11-27 19:30:13 +01:00
Phantom Hoover 2f9e64ed17 Remove erroneous call to CDR. 2020-11-27 18:14:12 +00:00
Fabian Woltermann 0a4f9d5673 Evaluate the ship_entry correctly 2020-11-27 09:43:16 +01:00
Fabian Woltermann 6423cc6001 Do not short-circuit evaluation here 2020-11-26 22:38:14 +01:00
Fabian Woltermann 6f8763346c Expose the power output in the ship class to sexps and scripting 2020-11-26 16:36:19 +01:00
Baezon 4024ff197d separate rotational and lateral maneuvers 2020-11-23 00:30:19 -05:00
Baezon c90171d8a3 add no_override flag to maneuvers 2020-11-22 11:58:15 -05:00
JohnAFernandez caef2aecf0 Make sure that the oswpt object will have the correct status for an exited ship (#2913) 2020-11-21 09:57:19 -05:00
Asteroth 5dbda7efd0 Merge pull request #2858 from Baezon/multi-beam-prep
Add beam parameter validation
2020-11-08 22:43:58 -05:00
Asteroth 498f82b0c4 Merge pull request #2823 from Baezon/continuous-spawn
Allow for continuously spawning weapons
2020-11-05 13:36:22 -05:00
Baezon 9034e4e043 revert and only do beam validation 2020-11-04 13:31:09 -05:00
Goober5000 283bcaf607 fix typo and elaborate sexp help 2020-10-26 20:51:00 -04:00
Baezon 62a1dae3b4 multi warning and no shadowing 2020-10-25 21:05:08 -04:00
Goober5000 455e2f9d8c improve message string splitting for outlier cases
If a message string contained a word that was too long, on its own, for the available screen real estate, the function wouldn't split the string at all.  The new behavior is to split the string even if the split location is suboptimal, since it's better to have as much of the message visible as possible.

Quoting from the code:

```
// only update the line break if:
// a) we don't have a line break yet;
// b) we're still within the required real estate
// (basically we want the latest line break that doesn't go off the edge of the screen,
// but if the *first* line break is off the end of the screen, we want that)
```
2020-10-14 15:57:09 -04:00
Goober5000 23b3aadf9b Message size fix (#2784)
* Fix underline length calculation in message scrollback
* Use SCP_string for message source (which allows ships with long display names to work without crashing) and message text
* Upgrade assorted functions to work with SCP_string
2020-10-06 14:31:03 -04:00
Goober5000 bfbc1389ab add for-players sexp
Useful for multiplayer missions.  Lists all currently valid player ships in the mission.  Works in both singleplayer and multiplayer.
2020-09-26 22:38:20 -04:00
Goober5000 147be6815c polish some SEXPs
Update SEXP help regarding variable types, and also add them to the SEXP syntax checker.

Fixes #2758.
2020-09-22 22:06:14 -04:00
JohnAFernandez 3384699086 Merge pull request #2712 from Goober5000/red_alert_multi_sexp_support
add multi support for red-alert sexp
2020-09-21 11:34:34 -04:00
JohnAFernandez 27faf89baa Fix Change IFF Multi Sexp 2020-09-20 09:53:47 -04:00
JohnAFernandez e29c172f27 Call send_ship before destroying it to avoid a crash. 2020-09-11 08:34:56 -04:00
Goober5000 ceac6ddff2 add multi support for red-alert sexp
This makes the red-alert SEXP execute properly in multiplayer.

Note, this is just the SEXP.  Multi-knowledgeable people will need to evaluate `red_alert_start_mission` and `red_alert_maybe_move_to_next_mission` to make sure those functions will work properly in multiplayer.
2020-09-04 13:15:49 -04:00
Goober5000 c3febbe01b Merge pull request #2687 from Goober5000/various_colgroup_fixes
various collision group fixes
2020-08-29 18:11:55 -04:00
Goober5000 f756b2a353 Merge pull request #2686 from Baezon/axial-turnrate-differences
Add "$respect ship axial turnrate differences:" flag (and fix a bug with 2673)
2020-08-29 16:49:14 -04:00
Goober5000 6f774ccab1 various collision group fixes
Collision groups as previously coded were unusable due to Lua 5.1's lack of support for bitwise operators.  This fixes that deficiency in two ways:
1) Objects now have the functions `addToCollisionGroup` and `removeFromCollisionGroup`
2) An `evaluateNumericSEXP` function has been added for returning SEXP results as numbers (so that the bitwise SEXP operators can be used)
2020-08-29 13:49:36 -04:00
asarium 2303785717 Improve scripting hook variable system
The previous system was kind of hacky and made things a bit inflexible.
This improves that system quite a bit and also adds unit tests for the
hook variable functionality.
2020-08-29 10:27:41 +02:00
Goober5000 9816a80b66 Merge pull request #2681 from Goober5000/more_for_counter_sexps
add for-ship-team and for-ship-species sexps
2020-08-28 09:49:03 -04:00
Baezon 2501b178d7 squash flag arguments and handle formation flying better 2020-08-27 16:50:55 -04:00
Baezon 9abc253023 v1 2020-08-26 23:27:34 -04:00
Goober5000 a3c32d929f add for-ship-team and for-ship-species sexps
This builds on the previous for-ship-class and for-ship-type sexps.
2020-08-25 13:25:42 -04:00
Goober5000 d8012d4ff0 miscellaneous scripting and ship-destruction enhancements 2020-08-23 20:44:25 -04:00
Goober5000 b6998a3e21 make Intel stuff dynamic
1) Make Intel_info a vector instead of a fixed-size array
2) Make intel descriptions SCP_string so they can be any length
2020-08-18 14:53:01 -04:00
Goober5000 1f4ff04890 handle SEXP_NAN_FOREVER 2020-08-14 16:25:11 -04:00
Goober5000 e4cd5675d0 handle SEXP_KNOWN_* 2020-08-14 15:53:02 -04:00
Goober5000 b6b7487db1 add LuaSEXP support for soundentry (OPF_GAME_SND) 2020-08-14 01:18:34 -04:00
Goober5000 de8164aa9c add for-ship-class and for-ship-type sexps
These sexps work just like for-counter, supplying arguments for when-argument.  They will list all ships that are present in the mission and are of a certain class or type.
2020-08-13 14:15:25 -04:00
Goober5000 83d9d352ff Merge pull request #2604 from Baezon/consistent-apply-whack-args
Supply world coordinates in whack function calls
2020-08-09 15:32:41 -04:00
Goober5000 0ed13a69e7 add the ability to use multiple sexp parameter variants
This is specifically for OPF_SHIP.  Currently if you specify a LuaSEXP with OPF_SHIP, it only works for ships that are present in the mission when the SEXP is called.  This is my attempt at a LuaSEXP parameter variant that will return a valid ship name regardless of the ship status.  It required a bit of finagling the existing API.
2020-08-03 21:26:39 -04:00
Goober5000 0177ebd66f add new versions of the collision group sexps
In most cases you have one group to/from which you are adding or removing several ships, but the existing sexps are designed for one ship and many groups.  This adds new sexps designed for one group and many ships.
2020-08-01 00:15:52 -04:00