Current Sprite
I have a sprite of a hole that I want Dink to fall down, and he lands on the spot of the hole on the next screen. Instead of making lots of scripts for each hole, I want it to remember where he was when he fel down it and make it the warp coordinates on the next screen. But first, I need to make it so the falling sprite falls in the middle of the hole. I wanna make it something like:
current sprites X coordinate==csx
current sprites Y coordinate==csy
generate sprite (csx+10) (csy+10)
Can someone show me how to or point me in the direction of a good turtourail?
current sprites X coordinate==csx
current sprites Y coordinate==csy
generate sprite (csx+10) (csy+10)
Can someone show me how to or point me in the direction of a good turtourail?
I think you could look at the rudiments of scripting, it's said to be good.
about your script:
I'd do it like this:
int &csx = sp_x(¤t_sprite,-1);
int &csy = sp_y(¤t_sprite,-1);
&csx += 10;
&csy += 10;
int &newhole = create_sprite(&csx,&csy,0,sprite seq,sprite frame);
(I don't know the sprite's sequence, nor the sprite's frame, so I haven't put any numbers on their places...)
about your script:
I'd do it like this:
int &csx = sp_x(¤t_sprite,-1);
int &csy = sp_y(¤t_sprite,-1);
&csx += 10;
&csy += 10;
int &newhole = create_sprite(&csx,&csy,0,sprite seq,sprite frame);
(I don't know the sprite's sequence, nor the sprite's frame, so I haven't put any numbers on their places...)
Would this work?
void main(void)
{
sp_que(¤t_sprite,-1000);
preload_seq(860);
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
freeze(1);
int &csx = sp_x(¤t_sprite,-1);
int &csy = sp_y(¤t_sprite,-1);
&csx -= 8;
&csy -= 4;
int &newhole = create_sprite(&csx,&csy,0,sprite seq 860,sprite frame 1);
{
sp_seq(1, 860);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
}
sp_touch_damage(¤t_sprite, 0);
sp_brain(1, 0);
wait(2000);
script_attach(1000);
fade_down();
&player_map += 1;
sp_x(1, &csx);
sp_y(1, &csy);
load_screen(683);
sp_brain(1, 1);
draw_screen();
fade_up();
kill_this_task();
}
Yes, this script is work of Redink from FIAT (I took away the duck stuff but I might need it...)
void main(void)
{
sp_que(¤t_sprite,-1000);
preload_seq(860);
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
freeze(1);
int &csx = sp_x(¤t_sprite,-1);
int &csy = sp_y(¤t_sprite,-1);
&csx -= 8;
&csy -= 4;
int &newhole = create_sprite(&csx,&csy,0,sprite seq 860,sprite frame 1);
{
sp_seq(1, 860);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
}
sp_touch_damage(¤t_sprite, 0);
sp_brain(1, 0);
wait(2000);
script_attach(1000);
fade_down();
&player_map += 1;
sp_x(1, &csx);
sp_y(1, &csy);
load_screen(683);
sp_brain(1, 1);
draw_screen();
fade_up();
kill_this_task();
}
Yes, this script is work of Redink from FIAT (I took away the duck stuff but I might need it...)
I think load_screen() should have no parm.
Replace this part:
int &newhole = create_sprite(&csx,&csy,0,sprite seq 860,sprite frame 1);
{
sp_seq(1, 860);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
}
with this:
int &newhole = create_sprite(&csx,&csy,0,860,1);
sp_seq(1,860);
sp_frame(1,1);
sp_nocontrol(1,1);
//I haven't testet whether or not this change is neccessary, but it's definitly prefered.
And move the sp_touch_damage(¤t_sprite,0); further upward, this construction *might* cause a problem (probably not, but it's better to move it upward anyway)
Cypry: The load_screen(); doesn't do anything with a parm, it's not forbidden to type your favorite number there...
int &newhole = create_sprite(&csx,&csy,0,sprite seq 860,sprite frame 1);
{
sp_seq(1, 860);
sp_frame(1, 1);
sp_nocontrol(1, 1); //dink can't move until anim is done!
}
with this:
int &newhole = create_sprite(&csx,&csy,0,860,1);
sp_seq(1,860);
sp_frame(1,1);
sp_nocontrol(1,1);
//I haven't testet whether or not this change is neccessary, but it's definitly prefered.
And move the sp_touch_damage(¤t_sprite,0); further upward, this construction *might* cause a problem (probably not, but it's better to move it upward anyway)
Cypry: The load_screen(); doesn't do anything with a parm, it's not forbidden to type your favorite number there...

Yeah it works!! But I have two problems:
No. 1: When the falling sprite appears, Dink doesn't disapper.
No. 2: The falling sprite does not play.
I don't know why these are happening because I am using the script from FIAT that worked perfectly. I'm still new to this so can someone explain why it is not working properly.
No. 1: When the falling sprite appears, Dink doesn't disapper.
No. 2: The falling sprite does not play.
I don't know why these are happening because I am using the script from FIAT that worked perfectly. I'm still new to this so can someone explain why it is not working properly.
Ok, for me it wasn't clear what the 860 sequence was, but I now think that it is the falling sprite.
Answer no1: You don't have a sp_nodraw(1,1); command, so dink will be drawn normaly...
Answer no2: You make a falling sprite, and then you try to make Dink do the animation, not the falling sprite...
I don't feel like giving complicated instructions to fix it, so I'll just give you the edited script:
void main(void)
{
sp_que(¤t_sprite,-1000);
preload_seq(860);
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
freeze(1);
sp_touch_damage(¤t_sprite,0);
int &csx = sp_x(¤t_sprite,-1);
int &csy = sp_y(¤t_sprite,-1);
&csx -= 8;
&csy -= 4;
int &newhole = create_sprite(&csx,&csy,7,860,1);
sp_nodraw(1,1);
sp_seq(&newhole,860);
wait(2000);
script_attach(1000);
fade_down();
&player_map += 1;
sp_x(1,&csx);
sp_y(1,&csy);
load_screen();
draw_screen();
sp_nodraw(1,0);
fade_up();
kill_this_task();
}
I hope this helps...
Answer no1: You don't have a sp_nodraw(1,1); command, so dink will be drawn normaly...
Answer no2: You make a falling sprite, and then you try to make Dink do the animation, not the falling sprite...
I don't feel like giving complicated instructions to fix it, so I'll just give you the edited script:
void main(void)
{
sp_que(¤t_sprite,-1000);
preload_seq(860);
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
freeze(1);
sp_touch_damage(¤t_sprite,0);
int &csx = sp_x(¤t_sprite,-1);
int &csy = sp_y(¤t_sprite,-1);
&csx -= 8;
&csy -= 4;
int &newhole = create_sprite(&csx,&csy,7,860,1);
sp_nodraw(1,1);
sp_seq(&newhole,860);
wait(2000);
script_attach(1000);
fade_down();
&player_map += 1;
sp_x(1,&csx);
sp_y(1,&csy);
load_screen();
draw_screen();
sp_nodraw(1,0);
fade_up();
kill_this_task();
}
I hope this helps...

Yay! It works with no errors! Thanks a lot metatarasal. Just one tiny question, where would I put the playsound of Dink going "Ahhhh!"? I am assumming under the "sp_seq(&newhole,860);".
EDIT 1: If your wondering I tried it myself but the sound was not a .wav file so the game crashed. I am currently looking for a conversion program.
EDIT 1: If your wondering I tried it myself but the sound was not a .wav file so the game crashed. I am currently looking for a conversion program.
I'd place it directly after the sp_touch_damage(¤t_sprite,0); command, but after the sp_seq(&newhole,860); would work perfectly fine too...