Visual Scripting


Working on the Scripts, one of my mayor concerns was creating them in a clean way that did not interfere with everything else, as this would have slowed my progress down with every added functionality, increased the amount of bugs , and made it impossible to revisit and tweak the project at a later point.

 

I was happy to realize quite early that the theoretical skills and knowledge from my coding works were transferable to the Visual Scripting, so that I could think in the same mindset here.

The following Excerpts are examples of different functionalities created for the game, with some commentary about their use and creation.


Card Selection & UI Rotation

In Floating Sanctum the player has to collect 11 cards, half of which are only needed for a secret ending, with the other half being mandatory steps to get to the end of the game.

 

At every given Time the player should have one of the cards selected as active card and have a visual indication of this.

As such,  it was one of the first tasks to create a structure that allowed the player to actually acquire the cards and circle trough them.

The light grey picture below shows the final version of the script that triggers whenever the player wants to rotate to another card.

Up to the Developer Console String Output in the middle everything was quickly created, with the math work being packed into the Card Circle Up&Down Functions to keep it easy to read.

With this, and intractable objects being added as well,  the game core was now testable.

 

A mayor roadblock here emerged when I wanted to rotate the UI Widget carrying the cards.

There were several function that could achieve this, but for quite a long time I did not find a way to make this specific parameter of the UI Widget publicly editable.

After some experimentation, with different kinds of widgets and other ways to display the Interface (at one point even considering to simply attach it directly to the player in the scene without using widgets) I found a button hidden in the settings of one of the UI Widgets that allowed me enough access to use the Render Angle Setter, which meant that this Problem was out of the way.


Door Logic

One of the most used scripts in the game, the doors should open as soon as the player got close enough while holding the correct active card and play a sound when they did so. Also they had to close as soon as he had moved away from them and some time had passed, again playing a sound.

The Script was created in a way that only activated it's frame by frame check for the right card when the player was close enough to keep it as efficient as possible, and also because the on trigger exit function was needed to see when the player moved away enough from the door to start the closing countdown.

The Door is equipped with a Boolean to check if it is already being opened/open to make sure it does not fire every frame the player is close enough.

Full Gate Logic
Full Gate Logic

Other Examples

A selection of other Script snippets from several places throughout the project, to showcase different functionalities.