Need help, DinkC
Hello all! Can someone tell my what I've done wrong with this script? I don't see it
//Boss 1 in cave.
void main(void)
{
if (&story == 0)
{
freeze(1);
int &boss1 = create_sprite(330, 257, 16, 587, 1);
sp_base_walk(&boss1, 580);
sp_speed(&boss1, 2);
freeze(&boss1);
Wait(200);
say_stop("Hello there! Are you a wizard?",1);
Wait(500);
say_stop("`3Yes, and get out of my cave!",&boss1);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?",1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!",&boss1);
Wait(1000);
say_stop("Well, thats TODAY!",1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(&boss1);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(&boss1, 9);
sp_exp(&boss1, 200);
sp_touch_damage(&boss1, 1);
sp_hitpoints(&boss1, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(&boss1, 1);
}
}
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
Thanks!

//Boss 1 in cave.
void main(void)
{
if (&story == 0)
{
freeze(1);
int &boss1 = create_sprite(330, 257, 16, 587, 1);
sp_base_walk(&boss1, 580);
sp_speed(&boss1, 2);
freeze(&boss1);
Wait(200);
say_stop("Hello there! Are you a wizard?",1);
Wait(500);
say_stop("`3Yes, and get out of my cave!",&boss1);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?",1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!",&boss1);
Wait(1000);
say_stop("Well, thats TODAY!",1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(&boss1);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(&boss1, 9);
sp_exp(&boss1, 200);
sp_touch_damage(&boss1, 1);
sp_hitpoints(&boss1, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(&boss1, 1);
}
}
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
Thanks!
If you ask a question it's handy if you tell us what's not working.
Where is the script attached to? A room or something I guess... Certainly not the &boss figure... That causes void hit(void) not to work. My advice would be to attach a new script to the boss (using sp_script) that contains the void hit(void) procedure.

HEY!! Wait a minute! It looks like it has no void talk( void ) attached to it. So here's the working one I guess.
void main(void)
{
if (&story == 0)
{
freeze(1);
int &boss1 = create_sprite(330, 257, 16, 587, 1);
sp_base_walk(&boss1, 580);
sp_speed(&boss1, 2);
freeze(&boss1);
void talk( void )
{
Wait(200);
say_stop("Hello there! Are you a wizard?", 1);
Wait(500);
say_stop("`3Yes, and get out of my cave!", &boss1);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?", 1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!" ,&boss1);
Wait(1000);
say_stop("Well, thats TODAY!" ,1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(&boss1);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(&boss1, 9);
sp_exp(&boss1, 200);
sp_touch_damage(&boss1, 1);
sp_hitpoints(&boss1, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(&boss1, 1);
}
}
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
void main(void)
{
if (&story == 0)
{
freeze(1);
int &boss1 = create_sprite(330, 257, 16, 587, 1);
sp_base_walk(&boss1, 580);
sp_speed(&boss1, 2);
freeze(&boss1);
void talk( void )
{
Wait(200);
say_stop("Hello there! Are you a wizard?", 1);
Wait(500);
say_stop("`3Yes, and get out of my cave!", &boss1);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?", 1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!" ,&boss1);
Wait(1000);
say_stop("Well, thats TODAY!" ,1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(&boss1);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(&boss1, 9);
sp_exp(&boss1, 200);
sp_touch_damage(&boss1, 1);
sp_hitpoints(&boss1, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(&boss1, 1);
}
}
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
Or wait... it seems to be attached to a room... then it's no use. Sorry.
My mistake. But I found bugs still. "...fireball magic?",1);" Yup, something's wrong. It's supposed to go like this: "...fireball magic?", 1);" Found the difference? There's a space between the ',' and the '1'(This counts all the talk scripts).

hehe didn't think about that
The script is fine until this part comes
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
NOTE: dubble is a script that makes him dublicate himself (a new enemy just
)
I hope this will help you find my script-error

The script is fine until this part comes

void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
NOTE: dubble is a script that makes him dublicate himself (a new enemy just

I hope this will help you find my script-error

Also, it's not "3Annoying human...". It's "3`Annoying human..." This isn't your problem though, but it will help the script.
As metatarasal said, the hit procedure won't run because it's not attached to &boss1 himself. So separate the script in two.
//Trigger script
void main(void)
{
if (&story == 0)
{
freeze(1);
int &boss1 = create_sprite(330, 257, 16, 587, 1);
sp_base_walk(&boss1, 580);
sp_speed(&boss1, 2);
freeze(&boss1);
sp_script(&boss1, "boss1");
}
}
//Boss1 script
void main()
{
int &boss1 = ¤t_sprite;
Wait(200);
say_stop("Hello there! Are you a wizard?",1);
Wait(500);
say_stop("`3Yes, and get out of my cave!",&boss1);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?",1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!",&boss1);
Wait(1000);
say_stop("Well, thats TODAY!",1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(&boss1);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(&boss1, 9);
sp_exp(&boss1, 200);
sp_touch_damage(&boss1, 1);
sp_hitpoints(&boss1, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(&boss1, 1);
}
}
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
If you already did that... Post the modified script. And the dubble script. And telling how it doesn't work wouldn't hurt either.
//Trigger script
void main(void)
{
if (&story == 0)
{
freeze(1);
int &boss1 = create_sprite(330, 257, 16, 587, 1);
sp_base_walk(&boss1, 580);
sp_speed(&boss1, 2);
freeze(&boss1);
sp_script(&boss1, "boss1");
}
}
//Boss1 script
void main()
{
int &boss1 = ¤t_sprite;
Wait(200);
say_stop("Hello there! Are you a wizard?",1);
Wait(500);
say_stop("`3Yes, and get out of my cave!",&boss1);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?",1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!",&boss1);
Wait(1000);
say_stop("Well, thats TODAY!",1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(&boss1);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(&boss1, 9);
sp_exp(&boss1, 200);
sp_touch_damage(&boss1, 1);
sp_hitpoints(&boss1, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(&boss1, 1);
}
}
void hit( void )
{
sp_target(&boss1, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(&boss1, -1);
&save_y = sp_y(&boss1, -1);
freeze(&boss1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(&boss1);
}
}
If you already did that... Post the modified script. And the dubble script. And telling how it doesn't work wouldn't hurt either.

No, it's "`3 Annoying human..."
Also (@Marpro), count your brackets. Either the original scripts main proc or the &story check wasn't closed. The talk thing Vukodlak posted is repulsive. Come on, a hit proc inside an if-check inside the main proc?
I suppose this is where I'd use the DinkC validator.

Also (@Marpro), count your brackets. Either the original scripts main proc or the &story check wasn't closed. The talk thing Vukodlak posted is repulsive. Come on, a hit proc inside an if-check inside the main proc?
I suppose this is where I'd use the DinkC validator.
Hmmm... I'll go and check if it's working now. But if it isn't working you'll probably hear from me soon

gash... I tried your version, scratcher, but when i enter the "boss1" room the game crashes and i get an error log

by the way, here's the "dubble" script
//Wizard x2
void main(void)
{
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 3);
sp_base_walk(¤t_sprite, 580);
sp_touch_damage(¤t_sprite, 1);
sp_hitpoints(¤t_sprite, 5);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
}

//Wizard x2
void main(void)
{
sp_brain(¤t_sprite, 9);
sp_speed(¤t_sprite, 3);
sp_base_walk(¤t_sprite, 580);
sp_touch_damage(¤t_sprite, 1);
sp_hitpoints(¤t_sprite, 5);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
}
You need to be specific, and not just say it crashes. Does it crash right away? Does it get to the dialog of the boss script? If it doesnt get there before crashing then you know the error is in the trigger script.
Before I get any farther I need to know what your two scripts are attached to?
If you would be specific, we could help you much easier. What was your script doing wrong? What was it attached to?
It's late and I wont be able to help you any more tonight, and I wont be home tomorrow until the afternoon. If you havent figured it out by then, I'll play around with it and see if I can't figure something out for you.
Later
Before I get any farther I need to know what your two scripts are attached to?
If you would be specific, we could help you much easier. What was your script doing wrong? What was it attached to?
It's late and I wont be able to help you any more tonight, and I wont be home tomorrow until the afternoon. If you havent figured it out by then, I'll play around with it and see if I can't figure something out for you.
Later
**UPDATE**
What Scratcher posted works. I'm not sure what you did, but you did it wrong. Attach the trigger script to something on the screen ( a rock, fence...tree...etc) and thats all you need to do. Fix the screenlock. screenlock(0) will unlock it. As is the screen remains locked after the boss is defeated.
Then again, you never said what was going wrong and I didnt have the dubble script so if the problem was in that then I don't know.
What Scratcher posted works. I'm not sure what you did, but you did it wrong. Attach the trigger script to something on the screen ( a rock, fence...tree...etc) and thats all you need to do. Fix the screenlock. screenlock(0) will unlock it. As is the screen remains locked after the boss is defeated.
Then again, you never said what was going wrong and I didnt have the dubble script so if the problem was in that then I don't know.
You did make two seperate scripts haven't you? The name of the second script has to be boss1. So the name of the first (trigger) script cannot have the same name.
What you probably did is having a script called boss1 with the information from Scratcher's "trigger script". (What you did with the rest of the information is a unclear to me...) Now you get an eternally looping script, wich obviously results in a crash.
If this is the case do this: Change sp_script(&boss1, "boss1"); into sp_script(&boss1,"bossy"); Then make a new script called bossy. Put this information into it:
void main()
{
Wait(200);
say_stop("Hello there! Are you a wizard?",1);
Wait(500);
say_stop("`3Yes, and get out of my cave!",¤t_sprite);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?",1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!",¤t_sprite);
Wait(1000);
say_stop("Well, thats TODAY!",1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(¤t_sprite);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(¤t_sprite, 9);
sp_exp(¤t_sprite, 200);
sp_touch_damage(¤t_sprite, 1);
sp_hitpoints(¤t_sprite, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(¤t_sprite, 1);
}
}
void hit( void )
{
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
freeze(¤t_sprite1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(¤t_sprite);
}
}
This is almost the same as Scratcher said, so I hope I'm being clear enough now.
What you probably did is having a script called boss1 with the information from Scratcher's "trigger script". (What you did with the rest of the information is a unclear to me...) Now you get an eternally looping script, wich obviously results in a crash.
If this is the case do this: Change sp_script(&boss1, "boss1"); into sp_script(&boss1,"bossy"); Then make a new script called bossy. Put this information into it:
void main()
{
Wait(200);
say_stop("Hello there! Are you a wizard?",1);
Wait(500);
say_stop("`3Yes, and get out of my cave!",¤t_sprite);
Wait(500);
say_stop("Eeh... Wait, could you learn me fireball magic?",1);
Wait(500);
say_stop("`3Annoying human, I'll teach you the magic the day I'm dead, haha!",¤t_sprite);
Wait(1000);
say_stop("Well, thats TODAY!",1);
Wait(500);
screenlock(1);
unfreeze(1);
unfreeze(¤t_sprite);
//Boss 1 music.
playmidi("Boss1.mid");
sp_brain(¤t_sprite, 9);
sp_exp(¤t_sprite, 200);
sp_touch_damage(¤t_sprite, 1);
sp_hitpoints(¤t_sprite, 150);
preload_seq(581);
preload_seq(583);
preload_seq(587);
preload_seq(589);
if (random(2,1) == 1)
{
sp_target(¤t_sprite, 1);
}
}
void hit( void )
{
sp_target(¤t_sprite, &enemy_sprite);
//lock on to the guy who just hit us
//playsound
if (random(3,1) == 1)
{
say("`3You'll never find ME, haha!", &boss1);
&save_x = sp_x(¤t_sprite, -1);
&save_y = sp_y(¤t_sprite, -1);
freeze(¤t_sprite1);
wait(200);
int &newdubble = create_sprite(&save_x, &save_y, 0, 420, 1);
sp_script(&newdubble, "dubble");
wait(200);
unfreeze(¤t_sprite);
}
}
This is almost the same as Scratcher said, so I hope I'm being clear enough now.

I've changed my script now to "sp_script(&boss1,"bossy");".
I have a trigger script now (boss1) and the really boss mode script, or what to call it, named bossy. Guess what... The script run exactly as I want now
And.. Before I made the script "bossy", the game crashed when I entered the boss1's room (The screen went black and I did get an error message).
And I was going to add the screenlock(0); I just wanted to see the script run like it should until it
Thank everyone, you really helped me out there
I have a trigger script now (boss1) and the really boss mode script, or what to call it, named bossy. Guess what... The script run exactly as I want now

And.. Before I made the script "bossy", the game crashed when I entered the boss1's room (The screen went black and I did get an error message).
And I was going to add the screenlock(0); I just wanted to see the script run like it should until it

Thank everyone, you really helped me out there
