Pushing
I have a puzzle where a lot of pushing is required. I would like it if the player could hold down an arrow key and push a rock a longer distance. The puzzle requires it to be pushed in steps however, so it shouldn't be as complex as it might sound.
What currently happens when I hold the arrow key, is that Dink starts pushing and the rock moves. This is good. However, Dink continues pushing after the rock has arrived at its position. I want Dink to start walking again, so he will continue pushing when he reaches the rock again. What would be the cleanest way to do this?
What currently happens when I hold the arrow key, is that Dink starts pushing and the rock moves. This is good. However, Dink continues pushing after the rock has arrived at its position. I want Dink to start walking again, so he will continue pushing when he reaches the rock again. What would be the cleanest way to do this?
Yes, it does indeed. Now the question is: what does this file do, that I don't do? I can't see any difference that would have any effect... Somehow it makes Dink stop pushing during the movement of the rock, but I don't see the script do anything to Dink at all. If I copy the way it handles hardness (even though I don't need it), that doesn't help either. Very strange...
Oh hey. If I had known about that file it might have saved me a week of headaches getting my puzzles to work right.
Looks like there has to be a sufficiently long wait between freeze and unfreeze. Just as I predicted! (...)
The push animation has to have enough time to play through, or something along those lines. wait(900) is enough for me, and changing Dink's sp_frame_delay() changes the time required.
The push animation has to have enough time to play through, or something along those lines. wait(900) is enough for me, and changing Dink's sp_frame_delay() changes the time required.
Thanks Scratcher, that means using sp_seq to replace the sequence should also work, and indeed it does.
Which brings me to the next problem: is there a way to make the delay between "walking into an object" and "pushing the object" shorter?
Which brings me to the next problem: is there a way to make the delay between "walking into an object" and "pushing the object" shorter?
I'm afraid not. 600 ticks is what it takes. See also dink.cpp line 3036 and further:
The run_through_tag_list_push(h) triggers the "push" procedure in DinkC-land.
if (play.push_active) if (play.push_timer + 600 < thisTickCount) { // stuff like setting sequence and such run_through_tag_list_push(h); return; }
The run_through_tag_list_push(h) triggers the "push" procedure in DinkC-land.
You COULD fake a push as soon as Dink runs into something using a touch procedure. You could make it act just like a regular push.
600 ticks is what it takes.
Too bad.
You COULD fake a push as soon as Dink runs into something using a touch procedure.
Yes, I thought of that, but I don't want it to be that short. I suppose I could do some delaying as well, but the puzzle is complex enough as it is. The players (yes, that's you ) will have to be patient.
Too bad.
You COULD fake a push as soon as Dink runs into something using a touch procedure.
Yes, I thought of that, but I don't want it to be that short. I suppose I could do some delaying as well, but the puzzle is complex enough as it is. The players (yes, that's you ) will have to be patient.