-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I guess we're doing UI again #345
Conversation
I hope the cutscene allocation works like I think, even if the CustomCutscene alloc is bigger than the vanilla, and vanilla does the destroying. At least using game_allocator stopped it from crashing on dtor. |
There are like 3 cutscenes in the game, we can probably map all of them if you want. The question is, do we really need this? it's nothing special, just a function that is called every frame, and it disables the entity logic (probably just skips calling some virtuals like process input). We can add function to clear it, as it should be safe to just |
Well I'm sure we don't need it, there are ton of places to hook for similar results. My question is really is there anything wrong with it, now that it's already done? Or can you show me a simpler way to replicate the functionality with existing methods? |
movable_vtable.unhook(ent, callback_id); | ||
floor_vtable.unhook(ent, callback_id); | ||
door_vtable.unhook(ent, callback_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this template jungle, but clear_callback didn't work and this fixed it.
Ok I'm done with this pr, it's getting pretty hefty. |
src/game_api/script/lua_vm.cpp
Outdated
lua["create_layer"] = create_layer; | ||
|
||
/// Setting to false disables the death screen from popping up for any usual reason, can still load manually | ||
lua["set_death_enabled"] = set_death_enabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so this also disables some small things like shop zoom, but do we care? I made it just for overlunking, but it's nice to have debugging tools in the api too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also just nice to not need a player in a level at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes for cutscenes or weird game modes in mods too I suppose. I'll change the name to something more descriptive, any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, also going back to the patterns, we could just get the address from vtable of state.screen_level, and for the theme stuff from level_gen
since they never gets destroyed and stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really want to redo the hooks for a fourth time, but you can suggest your fix in pr format and this works for now.
create_level/layer()
, initialize layers back, create an empty level after you've destroyed itdestroy_level/layer()
, wipes all entities and unloads the layer(s)set_level_logic_enabled()
, disable all usual death screens from popping up, including when playing with 0 playersMovable:clear_cutscene()
to stop intro, transition etc cutscenesON.PRE/POST_LAYER/LEVEL_CREATION
, called before/after any screen creates layersON.PRE/POST_LAYER/LEVEL_DESTRUCTION
, called before/after any screen unloads a layer or both layersON.PRE_LEVEL_GENERATION
cancelableON.*_LEVEL_GENERATION
run in transitions, since it runs in almost every other screen anyway