Star Citizen: Bugsmashers! - Don't Turn Off My UI, Bro
Transcript — every row opens the video at that moment
- 00:00:06
[Music] everyone welcome to bug smashers I'm your host Mark eben I'm here to show you some fun bug everyone we're here in my fun little multiplayer test map and my favorite ship Cutlass yeah and I have a buddy who is also myself because why not play on the same server as me awesome so I'm I'm flying up there and I muscle behind here because let's make things confusing and as you can see his UI is on whoa I love random asset bugs so his you eyes
- 00:00:56
on everything's cool I'm now gonna go run over get in the side of the turret remember when you'd sit coffee pinky up and you gotta make sure you spill it all right so this guy's in the turret he's going pew pew pew having his time of his life his you eyes on everything's dandy and he decides to exit when the eggs that happens his UI goes off and unfortunately it turns off the pilots UI ooh crap so not fun especially since people are gonna get in and out of seats and a multi cruise ship and we don't want random screens turning off because the guy in the back got out of his
- 00:01:43
turret what's happening well a long time ago we made a decision when we writing the SD item framework we forgot to take into account a few things oops basically we have these controllers and we have items and we have the good old players players take control of controllers which then take subsequent control items so the player will take control of the weapon controller which will then take control of some weapons well in the case of the UI screens the player is taking control of his dashboard and the dashboard will observe other things so that could promptly display them on the UI unfortunately when you have two dashboards they kind of interfere with each other because the UI for turning on
- 00:02:33
and off stuff is actually handled by the controller's themselves so say we have an energy controller which controls power we have two dashboards and they both want to watch it fortunately the dashboard will let's see let's go to drew rein online and let's go to that magical function any time the screen decides well the dashboard to say I need to turn off something or anything like that it will actually go to the controller and tell it to turn on or off so what that means if this guy the dashboard has a power loss or the user turns off all the screens it will go to the energy controller and turn that off which turns off this guy's UI because the controller itself has DUI what we
- 00:03:24
need to do instead is make the dashboards control that aspect because all they want to know is the information on the energy controller they don't care if it's if that thing has controlled the UI on or off so we need to separate a bunch of fun code so here is the awesome controllers energy weapon you name it it's basically this is the base class and any time here it is we have it's this UI state that gets toggled whenever it gets turned on or it gets attached this updates all the UI states now we don't actually want this to do any of that so we're gonna use the good old magic delete key delete everything there we go
- 00:04:14
deleted magic functions so we'll delete this guy because we don't want tend to control any more magical UI he has no control of UI but now we need to make the dashboard taking sole priority of all these things so we got asically gotta find all that area that we ripped out so the first part is here we don't need the controller's to turn everything on we need to do it ourselves so what we're gonna do I have this handy-dandy code right here already pre-made because I am lazy what this does is it will get all the active screens that are on the
- 00:05:01
dashboard which is currently showing up and it will toggle the power state based on what the dashboard says it should be so the UI is now controlled by the dashboard so if this guy turns it off we need to make sure only his stuff turns off and that's what this beautiful thing does right here and let's see what else we have to change should be ha more errors so since we're getting rid of this part this is where we create our screens and we already know for online so we might as well pass this on to the screen so when we're creating the screens if dashboards already online we need to make sure those screens are also online so we need to make all of these lovely things have that same information let's go to that lovely
- 00:05:55
function there it is ah so we are online passed through our awesome C++ lambda and then pass it where we do our register view shows I am all right what else calls great view this guy we need to see if we are also online I think that's all I was copied this guy do where did I put you there we go sit there so now let's make sure we have all the compile ah we don't need this anymore alright let's compile so what we have done is the dashboard has its own online
- 00:06:44
power state we only need it to control the UI screens themselves and not the controllers so that way they could be I mean it's it's like I have my desktop right here I have three monitors and if I turn them on and off I expect only mine turn off and not Hosmer's back there so compile all the things there we are back after compiling and I got my pilot in the seat and my co-pilot in the back let's see his magical lo UI is still on and now enter the turret the dududududu coffee as I am I'm gonna you know I'm gonna
- 00:07:37
turn off the power then I'm gonna eggs it because why not go back to the other guy and check it out the UI's still on magic this guy slowly gets out of the seat we and check it out his UI still on everything is awesome there you go hope you guys enjoyed so we had a little fun multiplayer bug there we're kind of like when you old used to play an n64 and you were playing on that big old television screen multiplayer split-screen you turn off the screen everyone's screen turns off not good especially since what you see shouldn't be what the other guy sees so fixed up the code soothes the dashboard on this
- 00:08:24
side and the dashboard on this side are independent of each other so whatever you turn on on here won't affect this guy over here and that will make sure that the pilot can fly and the guy and the turret could get in and out without causing havoc across the ship hope you guys enjoyed until next time thank you for watching so if you want to keep up with the latest and greatest in the star citizen the squadron 42 development please follow us on our social media channels see you soon
Transcript from YouTube’s automatic captions — punctuation and Star Citizen jargon are approximate. The video itself is hosted by CIG on the official channel.

