The Dink Network

The Official Dinker Question Thread

October 19th 2006, 02:33 AM
anon.gif
Dinker
Ghost They/Them
 
I made this so I won't clutter up the entire forum with all my questions. Anyway, question #1:

I'm trying to create a pie that heals some health and set it on a table. I also want the pie to respawn every time I enter that particular room even if I had previously eaten it. In DinkEdit, I have it tied to script homemadepie. It ain't working

homemadepie.c:

Here's the code:

void main( )
{
sp_touch_damage(&current_sprite, -1);
sp_nohit(&current_sprite, 1);

}

void touch( void )
{
&life += 3;
if (&life > &lifemax)
{
&life = &lifemax;
}
Playsound(10,22050,0,0,0);
sp_brain_parm(&current_sprite, 10);
say("Arwen! This is delicious!",1);
sp_brain(&current_sprite, 12);
sp_touch_damage(&current_sprite, 0);
sp_timing(&current_sprite, 0);

}
October 19th 2006, 05:50 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
There's noting wrong with your script. Maybe it's a hardness problem. You see the hardness of the pie is verry small and so it's possible that the hardness of the table goes over the hardness of the pie. Just remove the pie from the table and try again.
October 19th 2006, 08:59 AM
pq_water.gif
Maybe your script name is too long? (I seem to remember having a problem like that)
October 19th 2006, 11:14 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
No it's not that I tried it out with a long name to make sure.
October 19th 2006, 02:27 PM
anon.gif
Dinker
Ghost They/Them
 
Thank you, Erwin. I'll try that as soon as I can.

(hmm, maybe I should change say("Arwen! This is delicious!",1); to say("Erwin! You are a genius!",1); )
October 19th 2006, 02:44 PM
anon.gif
Dinker
Ghost They/Them
 
Well, I had to tinker with the depth dot and it's hardness box, but it works.
October 19th 2006, 05:35 PM
anon.gif
Dinker
Ghost They/Them
 
2) How do I change the sound a staircase makes from a door opening to footsteps when you touch it?
October 19th 2006, 09:14 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
In dinkedit, select the stairs and press shift-7. This will bring up the sprite's sound. Set this number to 39 (the stairs wav).
October 19th 2006, 11:21 PM
anon.gif
Dinker
Ghost They/Them
 
I'll do it, but I just assumed it would continue to play that sound while you're in the room whether you touched it or not. But I'm no expert at this, obviously. Thanks.
October 20th 2006, 12:27 AM
anon.gif
Dinker
Ghost They/Them
 
Indeed it worked, but I'm having a problem with an NPC. The scene is, Dink has acquired the title of Baron from the king for his deeds in the original game, so inside Dink's castle is a guard who announces his arrival into a room full of nobles. He walks around just fine, he announces the arrival perfectly, but I can't talk to him or have the void hit(void) activate. Here's the script:

void main(void)

{

// Take whatever sequence you had and round it down

by 10. 351 = 350, 383 = 380.

sp_base_walk(&current_sprite, 280);



// Give it a speed so it actually moves around.

sp_speed(&current_sprite, 1);



// Use the smart person brain so the character walks

around intelligently.

sp_brain(&current_sprite, 16);

}

{

say_stop("`4ATTENTION!", &current_sprite);
say_stop("`4The Baron Smallwood approaches!!",

&current_sprite);
wait(200)
say("Good morrow, good citizens!", 1);

}

void talk(void)
{
say("Good day, Sir knight!", 1);
wait(1000);
say("`4Good day, sire!", &current_sprite);
say("`4I'm just keeping an eye on these nobles.", &current_sprite);
say("`4Can never be too careful. <SALUTE>",

&current_sprite);
}

}

void hit(void)
{
say_stop("`4Sorry my lord, I didn't", &current_sprite);
say_stop("`4feel that through my armour.",

&current_sprite);

}
October 20th 2006, 12:48 AM
duckdie.gif
I just rechecked the game and the NPC does NOT announce my arrival. I confused him with another NPC.
October 20th 2006, 10:46 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Check your brackets, you closed the main procedure before you wanted to do so. You seem to have closed main, but opened another set of brackets. Also a problem in your talk procedure, you should use say_stop instead of say and there is an extra bracket there as well.

Add:
Perhaps this is what you wanted? I've fixed the mistakes I mentioned as well as an instance where you forgot a ';' after a wait command. If it still doesn't work, make sure the script name isn't terribly long and is attatched to your sprite. It should indeed work.

void main(void)
{

// Take whatever sequence you had and round it down
//by 10. 351 = 350, 383 = 380.
sp_base_walk(&current_sprite, 280);

// Give it a speed so it actually moves around.
sp_speed(&current_sprite, 1);

// Use the smart person brain so the character walks
//around intelligently.
sp_brain(&current_sprite, 16);

say_stop("`4ATTENTION!", &current_sprite);
say_stop("`4The Baron Smallwood approaches!!",&currentt_sprite);
wait(200);
say("Good morrow, good citizens!", 1);

}

void talk(void)
{

say_stop("Good day, Sir knight!", 1);
wait(1000);
say_stop("`4Good day, sire!", &current_sprite);
say_stop("`4I'm just keeping an eye on these nobles.", &current_sprite);
say("`4Can never be too careful. <SALUTE>", &current_sprite);

}

void hit(void)
{

say_stop("`4Sorry my lord, I didn't", &current_sprite);
say_stop("`4feel that through my armour.", &current_sprite);

}