The Dink Network

Chase scene help for upcoming DMOD

December 27th 2018, 08:07 PM
wizardb.gif
Bluedy
Peasant He/Him Romania bloop rumble
I like Frutti Fresh 
So basically I need to do a......."unique"........chase scene. In concept it sounds simple, but I'm a noob and I dunno how to execute it. So I made a drawing in paint with how the chase should play out and hopefully, with your help, Ill be able to build the script. Because I don't even know how to get started.

How the chase works.

its basically:

-dink is at coordonates x,y.
-monsters gets said coordonates
-monster waits one second
-dink moves away from coordonates
-monster spawns at dink's old coordonates with an attack animation, with sp_touch_damage so if dink stays still, monster spawns at said coordonates and dink dies.
December 27th 2018, 09:25 PM
duck.gif
toof
Peasant He/Him
I disagree. 
Will reply in more detail when I get some sleep. In the meantime, check out the excellently fantastic sp_x(), sp_y() functions. You can use them to obtain Dink's x,y coordinates.

You can then be a little more imaginative and try sp_z() function, which works, but freezes the game because it doesn't exist. It occurred to me also that sp_i() probably doesn't exist as well, meaning that we will never be able to script a puzzle that features a tesseract....
December 28th 2018, 03:50 AM
wizardb.gif
Bluedy
Peasant He/Him Romania bloop rumble
I like Frutti Fresh 
nice. yeah i already knew about sp_x() and sp_y().
December 28th 2018, 04:30 AM
wizardb.gif
Bluedy
Peasant He/Him Romania bloop rumble
I like Frutti Fresh 
Aight I did it. Lep pretty much did it.

void main(void)
{

sp_nodraw(&current_sprite, 1);
int &monster = create_sprite(5000,5000,0,170,1); //Create sprite offscreen
sp_touch_damage(&monster, 2); //Set damage

int &temp_x = sp_x(1,-1);
int &temp_y = sp_y(1,-1);

//Step two: Run a loop that gets dink's coords and  then waits (2000) (2 seconds(or however long you want))

FetchCoordLoop:
wait(200);  //increase later

//set coords
sp_x(&monster, &temp_x);
sp_y(&monster, &temp_y);
wait(1);

//get coords
&temp_x = sp_x(1,-1);
&temp_y = sp_y(1,-1);

goto FetchCoordLoop;
}


posted for anyone who might need this in the future