The Dink Network

finding the scroll

August 4th 2006, 03:05 PM
milder.gif
I am using this script:

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

}

void touch( void )
{
int &junk = free_items();

if (&junk < 1)
{
say("I'm full! I can't pick up anything else.", 1);
return;
}

add_item("item-nut",469, 7);


{
say("I have the scroll.",1);
&story = 27;
sp_active(&current_sprite, 0);
kill_this_task();

}

But it always come back. What am I doing wrong? It is not supposed to come back. I can't find the bug.

Please help??????????????????????????????????????????????????
August 4th 2006, 03:18 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
Ah, this is where using sp_editor_num() and editor_type comes into play. I've edited the touch function to show you what would be inserted.

void touch( void )
{
int &junk = free_items();

if (&junk < 1)
{
say("I'm full! I can't pick up anything else.", 1);
return;
}

add_item("item-nut",469, 7);

say("I have the scroll.",1);
&story = 27;

int &hold = sp_editor_num(&current_sprite);
editor_type(&hold, 1);
//kill scroll forever

}
August 4th 2006, 04:43 PM
milder.gif
No that isn't working.

Help me fellows!!

August 4th 2006, 05:09 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
{
say("I have the scroll.",1);
&story = 27;
sp_active(&current_sprite, 0);
kill_this_task();
}

Umm... There's no if statement above it, so you can leave the {}'s away... You're messing up the braces again!
August 4th 2006, 05:28 PM
milder.gif
Nope, that isn't the problem. The scroll is still turning back.

August 5th 2006, 12:04 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
That script is attached to a sprite in Dinkedit or WinDinkedit, right? If so, Striker's solution should work... although perhaps the script is being a tad bit annoying because of touch damage issues. Hrm. Try this:

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

void touch( void )
{
// Make it so the touch procedure is not run over-and-over
sp_touch_damage(&current_sprite, 0);

int &junk = free_items();
if (&junk < 1)
{
say("I'm full! I can't pick up anything else.", 1);
// Allow Dink to touch the sprite again in a couple seconds
wait(2000);
sp_touch_damage(&current_sprite, -1);
return;
}

add_item("item-nut", 469, 7);

say("I have the scroll.", 1);
&story = 27;

int &hold = sp_editor_num(&current_sprite);
editor_type(&hold, 1);

sp_active(&current_sprite, 0);
}