Problemo again
I have a code ~~
void talk(void)
{
if (&story == 3)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hello.", 1);
wait(100);
say_stop("`2Welcome to the 'Sword and Axe'", ¤t_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.", ¤t_sprite);
wait(100);
say_stop("`2Economy is really bad for me.", ¤t_sprite);
wait(100);
say_stop("`2I sold everything, with my table!", ¤t_sprite);
wait(100);
say_stop("I see, i will come later!", 1);
wait(100);
sp_dir(1,2);
unfreeze(1);
unfreeze(¤t_sprite);
}
{
if (&story == 4)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hey, im back and i have some news!", 1);
wait(100);
say_stop("`2Tell me them.", ¤t_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!", ¤t_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.", ¤t_sprite);
wait(100);
unfreeze(1);
unfreeze(¤t_sprite);
&story = 5;
}
}
When i run it, the 2nd part with the story 4 doesnt work! It just does nothing! WHY?
void talk(void)
{
if (&story == 3)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hello.", 1);
wait(100);
say_stop("`2Welcome to the 'Sword and Axe'", ¤t_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.", ¤t_sprite);
wait(100);
say_stop("`2Economy is really bad for me.", ¤t_sprite);
wait(100);
say_stop("`2I sold everything, with my table!", ¤t_sprite);
wait(100);
say_stop("I see, i will come later!", 1);
wait(100);
sp_dir(1,2);
unfreeze(1);
unfreeze(¤t_sprite);
}
{
if (&story == 4)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hey, im back and i have some news!", 1);
wait(100);
say_stop("`2Tell me them.", ¤t_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!", ¤t_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.", ¤t_sprite);
wait(100);
unfreeze(1);
unfreeze(¤t_sprite);
&story = 5;
}
}
When i run it, the 2nd part with the story 4 doesnt work! It just does nothing! WHY?
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();
}
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();
}
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(¤t_sprite);
say_stop("Hello, are you the giff of this village?", 1);
wait(100);
say_stop("`1Yes i am. What's the problem?", ¤t_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?", ¤t_sprite);
wait(100);
say_stop("I didnt came from the entrance, i came from a spell.", 1);
wait(100);
say_stop("`1...", ¤t_sprite);
sp_dir(¤t_sprite, 6);
wait(100);
sp_dir(¤t_sprite, 4);
wait(100);
say_stop("`1I didnt know that this village had spells!", ¤t_sprite);
wait(100);
say_stop("`1They needed to inform me before that!", ¤t_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...", ¤t_sprite);
wait(100);
say_stop("`1But his economies wont help us.", ¤t_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!", ¤t_sprite);
wait(100);
&story = 4;
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&story == 5)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hey, i went and he told me he needs money so...", 1);
wait(100);
say_stop("`1Yes...?", ¤t_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.", ¤t_sprite);
wait(100);
&gold += 200;
&story = 6;
unfreeze(1);
unfreeze(¤t_sprite);
}
}
void talk(void)
{
if (&story == 3)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hello, are you the giff of this village?", 1);
wait(100);
say_stop("`1Yes i am. What's the problem?", ¤t_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?", ¤t_sprite);
wait(100);
say_stop("I didnt came from the entrance, i came from a spell.", 1);
wait(100);
say_stop("`1...", ¤t_sprite);
sp_dir(¤t_sprite, 6);
wait(100);
sp_dir(¤t_sprite, 4);
wait(100);
say_stop("`1I didnt know that this village had spells!", ¤t_sprite);
wait(100);
say_stop("`1They needed to inform me before that!", ¤t_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...", ¤t_sprite);
wait(100);
say_stop("`1But his economies wont help us.", ¤t_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!", ¤t_sprite);
wait(100);
&story = 4;
unfreeze(1);
unfreeze(¤t_sprite);
}
if (&story == 5)
{
freeze(1);
freeze(¤t_sprite);
say_stop("Hey, i went and he told me he needs money so...", 1);
wait(100);
say_stop("`1Yes...?", ¤t_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.", ¤t_sprite);
wait(100);
&gold += 200;
&story = 6;
unfreeze(1);
unfreeze(¤t_sprite);
}
}
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.
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.