In this new series, I’m going to discuss parallel events in Smile Game Builder: how they work and their relationships with other events on the maps.
What Is A Parallel Event?A parallel event is any of the three automatic triggers in an event’s Event Details.
These run in the background until one or more conditions becomes true to trigger the sequence of events. Each one is used for different purposes and to launch events at certain times when certain conditions are true.
Each event trigger is codependent on its additional Event Sheet Conditions. If none are set, then the event triggers as soon as the player enters the map.
In this article, I’ll go through the functionality of each one and how they’re used and will continue exploring them in future parts.
Automatically Start (Synchronize and Run Repeatedly)
This is a "true" parallel event in the sense that, as it states, it automatically starts on the map and runs continuously in the background, checking the state of its conditions.One notable use is to check if the player has a certain item and, if so, then trigger something like a message or another event. For reference, I did something like this in Tutorial #5: Working with Conditions (Part 2).
Another use is to check and update variable values, such as modulo operations or player coordinates.
As a general rule, the Automatically Start (Synchronize and Run Repeatedly) doesn’t usually have conditions to trigger it, so as soon as the player enters a new map, it auto-starts and runs in the background until its conditions become false, depending on what it’s used for.
This can be activated with conditions, such as turning a Switch ON, but I’ll cover that in the next part.
Triggered Automatically (1 Time Only)As self-explanatory as it sounds, this triggers an event on the map once only. If it has no Event Sheet Conditions, then it won’t trigger again while you’re on that map, but will recur the next time you visit the map.
One possible use is to trigger a once-only event to display a message giving details on surroundings, personal thoughts or furthering the story line.
If you want the event to trigger just once, without it repeating on subsequent visits to the map, you can toggle it with either a normal Switch or a Local Switch. On a second sheet, its Event Sheet Conditions would have the switch turned ON and with the contents blank.
I’d recommend always using the Local Switch for this, however, as each event can have its own independent Local Switch that doesn’t affect other events. And this way, you can keep normal Switches free for other things.
Triggered Automatically (Repeated)With the Triggered Automatically (Repeated) Start Event, the event runs repeatedly in the background, essentially overriding all other triggers until its conditions become false.
This is because it operates as a loop, where you’d need to add conditions to disable it. While it’s activated, the auto-repeat trigger will halt other events, including player movement.
One notable use for it is to display information, such as the map name or more of the story line, and then use a Switch (normal or local) to disable it after a set amount of time and re-enable other events and player control.
In Part Two
In Part 2 of this article, I’ll expand on the Automatically Start (Synchronize and Run Repeatedly) trigger and go into more detail on how to use it effectively.
And in subsequent parts, I’ll similarly go more in-depth with the other Start Event triggers and their uses.
So, say you wanted to use the 10’s value from a number, but not the 1’s or any remainders after it, you can extract it as a single value using this function. In this article, variable manipulation uses the Advanced Variable Box Op.
For the purposes of this article, and to see it in action, the first step is to create a variable to generate a random number.
- Use the Random Number command in the Advanced Variables to generate a random number range. The regular Variable Box will just add a random number to the existing number. However, we want to generate a new random number each time.
- Assign a variable with a random number between 0 and 999.
Units or 1’s
To calculate the units, the formula is:
Number % 10
Which simply divides the number by 10 and outputs the remainder.
- Store the random number variable into another variable for the 1’s.
- Add another Advanced Variable Box to modify the 1’s variable to a fixed value of 10, and set the Substitute divided remainder as the operation.
Tens or 10’s
For caluclating the tens, the modulus operation is:
(Number % 100) / 10
- Once again, set a variable for the 10’s to the same as the random number.
- Substitute the remainder with a fixed value of 100.
- And divide the result by 10.
At this point, you may start to see a pattern emerging. This is a surefire way of calculating and outputting much larger numbers…
Hundreds or 100’s
The formula for the hundreds is:
(Number % 1000) / 100
- So, as with the tens, a variable is created, this time for the 100’s, and set to the same as the random number.
- The remainder is set.
- And divide the result by 100.
Thousands or 1000’s
If you’re going to use higher numbers in HUDs, such as for stats, you’ll also need thousands as well.
The modulo operation to calculate this is:
(Number % 10000) / 1000
This is set up in the same way as the previous numbers using the variable to store the 1000’s.
The final product will look like this:
Each time the random number updates, it’ll separate the value into its component parts, returning an integer for the thousands, hundreds, tens and units so that they, in turn, can be used to update graphics referencing the number.
You can check to see if it’s running properly by pressing F5 during playtesting and monitor each variable.
Notes About HUDs
I doubt you’ll need more than the 1000’s for creating HUDs because if numbers exceed the maximums, they won’t go above that. The only exceptions are probably experience and gold. If you’re determined on using these in a HUD, then following the same pattern by adding zeros to numbers (as seen above).
I won’t go into actually creating HUDs here, as that would take an entire tutorial – perhaps more than one – to cover fully. However, perhaps I will some time in the future.
There are a number of issues with HUDs, notably when numbers refresh on the map. They tend to flicker on-screen, which is distracting and annoying. This is primarily due to the way that SGB uses and synchronizes auto-running events. It cycles through each one until conditions are true, but removes and then replaces the graphical numbers according to those conditions.
Additionally, each true condition overrides the previous ones, so another anomaly occurs with trailing zeroes. As an example, if your value is three digits long, the output on-screen should be 000. However, if the number is 7, the preceding zeros are displayed as blanks.
There is, of course, a workaround for this, but it isn’t reliable or efficient. I’ll put that in another tutorial some time in the future when, hopefully, I’ll have a proper fix for it.
There’s no Smile Game Builder Tutorial this week!
Otherworld SGB: Through the VeilThis is primarily because of development on Otherworld SGB: Through the Veil.
It’s a project I wanted to create for a long time and, with everything I now know of SGB (including through the tutorials), it’s achievable.
Many of the techniques I demonstrated in some of the tutorials will also be used in Otherworld SGB.
Time Flies When You’re Having Fun!
You can have the BEST time management skills in the world, but Time is a hungry, fickle mistress, who will throw at you things that consume the most time, thereby, distracting you.
And, despite having 11 days off, they went by far too quickly. Everything I’d intended to achieve during this time was very particular, with each item allotted a specific timeframe.
Unfortunately, this means 3 of the planned showcases (including SGB resources and games) have been pushed back.
I’m back to work tomorrow, with the usual routine of having 2-3 days to work on anything project- or game-related. It’s NOT the "job of my dreams" – game development is! – but, hey, it pays the bills!
This tutorial is mainly for combat, but it includes answers to some of the FAQs and how-to’s to some comments I received.
Action Battle System in SGB
As mentioned in the video, here’s the link to the ABS Battle System.
Get Jacob’s Assets
You can also obtain the Alien and Drone characters I used in this video from Jacob’s 3D Art, where there’s a free download of his SGB assets and more.