Bolt - C# (switch) but naming is off and function might be wrong in bolt?

I am trying hard to get it into the visual scripting, but i am simply not feeling it.
Things that take me 5 minutes in C# takes me hours in Bolt, where as PlayMaker felt more “natural”.

Anyway, i got a AI working, and doing some things and trying to replicate my C# in bolt. (2 different project files)
But as an example a problem i persistently run into is the naming of functions.

Example, here i have a very simple switch.

            switch (Activity)
            {
                case "Idle":
                    Energy = Energy - IdleCost;
                    break;

                case "Working":
                    Energy = Energy - WorkCost;
                    break;

                case "Resting":
                    Energy = Energy - RestCost;
                    break;

                case "Moving":
                    Energy = Energy - MoveCost;
                    break;

                case "Eating":
                    Food = Food - EatCost;
                    break;

                default:
                    Energy = Energy - IdleCost;
                    break;
            }

Here i am trying “switch” in bolt.

It is CLEARLY not the same function as switch in C#
So how on earth would i know what the functions are called with different naming convention?

It is the same function, you just have to configure it in the Graph Inspector window. You can open it under Window/Graph Inspector.

2 Likes

Panthen has you covered for the general topic, but I thought I’d chime in on this bit:

If you can confidently program in C#, I recommend viewing Bolt through the lens of it enabling you to make a “DSL” (domain specific language) for your game. That is to say, you can make high level nodes that represent high level actions in your game. Mimicking a C# structure/workflow in Bolt might not be particularly productive for you, especially if you’re used to PlayMaker, which itself has a lot of high level actions like move camera, fade screen, etc.

1 Like

Like PanthenEye Said you can go in the graph inspector.
6771208--782782--SwitchCaseString.gif

1 Like

Yes I have been wondering how bolt works, I think i might want to get into it for advanced things that I might not be able to do in C#.

1 Like