The Dink Network

Script problem.

April 2nd 2006, 08:54 AM
fairy.gif
Glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
void main( void )
{
int &wiz = create_sprite(470, 200, 9, 581, 1);
sp_speed(&wiz, 1);
sp_base_walk(&wiz, 580);
sp_touch_damage(&wiz, 1);
sp_hitpoints(&wiz, 135);
sp_dir(1, 6);
freeze(1);
freeze(&wiz);
say_stop("I'm going to get all the food you have stolen from me back.", 1);
say_stop("`7Bite me", &wiz);
//and then the batle begins
unfreeze(1);
unfreeze(&wiz);

if (random(2,1) == 1)
{
sp_target(&current_sprite, 1);
}


void talk( void )
{
say("`7DIE...", &wiz);
}

void hit( void )
{
sp_target(&current_sprite, &enemy_sprite);

}

void die( void )
{
spawn("bossdie");
}
}

When the boss die won't bossdie.c load. Anyone here who knows why?
April 2nd 2006, 10:37 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
You seem to have made subvoids?

Close void main first before starting other voids like talk, die etcetera.
April 2nd 2006, 10:44 AM
fairy.gif
Glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
I tried that, buy noooh
April 2nd 2006, 11:06 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
In main, you're creating a new sprite (&wiz). This sprite seems to be the one attacking Dink. This sprite does not have a script attached to it, so nothing happens when it dies.
April 2nd 2006, 11:09 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Is &wiz the boss? Because bossdie.c only spawns when &current_sprite dies. Nothing happens if &wiz dies, because &wiz doesn't have a script.

Make a new script with this (I'll call it boss.c):

void talk( void )
{
say("`7DIE...", &current_sprite);
}

void hit( void )
{
sp_target(&current_sprite, &enemy_sprite);

}

void die( void )
{
spawn("bossdie");
}

And before "//and then the batle begins", add
sp_script(&wiz, "boss");

Next up: Change

if (random(2,1) == 1)
{
sp_target(&current_sprite, 1);
}

to

if (random(2,1) == 1)
{
sp_target(&wiz, 1);
}
}

and remove

void talk( void )
{
say("`7DIE...", &wiz);
}

void hit( void )
{
sp_target(&current_sprite, &enemy_sprite);

}

void die( void )
{
spawn("bossdie");
}
}

From this script.