Change next level?

Status
Not open for further replies.

Yacker

Metallic
Is there any way to change the next level to be loaded after completing a level in Lua, without calling your own G_ExitLevel?
 
That's the level header, a static-unchanging value. I need to be able to change the next level mid-game, essentially. Under X conditions I want them to continue normally, and under Y conditions I want them to go to a different level, etc. And no, a custom exit won't suffice, because it needs to be universally functional across any level.
 
That's the level header, a static-unchanging value. I need to be able to change the next level mid-game, essentially. Under X conditions I want them to continue normally, and under Y conditions I want them to go to a different level, etc. And no, a custom exit won't suffice, because it needs to be universally functional across any level.
You can use runsoc scripts triggered by the level to load new SOC lumps to overwrite the level header. Unless the nextlevel is loaded ahead of time, that should be sufficient to change the nextlevel mid-game.
 
Well, that has the permanent effect of overwriting the previous levelheader. As I said, I want universal functionality for this-vanilla maps, custom maps, etc.
 
Quick question: Exactly why Lua? Is there a reason you can't use linedef type 2 (Custom Exit)? (Edit: And if so, what is the reason?) If you'd like to make it so that doing something in-map changes the exit destination, without calling the exit at that point in time, you can use linedef type 400 (Set Tagged Sector's Floor Height/Texture) (or you could even use Lua) to change the floor height of the control sector for the special to change the next level, and have the special itself just apply straight to the normal exit. I think Mystic Realm does something like this.
 
Last edited:
And no, a custom exit won't suffice, because it needs to be universally functional across any level.

I've been very frustrated with this, as well. My best attempt at getting around this (without completely remaking the exit system from scratch to be almost identical except for one thing, which... uh no I'm not doing that) made playersforexit stop working, which wasn't ideal.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top