The Dink Network

Yargh, bumwaffle!

August 5th 2005, 07:31 PM
pig.gif
Woah I'm tired. When I close my eyes I feel like I'm going through some sort of vortex thing. Anyways, I got this script see (suprise suprise) and it almost doesent run. the last sign of it working is when it plays the midi. Or it unfreezes, whichever is last. So, heres the script type animal. Its probobly something stupid, but its really bothering me.

void main(void)
{
if(&story == 8);
{
stopmidi("9");
freeze(1);
wait(1000);
say_stop("Hmmm... I'ts a little quite...", 1);
wait(800);
say_stop("Too quite...", 1);
wait(300);
move_stop(1, 8, 300, 1);
wait(400);
screenlock(1);
wait(700);
say_stop("That is not a good sign.", 1);
playmidi("4.mid");
wait(500);
unfreeze(1);
int &where = (random(1, 400));
int &wheere2 = (random(1, 2));
int &wheeere3;
int &dir;
int &sequence;
loop:
&where = (random(1, 400));
&wheere2 = (random(1, 2));
If(&wheere2 == 1)
{
&wheere2 = 370;
&wheeere3 = 270;
}
If(&wheere2 == 2)
{
&wheere2 = 270;
&wheeere3 = 370;
}
if(&wheere2 = 370)
{
&dir = 4;
&sequence = 531;
}
if(&wheere2 = 370)
{
&dir = 6;
&sequence = 533;
}
int &boncabonc = create_sprite(&wheere2, &where1, 16, &sequence, 1);
sp_speed(&boncabonc, 1);
sp_base_walk(&boncabonc, 530);
move(&boncabonc, &dir, &wheeere3, 1);
wait(2000);
goto loop;
}
}

Thanks.
August 5th 2005, 07:34 PM
goblinm.gif
int &where = (random(1, 400));
int &wheere2 = (random(1, 2));

No need for the extra parenthesese.
int &where = random(1, 400);
int &wheere2 = random(1, 2);
is correct, I imagine. You also do it later.
August 5th 2005, 07:35 PM
goblinm.gif
Also, stopmidi(); works fine... no need to specify which midi you're stopping.
August 5th 2005, 07:57 PM
knight.gif
Vortex
Peasant He/Him United States
It rubs the lotion on its skin... 
Haha you said,
"When I close my eyes I feel like I'm going through...vortex..."
You went through me...like woah
August 6th 2005, 07:53 AM
anon.gif
Hog of space
Ghost They/Them
 
Thanks for your help, but theres something else stopping the boncas from spawning. I made a couple of other tweaks myself, so i might as well post the script. Cheers.

void main(void)
{
if(&story == 8);
{
stopmidi("9");
freeze(1);
wait(1000);
say_stop("Hmmm... I'ts a little quite...", 1);
wait(800);
say_stop("Too quite...", 1);
wait(300);
move_stop(1, 8, 300, 1);
wait(400);
screenlock(1);
wait(700);
say_stop("That is not a good sign.", 1);
playmidi("4.mid");
wait(500);
unfreeze(1);
int &where;
int &wheere2;
int &wheeere3;
int &dir;
int &sequence;
loop:
&where = random(1, 400);
&wheere2 = random(1, 2);
If(&wheere2 == 1)
{
&wheere2 = 370;
&wheeere3 = 270;
}
If(&wheere2 == 2)
{
&wheere2 = 270;
&wheeere3 = 370;
}
if(&wheere2 = 370)
{
&dir = 4;
&sequence = 531;
}
if(&wheere2 = 270)
{
&dir = 6;
&sequence = 533;
}
int &boncabonc = create_sprite(&wheere2, &where1, 16, &sequence, 1);
sp_speed(&boncabonc, 1);
sp_base_walk(&boncabonc, 530);
move(&boncabonc, &dir, &wheeere3, 1);
wait(2000);
goto loop;
}
}

w00t.
August 6th 2005, 01:29 PM
goblinm.gif
preload those sequences.

preload_seq(531);
preload_seq(533);
//just for luck...
preload_seq(535);
preload_seq(537);
August 6th 2005, 01:34 PM
spike.gif
There's only one = in some of those if statements.
August 6th 2005, 02:12 PM
pig.gif
Woohoo! It works now, just needs a lot of tweaking. Thanks very much.
August 6th 2005, 05:18 PM
pig.gif
Hmmm, tweaking is proving harder than I thought. Theese lines are all faulty in some way. Thanks.

&where1 = random(1, 400);
//Chooses either 1 or 400, not something in beetween.

sp_script(&boncabonc, bonca);
//just doesent work.

Thanks, there will probably be more because the script is really bad. Cheers.
August 6th 2005, 05:20 PM
spike.gif
Int &aappa = random(2,1);
if (&aappa == 1)
&where1 = 1;
if (&aappa == 2)
&where1 = 400;

sp_script(&boncabonc, "bonca");
August 6th 2005, 05:25 PM
pig.gif
Wow, fast reply. Thanks, but the random thing does that, and doesent choose something in beetween. Every time its either 1 or 400.
August 6th 2005, 05:28 PM
spike.gif
Ahh I thought you wanted the opposite... try switching the numbers
August 6th 2005, 05:35 PM
pig.gif
Woohoo, works, although theres another problem which i'm sure i can fix myself... Hmmm... Anyway, thanks a lot.
August 6th 2005, 06:24 PM
pig.gif
Ok, I guess I cant fix it myself... Crap. Thanks for baring with me, here is the main script again, and then there is bonca.c. The problem is, the boncas spawn, but dont move, they are stuck on the same frame and the same spot. Thanks.

void main(void)
{
if(&story == 8);
{
stopmidi("9");
preload_seq(530);
preload_seq(531);
preload_seq(532);
preload_seq(533);
preload_seq(534);
preload_seq(535);
preload_seq(536);
preload_seq(537);
preload_seq(538);
preload_seq(539);
freeze(1);
wait(1000);
say_stop("Hmmm... I'ts a little quite...", 1);
wait(800);
say_stop("Too quite...", 1);
wait(300);
move_stop(1, 8, 300, 1);
wait(400);
screenlock(1);
wait(700);
say_stop("That is not a good sign.", 1);
playmidi("4.mid");
wait(500);
unfreeze(1);
int &where1;
int &wheere2;
int &wheeere3;
int &dir;
int &sequence;
loop:
&where1 = random(400, 1);
&wheere2 = random(2, 1);
If(&wheere2 == 1)
{
&wheere2 = 370;
&wheeere3 = 270;
}
If(&wheere2 == 2)
{
&wheere2 = 270;
&wheeere3 = 370;
}
if(&wheere2 == 370)
{
&dir = 4;
&sequence = 531;
}
if(&wheere2 == 270)
{
&dir = 6;
&sequence = 533;
}
int &boncabonc = create_sprite(&wheere2, &where1, 16, &sequence, 1);
sp_script(&boncabonc, "bonca");
wait(2000);
goto loop;
}
}

void main(void)
{
freeze(&current_sprite);
sp_speed(&current_sprite, 1);
sp_brain(&current_sprite, 16);
sp_base_walk(&current_sprite, 530);
sp_touch_damage(&current_sprite, 4);
move_stop(&current_sprite, &dir, &wheeere3, 1);
sp_active(&current_sprite, 0);
}
August 6th 2005, 06:39 PM
goblinm.gif
That's supposed to happen when you do a freeze command .
August 6th 2005, 06:41 PM
pig.gif
Yes, but stuff moves after you use move_stop when you use a freeze command.
August 6th 2005, 06:42 PM
spike.gif
Local variables only work inside the same script... simple fix is to do the following in the bonca script:

int &bonx = sp_x(&current_sprite, -1);
if (&bonx == 270)
move_stop(&current_sprite, 6, 370, 1);
if (&bonx == 370)
move_stop(&current_sprite, 4, 270, 1);

btw, your script is quite unnecessarily complex.
August 7th 2005, 06:36 AM
pig.gif
Fatastic, works great now, thanks.
August 7th 2005, 10:24 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
You spelled "quiet" wrong.
August 7th 2005, 11:16 AM
duck.gif
Tal
Noble He/Him United States
Super Sexy Tal Pal 
Uh, no, he meant "quite." "Quiet" is to be silent.
August 7th 2005, 12:49 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
This is quite silly, so quit it and be quiet...
August 7th 2005, 12:57 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
Indeed
August 7th 2005, 01:12 PM
duck.gif
Tal
Noble He/Him United States
Super Sexy Tal Pal 
Ahh, I see, DaVince's post was in reference to spacehoggy's script instead of scratcher's use of "quite."

Thanks for the clarity, cough.
August 15th 2005, 07:15 PM
duck.gif
rp64
Peasant He/Him
 
(walks into room whistling; sees complicated programming codes; walks out of room whistling)