Dnotalk.c
I know this is very basic scripting, but what can I say, I'm a scripting disaster.
I'm kind of stuck how to customize Dnotalk.c succesfully. I tried some things, and some scripts crashed, but now I have this:
//dnotalk.c
void main( void )
{
if (&player_map == 500) {
say("Yeah", 1); }
if (&player_map == 65) {
say("Your momma", 1); }
else {
int &randy = random(5, 1);
if (&randy == 1)
say("I don't see anything interesting.",1);
if (&randy == 2)
say("There isn't much to see here.",1);
if (&randy == 3)
say("What should I look at?",1);
if (&randy == 4)
say("Hmm, perhaps I should look at something.",1);
if (&randy == 5)
say("I see air.",1); }
}
Now, Dink only says "Your momma", and doesn't say "Yeah" when he's in screen 500. Anyone knows how to properly do this? Note that the texts are changed because I might give away something then.
EDIT: This is mu 1212th post on this forum! *does the happy dance*
I'm kind of stuck how to customize Dnotalk.c succesfully. I tried some things, and some scripts crashed, but now I have this:
//dnotalk.c
void main( void )
{
if (&player_map == 500) {
say("Yeah", 1); }
if (&player_map == 65) {
say("Your momma", 1); }
else {
int &randy = random(5, 1);
if (&randy == 1)
say("I don't see anything interesting.",1);
if (&randy == 2)
say("There isn't much to see here.",1);
if (&randy == 3)
say("What should I look at?",1);
if (&randy == 4)
say("Hmm, perhaps I should look at something.",1);
if (&randy == 5)
say("I see air.",1); }
}
Now, Dink only says "Your momma", and doesn't say "Yeah" when he's in screen 500. Anyone knows how to properly do this? Note that the texts are changed because I might give away something then.

EDIT: This is mu 1212th post on this forum! *does the happy dance*
Try write it like this i find your scripting messy
void main(void)
{
if (&player_map == 500)
{
say("Yeah", 1);
}
if (&player_map == 65)
{
say("Your momma", 1);
}
else
{
int &randy = random(5, 1);
}
if (&randy == 1)
{
say("I don't see anything interesting.",1);
}
if (&randy == 2)
{
say("There isn't much to see here.",1);
}
if (&randy == 3)
{
say("What should I look at?",1);
}
if (&randy == 4)
{
say("Hmm, perhaps I should look at something.",1);
}
if (&randy == 5)
{
say("I see air.",1);
}
}
void main(void)
{
if (&player_map == 500)
{
say("Yeah", 1);
}
if (&player_map == 65)
{
say("Your momma", 1);
}
else
{
int &randy = random(5, 1);
}
if (&randy == 1)
{
say("I don't see anything interesting.",1);
}
if (&randy == 2)
{
say("There isn't much to see here.",1);
}
if (&randy == 3)
{
say("What should I look at?",1);
}
if (&randy == 4)
{
say("Hmm, perhaps I should look at something.",1);
}
if (&randy == 5)
{
say("I see air.",1);
}
}
Oh yes, I scripted it that way (else it wouldn't even work), this board must've messed it up a bit. I'll edit my post, but yeah, that's the way I did it.
Try write it with { and }
like:
if (&rand == 1);
{
say("I dont know how else to help you",1);
}
like:
if (&rand == 1);
{
say("I dont know how else to help you",1);
}
Ooh, ooh, I know, I know
void main(void)
{
if (&player_map == 500)
{
say("Yeah", 1);
}
if (&player_map == 65)
{
say("Your momma", 1);
}
else
{
int &randy = random(5, 1);
}
if (&randy == 1)
{
say("I don't see anything interesting.",1);
}
//Blah...
If &player_map is 500, the first line will be said, but the script will continue through all other lines. The else only works if &player_map is not 65. Basically, even when &player_map is 500, it'll still execute the else block, and say another text (which'll quickly overrule the first one, so that first if-statement is rubbish).
Secondly, &randy only gets initted when &player_map is not 65. Though as we've just seen, the value of it ís used, even when &player_map ís 65. Then there'll exist no variable called &randy, thus not knowing what to compare. In the (Java-)programmers world, this is a NullPointerException. It'll help to put return; after Dink has said something, especially in the &player_map checks.

void main(void)
{
if (&player_map == 500)
{
say("Yeah", 1);
}
if (&player_map == 65)
{
say("Your momma", 1);
}
else
{
int &randy = random(5, 1);
}
if (&randy == 1)
{
say("I don't see anything interesting.",1);
}
//Blah...
If &player_map is 500, the first line will be said, but the script will continue through all other lines. The else only works if &player_map is not 65. Basically, even when &player_map is 500, it'll still execute the else block, and say another text (which'll quickly overrule the first one, so that first if-statement is rubbish).
Secondly, &randy only gets initted when &player_map is not 65. Though as we've just seen, the value of it ís used, even when &player_map ís 65. Then there'll exist no variable called &randy, thus not knowing what to compare. In the (Java-)programmers world, this is a NullPointerException. It'll help to put return; after Dink has said something, especially in the &player_map checks.
I now have this:
//The script with the texts
void main(void)
{
if (&player_map == 500)
{
say("Yeah", 1);
}
if (&player_map == 499)
{
say("Your momma", 1);
}
}
else
{
int &randy = random(5, 1);
}
if (&randy == 1)
{
say("I don't see anything interesting.",1);
}
if (&randy == 2)
{
say("There isn't much to see here.",1);
}
if (&randy == 3)
{
say("What should I look at?",1);
}
if (&randy == 4)
{
say("Hmm, perhaps I should look at something.",1);
}
if (&randy == 5)
{
say("I see air.",1);
}
}
And that's kinda cool, 'cause Dink now says both "your momma" and "yeah", but when he's in any other screen, he doesn't say anything. Maybe that's even cooler...
//The script with the texts
void main(void)
{
if (&player_map == 500)
{
say("Yeah", 1);
}
if (&player_map == 499)
{
say("Your momma", 1);
}
}
else
{
int &randy = random(5, 1);
}
if (&randy == 1)
{
say("I don't see anything interesting.",1);
}
if (&randy == 2)
{
say("There isn't much to see here.",1);
}
if (&randy == 3)
{
say("What should I look at?",1);
}
if (&randy == 4)
{
say("Hmm, perhaps I should look at something.",1);
}
if (&randy == 5)
{
say("I see air.",1);
}
}
And that's kinda cool, 'cause Dink now says both "your momma" and "yeah", but when he's in any other screen, he doesn't say anything. Maybe that's even cooler...

This should work, didn't test it though.
void main()
{
int &randy = random(5, 1);
if (&randy == 1)
say("I don't see anything interesting.",1);
if (&randy == 2)
say("There isn't much to see here.",1);
if (&randy == 3)
say("What should I look at?",1);
if (&randy == 4)
say("Hmm, perhaps I should look at something.",1);
if (&randy == 5)
say("I see air.",1);
if (&player_map == 500)
say("Yeah", 1);
if (&player_map == 499)
say("Your momma", 1);
}
void main()
{
int &randy = random(5, 1);
if (&randy == 1)
say("I don't see anything interesting.",1);
if (&randy == 2)
say("There isn't much to see here.",1);
if (&randy == 3)
say("What should I look at?",1);
if (&randy == 4)
say("Hmm, perhaps I should look at something.",1);
if (&randy == 5)
say("I see air.",1);
if (&player_map == 500)
say("Yeah", 1);
if (&player_map == 499)
say("Your momma", 1);
}
Thou art screwing up...
The second } after your momma closes the main proc.
say("Yeah",1);
return;
Using return in case of &player_map checks may work.
Also remove that main proc closing } after your momma.
The second } after your momma closes the main proc.
say("Yeah",1);
return;
Using return in case of &player_map checks may work.
Also remove that main proc closing } after your momma.
I díd screw up. But I really think it's kind of cool to just disable those "nothing to see here" lines. I think I'll also remove the dnomagic lines., now I'm at it. When there is something significant happening in the screen, I'll let Dink say something.
Please take into consideration that when a player presses space when seeing nothing, he'll get accustomed to Dink saying nothing, probably forgetting that on some screens at some times there might be something useful to be said. Don't place any quest-critical stuff in there, even the most subtle hint will get lost.
Yeah, I know, I won't. Though, I don't think it's any different now, since no D-Mod has Dink saying something other than his regular lines, and even if I did have Dink say something in every screen, I don't think players will try "examening" every screen. Dnotalk will be more some kind of a funny extra, a small novelty, than anything else.