Commit graph

1469 commits

Author SHA1 Message Date
Sally Coolatta
1bbe90f659 Fix TextmapUnfixFlatOffsets
It had the right idea, it just literally did it wrong :P
2023-08-27 14:04:28 -04:00
Sally Coolatta
3c14931764 Merge master 2023-08-25 18:39:01 -04:00
Sally Coolatta
3c8eb505cc Merge branch 'master' into thing-script-args 2023-08-25 18:32:55 -04:00
Sally Coolatta
3009f1c106 Small dialogue polish
- Slide in from top
- Fix chaining multiple dialogues with the same speaker not working
- Unset when changing level
- Sped up punctuation pause a bit
2023-08-25 06:50:12 -04:00
Sally Coolatta
ffda097421 Fix no control toggle 2023-08-25 05:05:51 -04:00
Sally Coolatta
16e6aa423e Dialogue 2 2023-08-24 17:28:53 -04:00
toaster
a3640110ae Only permit Spray Cans to be grabbed on base game levels
I would not be so heavy handed against preventing players from grabbing Spray Cans on custom levels, but designing a system that permits unloaded headers to retain their cans is frankly overkill. There are plenty of other ways the same kind of level-scouring play can be experienced on custom levels.
2023-08-23 17:16:07 +01:00
toaster
e1b7cb66cb Rework the Spray Can system to ACTUALLY be what we want
Instead of being specific to each level, Spray Cans are stored in a list on gamedata that will be stepped along each Spray Can you collect.
They are only assigned to a level on collection - which prevents you from farming the same easy location for every colour in the game.

In addition, this new system is one step short of dehardcoding them entirely. Now only Spray Cans specifically asked for by the existence of UC_SPRAYCAN will be put in the list, and if a secondary parameter is either "Yes" or "True", it will be put at the head of the list. This could technically support custom skincolours one day, but the author of this commit doesn't care to do the last bit of work necessary to make it happen.

There's a slight extra overhead in that skincolor_t now also holds a `cache_spraycan` (renamed from `cachedcan`, which maps had previously)

Currently, there's no safeguard against grabbing it on a custom course - you'll lose the Spray Can as soon as you load a fresh game again - but  I consider that easy to fix (tomorrow) and necessary before merger, because the author of this commit does NOT want complaints on release because we forgot to protect users who keep on losing their skincolors.
2023-08-23 00:46:46 +01:00
toaster
3ccf668fda Rename numspraycans to nummapspraycans
- Consistency with nummaprings
- Prevents confusion with incoming gamedata struct variable
2023-08-22 23:12:02 +01:00
toaster
f7635c4399 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into spraycans 2023-08-22 19:57:28 +01:00
Sally Coolatta
f02e6dbe3c Final thing args code cleanup
- Fix the last few bugs I could find with thing args
- Move version update code
- Rename internal variables to `thing_[string]args` to make older code merge issues more obvious
2023-08-22 02:14:09 -04:00
Oni
852e2c1035 Merge branch 'acs-game-over' into 'master'
ACS script type for game over (lose GP round with no extra lives), improve MapWarp and add a handful of functions

Closes #591 and #572

See merge request KartKrew/Kart!1403
2023-08-21 16:50:18 +00:00
James R
5f9f573f20 Remove all code related to linedef 413, Change music 2023-08-21 00:44:27 -07:00
Sally Coolatta
e4c8af058b Fix badly placed version check
Made old maps get malformed during reading
2023-08-21 03:42:03 -04:00
Sally Coolatta
65269736be Unset mapthing spritex/yscale when converting old maps 2023-08-21 03:33:05 -04:00
Sally Coolatta
0cbd7d43db Allow writetextmap outside of binary maps
This allows for using -writetextmap as a conversion method for old version maps, while the editor does not have it.
2023-08-21 03:33:05 -04:00
Sal
eb72019426 Make UDMF scale compatible with ZDoom's spec 2023-08-21 03:33:05 -04:00
Sally Coolatta
55b8609251 Add UDMF version system
This is needed to convert maps, since I needed to change thing arguments' variable names...
2023-08-21 03:33:05 -04:00
Sally Coolatta
9d940ed654 Separate script args from mapthing args
SRB2 uses a LOT of mapthing args compared to Hexen (which has none) and ZDoom (which only has them on objects that will never ever activate scripts). So we really badly needed to separate the two if we want attaching scripts to things to be useful.
2023-08-21 03:33:04 -04:00
James R
2b02daca14 P_LoadLevel: don't randomize Podium music 2023-08-20 17:40:43 -07:00
James R
8a72f42818 Split G_ExitLevel into G_BeginLevelExit and G_FinishExitLevel
- Save retry condition in G_BeginLevelExit
- Apply condition in G_FinishExitLevel

Preparation for ACS level end scripts, since the exit
condition will need be known when the countdown starts,
not when it ends (that'd be too late to do anything in the
level).
2023-08-20 00:36:00 -07:00
toaster
dc695e7acf First pass at implementing Spray Can pickups
- Replaces a few D00DKart objects because the doomednum specifically replaced one of these
- Reports on load if the map has too many, or if one's assigned but the object doesn't exist
2023-08-19 22:21:20 +01:00
toaster
1d06637a38 First pass at assigning unique spraycans to level headers
Increments gamedata minor version, be aware
- M_AssignSpraycans
    - Called in M_FinaliseGameData.
    - Attaches a hardcoded set of colours to all race maps in cup order, stopping once we run out.
    - The colours are shuffled, with some "freebies" always at the head of the list.
    - Integrates partial lists pretty well.
    - In DEVELOP builds, I_Errors if it produces corrupted state.
- G_LoadGameData, G_SaveGameData
    - Save & Load is implemented for these assignments
2023-08-19 15:08:55 +01:00
James R
414d6f3647 Don't reset camera position when spectating
Fixes a software renderer crash due to hitlag VFX from the
player's death (death from spectating) being too close to
the camera.
2023-08-19 05:01:41 -07:00
Lach
53b48d057c Rename Lost Colony symbols to Ark Arrows and add 10 new symbol types 2023-08-15 22:47:04 +10:00
Oni
aeb6d6740f Merge branch 'encore-directional-lighting' into 'master'
Add encore variants of LightContrast, LightAngle and SpriteBacklight to level header

Closes #593

See merge request KartKrew/Kart!1388
2023-08-13 06:21:12 +00:00
James R
ebba7c327c Add encore variants of LightContrast, LightAngle and SpriteBacklight to level header 2023-08-11 20:30:30 -07:00
James R
e0562a44e5 Add MSF_DIRECTIONLIGHTING, forces directional lighting on, even indoors
UDMF flag: forcedirectionallighting
2023-08-11 01:42:48 -07:00
James R
70294e62bd Automatically disable directional lighting if the sector has no sky 2023-08-11 01:41:49 -07:00
toaster
8d7c9dd6ce Menu titles for level headers
For the tutorials. Replaces the no longer visible subtitle, since it's roughly analagous in purpose.
2023-08-10 00:28:17 +01:00
James R
e89ecc7a2d Merge branch 'music-technology' into 'master'
Replace music handling

See merge request KartKrew/Kart!1369
2023-08-08 22:19:36 +00:00
AJ Martinez
1cdb498862 DEVELOP cvar to turn off encore palettes (readability testing) 2023-08-07 19:06:21 -07:00
James R
39f46a0f20 Replace music handling
(This commit does not compile. Sound test and tunes
command code needs to be ported after this.)

This is a big one. Here's the rundown:

The old music system was very direct, much of the time
just a proxy to the real sound API in i_sound.h.

You could change the music on command, but there wasn't
a consistent way to prevent some music from playing over
others. P_RestoreMusic is one example of needing to
address this problem. The jingles system was intended as
another solution. Furthermore, sound test (Stereo) has its
own needs.

I am removing all of that. Music handling in general is
now a very deliberate system, kind of similar to jingles.

In the new system, "tunes" are registered. The tune stores
info such as whether it should loop or fade out. Most of
the configuration is intended to be initialized only ONCE.
Tunes can be mapped to an actual music lump. They can be
remapped at any time too.

Tunes are also configured with a priority number. This
determines which tune is heard, if multiple are supposed
to be playing at a time. You can even tell a tune how long
it should play, so it's unnecessary to track this with
bespoke timers.
2023-08-06 17:31:45 -07:00
James R
46406931c1 Toggle all manner of directional lighting with MSF_FLATLIGHTING 2023-07-27 17:49:45 -07:00
James R
49e7357704 Add MSF_FLATLIGHTING 2023-07-27 17:49:26 -07:00
toaster
b4197a2263 Double-free emergency fix for virtual resources
- vres_GetMap guarantees the same memory for the same lump id, provided it's active
- vres_Free won't delete curmapvirt unless you do some silly temp pointer stuff
2023-07-24 23:40:30 +01:00
Oni
87aab3c881 Merge branch 'music-joining' into 'master'
Fix music on midgame server join

Closes #473

See merge request KartKrew/Kart!1351
2023-07-23 17:51:47 +00:00
Oni
b82392dee6 Merge branch 'more-conversions' into 'master'
More UDMF conversions

See merge request KartKrew/Kart!1336
2023-07-23 17:24:17 +00:00
toaster
7c952e3509 Tidy P_LoadLevel music starting a little 2023-07-22 18:32:50 +01:00
toaster
e0b47b16e7 Improve Spectator entry handling
- Re-entry SHOULDN'T get stuck nonzero on first join for a given node
    - Set to 0 for all players on level start
    - Set to 0 for all players on level end
    - DEFINITELY never intentionally set on join with teamchange finalisation
    - This basically just prevents people from spamming New Challenger after hopping out mid-session, since the previous version, in addition to being buggy, was a little annoying.
- New Challenger no longer happens on tic 0 of mapload
    - Handles any late, pending PF_PF_WANTSTOJOINs without threat of reset in P_PostLoadLevel
2023-07-22 14:03:11 +01:00
toaster
4885611f47 Move ACS script loading back to P_DoLoadLevel, since on second thought it's just LOADING and not executing anything 2023-07-22 13:17:17 +01:00
toaster
5b4fc18264 P_PostLoadLevel: Move all events directly requiring finalised player lists into this function
- Grand Prix (& backup) and Match Race bot initialisation
    - Fixes rival selection
- P_InitPlayers
    - Has to be after bot init
- Beginning of demo recording
    - Grand Prix and Match Race replays appear to both function far better, and equivalently to boot.
        - A desync in "RNG seed 24" is reported. This is PR_BOTS. This is the only notable desync I can see!
- ACS_LoadLevelScripts
    - I'm not ironclad sold on this being the forever home, but it's also a not-from-netsave thing, and barring external input I could see some scripts being dependent on a finalised player list.
2023-07-22 13:17:16 +01:00
toaster
034fa4b0a9 Water Palace Turbine UDMF conversion
Requires changes in the script to support which I am not awake enough to finalise or make compatible with other branches. This took far longer than appropriate.
2023-07-15 22:50:53 +01:00
toaster
25f48fd26f Add ML_BLOCKMONSTERS to P_WriteTextmap 2023-07-15 20:08:53 +01:00
toaster
459e3684ab P_GetNodeType: Do not dereference invalid pointer for **nodedata parameter 2023-07-15 19:18:39 +01:00
toaster
ed8007471f Remove binary-relevant text field from side_t (and line_t)
Instead of storing this during binary-UDMF conversion and then copying it for certain argument fields, put it directly onto stringarg[0] (or [1] if it's the backside), then make relevant changes with those.

Reduces the amount of Zone memory used for binary converted maps, and the amount of struct memory used for all types of maps.

They have also been removed from the Lua API. Fret not, the stringargs on line_t have far more utility.
2023-07-12 18:37:00 +01:00
toaster
b61701a1bc Tidier conversion of string properties to UDMF
Previously, concatenated texture field strings were turned to text, then had that string run through get_number, then had it converted back into a string to become a stringarg.

Now, the concatenated string is copied directly to the relevant stringarg.

This fixes an issue where a map with object or state properties would have "context drift" - breaking when the object or state list changed, due to differently ordered freeslots, or new hardcoded objects.

This is also made consistent and with less repeated code via the addition of multile P_Write functions to replace both P_WriteConstant and multiple copypasted blocks of zone allocation and memcpy.
- P_WriteDuplicateText -- fresh zone memory copy with PU_LEVEL
- P_WriteSkinColor -- converts ID to SKINCOLOR_ name, then runs it through P_WriteDuplicateText
- P_WriteSfx -- converts ID to SFX_ name, then runs it through P_WriteDuplicateText

In order to avoid making p_setup.c dependent on `deh_tables.h`, object type 1202 simply artifically produces the expected range of MT_ROCKCRUMBLE1 to MT_ROCKCRUMBLE16. It was technically possible to produce unexpected effects with extremely high offsets, but if your map was doing something like that, you're intelligent enough to go back and swap the MT_ constant out with your intended goal.
2023-07-12 17:13:38 +01:00
toaster
36e0a23c09 Remove console script support from maps
The linedef's behaviour was broken horribly by long map names, and it's not worth the effort to fix it for the following reasons.
- It was considered a security vulnerability to have free access to the console when it was written.
- The game literally had a cvar to disable running console scripts. That's "I am willingly distributing ActiveX Word Documents in 2023" levels of foolhardery.
- Anything GOOD it can do, both Lua and ACS can do better.
2023-07-12 16:32:23 +01:00
toaster
ba5047459c Remove last remnants of Action 434 ("Custom Power")
Had no behaviour, but was being processed
2023-07-12 16:16:56 +01:00
toaster
c5c78df946 Linedef Action 460 (Award Rings) now supports negative ring counts
UDMF now has a native ring drainer effect.

Also fixes the WriteTextmap warning for the deprecated sector effect, which should have been encouraging you to use this action, not action 462!?
2023-07-12 13:17:09 +01:00