The Dink Network

Re: Buttons

September 10th 2007, 03:11 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
I was wondering what decided what hapens when you press buttons like ctrl and the arrow keys. Is it done by scripts called button 1-2-3 etc.? If so what do those scripts contain and where could I find them. If It's something else please let me know.
September 10th 2007, 03:21 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
If you click on a button in the main screen (or use ctrl), it'll start a special script. I think they were start-1 for the start button, start-2 for the load button and start-3 for the exit button.

I think these scripts are spawned once you press one of the button sprites, but I could be wrong there. In any case, they launch these scripts somehow.
September 10th 2007, 03:23 PM
dinkdead.gif
They're probably wired into the engine and not editable by scripts, although there is one for the escape key (escape.c).
September 10th 2007, 05:04 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
Oh, I see I misinterpreted, sorry. I'm not sure if this would work, but you could disable standard movement somehow and make the player move whenever you press a key.

I don't think the Dink engine is capable to do this?
September 11th 2007, 02:11 AM
duckdie.gif
Oh, I see I misinterpreted, sorry. I'm not sure if this would work, but you could disable standard movement somehow and make the player move whenever you press a key.

I don't think the Dink engine is capable to do this?


Yes, it's possible, to an extent. It has been done before, in fact.

There is a way to edit what the "wired" keys (ctrl, enter, spacebar, shift, and so on) do using wait_for_button scripts, but if you're planning on doing some thorough editing, you might be better off editing the Dink engine since wait_for_button scripts can't do everything.
September 13th 2007, 12:09 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Mostly I'm trying to control a different sprite than Dink while still being able to control Dink. I would really like to know if there's a way to script this.
September 13th 2007, 01:38 PM
duckdie.gif
Ouch. That depends. What do you mean by "control"? You might be able to get it to do various things, but if you want to, say, have two player characters at the same time, I don't think you'll be able to do it without editing the engine.
September 13th 2007, 04:25 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
I'm not really sure if this is what you are looking for, but.....

Create the sprite you want to control while still controlling Dink. Set it's base_walk, give it a brain of 1, and then when you go onto the screen that sprite is on, the sprite should move with you. Oh, and set the speed.
September 14th 2007, 03:16 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
That's a good idea. You could make a two player game. Is there any script that controls Dink completely? If there is, then you could just copy & paste everything in here to another script, edit which buttons do which, (e.g. change up, down, left, right, to A, D, W, S) and you'd have a two player game.

Though it might be kinda hard to work out the screen scroll system, unless you've only got one screen.
September 14th 2007, 04:40 AM
duckdie.gif
No, no, no. Making a real time (not turn-based) two player game where you would fully control Dink and another sprite at the same time sounds pretty impossible to me with the current version of Dink.

If you give a sprite a brain of 1, all it will do is emulate Dink somewhat.
September 14th 2007, 04:52 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
But, is there a certain script which controls the Dink brain?
September 14th 2007, 05:02 AM
duckdie.gif
No. Not unless your definition of "a script" is the Dink engine source code.
September 15th 2007, 06:24 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
I was afraid you'd say that. There are other ways to move other sprites I'll see if I can figure out a decent way.

BTW: Thanks for telling me.