Commit Graph
1443 Commits
Author SHA1 Message Date
Goober5000 2aed10ee7f Merge pull request #2839 from Goober5000/fix_lock_indicator
redo the locking animations for multilock
2020-10-28 21:17:08 -04:00
wookieejedi fea8086647 Merge pull request #2838 from Baezon/reset-burst-flag
Add "resets" burst flag
2020-10-28 15:54:05 -04:00
Goober5000 9eaa7bf024 redo the locking animations for multilock
The multilock patch did not handle `Lock_anim` in the best way, and handled `Lock_gauge` in a very bizarre way, despite the fact that they are two simple hud animations.  This changes the `lock_info` struct to track the correct `time_elapsed` value for both, and changes the locking code to use the values in the correct way.

Additionally, this properly loops the lock triangles on the FS1 lock indicator.  Strangely, even prior to the multilock merge it appears that the triangles wouldn't have animated more than a quarter turn.

Finally, this prevents the FS1 lock indicator from blinking, since in retail FS1 it didn't blink.

Tested with FSPort and no-mods.  Fixes #2826.
2020-10-27 02:55:36 -04:00
Baezon 3db3dade77 implement "resets" burst flag 2020-10-27 01:39:35 -04:00
Goober5000 a8e1f02984 Merge pull request #2833 from Baezon/remote-detonate-fix
Fix `remote_detonaters_active` decrementing
2020-10-26 10:34:24 -04:00
Baezon c93c8e0bd7 fix remote_detonaters_active decrementing 2020-10-25 16:14:43 -04:00
Fabian Woltermann 0e5fbb1396 Fix a number of crash issues 2020-10-25 00:08:52 +02:00
Fabian Woltermann 23ea4eca43 Merge pull request #2517 from The-E/feature/lab_v2
Rewrite the lab
2020-10-23 18:01:47 +02:00
Baezon ef65914129 v1 2020-10-19 13:40:25 -04:00
Fabian Woltermann 13cd2d3326 Make the AO flag work 2020-10-17 16:07:33 +02:00
Tyler Blount 2f07c0785e Add comment for clarification 2020-10-16 17:34:05 -06:00
Tyler Blount 8090f60940 Don't clear locks for swarm/corkscrew missiles until the last missile needs to be fired 2020-10-16 16:15:48 -06:00
Goober5000 785cabfc4c fix a very special case with ship field initialization
If you create a kamikaze ship with ship-create, it won't work properly, because the explosion values are not initialized to -1 as expected.  This fixes that.
2020-10-15 22:13:06 -04:00
Goober5000 465af93dcd fix display names for wings (#2787)
Fix wing name generation, when using hash symbols, to use the new display name method.
2020-10-08 22:48:30 -04:00
JohnAFernandez 186fe51344 Object update packet upgrade (#2752)
* Object Update Refactor

    1. Keeps the object update packet aligned, even if the ship is dying or has not yet arrived on the client.
    2. Properly handles model point shields (yes, that's what was causing multi to crash the most!)
    3. Reworks positional interpolation timing and adds rotational interpolation, by sending timing information with every object update packet in a header shared between objects.
    4. Saves a lot of bandwidth by only sending data that is changing. (no more sending all subsystems once per second!)
    5. Better handles out of order packets (but can still use their information if recent enough!)
    6. Builds the basis for Rollback by beginning to record the positions and orientations and velocities of ships for the last 30 frames.
    7. Adds subsystem rotation -- Yeah, you saw that right, subsystems will now spin in multi.
    8. Waypoint movement is now enabled via sexp, and time to arrival of waypoints is updated on the target info gauge.

* Fix edge case crash and Incorporate feedback

* Clean Up Interpolate Angles Quick

* Restrain the client

* How was this still here???

* Make sure every part of OO uses OOC_INDEX_NULLPTR_SUBSYSTEM define

* Fix Way to Store Return Values

* Ok travis, we get it

* Ok travis.........
2020-10-08 15:29:06 -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 18c93f2b5a add No_impact_spew weapon flag
If you want to make a weapon that doesn't generate smoke particles on impact.
2020-10-02 22:12:59 -04:00
Goober5000 15061d5daf fix flags in ships.tbl and weapons.tbl
When flags are parsed, they can be reset.  This is a problem for flags that are set based on lines elsewhere in the entry, so each table uses its own method to get around it.  However, not all flags used this method - particularly the new Has_display_name flag.  This brings the flag management up to date.
2020-10-02 00:53:33 -04:00
Baezon 3cf9bc250a v1 2020-09-25 13:58:07 -04:00
Baezon 232035e45d handle shockwaves and renaming 2020-09-24 01:00:21 -04:00
Baezon 58ce531ec6 v1
V2
2020-09-24 01:00:21 -04:00
JohnAFernandez 4cdab81ebb Merge pull request #2761 from Baezon/improve-homeworld-warp
Improve Homeworld warp effect
2020-09-23 21:33:19 -04:00
Baezon d9913d5b9e v1 2020-09-22 23:26:14 -04:00
Goober5000 46691badb8 CI stuff 2020-09-21 22:05:00 -04:00
Goober5000 5a3c8d262c optimze memory usage by weapon loadout
The weapon loadout arrays wasted a ton of memory in several ways.  First, only friendly fighters and bombers have weapon loadouts; most ship classes do not need this storage.  Second, as DahBlount noticed, only 8 bits are needed for the flags, while the fields were using standard 32-bit ints.  Third, there are currently 500 weapon types but most loadouts only provide a dozen or so options.

This refactors the loadout storage to keep a short vector of weapon-flag pairs for each bank, and the bank storage is allocated only when needed.  The new `allowed_weapon_bank` class provides `operator[]` implementations so that the new API is almost completely compatible with the old one.  The only things that require the new API are assignments, since `operator[]` is read-only.  (A writable `operator[]` would not be able to tell when a flag value of 0 should be stored or not.)
2020-09-21 16:54:34 -04:00
Tyler Blount fe5eff2cee Fix #2724 2020-09-20 19:05:42 -06:00
Baezon c143f9f6ec copy paste error 2020-09-19 22:10:01 -04:00
wookieejedi 167e1430ee Clarify doc and add countermeasure object to hook 2020-09-16 15:35:11 -04:00
wookieejedi e544e1d081 Update ship.cpp
This PR adds a scripting hook which triggers when a ship fires a countermeasure. It has two variables, the ship firing the countermeasure and the number of countermeasures remaining. I have tested and it works as expected. This new hook complements the preexistsing `On Secondary Fire` and `On Primary Fire` hooks.
2020-09-16 12:58:34 -04:00
Goober5000 f4924971f7 patch ship type lookup 2020-09-13 02:10:41 -04:00
Goober5000 c5c65a7031 Merge pull request #2720 from Goober5000/wing_formation_tweak
make wing formation parsing a little more robust
2020-09-08 20:21:59 -04:00
Goober5000 4bf6aaeddc make wing formation parsing a little more robust 2020-09-08 17:31:00 -04:00
Goober5000 f6ca9cddfa support zero-length display names
Previously the code assumed that an empty display name was the same as no display name.  This adds a flag so that empty names are allowed.
2020-09-07 14:38:16 -04:00
Goober5000 0e1dfa7ab0 Merge pull request #2692 from Baezon/species-wing-positions
Allow for arbitrary wingmate relative positions
2020-09-01 14:38:23 -04:00
Goober5000 782898fba9 mmf 2020-08-31 16:59:58 -04:00
Goober5000 bf949f1ff0 move formations from species_defs.tbl to ships.tbl 2020-08-31 15:44:02 -04:00
Goober5000 3d734948da Merge branch 'master' into display_name 2020-08-29 13:47:21 -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 1913d8cde2 add more debris sounds
Sounds for debris collision and explosion.
2020-08-28 12:50:40 -04:00
Goober5000 82292e4e2b Merge pull request #2679 from Goober5000/misc_enhancements
miscellaneous scripting and ship-destruction enhancements
2020-08-27 13:54:26 -04:00
Goober5000 d8012d4ff0 miscellaneous scripting and ship-destruction enhancements 2020-08-23 20:44:25 -04:00
Tyler Blount 85a0e92a4f Set target info correctly if the weapon is a HEAT seeker 2020-08-22 22:22:58 -06:00
Goober5000 3b2af702f7 refactor display_name for ships, ship classes, and weapon classes
Several things going on here:
1) refactor `get_display_string()` to `get_display_name()` to be more precise
2) likewise, refactor `alt_name` to `display_name`
3) automatically generate display names when parsing the ship, ship class, and weapon class for the first time
4) remove the on-the-fly truncation of names with hash symbols

Basically this subsumes the `end_string_at_first_hash_symbol` logic into the display name.  Rather than truncate the name every time it's displayed, truncate it once when it's parsed.  This takes advantage of the previous display name infrastructure, since display names are a superset of the case of truncating the hash symbol.

This also has the benefit of now allowing hash symbols within display names.  When updating Destiny of Peace, I noticed that "Lockheed Shuttle #4" would no longer display properly; and it was not previously possible to fix this even with display names.

I could pull out the `get_display_string()` and `alt_name` renaming into a separate PR if desired.
2020-08-21 00:15:38 -04:00
Tyler Blount 1edba8d795 Handle empty banks correctly 2020-08-19 11:11:13 -06:00
Goober5000 2dec0af410 add code to tell if debris is one of those tiny models
make Debris dynamic, and use a soft limit at 64 pieces (the old MAX)
add per-class specification of death roll sounds
2020-08-12 23:51:39 -04:00
Goober5000 74a8e4b6aa Merge pull request #2639 from Goober5000/secondary_bank_fix
fix crash from multilock merge
2020-08-11 12:55:55 -04:00
Goober5000 514ca1bda9 Merge pull request #2642 from Goober5000/debris_ambient
Several small sound-related enhancements
2020-08-10 09:50:14 -04:00
Goober5000 00e1a5fcba add collision sounds 2020-08-09 16:58:38 -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 a1a0bd3e0e fix crash from multilock merge
After the multilock PR #2207, ships without secondary weapons will crash the game.  This can easily be seen in the very first training mission of the FS2 main campaign, and it is due to an invalid bank access in `ship_stop_secondary_fire`.  The `current_secondary_bank` is 0, but there are 0 secondary banks.  The Assert catches this, but that's not enough.

This change fixes the crash, as it initializes the current banks to -1 instead of 0.  However I'm not familiar with the new multilock way of doing things so I can't say if that is correct in all cases.
2020-08-08 13:50:31 -04:00