The Dink Network

Re: remove hardness/spirit

September 7th 2009, 11:49 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
I have a (invisible) spirit blocking the way into a town.
I want to remove it (or remove it's hardness) when i talk to another spirit on the screen.
Help, please
September 7th 2009, 11:57 AM
fairy.gif
GlennGlenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Something like this should work

void main()
{
if (&story >= 1)
{
sp_hard(&current_sprite, 1);
draw_hard_map();
}
}
September 7th 2009, 12:05 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Invisible/Background Sprites can't run scripts. You'll have to include sp_nodraw(&current_sprite, 1); in the script of a normal (non-invisible) sprite to make it work. So, yeah. Just include that line in Glenn's script and make it a person/creature sprite and it should work.

Also, it sprite.
September 7th 2009, 12:06 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
I'm not the experienced scripter, but my guess is that you can attach this script to the screen:

void main ( void )
{
if (&bob == 0)
{
int &hard;
&hard = create_sprite(xxx,yyy,#,#,#);
sp_nodraw(&hard, 1); 
//this'll make the sprite invisible.
sp_hard(&hard, 0);
//the 0 means hard, 1 means not.
draw_hard_sprite(&hard);
//this'll draw the hardness box for the sprite.
}
else
{
sp_hard(&hard, 1);
draw_hard_sprite(&hard);
}
}


So if &bob becomes a number other than zero, the hardness of the invisible sprite should disappear. I have no idea if this will work live on the same screen.

Is spirit the new sprite? Awesome.
September 7th 2009, 12:10 PM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
Quiztis:

1) You don't have a void main(void)

2) You don't a have semi-colon after int &hard. I dunno if this hurts anything, just saying.

3) You only referred to your created sprite (hard) as &hard once. The rest of the time it was &current_sprite.

I didn't see anything else wrong...I'm just pointing out it's a bit easier if you just attach the script to the sprite.
September 7th 2009, 12:28 PM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
But because he wants it to happen when he talks to another sprite in the screen, it depends. Sure, if he has created the sprite by scripting he could use the current sprite name, but if he has created it with the map editor, he should use temphold.

Anyways, I'm too lazy to explain how to do that right now.
September 7th 2009, 12:33 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
OH GAWD!!1

I'll change it right away.
September 7th 2009, 01:04 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Thanks, It's working now <3