The Dink Network

Problemo again

April 6th 2009, 08:38 AM
goblinh.gif
mkbul
Peasant He/Him Greece
TPA~ 
I have a code ~~

void talk(void)

{
if (&story == 3)
{
freeze(1);
freeze(&current_sprite);

say_stop("Hello.", 1);
wait(100);
say_stop("`2Welcome to the 'Sword and Axe'", &current_sprite);
wait(100);
say_stop("Sounds like a nice name.", 1);
wait(100);
say_stop("Do you sell weapons now?", 1);
wait(100);
say_stop("`2If you had read the sign you will know that i dont.", &current_sprite);
wait(100);
say_stop("`2Economy is really bad for me.", &current_sprite);
wait(100);
say_stop("`2I sold everything, with my table!", &current_sprite);
wait(100);
say_stop("I see, i will come later!", 1);
wait(100);
sp_dir(1,2);

unfreeze(1);
unfreeze(&current_sprite);
}

{
if (&story == 4)
{
freeze(1);
freeze(&current_sprite);

say_stop("Hey, im back and i have some news!", 1);
wait(100);
say_stop("`2Tell me them.", &current_sprite);
wait(100);
say_stop("Giff want's you to do thw weapon as soon as possible!", 1);
wait(100);
say_stop("I guess he wants to do something outside this land!", 1);
wait(100);
say_stop("`2If he gives me some money i can!", &current_sprite);
wait(100);
say_stop("Ok, i will tell him. No promise though.", 1);
wait(100);
say_stop("`2 200 Gold is enough i belive.", &current_sprite);
wait(100);

unfreeze(1);
unfreeze(&current_sprite);

&story = 5;
}
}

When i run it, the 2nd part with the story 4 doesnt work! It just does nothing! WHY?
April 6th 2009, 08:58 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
There is a bracket right before your if (&story == 4) statement that is unnecessary. You might also want to double check to see if your &story variable is the right value.

What I usually do is make a key script that will tell me all my variables at any given time. Something like this helps a lot.

//key-80.c "P"
void main ()
{
freeze(1);
choice_start();
"Story is &story"
choice_end();
unfreeze(1);
kill_this_task();
}
April 6th 2009, 11:01 AM
goblinh.gif
mkbul
Peasant He/Him Greece
TPA~ 
Thanks it worked, now i have a problem that it doesnt add the gold if i tak to him! Why?

void talk(void)
{
if (&story == 3)
{
freeze(1);
freeze(&current_sprite);

say_stop("Hello, are you the giff of this village?", 1);
wait(100);
say_stop("`1Yes i am. What's the problem?", &current_sprite);
wait(100);
say_stop("I need your help. What is this village called?", 1);
wait(100);
say_stop("`1Its called Vesti, you fool. Didnt you read the sign just in front of the entrance?", &current_sprite);
wait(100);
say_stop("I didnt came from the entrance, i came from a spell.", 1);
wait(100);
say_stop("`1...", &current_sprite);
sp_dir(&current_sprite, 6);
wait(100);
sp_dir(&current_sprite, 4);
wait(100);
say_stop("`1I didnt know that this village had spells!", &current_sprite);
wait(100);
say_stop("`1They needed to inform me before that!", &current_sprite);
wait(100);
say_stop("Well, do you know that the armor is gonna make a weapon for that blcked entrance?", 1);
wait(100);
say_stop("`1Of course...", &current_sprite);
wait(100);
say_stop("`1But his economies wont help us.", &current_sprite);
wait(100);
say_stop("Ok im gonna ask him", 1);
wait(100);
say_stop("`1He needs to make it or...Go out and tell him!", &current_sprite);
wait(100);

&story = 4;

unfreeze(1);
unfreeze(&current_sprite);
}

if (&story == 5)
{

freeze(1);
freeze(&current_sprite);

say_stop("Hey, i went and he told me he needs money so...", 1);
wait(100);
say_stop("`1Yes...?", &current_sprite);
wait(100);
say_stop("He told me that he needs 200 at least.", 1);
wait(100);
say_stop("`1Aww...i haven't got any other choice! Take them.", &current_sprite);
wait(100);
&gold += 200;
&story = 6;

unfreeze(1);
unfreeze(&current_sprite);
}
}

April 6th 2009, 11:19 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
The script works for me...

I really haven't got any idea what might be behind this, you could try inserting two say_stop(); commands to make sure that the amount of gold really isn't changing. Just replace:

&gold += 200;

with:

say_stop("gold is &gold",1);
&gold += 200;
say_stop("gold is &gold",1);


Other than that I can't think of anything right now.