tsunamayo / Starship-EVO

Welcome to Starship EVO bug tracking repo !
112 stars 17 forks source link

[Suggestion] New Block - Operator Gate #5849

Open asanagisae opened 5 days ago

asanagisae commented 5 days ago

I was going to post this in the Event Gate suggestions issue, then I realized it should be a separate block entirely.

I'd like to propose a "(Math) Operator Gate". It takes a value from a linked block and applies an operation to it, either Addition or Multiplication. It then sends the new value to whatever it's linked to.

For example, build a simple demo chain (with the link tool) like this:

Hinge A > Operator Gate > Hinge B

The Operator Gate reads the value from Hinge A. Set the Operator Gate to "Multiply: 0.5". The gate then sends this value to Hinge B. The result is that Hinge B moves at half the angle of Hinge A.

You can also set the Operator to "Multiply: -1" to flip the direction of movement, in case you've placed a hinge backwards.

Here's a more practical example:

Mech Computer > Operator Gate > Ball Joins (bust)

Normally the Mech Computer would tell the joint to move to an angle that matches the direction the player is looking at. This is fine when there's one bust join. However, for compound bust joins (as in a centipede), this effect becomes compounded and the mech's head turns too far. If the Operator Gate can take this value and reduce it (with multiplication) before sending the signal to the hinges, you can reduce the effect.

For this centipede, I'm using one Bust join between every segment, so that the whole mech wiggles with camera movement. There are two joins between the parent entity and the head, so I'd want to reduce the Bust animation by half:

https://github.com/tsunamayo/Starship-EVO/assets/10069469/33902c94-48fa-4d50-b95e-e6eb700e02a7


Things that can send signals to an Operator Gate:

Things that can receive signals from an Operator Gate:


It's also possible that the Operator Gate can do comparisons like greater than or less than, similar to (or replacing) the Event Gate comparing if a hinge's angle is superior to or inferior to a certain angle.

tsunamayo commented 5 days ago

@asanagisae Hi, yes this has been discussed several time now. My opinion is that for such an advanced need we need more a programable logic block, with a mini API for each ship, with either some LUA code or a visual interface. First I need to work on my input gate that could push various state / setting to a system. Honestly this is longer term, definitely post survival, but yeah that would be the last step for a really complete logic system.

It is a dev that would lay ground for modding too.

asanagisae commented 5 days ago

It's good to know the wheels are already in motion!

One more related idea, the ability to send signal from thrusters to other things (on a space ship):

Thruster > Spotlight

The idea here is that the spotlight is usually off. When the thruster visually fires in response to player movement, the spotlight also fires at the same strength as the thruster.

Quite a few players will use spotlights to accentuate the visual appearance of thrusters. Unfortunately, until now, we have only been able to turn spotlights entirely on or off. We can leave laser trails from thrusters while in warp or light cruise, but we can't easily turn them on and off during normal flight.