Frame/Sequence Help
Hi! I have been a long time fan of Dink and have finally decided to begin making my first D-mod. I have been having issues on getting a sprite of Dink to appear to "dance." I think what I have to do is individually select each frame since obviously not all the Dink frames are in the same sequence and I want him to jump around almost randomly for the dancing. (Well, not randomly, but I mean frames from different sequences played out of their order.) I hope what I'm asking make sense because I'm not entirely sure if I'm asking it right, heh. Thanks for your help in advance! -FF
Oh yeah, if you don't mind, could you please explain it in detail since I'm still very new to creating D-mods. Thanks.
Oh yeah, if you don't mind, could you please explain it in detail since I'm still very new to creating D-mods. Thanks.
Well, you could do something like this:
sp_pseq(&spr,xxx);
sp_pframe(&spr,xxx);
wait(100);
sp_pseq(&spr,xxx);
sp_pframe(&spr,xxx);
wait(100);
sp_pseq(&spr,xxx);
sp_pframe(&spr,xxx);
wait(100);
and so on, where &spr is the sprite you want to dance, and xxx is you number for sequences and frames.
sp_pseq(&spr,xxx);
sp_pframe(&spr,xxx);
wait(100);
sp_pseq(&spr,xxx);
sp_pframe(&spr,xxx);
wait(100);
sp_pseq(&spr,xxx);
sp_pframe(&spr,xxx);
wait(100);
and so on, where &spr is the sprite you want to dance, and xxx is you number for sequences and frames.
If you need to do this 'dance' often, it's probably better to create a new sequence by using Dink's graphics and placing them in the order you want. You'd need to download the Dink graphics to do that though (or find some program that can extract the individual bitmaps from the .ff files).
You could do a way without really scripting all that they explained. Try giving the sprite a brain of '9' and setting his hardness to '0'. I think this'll work if you want a sprite to stay in the same place and always do his little 'dance'.
Well, if I could recommend something to you, that would be to not start complicating yourself trying to do something that is very hard to do with DinkC. Instead, I think, it's wise to start, trying as a goal, to get as far as other people with his (her) first DMod. For example, I believe "Isle of Croth" is the first DMod of S. Klaebe, and you see, is a very good DMod, and I don't know, but does not look that it has complicated scripts.
And there are others DMods that are short and focused on its story, like Cycles of Evil, and the recent one The Basilisk Smile. They are not much complicated on its scripts, because they are focused on the story, like already said (Well, Cycles of Evil HAS complicated scripts, I believe).
So, I think you will be very frustrated if you start doing complicated things. I think you can even get frustrated with DinkC by doing things that appear easy to do .
And there are others DMods that are short and focused on its story, like Cycles of Evil, and the recent one The Basilisk Smile. They are not much complicated on its scripts, because they are focused on the story, like already said (Well, Cycles of Evil HAS complicated scripts, I believe).
So, I think you will be very frustrated if you start doing complicated things. I think you can even get frustrated with DinkC by doing things that appear easy to do .
Don't be afraid of challenging yourself. But then, what would I know...
Thanks for all the great help and advice everyone! I got a couple more questions with scripting that I got stuck at if you don't mind...:
playmidi("MIDI.mid");
int &milder = create_sprite(180, 174, 6, 403, 8);
sp_base_walk(&milder, 400);
sp_speed(&milder, 1);
move_stop(&milder, 6, 230, 1);
say_stop("TEXT", &Milder);
wait(2000);
say_stop("TEXT", &Milder);
sp_brain(&milder, 0); //10th line
wait(700);
sp_pseq(&milder, 403);
sp_pframe(&milder, 3); sp_x(&milder, 230); sp_y(&milder, 181);
wait(1000);
First of all, on the tenth line where I change the brain, does the Dink Engine take a while to realize I changed it or does the current sequence have to be completed before the sprite "freezes"? I have been having trouble between switching the brain off (to zero) and then "jumping" the sprite to a new seq, frame, x and y coordinate because the sprite still moves for less than a second after I turn it's brain off. So essentially, I want the sprite to walk in place, then freeze up and stay frozen while being moved around.
I attempted to correct this problem by adding in the "wait(700);", but there has got to be a more effective way because sometimes the "wait(700);" is too long so the sprite has already stopped moving before it "jumps" and other times it's just the opposite.
Also, everytime I use "sp_pseq(&XXX, XXX);" and "sp_pframe(&XXX, XXX);" do I need to state "sp_x(&XXX, XXX);" and "sp_y(&XXX, XXX);" in order to get the sprite to display?
And finally... what is "preload_seq(XXX);" and how does it work? I noticed it was in the dink source at the top of many scripts. Would I be able to use it here?
Thanks so much again for all your help!!
playmidi("MIDI.mid");
int &milder = create_sprite(180, 174, 6, 403, 8);
sp_base_walk(&milder, 400);
sp_speed(&milder, 1);
move_stop(&milder, 6, 230, 1);
say_stop("TEXT", &Milder);
wait(2000);
say_stop("TEXT", &Milder);
sp_brain(&milder, 0); //10th line
wait(700);
sp_pseq(&milder, 403);
sp_pframe(&milder, 3); sp_x(&milder, 230); sp_y(&milder, 181);
wait(1000);
First of all, on the tenth line where I change the brain, does the Dink Engine take a while to realize I changed it or does the current sequence have to be completed before the sprite "freezes"? I have been having trouble between switching the brain off (to zero) and then "jumping" the sprite to a new seq, frame, x and y coordinate because the sprite still moves for less than a second after I turn it's brain off. So essentially, I want the sprite to walk in place, then freeze up and stay frozen while being moved around.
I attempted to correct this problem by adding in the "wait(700);", but there has got to be a more effective way because sometimes the "wait(700);" is too long so the sprite has already stopped moving before it "jumps" and other times it's just the opposite.
Also, everytime I use "sp_pseq(&XXX, XXX);" and "sp_pframe(&XXX, XXX);" do I need to state "sp_x(&XXX, XXX);" and "sp_y(&XXX, XXX);" in order to get the sprite to display?
And finally... what is "preload_seq(XXX);" and how does it work? I noticed it was in the dink source at the top of many scripts. Would I be able to use it here?
Thanks so much again for all your help!!
So essentially, I want the sprite to walk in place, then freeze up and stay frozen while being moved around.
You might want to try sp_picfreeze(&milder, 1) instead of changing Milder's brain. However, I'm not sure if sp_picfreeze works with brain 6.
Also, everytime I use "sp_pseq(&XXX, XXX);" and "sp_pframe(&XXX, XXX);" do I need to state "sp_x(&XXX, XXX);" and "sp_y(&XXX, XXX);" in order to get the sprite to display?
No.
And finally... what is "preload_seq(XXX);" and how does it work?
preload_seq is used to make sure that sequences are loaded into memory before they're used. The only benefit is the game might pause for a little bit while it loads the sequences for a monster the first time it starts walking in a direction it hasn't walked in before.
You might want to try sp_picfreeze(&milder, 1) instead of changing Milder's brain. However, I'm not sure if sp_picfreeze works with brain 6.
Also, everytime I use "sp_pseq(&XXX, XXX);" and "sp_pframe(&XXX, XXX);" do I need to state "sp_x(&XXX, XXX);" and "sp_y(&XXX, XXX);" in order to get the sprite to display?
No.
And finally... what is "preload_seq(XXX);" and how does it work?
preload_seq is used to make sure that sequences are loaded into memory before they're used. The only benefit is the game might pause for a little bit while it loads the sequences for a monster the first time it starts walking in a direction it hasn't walked in before.