finding the scroll
I am using this script:
void main( void )
{
sp_touch_damage(¤t_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(¤t_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??????????????????????????????????????????????????
void main( void )
{
sp_touch_damage(¤t_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(¤t_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??????????????????????????????????????????????????
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(¤t_sprite);
editor_type(&hold, 1);
//kill scroll forever
}
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(¤t_sprite);
editor_type(&hold, 1);
//kill scroll forever
}
{
say("I have the scroll.",1);
&story = 27;
sp_active(¤t_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!
say("I have the scroll.",1);
&story = 27;
sp_active(¤t_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!
Nope, that isn't the problem. The scroll is still turning back.
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(¤t_sprite, -1);
}
void touch( void )
{
// Make it so the touch procedure is not run over-and-over
sp_touch_damage(¤t_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(¤t_sprite, -1);
return;
}
add_item("item-nut", 469, 7);
say("I have the scroll.", 1);
&story = 27;
int &hold = sp_editor_num(¤t_sprite);
editor_type(&hold, 1);
sp_active(¤t_sprite, 0);
}
void main( void )
{
sp_touch_damage(¤t_sprite, -1);
}
void touch( void )
{
// Make it so the touch procedure is not run over-and-over
sp_touch_damage(¤t_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(¤t_sprite, -1);
return;
}
add_item("item-nut", 469, 7);
say("I have the scroll.", 1);
&story = 27;
int &hold = sp_editor_num(¤t_sprite);
editor_type(&hold, 1);
sp_active(¤t_sprite, 0);
}










