Less than, more than...
Let's say the this is a script:
void main( void )
{
int &dam;
}
void hit( void )
{
&dam = sp_hitpoints(¤t_sprite, -1);
if (&dam < 35)
{
say("`0I like pie", ¤t_sprite);
sp_speed(¤t_sprite, 4);
move_stop(¤t_sprite, 6, 162, 1);
move_stop(¤t_sprite, 4, 162, 1);
move_stop(¤t_sprite, 8, 156, 1);
move_stop(¤t_sprite, 2, 156, 1);
sp_speed(¤t_sprite, 2);
}
if (&dam < 30)
{
say("`0I like apples!", ¤t_sprite);
}
}
When the sprite has, say, 25 hitpoints, he will first say "I like pie" and do the move_stop, and after he's done with it, he will say "I like apples!"
This is because there is no <35>30 math supported, is there? I mean, I want him to say "I like apples" when he's below 30, not "I like pie".
Anyone know if there's a solution to this problem, or is just not supported in Dink?
Thanks.
void main( void )
{
int &dam;
}
void hit( void )
{
&dam = sp_hitpoints(¤t_sprite, -1);
if (&dam < 35)
{
say("`0I like pie", ¤t_sprite);
sp_speed(¤t_sprite, 4);
move_stop(¤t_sprite, 6, 162, 1);
move_stop(¤t_sprite, 4, 162, 1);
move_stop(¤t_sprite, 8, 156, 1);
move_stop(¤t_sprite, 2, 156, 1);
sp_speed(¤t_sprite, 2);
}
if (&dam < 30)
{
say("`0I like apples!", ¤t_sprite);
}
}
When the sprite has, say, 25 hitpoints, he will first say "I like pie" and do the move_stop, and after he's done with it, he will say "I like apples!"
This is because there is no <35>30 math supported, is there? I mean, I want him to say "I like apples" when he's below 30, not "I like pie".
Anyone know if there's a solution to this problem, or is just not supported in Dink?
Thanks.
if (&dam < 30)
{
say("`0I like apples!", ¤t_sprite);
return; / &dam = 99999;
}
if (&dam < 35)
{
say("`0I like pie", ¤t_sprite);
sp_speed(¤t_sprite, 4);
move_stop(¤t_sprite, 6, 162, 1);
move_stop(¤t_sprite, 4, 162, 1);
move_stop(¤t_sprite, 8, 156, 1);
move_stop(¤t_sprite, 2, 156, 1);
sp_speed(¤t_sprite, 2);
}
or
if (&dam > 29)
{
if (&dam < 35)
{
say("`0I like pie", ¤t_sprite);
sp_speed(¤t_sprite, 4);
move_stop(¤t_sprite, 6, 162, 1);
move_stop(¤t_sprite, 4, 162, 1);
move_stop(¤t_sprite, 8, 156, 1);
move_stop(¤t_sprite, 2, 156, 1);
sp_speed(¤t_sprite, 2);
}
}
{
say("`0I like apples!", ¤t_sprite);
return; / &dam = 99999;
}
if (&dam < 35)
{
say("`0I like pie", ¤t_sprite);
sp_speed(¤t_sprite, 4);
move_stop(¤t_sprite, 6, 162, 1);
move_stop(¤t_sprite, 4, 162, 1);
move_stop(¤t_sprite, 8, 156, 1);
move_stop(¤t_sprite, 2, 156, 1);
sp_speed(¤t_sprite, 2);
}
or
if (&dam > 29)
{
if (&dam < 35)
{
say("`0I like pie", ¤t_sprite);
sp_speed(¤t_sprite, 4);
move_stop(¤t_sprite, 6, 162, 1);
move_stop(¤t_sprite, 4, 162, 1);
move_stop(¤t_sprite, 8, 156, 1);
move_stop(¤t_sprite, 2, 156, 1);
sp_speed(¤t_sprite, 2);
}
}
I had just found that last way on the DinkC Reference, after searching for an hour or so. How the hell am I supposed to know < and > are called "bumps".
Thanks, scratch-man.
Thanks, scratch-man.