The Dink Network

sword stuff

July 18th 2004, 07:34 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
hello. I want that when you pick up a sword, you can't use it yet, not until &variable is at least 1.
So, you pick up the sword, and you get item-sw1.

what do I need to change in the void use (void)so you can't use it right away, but only after &variable is 1 or higher?

original item-sw1 script:

void use( void )
{
//disallow diagonal punches

if (sp_dir(1, -1) == 1)
sp_dir(1, 2);
if (sp_dir(1, -1) == 3)
sp_dir(1, 2);
if (sp_dir(1, -1) == 7)
sp_dir(1, 8);
if (sp_dir(1, -1) == 9)
sp_dir(1, 8);

&basehit = sp_dir(1, -1);
&basehit += 100; //100 is the 'base' for the hit animations, we just add
//the direction
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(200);
playsound(8, 8000,0,0,0);

}

I messed around with this, but I seem the too big a scripting disaster for this. please help!
July 18th 2004, 07:42 AM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
try this

void use( void )
{
if (&variable >= 1)
{
//disallow diagonal punches

if (sp_dir(1, -1) == 1)
sp_dir(1, 2);
if (sp_dir(1, -1) == 3)
sp_dir(1, 2);
if (sp_dir(1, -1) == 7)
sp_dir(1, 8);
if (sp_dir(1, -1) == 9)
sp_dir(1, 8);

&basehit = sp_dir(1, -1);
&basehit += 100; //100 is the 'base' for the hit animations, we just add
//the direction
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(200);
playsound(8, 8000,0,0,0);
}else
{
say("i cant use this yet.", 1);
}
}
July 18th 2004, 07:51 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Hmm, how about this:

void use( void )
{
//disallow diagonal punches
if (&variable < 1)
{
say("I can't use this yet", 1);
return;
}
if (sp_dir(1, -1) == 1)
sp_dir(1, 2);
if (sp_dir(1, -1) == 3)
sp_dir(1, 2);
if (sp_dir(1, -1) == 7)
sp_dir(1, 8);
if (sp_dir(1, -1) == 9)
sp_dir(1, 8);

&basehit = sp_dir(1, -1);
&basehit += 100; //100 is the 'base' for the hit animations, we just add
//the direction
sp_seq(1, &basehit);
sp_frame(1, 1); //reset seq to 1st frame
sp_kill_wait(1); //make sure dink will punch right away
sp_nocontrol(1, 1); //dink can't move until anim is done!
wait(200);
playsound(8, 8000,0,0,0);
}

Bold things are new.
July 18th 2004, 07:53 AM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Hey simeon will my work yoo?
July 18th 2004, 09:06 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Oh, i'll just erase this, because Simeon already said it.
July 18th 2004, 09:25 AM
slayer.gif
MadStalker
Peasant He/Him Finland
tag line 
Glennglenn: It would.
July 18th 2004, 09:34 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Yep, Simeon's script should work. I'm an idiot for typing the same thing before actually looking at the responses...
July 18th 2004, 09:50 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
thanks everyone