The Official Dinker Question Thread
October 19th 2006, 02:33 AM

Dinker


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(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);
}
void touch( void )
{
&life += 3;
if (&life > &lifemax)
{
&life = &lifemax;
}
Playsound(10,22050,0,0,0);
sp_brain_parm(¤t_sprite, 10);
say("Arwen! This is delicious!",1);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
}
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(¤t_sprite, -1);
sp_nohit(¤t_sprite, 1);
}
void touch( void )
{
&life += 3;
if (&life > &lifemax)
{
&life = &lifemax;
}
Playsound(10,22050,0,0,0);
sp_brain_parm(¤t_sprite, 10);
say("Arwen! This is delicious!",1);
sp_brain(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_sprite, 0);
}
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.
Maybe your script name is too long? (I seem to remember having a problem like that)
No it's not that I tried it out with a long name to make sure.
October 19th 2006, 02:27 PM

Dinker


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);
)
(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

Dinker


Well, I had to tinker with the depth dot and it's hardness box, but it works.
October 19th 2006, 05:35 PM

Dinker


2) How do I change the sound a staircase makes from a door opening to footsteps when you touch it?
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

Dinker


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

Dinker


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(¤t_sprite, 280);
// Give it a speed so it actually moves around.
sp_speed(¤t_sprite, 1);
// Use the smart person brain so the character walks
around intelligently.
sp_brain(¤t_sprite, 16);
}
{
say_stop("`4ATTENTION!", ¤t_sprite);
say_stop("`4The Baron Smallwood approaches!!",
¤t_sprite);
wait(200)
say("Good morrow, good citizens!", 1);
}
void talk(void)
{
say("Good day, Sir knight!", 1);
wait(1000);
say("`4Good day, sire!", ¤t_sprite);
say("`4I'm just keeping an eye on these nobles.", ¤t_sprite);
say("`4Can never be too careful. <SALUTE>",
¤t_sprite);
}
}
void hit(void)
{
say_stop("`4Sorry my lord, I didn't", ¤t_sprite);
say_stop("`4feel that through my armour.",
¤t_sprite);
}
void main(void)
{
// Take whatever sequence you had and round it down
by 10. 351 = 350, 383 = 380.
sp_base_walk(¤t_sprite, 280);
// Give it a speed so it actually moves around.
sp_speed(¤t_sprite, 1);
// Use the smart person brain so the character walks
around intelligently.
sp_brain(¤t_sprite, 16);
}
{
say_stop("`4ATTENTION!", ¤t_sprite);
say_stop("`4The Baron Smallwood approaches!!",
¤t_sprite);
wait(200)
say("Good morrow, good citizens!", 1);
}
void talk(void)
{
say("Good day, Sir knight!", 1);
wait(1000);
say("`4Good day, sire!", ¤t_sprite);
say("`4I'm just keeping an eye on these nobles.", ¤t_sprite);
say("`4Can never be too careful. <SALUTE>",
¤t_sprite);
}
}
void hit(void)
{
say_stop("`4Sorry my lord, I didn't", ¤t_sprite);
say_stop("`4feel that through my armour.",
¤t_sprite);
}
I just rechecked the game and the NPC does NOT announce my arrival. I confused him with another NPC.
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(¤t_sprite, 280);
// Give it a speed so it actually moves around.
sp_speed(¤t_sprite, 1);
// Use the smart person brain so the character walks
//around intelligently.
sp_brain(¤t_sprite, 16);
say_stop("`4ATTENTION!", ¤t_sprite);
say_stop("`4The Baron Smallwood approaches!!",¤tt_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!", ¤t_sprite);
say_stop("`4I'm just keeping an eye on these nobles.", ¤t_sprite);
say("`4Can never be too careful. <SALUTE>", ¤t_sprite);
}
void hit(void)
{
say_stop("`4Sorry my lord, I didn't", ¤t_sprite);
say_stop("`4feel that through my armour.", ¤t_sprite);
}
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(¤t_sprite, 280);
// Give it a speed so it actually moves around.
sp_speed(¤t_sprite, 1);
// Use the smart person brain so the character walks
//around intelligently.
sp_brain(¤t_sprite, 16);
say_stop("`4ATTENTION!", ¤t_sprite);
say_stop("`4The Baron Smallwood approaches!!",¤tt_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!", ¤t_sprite);
say_stop("`4I'm just keeping an eye on these nobles.", ¤t_sprite);
say("`4Can never be too careful. <SALUTE>", ¤t_sprite);
}
void hit(void)
{
say_stop("`4Sorry my lord, I didn't", ¤t_sprite);
say_stop("`4feel that through my armour.", ¤t_sprite);
}