The Dink Network

Help!This can't work!

July 8th 2009, 05:55 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
I attached this script to a well,but when I tested it,the well just didn't talk to me! Can anyone tell me why is that?
script attached above:
void talk(void)
{
if (&story==0)
{
say_stop("`2Hey.",&current_sprite);
wait (250);
say_stop("Wow!A talking well!",1);
wait (250);
say_stop("`2What?Haven't you seen a well talked?",&current_sprite);
wait (250);
say_stop("Ummm...Yes.",1);
wait (250);
say_stop("`2dang£¡",&current_sprite);
wait (250);
say_stop("...",1);
wait (250);
say_stop("`2There is a stone,hit it.",&current_sprite);
wait (250);
say_stop("Fine.",1)
&story=1;
}
if (&story==1)
{
say_stop("`2Hit it!",&current_sprite);
}
if (&story==2)
{
say_stop("`2Well done.",&current_sprite);
wait (250);
say_stop("<sigh>",1);
&story=3;
}
if (&story==3)
{
say_stop("`2Hey.",&current_sprite);
wait (250);
say_stop("Hey.",1);
}
}
void hit(void)
{
say_stop("`2grrr!",&current_sprite);
}
July 8th 2009, 05:58 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
Are you sure that &story is equal to 0 when the script starts?
July 8th 2009, 06:00 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Yes,I'm sure about it.
July 8th 2009, 06:00 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Maybe I should make &story a global varible?
July 8th 2009, 06:00 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
I'm testing one thing:

void talk(void)
{
if (&story==0)
{
say_stop("`2Hey.",¤t_sprite);
wait (250);
say_stop("Wow!A talking well!",1);
wait (250);
say_stop("`2What?Haven't you seen a well talked?",¤t_sprite);
wait (250);
say_stop("Ummm...Yes.",1);
wait (250);
say_stop("`2dang£¡",¤t_sprite);
wait (250);
say_stop("...",1);
wait (250);
say_stop("`2There is a stone,hit it.",¤t_sprite);
wait (250);
say_stop("Fine.",1)
&story=1;
}
if (&story==1)
{
say_stop("`2Hit it!",¤t_sprite);
}
if (&story==2)
{
say_stop("`2Well done.",¤t_sprite);
wait (250);
say_stop("<sigh>",1);
&story=3;
}
if (&story==3)
{
say_stop("`2Hey.",¤t_sprite);
wait (250);
say_stop("Hey.",1);
}
}
void hit(void)
{
say_stop("`2grrr!",¤t_sprite);
}


I'm not sure if it helps, but try to put spaces like this
(&story == 0)
and so on. Another thing you should do is check out if the story is equal to 0 as Patrunjelu said.
July 8th 2009, 06:02 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
Although this might not be the problem, you could try to freeze dink and the well... (it will help to follow the dialogue better)
freeze(1); freeze(&current_sprite);
same for unfreeze @ the end of the script.
Your script should work since it is nothing wrong there. You could try setting &story to 0 before the actual dialogue (in the same script) to be sure that's not the problem.

void talk(void)
{
&story = 0;
... rest of script
}
July 8th 2009, 06:04 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Thank you guys,I'll try that.
July 8th 2009, 06:05 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
&story is supposed to be a global variable Unless you declare and use it in another script.
But as far as I can see, &story will be equal to 2 when the stone is hit (2 is a value assigned to it in the stone's hit procedure right?). That means, &story has to be global.
July 8th 2009, 06:09 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
I made an effort as you told,but the well just said "Hey" to me,and there was no other words from it....
Why?
Why?
Why???
July 8th 2009, 06:11 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
Can you show me your new script?
July 8th 2009, 06:13 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
There is no big change.I just added some space in it...
void talk(void)
{
if (&story == 0)
{
say_stop("`2Hey.",&current_sprite);
wait (250);
say_stop("Wow!A talking well!",1);
wait (250);
say_stop("`2What?Haven't you seen a well talked?",&current_sprite);
wait (250);
say_stop("Ummm...Yes.",1);
wait (250);
say_stop("`2dang£¡",&current_sprite);
wait (250);
say_stop("...",1);
wait (250);
say_stop("`2There is a stone,hit it.",&current_sprite);
wait (250);
say_stop("Fine.",1)
&story = 1;
}
if (&story == 1)
{
say_stop("`2Hit it!",&current_sprite);
}
if (&story == 2)
{
say_stop("`2Well done.",&current_sprite);
wait (250);
say_stop("<sigh>",1);
&story = 3;
}
if (&story == 3)
{
say_stop("`2Hey.",&current_sprite);
wait (250);
say_stop("Hey.",1);
}
}
void hit(void)
{
say_stop("`2grrr!",&current_sprite);
}
July 8th 2009, 06:17 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
void talk(void)
{
freeze(1);
freeze(&current_sprite);
if (&story == 0)
{
say_stop("`2Hey.", &current_sprite);
wait(250);
say_stop("Wow!A talking well!", 1);
wait(250);
say_stop("`2What?Haven't you seen a well talked?", &current_sprite);
wait(250);
say_stop("Ummm...Yes.", 1);
wait(250);
say_stop("`2dang", &current_sprite);
wait(250);
say_stop("...", 1);
wait(250);
say_stop("`2There is a stone,hit it.", &current_sprite);
wait(250);
say_stop("Fine.", 1)
&story = 1;
}
if (&story == 1)
{
say_stop("`2Hit it!", &current_sprite);
}
if (&story == 2)
{
say_stop("`2Well done.", &current_sprite);
wait(250);
say_stop("<sigh>", 1);
&story = 3;
}
if (&story == 3)
{
say_stop("`2Hey.", &current_sprite);
wait(250);
say_stop("Hey.", 1);
}
unfreeze(1);
unfreeze(&current_sprite);
}
void hit(void)
{
say_stop("`2grrr!",&current_sprite);
}

Try it now.
The problem was since the beginning, the space between the procedure's name and it's parameter: wait(250) is correct, wait (250) isn't.
It should work now.
July 8th 2009, 06:22 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Oh I understand.
Thank you!!
July 8th 2009, 06:25 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Patrunjelu, you don't need to put freeze(&current_sprite) there, because the well probably isn't moving at all

...unless it has three, no, I mean two legs
July 8th 2009, 06:26 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
I put freeze(&current_sprite) by default to any sprite. I just got used to doing so.
July 8th 2009, 06:27 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
There is one more problem.
When I talked to the well then I talked to the stone,it just said "Is it the well?" to me and there is no more words from it.
This is the stone's script.
void talk(void)
{
if (&story != 1)
{
say_stop("`3I'm a tree.",&current_sprite);
}
if (&story == 1)
{
say_stop("`3Is it the well?",&current_sprite);
wait(250);
say_stop("Yes.",1);
wait(250);
say_stop("`3I knew it.",&current_sprite);
&story = 2;
}
}
void hit(void)
{
say_stop("`3Don't hit me!",&current_sprite);
}

July 8th 2009, 06:27 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
void talk(void)
{
freeze(1);
freeze(&current_sprite);
if (&story != 1)
{
say_stop("I'm a tree.", &current_sprite);
}
if (&story == 1)
{
say_stop("`3Is it the well?", &current_sprite);
wait(250);
say_stop("Yes.", 1);
wait(250);
say_stop("I knew it.", &current_sprite);
&story = 2;
}
unfreeze(1);
unfreeze(&current_sprite);
}

void hit(void)
{
say_stop("`3Don't hit me!", &current_sprite);
}

try it now.
and for better looks:
void talk(void)
{
	freeze(1);
	freeze(&current_sprite);
  if (&story != 1)
  {
   say_stop("I'm a tree.", &current_sprite);
  }
  if (&story == 1)
  {
   say_stop("`3Is it the well?", &current_sprite);
   wait(250);
   say_stop("Yes.", 1);
   wait(250);
   say_stop("I knew it.", &current_sprite);
   &story = 2;
  }
  unfreeze(1); 
  unfreeze(&current_sprite);
}

void hit(void)
{
say_stop("`3Don't hit me!", &current_sprite);
}
July 8th 2009, 06:29 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Wow!It worked again!
Could you tell me what's wrong with the origional script?
July 8th 2009, 06:32 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
I didn't change much to it. It's just the space between wait procedure and it's parameter.
You are using wait (250); when you should be using wait(250);
Once the game tries to compile the wait (250); line it gets an error and doesn't even try to do anything further with the script.
July 8th 2009, 06:33 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Oh,I understand.
Now,it's time to take over the world!Hahahaha!
July 8th 2009, 06:36 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
You won't get me alive.
*uses poison*
July 8th 2009, 06:39 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Nooooo!You can't die!
What can I do without you?How can I defeat a pillbug if you are not with me?HOW?...<burst into tears>
July 8th 2009, 06:39 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
Now a thing asked millions of times:
How come every topic in TDN always gets off-topic?
July 8th 2009, 06:40 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
Don't worry. I am immune to poison.
After solving one's problems a piece of offtopic is always welcome.
July 8th 2009, 06:44 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Ummm...May I ask what a "offtopic" is?
I don't know much about that you know.
July 8th 2009, 06:46 AM
dragon.gif
Patrunjelu
Peasant He/Him Romania
Rawr! 
This thread was created so that you can find out why your script wasn't working.
When we started talking about something else other than your script (poison thing and taking over the world) we were offtopic since those things were never the point of this thread.
July 8th 2009, 06:48 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
Oh.I'll take care about that.
God,forgive me for my off-topic behavior...
July 8th 2009, 06:54 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
It's not so horrible.

Now, if you want to create a thread not connected to Dink or just something completely random, then you can use the off-topic thread (marked with banana)
July 8th 2009, 06:57 AM
knights.gif
pathfinder
Peasant He/Him China
I love hanging ON LINE without doing anything... 
I agree completely.
I'm new here after all.
July 8th 2009, 06:58 AM
custom_skull.gif
Skull
Peasant He/Him Finland bloop
A Disembodied Sod 
You could make a thread where you introducte yourself.