Yet another script question
Why does the following script not work? Dink says "It's here" whether the sprite is visible or not, and I can't work out what I'm doing wrong.
void main (void)
{
int &here = sp_nodraw(¤t_sprite, -1);
//uncomment following line to test
//sp_nodraw(¤t_sprite, 1);
}
void talk (void)
{
if (&here == 0)
{
say("It's here!", 1);
}
}
void main (void)
{
int &here = sp_nodraw(¤t_sprite, -1);
//uncomment following line to test
//sp_nodraw(¤t_sprite, 1);
}
void talk (void)
{
if (&here == 0)
{
say("It's here!", 1);
}
}
void main (void)
{
//uncomment following line to test
//sp_nodraw(¤t_sprite, 1);
int &here = sp_nodraw(¤t_sprite, -1);
}
{
//uncomment following line to test
//sp_nodraw(¤t_sprite, 1);
int &here = sp_nodraw(¤t_sprite, -1);
}
Oh... yes. I should've realised that from my other question. Thanks!
Can I set the same variable multiple times in the same script, for example:
void main (void)
{
int &here;
}
void talk (void)
{
&here = sp_nodraw(¤t_sprite, -1);
if (&here == 0)
{
//whatever happens goes here
}
}
void hit (void)
{
&here = sp_nodraw(¤t_sprite, -1);
if (&here == 0)
{
//whatever happens goes here
}
}
void somethingelse (void)
{
&here = sp_nodraw(¤t_sprite, -1);
if (&here == 0)
{
//whatever happens goes here
}
}
or would I have to use seperate variable names?
Can I set the same variable multiple times in the same script, for example:
void main (void)
{
int &here;
}
void talk (void)
{
&here = sp_nodraw(¤t_sprite, -1);
if (&here == 0)
{
//whatever happens goes here
}
}
void hit (void)
{
&here = sp_nodraw(¤t_sprite, -1);
if (&here == 0)
{
//whatever happens goes here
}
}
void somethingelse (void)
{
&here = sp_nodraw(¤t_sprite, -1);
if (&here == 0)
{
//whatever happens goes here
}
}
or would I have to use seperate variable names?
Might as well ask this in here...
To add new graphics, do I just pick an unused sequence number from WDE and edit the .ini file as described in DinkC.chm, or is there more to it than that?
To add new graphics, do I just pick an unused sequence number from WDE and edit the .ini file as described in DinkC.chm, or is there more to it than that?
That's it, though there's slightly more that can be told about it.
First of all don't forget to make sure the graphics are in the right palette. (Or you'll force the player to use true color mode)
Secondly make sure that you choose the right unused sequence number. For example, sequence 348 is unused. But if you do choose it, the game can use it as part of the red trader's walking sequences.
A safe rule of the thumb is that if only the last digit is different from a sequence that belongs to an animal or a person you shouldn't use it.
So using 44 probably isn't a good idea (pig sprites), but using 39 is fine.
First of all don't forget to make sure the graphics are in the right palette. (Or you'll force the player to use true color mode)
Secondly make sure that you choose the right unused sequence number. For example, sequence 348 is unused. But if you do choose it, the game can use it as part of the red trader's walking sequences.
A safe rule of the thumb is that if only the last digit is different from a sequence that belongs to an animal or a person you shouldn't use it.
So using 44 probably isn't a good idea (pig sprites), but using 39 is fine.
Thanks. Maybe while I'm learning I'll make some kind of FAQ thing: things that you can't do or things that I found it hard to find information about.
Incidentally, does it really matter about the palette, because isn't true colour on by default anyway?
Incidentally, does it really matter about the palette, because isn't true colour on by default anyway?
No, it isn't. In fact I play every DMOD on normal (8-bit) mode unless the readme explicitly states that truecolor is necessary. I might become to conservative for this world...