SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 03-29-2017   #1
Yacker
Metallic
 
Yacker's Avatar
Default Change next level?

Is there any way to change the next level to be loaded after completing a level in Lua, without calling your own G_ExitLevel?
Yacker is offline   Reply With Quote
Old 03-30-2017   #2
Fodder
SRB2 = Sonic OVA?
 
Fodder's Avatar
Default

Quote:
Originally Posted by Yacker View Post
Is there any way to change the next level to be loaded after completing a level in Lua, without calling your own G_ExitLevel?
I don't know anything about Lua, but if SOC is available for you to use then I think there's an easier way if you just need a next level to be tied to the current level:

https://wiki.srb2.org/wiki/Level_header#NextLevel
__________________
Spoiler:
This is a bold claim!
Fodder is offline   Reply With Quote
Old 03-30-2017   #3
Yacker
Metallic
 
Yacker's Avatar
Default

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.
Yacker is offline   Reply With Quote
Old 03-30-2017   #4
Prime 2.0
Actually a decent lazy bum
Moderator
 
Prime 2.0's Avatar
Default

Quote:
Originally Posted by Yacker View Post
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.
__________________
Science tells us that nothing can be proven, only rendered more likely to be true. If we do not question what we already know, how can we know, much less admit, when we're wrong? Such things are vital to progress.
Prime 2.0 is offline   Reply With Quote
Old 03-30-2017   #5
Yacker
Metallic
 
Yacker's Avatar
Default

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.
Yacker is offline   Reply With Quote
Old 03-30-2017   #6
Zwip-Zwap Zapony
Please just call me Zappy.
 
Zwip-Zwap Zapony's Avatar
Default

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 by Zwip-Zwap Zapony; 03-31-2017 at 01:03 PM.
Zwip-Zwap Zapony is offline   Reply With Quote
Old 03-30-2017   #7
TehRealSalt
/me FLEX ᕦ(◉ᴥ◉)ᕥ
Developer
 
TehRealSalt's Avatar
Default

Quote:
Originally Posted by Yacker View Post
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.
TehRealSalt is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:58 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.