(SOLVED) 100 posts, XD

In my Vironia game I have four different powers that the player can switch between.

  • The first power is the primary power that emits a ball of energy.

  • The second power is a power that allows the player to throw a dark shuriken.

  • The next two powers you don’t have to worry about (For now).

I need help with the concept of switching in-between powers.
If the player clicks a rune, then it messages the emit arrow and switches the players power to the one depicted on the rune.

I have the messages done but I need help with the coding inside the emit arrow.

just use a router


Is there a specific way to use the router? Please explain how it will switch the powers.

use the help menu in the behaviour
it’s a really simple behaviour but i don’t think you knew about it yet because it should solve your problem
it’s in the number menu


Ok, I’ll try that. Thanks.

1 Like

There’s only one input for four outputs. Is there a specific way for a specific output to be selected. I know there’s a ‘Select Specific Route’ but how can that be done with only one select input?

How do I make the router switch the current power? Is seems like it would only act as a ‘Once’ trigger. I need the player to be able to use the spacebar to shoot the emit object.

You input a number into the “Select” input on the router to select a path for the “In” input to travel through.

1 Like

Oh, thanks.

How do I make the power that the player switches to stays permanently until they switch it again?

Is it just me or does everyone try to ignore this topic?

Since it’s summertime for most people, they probably are off doing things irl. I don’t think it’s intentional that not many people are paying notice.

For the powers, you could have the messages change a number value. So if the set number is 1, it will turn the main switch on, and the rest on, allowing the first emit or power to be activated while the rest can’t be emitted.

Then when the number is 2, it turns the first, third, and fourth switch off, while turning the second on and so forth. This is kind of a primitive design, but I still use it as I’m still trying to understand routers myself.

That’s if the powers are just emitting different projectiles or weapons. But you could probably still rig it up to other abilities. I would help further by sending screenshots, but it’s midnight for me and I usually work most of the day.

1 Like

Oh, I guess I should be expecting less replies during summer.

1 Like

I have each of the outputs on the Router to the other three off inputs and to the on input on the specific switch.

It doesn’t work.

I would personally remove the router and set it to a number. Have the other four numbers into the “set” input.

Have an always into the get so it’s constantly checking the number so it should automatically change the switches depending on what power is activated.

I forgot, you’ll need filters as well to check what the number is.

I feel dumb because I’m sure the router is much easier than all this, but I’m not entirely sure how the router works. I’ve messed around with it before, but I struggle getting it to work correctly.

1 Like

Where do I put the Filters and what do I set them to?

I don’t either. Do I need another Number?

If you want, I can send the link. That way you could send Screenshots.

The four numbers —> (set input) number —-> filters (4) —> switches

So you have the four numbers into the set input of a new number behavior. Everytime when a message is sent to the object, it’ll set the number based on what power is currently active. Have an Always behavior linked into the new numbers Get input so it’ll always check what the power is.

Then attach four filters to the new number behavior. All four are equal to the range 1-4 so it’ll detect when the power is 1, 2, 3, or 4.

Using the first power for example, use the pass output to turn the first switch on, and the rest off. The second power will turn the second switch on, the rest off, and so on.

I’m currently on my phone or else I would just hop on and send a screenshot.

1 Like

Are the original four numbers attached to Value or in?

The original four numbers are only gonna be attached to the new number. Then the new number will be attached to the filters four times. Should look like a bottleneck or hourglass.

1 Like

It’s still not working.

This will likely be the last of my posts for the day, I have things occupying the rest of the day.

First things first. The messages need to be into the “get” input of the four numbers. Not set.

The always needs to be on the “get” input of the new number. Not the first four. Cause then it’s always setting the number to all four powers at the same time.

The new number needs to be into the “in” input of the filters. Value changes what value to look for so it’s constantly trying to look for all four numbers.

And you have to continue on the first filter. How it turns the rest of the switches off on the pass output, while turning its own switch on. The rest of the filters are the same way, turning their own respective switch on, while turning the rest off.

So when a number is 3, the messages will send the number to set the new number. The always constantly updates the input so the filters can always detect what that number is. The third filter (should be set equal to 3) will then activate. Turning the 3rd switch on, and the other 3 switches off. So when you click or activate an ability, put the trigger into that switches “in” input so it’ll emit the projectile or whatever the third power is.

1 Like