Playing sequences for Dink
void main(void) { int &dinkx; } void touch(void) { sp_touch_damage(¤t_sprite, 0); freeze(1); sp_base_walk(1, -1); sp_pseq(1, 996); sp_pframe(1, 1); &dinkx = sp_x(1, -1); &dinkx += 24; move_stop(1, 6, &dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 2); &dinkx += 24; move_stop(1, 6, dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 3); &dinkx += 24; move_stop(1, 6, dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 4); &dinkx += 24; move_stop(1, 6, &dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 5); &dinkx += 24; move_stop(1, 6, &dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 6); &dinkx += 24; move_stop(1, 6, &dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 7); &dinkx += 24; move_stop(1, 6, &dinkx, 1); sp_pseq(1, 996); sp_pframe(1, 8); &dinkx += 24; move_stop(1, 6, &dinkx, 1); wait(1); sp_base_walk(1, 70); unfreeze(1); sp_touch_damage(¤t_sprite, -1); }
Why doesn't this work properly? When I touch the object, it doesn't start playing sequence 996 until it finishes playing Dink's walking animation, which makes it look really weird.
I tried using sp_seq(1, 996);, but then it finishes playing the animation before Dink's finished moving 190 pixels. So I've tried doing it manually like this, but now it waits until the walking animation finishes before he starts playing seq 996. It's weird though, because he starts moving straight away.

Also, on a different subject, why doesn't sp_flying(1, 1); work? I use sp_flying(1, 1); then use move_stop(1, 6, 300, 0); but he still gets stuck on the blue hardness. What's up with that?
(I know that question has nothing to do with the first one, but I feel like my questions spam the forums enough as it is

March 21st 2011, 12:10 PM

Sparrowghost


"I use sp_flying(1, 1); then use move_stop(1, 6, 300, 0); but he still gets stuck on the blue hardness"
I don't know (and can't test cos I'm sneakily answering this in college, and can't answer the first one either for the same reason
) but why not just do move_stop(1, 6, 300, 1); instead?
I don't know (and can't test cos I'm sneakily answering this in college, and can't answer the first one either for the same reason

Partly because I've simplified it. Essentially, Dink has an item. If he uses this item, he moves about 150 pixels in whichever direction he's facing. Instead of just teleporting him to that location, I want him to move/walk/whatever there. But I want him to be able to move through blue hardness only. If you stick a 1 at the end of a move(); or move_stop(); then that lets him move through all hardness types I think.
I also tried doing this by making a missile that looked like Dink and using that, but the problem with that is that you can't use freeze(); or move_stop(); on missiles.
I also tried doing this by making a missile that looked like Dink and using that, but the problem with that is that you can't use freeze(); or move_stop(); on missiles.
If you're trying to disable Dink's walking animation, use sp_base_walk(1,0) instead of sp_base_walk(1,-1). -1 just gets the value of base walk, it doesn't change it.
As for sp_flying(1,1), I would guess that it doesn't work in conjuction with move()... The latter command is probably ignoring/overriding sp_flying().
As for sp_flying(1,1), I would guess that it doesn't work in conjuction with move()... The latter command is probably ignoring/overriding sp_flying().
Ok, thanks scratch, I'll test it out... I was using -1 because I read somewhere (might of been DinkC reference?) that that was how you disable it. And if move(); does override sp_flying(); then I guess I'll just leave that bit out... That was kinda for aesthetics, but I can probably get by without it
EDIT: Nah, setting the base_walk to 0 didn't work. It made it so that Dink kept switching between 996 and his walking animation.
EDIT: Nah, setting the base_walk to 0 didn't work. It made it so that Dink kept switching between 996 and his walking animation.
That's my bad, -1 seems to work just as well in this case... stupid DinkC.
It occurs to me that you've not disabled Dink's sp_base_idle(), although I've no idea how that could cause it to alternate between 996 and Dink's WALKING animation.
Also, try adding a sp_seq(1,0) before using sp_pseq(1,996) for the first time. If Dink is currently playing through a sequence (like walking around), switching straight to sp_pseq() usually doesn't work.
It occurs to me that you've not disabled Dink's sp_base_idle(), although I've no idea how that could cause it to alternate between 996 and Dink's WALKING animation.

Also, try adding a sp_seq(1,0) before using sp_pseq(1,996) for the first time. If Dink is currently playing through a sequence (like walking around), switching straight to sp_pseq() usually doesn't work.
Yup, seems to have got it working how I intended... Thank you!
No more walking animationatronix getting in the way any more

