The Dink Network

need help with my script

May 26th 2005, 09:34 AM
burntree.gif
EEs
Peasant They/Them
 
Im tring to do a script. Its my first ever! 'cause its my first one I dont know whats wrong? Here it is:
// the tree

void hit( void )
{
&tree = 1;
say_stop("`4Ouch!", current_sprite);

}
void talk ( void )
{
if (&tree == 1)
{
freeze(1);
playmidi("1.mid");
say_stop("That is a nice tree.", 1);
wait(500);
say_stop("`4Thank you, human.", &current_sprite);
&tree = 2;
unfreeze(1);
}
}
void talk(void)
{
if (&tree == 2)
{
freeze(1);
say_stop("Yepp, this is a nice tree.", 1);
wait(500);
say_stop("`4I already know that.", &current_sprite);
&tree = 3;
unfreeze(1);
}
}
void talk(void)
{
if (&tree == 3)
{
freeze(1);
say("This is a very very very VERY nice tree.", 1);
wait(500);
say("`4Whats wrong with you?.", &current_sprite);
&tree = 4;
unfreeze(1);
}
}
void talk(void)
{
if (&tree == 4)
{
freeze(1);
say_stop("Nothing at all.", 1);
wait(500);
say_stop("`4Go and burn yourself.", &current_sprite);
&tree = 5;
unfreeze(1);
}
}
}
void talk(void)
{
if (&tree == 4)
{
say_stop("...", 1);
}
May 26th 2005, 09:47 AM
fairy.gif
Glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
You can't have 4 void talk(void)
May 26th 2005, 09:48 AM
burntree.gif
EEs
Peasant They/Them
 
how to fix?
May 26th 2005, 09:50 AM
fairy.gif
Glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Try this.

void hit( void )
{
&tree = 1;
say_stop("`4Ouch!", current_sprite);
}

void talk ( void )
{

if (&tree == 1)
{
freeze(1);
playmidi("1.mid");
say_stop("That is a nice tree.", 1);
wait(500);
say_stop("`4Thank you, human.", &current_sprite);
&tree = 2;
unfreeze(1);
}

if (&tree == 2)
{
freeze(1);
say_stop("Yepp, this is a nice tree.", 1);
wait(500);
say_stop("`4I already know that.", &current_sprite);
&tree = 3;
unfreeze(1);
}

if (&tree == 3)
{
freeze(1);
say("This is a very very very VERY nice tree.", 1);
wait(500);
say("`4Whats wrong with you?.", &current_sprite);
&tree = 4;
unfreeze(1);
}

if (&tree == 4)
{
freeze(1);
say_stop("Nothing at all.", 1);
wait(500);
say_stop("`4Go and burn yourself.", &current_sprite);
&tree = 5;
unfreeze(1);

}

if (&tree == 4)
{
say_stop("...", 1);
}
}
May 26th 2005, 09:54 AM
burntree.gif
EEs
Peasant They/Them
 
thanks but it doesent work. if hir it nothing happends. If use it nothing happends... and the status bar isent uptating before selectiong a weapon.
May 26th 2005, 10:06 AM
spike.gif
you need to make a global called &tree in main.c

after that do what glenn said, except reverse it so that if (&tree == 4) is first and if (&tree == 1) is last.
May 26th 2005, 10:15 AM
spike.gif
If use it nothing happends... and the status bar isent uptating before selectiong a weapon.

Don't use that innocent tree. you need to do

&update_status = 1;
draw_status();

to get the status bar behave.
May 26th 2005, 01:59 PM
goblins.gif
igloo15
Peasant He/Him
 
make sure you attached the script to the tree and also I believe its &current_sprite not current_sprite.