What made you decide to finish before the end of the year?
Jan 10th I finish my contract here and begin moving my family across the country. I also need to do a visa transfer during that and also visit my wife's family in another province - which means at least 3 flights with a one year old - plus when you update a visa you turn your passport over to the government for a week or two - all during the single-most-traveled holiday on planet Earth in the middle of a pandemic with increasing virulence.
It's gonna be stressful.
I think if I don't finish before then, I'll probably take another month or two off and I don't really want to work on this again at that point. Better to complete it than put it on eternal hiatus or to abandon the project unfinished in any form. At least now it'll be "done" and I can move on to another one when things settle down a bit.
-=-=-=-=-=-=-
Speaking of finishing the project: lets blast some problems!
Music:
As you can see - a song is loaded and it is set to begin playing. The visualizer at the bottom shows that it is specifically NOT playing.
This is because Manjaro is a real mother fucker sometimes. (I'm overwhelmingly satisfied with my OS, but apparently this is the limits of it.)
Manjaro has audio bugs, as previously mentioned.
Up to this point, I've always experienced those bugs as popping in audio.
APPARENTLY that can also appear in a complete collapse of audio drivers.
Not only does no music play in Godot - no music would play in VLC, web, or anywhere. And it looks completely identical to when there's something wrong with looping music.
A restart fixed it for a time, but eventually it cut out again (terrifying me greatly)
So...
Anyway music is finished.
Here's how it works. Let's take a stroll over to our good friend, the global.
Rather than struggle with passing instructions through the scene tree or asking multiple audioplayers to open and close, this is a much simpler solution.
When the game starts, the singleton ("global") gives itself an audioplayer and names it "music".
Then we make a custom function named "play()" and give it an argument named path.
Quite simply, when a scene is loaded, it tells the global to load a song into its stream - which will interrupt the last song and start a new one. Easy-peasy.
At the beginning of every scene that should have music, I tell the global to load the correct song and play it - and since all the scenes are killed and opened by the global as well, this has no problems so far - works easy as can be.
Music = blasted
(will probably recompose tomorrow and upload the new music and test on a different machine in case there is something wrong that I can't detect because of Manjaro on Pi's music issues.)
The Machine:
I go into the gameshop scene and shuffle the cube boys around a little - add a bar, dead tavern keeper, and a "machine" - which is just an archery tower shrunk down significantly.
I put a light source on top of it to 1 - get the attention of the player and 2 - for Zultan's sake. I decided I wanted the object to blink.
My code looked something like this:
func _physics_process(delta):
var L = true
var timer = 0
timer += delta
print(timer)
if timer > 10 and L:
light.hide()
timer = 0
L = false
if timer > 10 and !L:
light.show()
timer = 0
L = true
You may realize the mistake I made.
If not, don't feel bad, because I didn't for at least 10 minutes.
Here's a hint: this is what print(timer) would show:
The reason this didn't work is simple - I declared the variables inside the process - meaning about 60/second, timer was being re-written to 0 and L was being re-written to true. Anyway, moving the variables outside the function makes this work and it's a lot simpler and more reliable than the previous timer method I was using (the whole yield, timer, etc). Although if the whole game was in process, that might be preferable still.
I tweaked the check value a few times until I was satisfied with its blinkiness - this is also when the audio drivers collapsed again, which was honestly a god-send because the music was driving me nuts.
The Cubeboys:
I gave the cubeboys a new sprite instead of a copy-righted Sprite. Now they have a sort of MMO-style talk icon above them. It's pretty hard to see, because our character feels like they're about 1 meter tall. I'll fix that in a moment.
First, the cubeboys don't have collision, so you can literally walk though them. And although they already look like blocky ghosts - I'd prefer if they didn't behave like it.
The issue behind this is the same as the issue behind the walls - they were set to be Areas instead of StaticBodies. However, in the case of cubeboys - I don't want them to be totally static. They have one layer of collision which passes arguments of their teams to battlescene. Instead, I decided to keep them as an Area, with the large collision for talking, then gave them a staticbody, which has its own collision - so that you can't walk through them.
Here's what it looks like:
It's possible to do the same with masks and layers, and also to do it with code, but this took like...10 seconds, so for our purposes it's a superior solution.
The Machine - More:
The machine takes a very similar approach - one layer to block you from walking through them and another that will pass arguments to the dialog screen (to open something like a menu that'll allow you to change up your team. (accidentally cut off the second collision box in that screenshot, but it's under the staticbody).
I also added a bar countertop and made our character about 50% taller. Fun-fact, originally I had tilted the collision box, which is a cylinder. Which allowed our character to walk through the back of the machine a few times and push themselves through the floor. Love that bug.
I connected up the signals and wrote a bit of code - if everything is working, when you press any of the 'talk' buttons near the machine, it will print a message to the terminal. Here's hoping everything is tied up right.
All that's left is to design an interface to modify your team and to get that communicating to the global - I have a conceptualization of how to do this, so it might be easy enough to just...do it. Wish me luck!
-=-=-=-=-=-
Also, I opened the dialog scene for the first time in ages and forgot that I wrote this there:
Past delphonso really set a trap for me - christ - fuck you, buddy.