The Dink Network

Nuttree

July 24th 2006, 03:43 PM
milder.gif
THis is what I want. Dink can only get a nut from the nuttree when &story = 9. He only get's one. (He is needing it to cure someone.)
And when he picked up one nut the boss script is going to run script name s10-gobboss. So how can I manage that this are the scripts I use.

============================================================
First the nuttree:

void main( void )
{
int &crap;

}

void talk( void )
{
say_stop("Hey, I found the Nuttree.", 1);
wait(250);
}

void hit( void )
{
&crap = scripts_used();
if (&crap > 170)
{
//don't make any more nuts, there are 165 already on the screen..)
return;
}

//lets make the nut fall down and give it a nut script
&crap = create_sprite( 158, 226, 0, 421, 23);
sp_speed(&crap, 1);
move_stop(&crap, 2, 226, 1)
sp_script(&crap, "s1-nut");
}

=================================================================
Now the S1-nut 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",438, 19);

if (&nuttree < 1)
{
&nuttree = 1;
}

say("I picked up a nut!",1);
sp_active(&current_sprite, 0);

}

=============================================================
And last the s10-gobboss script;

//first meeting with the gobboss

void main ( void )
{
int &gob = create_sprite(436, 148, 16, 801, 1);
sp_base_walk(&gob, 800);
sp_speed(&gob, 1);
freeze(1);
freeze(&gob);
wait(100);
move_stop(&gob, 2, 356, 1);
freeze(&gob);
wait(100);
say_stop_npc("`0Who is taking my nuts.", &gob);
wait(100);
&story = 10;
say_stop_npc("`0Oh, its you. Dinkytoy. You are gonna die.", &gob);
wait(100);

//Battle starts
sp_script(&gob, "en-gobboss");
unfreeze(1);
unfreeze(&gob);

}
}

The reason I ask this is that I have to make sure that Dink has one nut in his items pack when he meets the headwizard. Or is there another way to make sure he has the nut?

Please help I am really really stuck now. THis is the most important point of the first world in my dmod.

July 24th 2006, 03:57 PM
knightg.gif
cypry
Peasant He/Him Romania
Chop your own wood, and it will warm you twice. 
Use
if(&boss == 0)
{
external("s10-gobboss","main");
&boss = 1;
}
right under add_item("item-nut",438, 19); Also make sure &boss is a global var.
One more thing: "s10-gobboss" is too long for a scriptname. I think it should have maximum 8 or 9 chars.
Edit: If you don't want more nuts to fall from the tree after the boss appeared, you should use
if(&boss == 1)
{
return
}

in the hit procedure of the nut tree.
July 24th 2006, 04:34 PM
milder.gif
Now I have the next problem.

================================
The nuttree

void main( void )
{
int &crap;

}

void talk( void )
{
say_stop("Hey, I found the Nuttree.", 1);
wait(250);
}

void hit( void )
{
&crap = scripts_used();
if (&crap > 170)
{
//don't make any more nuts, there are 165 already on the screen..)
return;
}
if(&boss == 1)
{
return
}

//lets make the nut fall down and give it a nut script
&crap = create_sprite( 158, 226, 0, 421, 23);
sp_speed(&crap, 1);
move_stop(&crap, 2, 226, 1)
sp_script(&crap, "s1-nut");
}

=======================================
s1-nut

void main( void )
{
int &boss;
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",438, 19);

if(&boss == 0)
{
external("s10-gobboss","main");
&boss = 1;
}


say("I picked up a nut!",1);
sp_active(&current_sprite, 0);

}
========================

Now when I hit the nuttree and the nut falls and I want to pick the nut It says "I'm full! I can't pick up anything else." and my items pack is full of nuts. And the boss script is starting and I get a lot of bosses in the screen instead of one. And when I killed them I still can pick a nut.

ANd for Also make sure &boss is a global var. Do you mean the &boss I put in the S1-nut file or does it have to be in another file??????????????????????????????????????????????????????????????????????????????????????

Please help

July 24th 2006, 09:31 PM
goblinm.gif
Put the line sp_touch_damage(&current_sprite, 0) at the beginning of the nuts touch procedure.