Scripting a graphic
January 5th 2007, 08:06 PM

Rad Frog
Is it possible to give hardness and touch damage to an inanimate graphic put in with a script using the command create_sprite? I want to use sequence 335 and enlarge it, plus make it hard. Can do? How?
I have it displaying properly at runtime, but Dink can walk through it. Hit points arent so important, but I reallly want it to be hard.
I am chugging right along with the WinDinkEdit2 editor. Most of it is intuitive. But what is purpose of the screen displayed when I am looking at the hardness of the sprites on a tile, and press E? They won't copy/paste for me.
I have it displaying properly at runtime, but Dink can walk through it. Hit points arent so important, but I reallly want it to be hard.
I am chugging right along with the WinDinkEdit2 editor. Most of it is intuitive. But what is purpose of the screen displayed when I am looking at the hardness of the sprites on a tile, and press E? They won't copy/paste for me.
January 5th 2007, 08:29 PM

dinkmega
Hello.
Um yeah, you can give those attributes to a sprite via attaching a script:
void main (void)
{
int &sprite = create_sprite(&spritex, &spritey, &spritebrain, 335, 1)
//next comes hardness 0
sp_hard(&sprite, 0);
//next, it's size. 100 is normal size, 100%
sp_size(&sprite, 200);
}
Sorry, I can't help you very much with Windinkedit
Um yeah, you can give those attributes to a sprite via attaching a script:
void main (void)
{
int &sprite = create_sprite(&spritex, &spritey, &spritebrain, 335, 1)
//next comes hardness 0
sp_hard(&sprite, 0);
//next, it's size. 100 is normal size, 100%
sp_size(&sprite, 200);
}
Sorry, I can't help you very much with Windinkedit
January 5th 2007, 08:32 PM

dinkmega
Dang, forgot touch damage:
void main (void)
{
sp_touch_damage(&sprite, value_goes_here);
}
void main (void)
{
sp_touch_damage(&sprite, value_goes_here);
}
And you forgot something else, that is to draw the hardness. The sprite you made is 'hard', but Dink can still walk through it. So add: draw_hard_sprite(&sprite); after the sp_hard(&sprite,0); command. So the total thing should look like:
void main(void)
{
//let's make the sprite
int &sprite = create_sprite(&spritex, &spritey, &spritebrain, 335, 1)
//make it hard:
sp_hard(&sprite, 0);
draw_hard_sprite(&sprite);
//let's make it twice as large:
sp_size(&sprite, 200);
//A bit of touch damage:
sp_touch_damage(&sprite, value_goes_here);
}
About your problem with the hardness mode, when you press 'E' the yellow blocks that are apearing should just work like normal tiles. Exept that they are invisible and are simply for making areas hard.
void main(void)
{
//let's make the sprite
int &sprite = create_sprite(&spritex, &spritey, &spritebrain, 335, 1)
//make it hard:
sp_hard(&sprite, 0);
draw_hard_sprite(&sprite);
//let's make it twice as large:
sp_size(&sprite, 200);
//A bit of touch damage:
sp_touch_damage(&sprite, value_goes_here);
}
About your problem with the hardness mode, when you press 'E' the yellow blocks that are apearing should just work like normal tiles. Exept that they are invisible and are simply for making areas hard.
January 7th 2007, 11:32 AM

Rad Frog
Thanks much. I will use the info you both gave in my next attempt. I did a bum workaround in the thing I am working on right now.






