MinecraftTransportSimulator icon indicating copy to clipboard operation
MinecraftTransportSimulator copied to clipboard

[Suggestion] Need a way to change gun_yaw and gun_pitch values with collision boxes

Open PlumePack opened this issue 3 years ago • 4 comments

Hey, We're making an artillery gun, and we're trying to have it so clicking on specific parts of it change the gun orientation (like in real life). Would it be possible to make it so you can use several collision boxes to modify gun_yaw and gun_pitch, so that we can rotate the cannon and have it shoot where we want to aim it at? (As in: one collision box would increment gun_yaw by 1, another collision box would decrease it by 1, same with pitch...)

That way, it'd make it so the cannon stops shooting straight even when rotated (we're rotating with different variables right now...) and would let us set limits to how much the cannon can rotate

PlumePack avatar Oct 24 '22 14:10 PlumePack

If I'm not mistaken, variableModifiers could in theory do this right now? Give it a go, and make sure to try it both on the vehicle/mounting part side then on the gun itself.

boot2big avatar Oct 24 '22 18:10 boot2big

gun_yaw should be able to be changed by hitbox variables incrementing or decrementing that. If you can't, then I'd need to adjust the code to do such a thing. VMs shouldn't be required.

Is such a thing possible currently, or do I need to make code changes?

DonBruce64 avatar Oct 24 '22 23:10 DonBruce64

It doesn't seem possible atm, we tried doing that and it still breaks

PlumePack avatar Oct 25 '22 04:10 PlumePack

I will have to change this in the code, then. Because it should be something that's possible to allow for placable guns you don't need to sit in to aim.

DonBruce64 avatar Oct 25 '22 13:10 DonBruce64

Implemented in 22.4.0.

DonBruce64 avatar Dec 03 '22 03:12 DonBruce64