Star Citizen: Bugsmashers! - Turret Trouble
Transcript — every row opens the video at that moment
- 00:00:06
[Music] Hey everyone, welcome to Bug Smashers. I'm your host Mark Abit. Let's take a look at some bugs. Bug Smashers. Hey everyone, we are here in the fun little test level for the SC item 2.0 constellation. And what we see here is a list of all the items and their individual components. Um, so with the item 2.0 infrastructure, we could have uh some entity like my hand, and it could be composed of physics, it could
- 00:00:53
be composed of an item, it could be composed of a power plant, a weapon system, or even a seat. So, all five of those components basically make our entity. And in the case of uh this constellation, we have a turret. And this bad boy is composed of a bunch of components. And this is our whole new item 2.0 entity 2.0 system where we have our turret, which is an item. It has these individual components, geometry, physics, animation, and our actual item logic. So we have here a dashboard. Uh this is the thing that we will see in front of you that has all the screens. It has a turret params. This is the thing that you need to move and rotate uh this guy around. He has a seat. This is basically the interface to uh the
- 00:01:42
ship saying, "Hey, I am a person sitting in here. Give me control of stuff." And then finally, we have the weapon controller. This allows you to be able to shoot stuff. So ideally when you plop one of these down into a ship, you could get in it, play some animations, gain control of some awesome weapons, and let's see what happens. So I am going to sit down, fast forward all the animations. And as you can see, um, some of this debug text is kind of turned a different color. So we have, um, an editor player which is basically in blue. That's me. I just sat down in the seat and he's gained control of you can see right above the read me uh replace me ball. I've gained control of the
- 00:02:30
seat, the turret and the weapon controller. So all these components that I have in here, I've gained control of them except our weapon controller has not gained any weapons. So where are our weapons? They should be There they are. So, we have this weapon gun that's on the hard point of the turret, but unfortunately, we're not gaining control of anything. That's on the very far right. We have turret right and turret left. So, what's happening? Well, let's take a look even further. Um, so here's our ship XML. This basically says, "Hey, here's everything you need to know about a ship." And we have these things called controller defs blocks which basically define um some
- 00:03:20
set of parameters of who is going to control what. So for this seat when a um user sits down he'll take control of the turret itself. Um and then we he will also be able the turret itself will also take control over itself. Again, it's kind of weird, but the way that the code is set up is um this user defaf is basically the seat. So, when the player sits down, he'll gain control of the seat. And then it's usable. Um since the seat now says, "Hey, this person has got in. What else could he can control?" That's the second block. And then he'll be able to control basically his dashboard, his turret, and even his weapon controller. That's why it's kind of set up this way. The reason
- 00:04:07
why it's also set up this way is because yes, you could have these components all built in the item, but you could actually separate them out and have them um subcomponents underneath connected um item ports. So, it's kind of a weird setup because the system allows you to be very flexible. And this turret has um uh we go back to this guy. We have an item which has some item ports and those item ports. We could set up a gun and we could also set up another gun on the other item port. So on these item ports we have some weapons, but unfortunately we're not getting control of them. Why? Well, um let's go back here. as you're saying
- 00:04:56
that we set up these um priorities of who could gain control based on these things called controllable tags. And when we snap um these weapons on it, well, we're not gaining anything. As you can see, we're looking for these weapon guns, but we only take control of them. So, by default, we have no control unless they have the tag uh the lower turret tag. So, we've assumed that these weapons that attach on to us are going to have the same tag as us. unfortunately don't. So, let's make sure that that happens. And the reason we want to do that is so that if we have the same turret copied and pasted in a few spots, all we have to do is set the tag here and then everything underneath gets it. So, in the code, whenever we add this um new component, so we don't do things entity levelwise, we do things
- 00:05:47
component-wise. So, when each of these get attached, we handle them independently. So, we don't care if they're on another entity or all in this guy. We basically get the item port and get its tag and then we use that. But, as you can see, the weapons are on we have the weapons and then the um turret. They're attached onto it. So, there's nothing to describe what flags or tags that these guys should have. So what we can do is enable this bit of code and as recode runs what this will say is if we are not directly attached to the ship that means we're going to go all the way up to our parent. So for this weapon we're going to go to the parent we're going to get its tag and use that. So what this will allow us to do is those weapons that get attached we use this tag so that the weapon
- 00:06:36
controller could gain control of them. So, we'll let Recode do its thing and I'll sip some coffee. Aha! Recode has done its thing. We're going to snap out of the turret. Fly back up to the top. We're going to enter again. Fast forward. Now we got gained control of everything again. Now see if we gain control. Yep. And now we have gained control of our weapons so we can fire them as we please. Pew pew pew. Well, hope you guys enjoyed this sneak peek. Till next time. So, as you
- 00:07:25
guys saw, we had a fun little bug where we have these new setup with the turrets where they're all mashed together and we're just adding a bunch of components. We slap it on the seat and we only get control of the seat. None of the weapons. We can't even get control of the dashboard, so we can't get out. It was simple as making sure that we add tags to each into those components. So when we slap it on, we sit down, we take control of ourselves, and then we can get in out as we please, shoot all the weapons, and have a good time. Hope you guys enjoyed. Until next time. Thank you for watching. So, if you want to keep up with the latest and greatest in Star Citizen and Squadron 42's 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.

