Reply to Re: How can I code this situation?
If you don't have an account, just leave the password field blank.
The sprite won't actually be gone forever, though, it'll be there when you re-enter the screen. To get him stay away his editor type needs to be changed.
sp_editor_num(¤t_sprite);
editor_type(&return,1);
1 stands for kill sprite completely. Check the DinkC reference for a list of different states.
These commands are pretty cool, they're used primarily for changes in the map such as burnt trees, killed monsters, destroyed barrels, but are useful for other things as well. Having a sprite introduce itself, for example, or a quest like collecting 5 mushrooms could be easily done with editor_seq(); or editor_frame(); without wasting globals.
//Example
void talk()
{
freeze(1);
int &getnum = sp_editor_num(¤t_sprite);
int &num = editor_seq(&getnum,-1);
if (&num == 0)
{
say_stop("`%Hi, I'm Mister Questman, your friendly town questgiver.",¤t_sprite);
say_stop("Nice to meet you, I'm Dink.",1);
editor_seq(&getnum,1);
}
if (&num == 1)
{
say_stop("`0Hi, Dink.",¤t_sprite);
say_stop("Hi, Mister Questman.",1);
}
unfreeze(1);
}
sp_editor_num(¤t_sprite);
editor_type(&return,1);
1 stands for kill sprite completely. Check the DinkC reference for a list of different states.
These commands are pretty cool, they're used primarily for changes in the map such as burnt trees, killed monsters, destroyed barrels, but are useful for other things as well. Having a sprite introduce itself, for example, or a quest like collecting 5 mushrooms could be easily done with editor_seq(); or editor_frame(); without wasting globals.
//Example
void talk()
{
freeze(1);
int &getnum = sp_editor_num(¤t_sprite);
int &num = editor_seq(&getnum,-1);
if (&num == 0)
{
say_stop("`%Hi, I'm Mister Questman, your friendly town questgiver.",¤t_sprite);
say_stop("Nice to meet you, I'm Dink.",1);
editor_seq(&getnum,1);
}
if (&num == 1)
{
say_stop("`0Hi, Dink.",¤t_sprite);
say_stop("Hi, Mister Questman.",1);
}
unfreeze(1);
}