I ended up having a lot of trouble trying to make a C# plug-in for some reason so I ended up making my own simple version of this same thing with just GDScript. This is just for anyone else who maybe runs into the same issue and ends up here. I would recommend having a main Node with children of the different songs as AudioStreamPlayer's that can each have this script. Using the times as export vars means each song can have its own end and re-loop values. (I'm using Godot 3.5) ------------------------------------------------ extends AudioStreamPlayer export var end_time : float export var loop_time : float var timing : float func _process(delta): timing = get_playback_position() if timing >= end_time: seek(loop_time)
Yup I mentioned just under a minute in, the GlobalClass attribute was new in Godot 4.1, so 3.5 will definitely not support it. But, indeed, it's totally doable in GDScript =D
so i created the C# script, copied yours, saved it. even restarted godot 4.3 mono version, but i don't see the node anywhere. did i do something wrong? why isn't it showing up?
Well, allowing for the self-evident problem that I can't tell you what you did wrong without seeing your script :-P, the two things I would check first are if you forgot to put the [GlobalClass] attribute above the class, or if you didn't build the project. That's really all there would be to getting it to simply show up, even if you mis-copied anything else.
It's a short script, so you can copy it right off the video. However I don't mind creating a repo for it, apart from the hope that it becomes redundant if Godot implemented this natively 😋. Don't have time right at the moment, but I'll update here when I get said moment.
This is amazing. Is this FFVI mockup project on git? I would love to take a look at it! I'm learning to make an RPG at the moment in godot. I'm on v3.5.2
Thanks! Yes, this video is not in the playlist because it wasn't really essential, but the Godot 4 Final Fantasy VI Battle System playlist has videos of my building that project--just the battle system, not the entire game LOL (so far =D). I put it on Git, but as you'll see, I did exclude the images/audio just because I'm so literally duplicating it, I'm avoiding potential headaches. So, it won't run out of the box, but if you follow along and replace the sprites/animations/audio/etc..., it will. But that serves the purpose at the same time--it'll give you a solid (battle system) foundation and if you're making an RPG, you're gonna have to get into that and understand it anyway of course. Of course--if you're using 3.5.2 there will be some differences here and there. I think it's worth using 4 these days unless you want to publish a C# project to web--which is still in abeyance in version 4 because of some lacking .NET support.
@@dungeoncorps So I've thought of possibly doing a video on this topic (though others have done so). I'll just give you a couple of my main reason for choosing it, aside form the fact I have some experience with it 😋. The simplest one is that C# is faster by a fair clip. Now, if you're making an RPG you may not find this impactful unless you're doing something like the Moonerang in Sea of Stars 😂. But the bigger reason for me is that any C# libraries and such that exist can be used in your game. Another way to think of this is if you have the need to do "regular" stuff in your game--like something not specific to games, but something you might find in an ordinary computer program--then you can do that with C# where in many cases, not GDScript. One example of this is my recent video about connecting to local AI (Oobabooga). You need to essentially talk to a server in a specific way, and that ain' happening in GDScript. An even better example is LiteDB--which is the database I use in the FF VI project. Ain' no connecting to that in GDScript either (unless someone makes a plugin or you do your own GDExtension). Now, you don't have to use that...you could use SQLite, for example, and there is a GDScript plugin for that, but then you're limited to what is provided, and in the case of a plugin, what is kept up to date. It'd be up to you, though, if any such thing is necessary for what you're trying to do. Some good news, though, is learning your 1st programming language is always the hardest. If you get a feel for general things like program flow, separating "tasks" into methods/functions, etc... then it's not like re-learning everything. If you look at Godot's documentation, you'll see they have GDScript & C# tabs on most (though not all!) of their code examples, and you can get a feel for pivoting between them, if you were looking at the FF VI project for example. One thing that would be unintuitively different are the C# events which I use in there. The closest thing would be custom signals, though. "id love to develop a more complex battle system like ffvi!" -- As for this, hoo-rah! 😁 That's exactly what I was after making that playlist. There are some good tutorials on getting a very basic system up, but I couldn't find much in the line of a more realistic/comprehensive system. It also takes forever to build one up, but here is kind of a middle ground. Imitation is the sincerest form of flattery, and there's so much that's been dissected in the great games like this one, then there are no design decisions to make, and we have a solid realistic example.
I ended up having a lot of trouble trying to make a C# plug-in for some reason so I ended up making my own simple version of this same thing with just GDScript. This is just for anyone else who maybe runs into the same issue and ends up here.
I would recommend having a main Node with children of the different songs as AudioStreamPlayer's that can each have this script. Using the times as export vars means each song can have its own end and re-loop values.
(I'm using Godot 3.5)
------------------------------------------------
extends AudioStreamPlayer
export var end_time : float
export var loop_time : float
var timing : float
func _process(delta):
timing = get_playback_position()
if timing >= end_time:
seek(loop_time)
Yup I mentioned just under a minute in, the GlobalClass attribute was new in Godot 4.1, so 3.5 will definitely not support it. But, indeed, it's totally doable in GDScript =D
This worked great for me. Just needed to add @ before export in 4.2.
Exactly what I needed! You're a life saver, thanks!
No sweat 👍. This is one of those things I'm waiting to be standard in any game engine, but it's always a measure of your Google-Fu 😅.
so i created the C# script, copied yours, saved it. even restarted godot 4.3 mono version, but i don't see the node anywhere. did i do something wrong? why isn't it showing up?
Well, allowing for the self-evident problem that I can't tell you what you did wrong without seeing your script :-P, the two things I would check first are if you forgot to put the [GlobalClass] attribute above the class, or if you didn't build the project. That's really all there would be to getting it to simply show up, even if you mis-copied anything else.
i got it working just fine now. sorry about that
I don't suppose you have a link to that so I may shamelessly copy it?
It's a short script, so you can copy it right off the video. However I don't mind creating a repo for it, apart from the hope that it becomes redundant if Godot implemented this natively 😋. Don't have time right at the moment, but I'll update here when I get said moment.
This is amazing. Is this FFVI mockup project on git? I would love to take a look at it! I'm learning to make an RPG at the moment in godot. I'm on v3.5.2
Thanks! Yes, this video is not in the playlist because it wasn't really essential, but the Godot 4 Final Fantasy VI Battle System playlist has videos of my building that project--just the battle system, not the entire game LOL (so far =D). I put it on Git, but as you'll see, I did exclude the images/audio just because I'm so literally duplicating it, I'm avoiding potential headaches. So, it won't run out of the box, but if you follow along and replace the sprites/animations/audio/etc..., it will. But that serves the purpose at the same time--it'll give you a solid (battle system) foundation and if you're making an RPG, you're gonna have to get into that and understand it anyway of course.
Of course--if you're using 3.5.2 there will be some differences here and there. I think it's worth using 4 these days unless you want to publish a C# project to web--which is still in abeyance in version 4 because of some lacking .NET support.
@@Holonet01 thanks. Are there benefits of coding this in c# and not gdscript? I am unfamiliar with c#
id love to develop a more complex battle system like ffvi!
@@dungeoncorps So I've thought of possibly doing a video on this topic (though others have done so). I'll just give you a couple of my main reason for choosing it, aside form the fact I have some experience with it 😋. The simplest one is that C# is faster by a fair clip. Now, if you're making an RPG you may not find this impactful unless you're doing something like the Moonerang in Sea of Stars 😂. But the bigger reason for me is that any C# libraries and such that exist can be used in your game. Another way to think of this is if you have the need to do "regular" stuff in your game--like something not specific to games, but something you might find in an ordinary computer program--then you can do that with C# where in many cases, not GDScript. One example of this is my recent video about connecting to local AI (Oobabooga). You need to essentially talk to a server in a specific way, and that ain' happening in GDScript. An even better example is LiteDB--which is the database I use in the FF VI project. Ain' no connecting to that in GDScript either (unless someone makes a plugin or you do your own GDExtension). Now, you don't have to use that...you could use SQLite, for example, and there is a GDScript plugin for that, but then you're limited to what is provided, and in the case of a plugin, what is kept up to date.
It'd be up to you, though, if any such thing is necessary for what you're trying to do. Some good news, though, is learning your 1st programming language is always the hardest. If you get a feel for general things like program flow, separating "tasks" into methods/functions, etc... then it's not like re-learning everything. If you look at Godot's documentation, you'll see they have GDScript & C# tabs on most (though not all!) of their code examples, and you can get a feel for pivoting between them, if you were looking at the FF VI project for example.
One thing that would be unintuitively different are the C# events which I use in there. The closest thing would be custom signals, though.
"id love to develop a more complex battle system like ffvi!"
-- As for this, hoo-rah! 😁 That's exactly what I was after making that playlist. There are some good tutorials on getting a very basic system up, but I couldn't find much in the line of a more realistic/comprehensive system. It also takes forever to build one up, but here is kind of a middle ground. Imitation is the sincerest form of flattery, and there's so much that's been dissected in the great games like this one, then there are no design decisions to make, and we have a solid realistic example.