Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
VVVVVV has this interesting system called altstates. It's where a room can have multiple sets of tiles which can be switched between by using
altstates(ID)
in a script. This is only used in the pre-secret lab cutscene.This works by the entity class having an
altstates
variable, which is 0 most of the time. Then when loading a room, it checks if that variable is a certain number, and switches out the set of tiles to load.This is very hardcoded.
Like a couple of my other PRs (ex. #897, #905), this PR helps with the goal of reducing the split between custom levels and the main game. This gives the custom level system the ability to load alternate sets of tiles. To make it a bit more useful, it's per-room, instead of a global "altstate".
So,
altstates(ID)
has been stripped out -- it's not very useful when altstates are now per-room. Instead,altstate(x, y, ID)
has taken it's place.x
andy
can be-1
to target the current x/y. The command changes the altstate and reloads the room. Altstates are stored separately from normal rooms in the level file, and this is because every single tile in levels are just one huge list... so altstates they're stored like so:Like #897, this PR does NOT replace the current system used in the main game, as that should be done when the main game is overhauled to use a better format. However, laying down the systems for future use is the way to get there.
Also like #897, this doesn't add any editor support. In the future, I might make a PR to add some missing editor features, however I'm not sure yet. I'd love input on this decision. Additionally, if editor support for altstates is requested alone, I can do that in this PR as well.
Legal Stuff:
By submitting this pull request, I confirm that...
CONTRIBUTORS
file and the "GitHub Friends"section of the credits for all of said releases, but will NOT be compensated
for these changes