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.
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.
- 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
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
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.
- 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).
- 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
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
(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.
- 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
- 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
- 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.
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.
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.
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.
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.
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!?