Waypoints
A couple days ago, I decided to start working on my D-Mods again. Shock, awe.
I wanted a sprite to move in a really bizarre manner, flying across multiple screens in loops and curves.
The only way to make a sprite move in loops and curves is to use sp_mx and sp_my (and 1.08's sp_move_x and sp_move_y) or to hard-code sp_x and sp_y coordinates in order. Either of these methods would be hours upon hours of trial-and-error to calculate.
So I had an idea: Waypoints. Essentially, I place several sprites on the screen, which aren't visible during the game. Then I have my moving sprite target each of those sprites and move to each one in order.
Right now it works, but the speed varies quite wildly between each 'jump', so I have to normalize the speed so it is about the same value.
There's a good chance I'll release some sort of video tutorial (with sample scripts) for people to use. With some modifications (i.e. the use of move_stop instead of sp_mx/sp_my) it could even be useful for things like guards. That way you could have a guard follow a set path without coding it, and then you can just move the waypoints if you decide to change the map later.
I wanted a sprite to move in a really bizarre manner, flying across multiple screens in loops and curves.
The only way to make a sprite move in loops and curves is to use sp_mx and sp_my (and 1.08's sp_move_x and sp_move_y) or to hard-code sp_x and sp_y coordinates in order. Either of these methods would be hours upon hours of trial-and-error to calculate.
So I had an idea: Waypoints. Essentially, I place several sprites on the screen, which aren't visible during the game. Then I have my moving sprite target each of those sprites and move to each one in order.
Right now it works, but the speed varies quite wildly between each 'jump', so I have to normalize the speed so it is about the same value.
There's a good chance I'll release some sort of video tutorial (with sample scripts) for people to use. With some modifications (i.e. the use of move_stop instead of sp_mx/sp_my) it could even be useful for things like guards. That way you could have a guard follow a set path without coding it, and then you can just move the waypoints if you decide to change the map later.
I suppose it would be foolhardy to think that you could create the sine function as a subroutine and generate a flight path from that? (aka, Sigma (1!/x - 3!/x^3 + 5!/x^5... or something like that) Or are computers not good enough yet?
Sounds really cool. Actually I was planning on doing something with guards moving certain paths for my next DMOD. (Though I designed the paths easy so hardcoding it would still be an option for me.)
The little fireballs which circle the boncas in VDC were accomplished with sp_mx and sp_my. In the future, I will definitely use sp_x and sp_y though. More code, but infinitely more reliable.
Anyways, a waypoint system might give you more leeway as to how your sprite moves, but I would prefer the portability (and unpredictability) of a script.
Anyways, a waypoint system might give you more leeway as to how your sprite moves, but I would prefer the portability (and unpredictability) of a script.
Sounds like a great idea. Something I would use for sure.
I remember having the same idea sometime ago.. But I was too lazy to make anything
Sounds awesome. I'd like to use it if I got bored enough to make a D-Mod...(Gave up on DatB)