The Dink Network

Getting Dink to walk to a location

March 6th 2012, 09:54 AM
duckdie.gif
bsitko
Peasant He/Him United States
 
Question for you Dinkers out there. Anyone know how to get Dink to walk to a specific spot when you don't know where on the map screen you are?
March 6th 2012, 10:04 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Sure, it's not that hard.

First you make Dink walk to the X coordinate of the destination point, then to the Y coordinate For the direction in the move() command, you need to determine whether the destination point is above, under, right or left of the player. You can use simple if() conditionals for this.

If you need pathing it becomes a lot more complicated and I can't really help with that.

I can provide more information and maybe an example if you don't understand what I'm trying to say^^
March 6th 2012, 10:07 AM
spike.gif
move_stop(1,2,200,1);
move_stop(1,8,200,1);
move_stop(1,4,200,1);
move_stop(1,6,200,1);

^ This works too, though it can be rather inelegant. (Dink'll walk right through houses, rocks, etc)
March 6th 2012, 10:11 AM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Well, in the editor, you can put your mouse over a spot, and in the bottom corner it should tell you the coordinates. So, remember those, write them down on a scrap of paper or something and then use your move(); command.
March 6th 2012, 10:14 AM
duckdie.gif
bsitko
Peasant He/Him United States
 
Hmm... moving him is not a problem. It's just that if you enter this screen on the bottom you need to walk UP. If you enter this screen on the left hand side you need to walk right. How do you get the engine to move it correctly when you don't know which side you entered from?

Kyle: You touched on figured out with if statements your starting point. Anyone know what command to run to figure that out?
March 6th 2012, 10:23 AM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
You could put sprites in at the entrance. So as soon as dink enters, you get the void touch command and then move him from there. It'd be redundant but I'm not a master of DinkC so someone else probably has an easier way to do it.
March 6th 2012, 10:26 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Alright, so the way it works is this:

&dinkx = sp_x(1, -1);
&dinky = sp_y(1, -1);

if (&dinkx > 200) // Dink is now on the right side of the desired point
move(1, 4, 200, 1);

if (&dinkx < 200) // Dink is now on the left side of the desired point
move(1, 6, 200, 1);


Do the same for the y-coordinate. Does this make sense?
March 6th 2012, 10:40 AM
duckdie.gif
bsitko
Peasant He/Him United States
 
That's perfect Kyle... I was having issue figuring out HOW I can get the X & Y coordinate. From there it's just using some if statements to get Dink where I need him. Thanks for the help!
March 6th 2012, 10:51 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
My pleasure bsitko Come back if you have more questions, we'll still be here^^
March 6th 2012, 11:08 AM
duckdie.gif
bsitko
Peasant He/Him United States
 
Kyle.. you've been hanging around since 2000 and you've only got 2 DMOD's? Get WITH IT MAN! Ha!
March 6th 2012, 11:12 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
And one is a demo!

I'm working on one, but unfortunately adult life hit me in the face with a 40 hour work week. Having not worked before, it was a hard slap
March 6th 2012, 11:17 AM
duckdie.gif
bsitko
Peasant He/Him United States
 
I hear you on that one. Add 2 kids into the mix and you've got one heck of a busy schedule. Although I've been trying to find time to work on ... something.
March 6th 2012, 11:27 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Yeah, I can only imagine the amount of spare time kids remove from your life Not starting that anytime soon, or ever xD