Reply to Re: Need Help
If you don't have an account, just leave the password field blank.
March 13th 2006, 10:28 PM

kjmarket


To animate sprites such as the fireplace fire, you need to set it's brain to the repeating brain...and the fire sound. This can be done in the editor or by script.
WinDinkEdit gives you the sequence of a sprite, by right clicking and going to properties. If you spawn the sprite using a script, you would need to set that sequence.
void main( void)
{
sp_brain(¤t_sprite, 6);
sp_sound(¤t_sprite, 23);
}
That simple bit of code will give you a working fireplace with the fireplace sound effect.
Now if you wanted to make something animate when you hit it, then that can be accomplished quite easily. I threw this together in a few minutes. I have a sprite than when hit, it spawns a different sprite and animates it ( a blood ring ). I attached the script to one of the weird poles that you tend to see near goblin huts.
void hit( void)
{
int &thisone = create_sprite(358, 57, 7, 162, 1); ( one line )
sp_seq(&thisone, 162);
}
This spawns a blood ring looking sprite when the pole is hit. The first two numbers of the create_sprite line are the x and y coordinates. The 4th ( 162) is the sprite number ( sequence ). The next line tells it what sequence to start playing for what sprite.
WinDinkEdit gives you the sequence of a sprite, by right clicking and going to properties. If you spawn the sprite using a script, you would need to set that sequence.
void main( void)
{
sp_brain(¤t_sprite, 6);
sp_sound(¤t_sprite, 23);
}
That simple bit of code will give you a working fireplace with the fireplace sound effect.
Now if you wanted to make something animate when you hit it, then that can be accomplished quite easily. I threw this together in a few minutes. I have a sprite than when hit, it spawns a different sprite and animates it ( a blood ring ). I attached the script to one of the weird poles that you tend to see near goblin huts.
void hit( void)
{
int &thisone = create_sprite(358, 57, 7, 162, 1); ( one line )
sp_seq(&thisone, 162);
}
This spawns a blood ring looking sprite when the pole is hit. The first two numbers of the create_sprite line are the x and y coordinates. The 4th ( 162) is the sprite number ( sequence ). The next line tells it what sequence to start playing for what sprite.