The Dink Network

Waypoints

May 16th 2006, 09:35 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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.
May 16th 2006, 10:57 PM
wizard.gif
Chrispy
Peasant He/Him Canada
I'm a man, but I can change, if I have to.I guess. 
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?
May 17th 2006, 01:53 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
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.)
May 17th 2006, 09:38 AM
goblinm.gif
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.
May 17th 2006, 10:37 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
Sounds like a great idea. Something I would use for sure.
May 18th 2006, 01:39 PM
sob_scorpb.gif
ikkejw
Peasant They/Them
 
I remember having the same idea sometime ago.. But I was too lazy to make anything
May 18th 2006, 06:04 PM
knights.gif
DinkKiller
Peasant He/Him United States
The world could always use more heroes 
Sounds awesome. I'd like to use it if I got bored enough to make a D-Mod...(Gave up on DatB)
May 19th 2006, 02:13 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
Sounds like a great ideea.