The Dink Network

Scripting Help

May 10th 2007, 08:42 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Well i made this topic beacuse i don't want to create more of my problems like"say script help,move script help etc." so i wanted to add my problems with scripting in here.So my first help of scripting is how can i make Dink invisible cause i made a Dink sprite as a intro but there are two of them and how can i fix the problem with showing graphic cause i made a message on Paint and it won't show?

EDIT:Also i cancel creating my d-mod called "Dink's Vacation" so i try to made an trillogy d-mod called "The Legend of the Dink".
May 10th 2007, 10:02 AM
wizardg.gif
slayer4990
Peasant He/Him Canada
Foppery and Whim! 
For the "Message-not-showing" bit, did you convert it to the dink pallette and throw it in the Dink.INI? And your other problem, I can't think of off the top of my head.
May 10th 2007, 02:01 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
"For the "Message-not-showing" bit, did you convert it to the dink pallette and throw it in the Dink.INI?"

But how?What should i type on Dink INI?
May 11th 2007, 02:12 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
So my first help of scripting is how can i make Dink invisible cause i made a Dink sprite as a intro but there are two of them

If you want Dink in the intro just make it Dink! Start off your script with 'freeze(1);' Then put stuff like
'move_stop(1, #, #, #);' So it moves Dink. It saves alot of trouble. I would recommend this. Or if you still wanna do what you were gonna do, do 'sp_nodraw(1, 1);' to make Dink invisible I think. It means it won't draw (nodraw) the sprite. Whether it is 1 (Dink) &current_sprite, or the name of another sprite, it doesn't matter.

And how can i fix the problem with showing graphic cause i made a message on Paint and it won't show?

In the 'DINK.INI' anywhere, (Down the bottom where it has the message is recommended) since it is a message and not an animation, put 'load_sequence_now graphics/directory/mess-01 NOTANIM' Or 'load_sequence graphics/directory/mess-01 900 NOTANIM' Doesn't matter.

I'll explain it now. Let's say you made a new folder in your GRAPHICS directory of your Dmod and called it MESSAGE. Then you make the BMP and we'll say you called is mess-01. If you had more than one graphic you would make them mess-02, mess-03, all the way to mess-50. You may be able to go higher but I don't know. I don't think you'd have that many graphics in one folder though. Anyway with that settled, in the 'DINK.INI' you would put either 'load_sequence_now' or 'load_sequence' I usually do 'load_sequence_now' I don't think it really matters. Anyway, after that you put the directory. In this case it would be 'graphics/message' Now we put the name of the file. We skip the # because doing what we do adds all the graphics in the folder with mess-#. We go 'mess- ' Finally, we put how we load it. You know, the sequence, frames and all that. But if you aren't doing an animation you only need to put NOTANIM instead of all the other crap. Anyway, you then put '900 NOTANIM' Or if you don't want the sequence to go in sequence 900 in the editor you change the 900 to something else.
May 11th 2007, 11:00 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanks for the first problem but in second i don't understand.Another problem:"How can i change screen for example from 1 to 3?"
May 11th 2007, 07:31 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
but in second i don't understand.

Just load it in the DINK.INI as
load_sequence_now graphics/message/mess- 900 NOTANIM

Assuming that you named the file mess-01 in the directory message.

How can i change screen for example from 1 to 3?"

&player_map = 3; will change the screen to map '3'. But when I usually make it 'fade up/down' I do this:

fade_down();
sp_base_walk(1, 70);
sp_base_attack(1, 100);
sp_brain(1, 1);
sp_que(1, 0);
sp_noclip(1, 0);
sp_active(&kill, 0);
wait(500);
script_attach(1000);
fill_screen(0);
&player_map = #;
load_screen(#);
draw_screen();
&update_status = 1;
draw_status();
sp_x(1, #);
sp_y(1, #);
sp_dir(1, #);
freeze(1);
fade_up();

Where # is the direction Dink faces, the screen he fades to, the screen it loads and the x and y coordinates.

Hope this helps!
May 14th 2007, 05:15 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Whoa! That looks terribly complicated, and it can cause quite nasty bugs too... Doing a script_attach(1000); and no kill_this_task(); is a sure way of crashing the game if you do it a couple of times.

Do it like this: (remove the comments if you like)

//first freeze Dink and let it become dark...
freeze(1);
fade_down();
//Specify the screen Dink will go to
&player_map = #;
//New X and Y coordinates if necessary:
sp_x(1,#);
sp_y(1,#);
//Make the script survive the change of screens:
script_attach(1000);
//Now change screens:
load_screen();
draw_screen();
//Freeze Dink again and make it light again:
freeze(1);
fade_up();
//Rest of the cutscene if necessary
//And don't forget to kill the script afterwards to avoid bugs:
kill_this_task();
May 17th 2007, 11:45 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Ok no i want to change the normal status bar into mine.How can i do that?
May 19th 2007, 06:48 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
Edit the graphics.
May 20th 2007, 10:17 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Ok another problem.How can i make Dink appear again after sp_nodraw?Cause i'm now making another part of The Legend of the Dink
May 20th 2007, 10:49 AM
peasantmb.gif
Lunacre
Peasant He/Him Finland
 
Use sp_nodraw(1, 0);
May 21st 2007, 10:33 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
allright now another problem.WHat shoud i do that one script will not run in the same screen after going to the another screen and return to one where i scripted for example:
First visit on the screen(scripted):
"Let's kick some ass"
<GO to the next screen(unscripted)>
<Returning to the previous screen(scripted)>
"Let's kick some ass"
May 21st 2007, 10:45 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Attach the script to the screen and put what you want to happen in the main procedure. I think that's what your asking..

For WinDinkEdit, go to the screen you want and right click. From there go to properties and you can find the script you want for the screen.

For DinkEdit, open the screen you want scripted, make sure you're in tile mode, and then press B to type in the script name.
May 21st 2007, 01:08 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
wrong rabidwolf9 i know how to script the screen but what shoud i do to not run the script in scripted screen.I tried with if(&story = 0) ended with &story = 1 but nothing.Here's the script:
void main(void)
{
if(&story = 0)

freeze(1);
wait(750);
playsound(24, 22052, 0, 0, 0);
int &circle = create_sprite(250, 215, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(1, 0);
say_stop("Ah finally i'll find this book and kick Seth's ass!", 1);
sp_dir(1, 4)
wait(350);
sp_dir(1, 6);
wait(350);
sp_dir(1, 8);
wait(350);
sp_dir(1, 2);
say_stop("Hmmm i don't see a Temple in here", 1);
sp_dir(1, 4);
say_stop("dang you Matridge you teleported me into bad place!", 1);
unfreeze(1);
kill_this_task();

&story = 1
}
May 21st 2007, 01:39 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Place the brackets correctly:
void main(void)
{
if(&story = 0)
{
freeze(1);
wait(750);
playsound(24, 22052, 0, 0, 0);
int &circle = create_sprite(250, 215, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(1, 0);
say_stop("Ah finally i'll find this book and kick Seth's ass!", 1);
sp_dir(1, 4)
wait(350);
sp_dir(1, 6);
wait(350);
sp_dir(1, 8);
wait(350);
sp_dir(1, 2);
say_stop("Hmmm i don't see a Temple in here", 1);
sp_dir(1, 4);
say_stop("dang you Matridge you teleported me into bad place!", 1);
unfreeze(1);

//kill_this_task(); is not needed
}
&story = 1
}
May 21st 2007, 01:40 PM
peasantmb.gif
Lunacre
Peasant He/Him Finland
 
void main(void)
{
if(&story = 0)

//There should be a bracket here.
{


freeze(1);
wait(750);
playsound(24, 22052, 0, 0, 0);
int &circle = create_sprite(250, 215, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(1, 0);
say_stop("Ah finally i'll find this book and kick Seth's ass!", 1);
sp_dir(1, 4)
wait(350);
sp_dir(1, 6);
wait(350);
sp_dir(1, 8);
wait(350);
sp_dir(1, 2);
say_stop("Hmmm i don't see a Temple in here", 1);
sp_dir(1, 4);
say_stop("dang you Matridge you teleported me into bad place!", 1);
unfreeze(1);
//This line should be before kill_this_task command, I think.
&story = 1;

kill_this_task();

//Add a bracket here too.
}

}

I think that should do it.

Whoops! Metatarasal explained the problem already
May 21st 2007, 01:54 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Tested and problem with the script...Dink won't appear .
May 21st 2007, 03:01 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Oops, my bad. Didn't see another mistake in your script. This line:
if(&story = 0)
should be:
if (&story == 0)
May 26th 2007, 01:47 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Ok i have another problem.How can i do a touch script for example: Dink goes to cave and if he touch a entrance it'll say "Now way i'm not going there!" and came back and how to use a Vision option
May 26th 2007, 02:00 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Touch script:

void main(void)
{
sp_touch_damage(&current_sprite,-1);
}
void touch(void)
{
if (&story < 3)
{
say("Now way i'm not going there!",1);
}
}

To use visions... Well I don't like visions, but if you do plan to use them do it like this:

- Set the vision of the thing you want to be visible only when you choose to and give it a vision (not 0)
- In a script attached to the room set the vision, like when you've set the vision for the object to 5, do this:
void main(void)
{
&vision = 5;
}
And you should be fine, I do believe sprites with a vision need to be of the normal type, using background or invisible causes problems.
May 30th 2007, 01:57 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanx now i want to know what's difference between < & > in for example if (&story > 3);?
May 30th 2007, 02:03 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
if (&story > 3)
{
say_stop("Blah.", 1);
}

That would run if the &story variable is above 3. Didn't you learn the > greater than < less than thing in school? On more thing...

if (&story >= 3)
{
say_stop("Blah.", 1);
}

That will run if the &story variable is either greater than or equal to 3. (It might be ... &story => 3) I forgot.
May 30th 2007, 03:13 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Well the operators are:

== equal to
>= greater then or equal to
> greater then
< less then
<= less then or equal to
!= not equal to

So >= is correct and => isn't.
May 30th 2007, 10:25 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanks but now i have a problem with the new question in choice_start i made this script:
void talk(void)
{
freeze(1);
freeze(&current_sprite);
choice_start();
"Ask about magic"
"Ask about village"
"Ask about Temple of the Ancients"
(&story == 3)"Tell about the blocking road"
"Nevermind"
choice_end()

if (&result == 1)
{
say_stop("Can you learn me some magic?", 1);
say_stop("`3Of course", &current_sprite);
wait(750);
say_stop("`3For 1 million gold.", &current_sprite);
say_stop("WHAT?!!I want it for 1000 gold", 1);
say_stop("`3Million gold or no magic", &current_sprite);
say_stop("NO WAY I'M OUTTA HERE!", 1);
unfreeze(1);
unfreeze(&current_sprite);
}
if (&result == 2)
{
say_stop("Tell me about something about the village", 1);
say_stop("`3Well you are in Midina village the villagers are peaceful.", &current_sprite);
say_stop("`3If not that idiot called Rand!", &current_sprite);
say_stop("`3He suspects me that i changed his axe into a stick.What an ass!", &current_sprite);
unfreeze(1);
unfreeze(&current_sprite);
}
if (&result == 3)
{
say_stop("Tell me about the Temple of the Ancients", 1);
say_stop("`3Temple of the Ancients?Hmmm i don't know about this temple.Sorry.", &current_sprite);
unfreeze(1);
unfreeze(&current_sprite);
}
if (&result == 4)
{
if (&story == 3)
{
say_stop("Hey can you help me?", 1);
say_stop("`3In what?", &current_sprite);
say_stop("The road is blocked is there another way to the temple?", 1);
say_stop("`3What?The road is blocked again!.Ok i'll help you.Hold on for a sec", &current_sprite);
say_stop("`3Ommmmmm.....Ommmmmmm......", &current_sprite);
playsound(24, 22052, 0, 0, 0);
wait(750);
say_stop("`3There you go go south from my house for a secret passage", &current_sprite);
say_stop("Erm....Gee...Thanks...", 1);
unfreeze(1);
unfreeze(&current_sprite);

&story = 4
}
}
if (&result == 5)
{
unfreeze(1);
unfreeze(&current_sprite);
}
and when it's story = 3 it won't show me.What shoud i do?
May 30th 2007, 11:01 AM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Your script works fine. Check if story is 3.
May 30th 2007, 11:36 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanks but that's strange when i enter to the screen where is a watch tower with this script:
void main(void)
{
int &wtower = create_sprite(315, 106, 0, 60, 2);
sp_script(&wtower, "guardwindow");
if (&story == 1)
{
freeze(1);
say_stop("Ah finally i taught i never get out from this forest", 1);
move_stop(1, 6, 310, 1);
say_stop("`3Hey you!", &wtower);
sp_dir(1, 8);
say_stop("Who me?", 1);
say_stop("`3Yes you!Come here!", &wtower);
move_stop(1, 8, 160, 1);
say_stop("`3A!ha! just as i taught you're the one who stole my axe!", &wtower);
say_stop("Wha?", 1);
say_stop("`3Don't lie to me i know it's you!", &wtower);
say_stop("`4Rand!", &wtower);
say_stop("`3What?", &wtower);
say_stop("`4Leave him alone!He didn't stole your axe!", &wtower);
say_stop("`3Oh yes he is!", &wtower);
playsound(9,22050,0,0,0);
say_stop("`3Ow!What was that for!", &wtower);
say_stop("`4Shut your mouth about your axe or you guard at the highest tower.", &wtower);
say_stop("`4Now LEAVE HIM ALONE!", &wtower);
say_stop("`3Ok,ok", &wtower);
say_stop("`4Sorry for that traveller cause he always loves his axe.", &wtower);
say_stop("It's ok", 1);
unfreeze(1)
}
&story = 2
}
From 3 changes to 2.How to fix it?
May 30th 2007, 12:10 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Could you state your problem clearly? I don't get it.
May 30th 2007, 01:03 PM
goblinm.gif
1. SEMICOLONS

2. &story = 2 will always be run the way you've written this. Switch it with the curly brace above it.
May 30th 2007, 01:33 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Oh yes, now I see it too. Must have missed while trying to figure out what he meant with "From 3 changes to 2.How to fix it?"
May 31st 2007, 12:30 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Hmm strange when i add a touch script Dink won't do anything.I'm attaching a script if i did something wrong:
void main(void)
{
sp_touch_damage(&current_sprite, -1);
}
void touch(void)
{
say("`8Hey i said no one enters to Guard House!", &guard);
}
}
May 31st 2007, 01:09 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
What is &guard? Is it a global, and if so where is it referring to?
May 31st 2007, 01:14 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Is &guard a global variable and assigned to the guard sprite? If not, this object will not have access to the sprite you want the line to be spoken by. Also, you have a "}" too many at the end.

Try replacing the last say() line with one where Dink speaks.

If, however, the above points were already taken into account and it still doesn't work you'll have to provide us with a bit more information.
June 1st 2007, 02:25 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Ok now i have a REALLY big problem.I made this script:
void talk(void)
{
if (&sseller == 0)
{
freeze(1);
say_stop("`5Ohhh i'm so sick", &current_sprite);
say_stop("Hey are you ok?", 1);
say_stop("`5Yeah...I'm just so sick", &current_sprite);
wait(500);
say_stop("`5Could you get a elixir for me?I'll give you something.", &current_sprite);
say_stop("Ok i'll help you.", 1);
say_stop("`5Thank you.", &current_sprite);
}
&sseller = 1
}
if (&sseller == 1)
{
freeze(1);
say_stop("`5 Do you have a elixir for me?", &current_sprite);
say_stop("Nope.", 1);
say_stop("`5Then go...please i have a family and i don't want to die.", &current_sprite);
unfreeze(1);
}
if (&sseller == 2)
{
freeze(1);
say_stop("`5Here's your elixir.", 1);
kill_item("item_ELI")
say_stop("`5*gulg*gulg*gulg*", &current_sprite);
int &myx = sp_x(1,-1);
int &myy = sp_y(1,-1);
&myy -= 60;
int &mcrap = create_sprite(&myx, &myy, 6, 169, 1);
sp_seq(&mcrap, 169);
sp_script(&mcrap, "shrink");
&myy -= 30;
&myx -= 30;
int &dcrap = create_sprite(&myx, &myy, 6, 169, 3);
sp_seq(&dcrap, 169);
sp_frame(&dcrap, 3);
sp_script(&dcrap, "shrink");

&myy += 10;
&myx += 60;
int &rcrap = create_sprite(&myx, &myy, 6, 169, 6);
sp_script(&rcrap, "shrink");
sp_seq(&rcrap, 169);
sp_frame(&rcrap, 6);
sp_nodraw(&current_sprite, 1)
int &seller = create_sprite(465, 250, 16, 413, 1);
freeze(&seller)
sp_dir(1, 7)
wait(500);
say_stop("`5Whoah!Thanks bud.Now i feel better", &seller);
say_stop("`5Here's your reward", &seller);
add_item("item-sw1",438, 7);
say_stop("Thanks.", 1);
sp_script("hseller")
&sseller = 3
unfreeze(1);
unfreeze(&seller);
}
and when NPC ends saying in "if(&sseller = 0)"he starts to saying on "if (&sseller == 1)"and when it ends the windows crashed!
June 1st 2007, 02:36 PM
spike.gif
There are a lot of mistakes in there, a good cleanup might be all it needs. I'd fix the brackets and other petty mistakes before even looking for other bugs.
June 2nd 2007, 12:37 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
void talk(void)
{
if (&sseller == 0)
{
freeze(1);
say_stop("`5Ohhh I'm so sick", &current_sprite);
say_stop("Hey are you ok?", 1);
say_stop("`5Yeah...I'm just so sick", &current_sprite);
wait(500);
say_stop("`5Could you get an elixir for me? I'll give you something.", &current_sprite);
say_stop("Ok I'll help you.", 1);
say_stop("`5Thank you.", &current_sprite);
&sseller =1;
goto done;
}

if (&sseller == 1)
{
freeze(1);
say_stop("`5 Do you have an elixir for me?", &current_sprite);
say_stop("Nope.", 1);
say_stop("`5Then go...please, I have a family and I don't want to die.", &current_sprite);
unfreeze(1);
&sseller = 2;
goto done;
}
if (&sseller == 2)
{
freeze(1);
say_stop("`5Here's your elixir.", 1);
kill_this_item("item_eli")
say_stop("`5*gulg*gulg*gulg*", &current_sprite);
int &myx = sp_x(1,-1);
int &myy = sp_y(1,-1);
&myy -= 60;
int &mcrap = create_sprite(&myx, &myy, 6, 169, 1);
sp_seq(&mcrap, 169);
sp_script(&mcrap, "shrink");
&myy -= 30;
&myx -= 30;
int &dcrap = create_sprite(&myx, &myy, 6, 169, 3);
sp_seq(&dcrap, 169);
sp_frame(&dcrap, 3);
sp_script(&dcrap, "shrink");

&myy += 10;
&myx += 60;
int &rcrap = create_sprite(&myx, &myy, 6, 169, 6);
sp_script(&rcrap, "shrink");
sp_seq(&rcrap, 169);
sp_frame(&rcrap, 6);
sp_nodraw(&current_sprite, 1)
int &seller = create_sprite(465, 250, 16, 413, 1);
freeze(&seller)
sp_dir(1, 7)
wait(500);
say_stop("`5Whoah!Thanks bud. Now I feel better", &seller);
say_stop("`5Here's your reward", &seller);
add_item("item-sw1",438, 7);
say_stop("Thanks.", 1);
sp_script("hseller")
&sseller = 3
unfreeze(1);
unfreeze(&seller);

done:
}

There you are! It should work. I also brushed up the grammar and stuff a bit too for you.
June 2nd 2007, 02:30 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
What I would do is reverse the order in which you write the script, like this:

void talk(void)
{
if (&sseller == 2)
{
freeze(1);
say_stop("`5Here's your elixir.", 1);
kill_this_item("item_eli")
say_stop("`5*gulg*gulg*gulg*", &current_sprite);
int &myx = sp_x(1,-1);
int &myy = sp_y(1,-1);
&myy -= 60;
int &mcrap = create_sprite(&myx, &myy, 6, 169, 1);
sp_seq(&mcrap, 169);
sp_script(&mcrap, "shrink");
&myy -= 30;
&myx -= 30;
int &dcrap = create_sprite(&myx, &myy, 6, 169, 3);
sp_seq(&dcrap, 169);
sp_frame(&dcrap, 3);
sp_script(&dcrap, "shrink");

&myy += 10;
&myx += 60;
int &rcrap = create_sprite(&myx, &myy, 6, 169, 6);
sp_script(&rcrap, "shrink");
sp_seq(&rcrap, 169);
sp_frame(&rcrap, 6);
sp_nodraw(&current_sprite, 1)
int &seller = create_sprite(465, 250, 16, 413, 1);
freeze(&seller)
sp_dir(1, 7)
wait(500);
say_stop("`5Whoah!Thanks bud. Now I feel better", &seller);
say_stop("`5Here's your reward", &seller);
add_item("item-sw1",438, 7);
say_stop("Thanks.", 1);
sp_script("hseller")
&sseller = 3;
unfreeze(1);
unfreeze(&seller);
}
if (&sseller == 1)
{
freeze(1);
say_stop("`5 Do you have an elixir for me?", &current_sprite);
say_stop("Nope.", 1);
say_stop("`5Then go...please, I have a family and I don't want to die.", &current_sprite);
unfreeze(1);
&sseller = 2;
}
if (&sseller == 0)
{
freeze(1);
say_stop("`5Ohhh I'm so sick", &current_sprite);
say_stop("Hey are you ok?", 1);
say_stop("`5Yeah...I'm just so sick", &current_sprite);
wait(500);
say_stop("`5Could you get an elixir for me? I'll give you something.", &current_sprite);
say_stop("Ok I'll help you.", 1);
say_stop("`5Thank you.", &current_sprite);
&sseller =1;
}
}

This way it won't go ahead with the part when &sseller == 1 because the &sseller == 0 part is on the end of the script. Doing goto commands can make a script very complicated to read.
June 2nd 2007, 02:34 AM
boncag.gif
Znex
Peasant He/Him Australia
Oh hey. 
To make it shorter, you could change the if (&sseller == 0) to else. Like so:

void talk(void)
{
if (&sseller == 2)
{
freeze(1);
say_stop("`5Here's your elixir.", 1);
kill_this_item("item_eli")
say_stop("`5*gulg*gulg*gulg*", &current_sprite);
int &myx = sp_x(1,-1);
int &myy = sp_y(1,-1);
&myy -= 60;
int &mcrap = create_sprite(&myx, &myy, 6, 169, 1);
sp_seq(&mcrap, 169);
sp_script(&mcrap, "shrink");
&myy -= 30;
&myx -= 30;
int &dcrap = create_sprite(&myx, &myy, 6, 169, 3);
sp_seq(&dcrap, 169);
sp_frame(&dcrap, 3);
sp_script(&dcrap, "shrink");

&myy += 10;
&myx += 60;
int &rcrap = create_sprite(&myx, &myy, 6, 169, 6);
sp_script(&rcrap, "shrink");
sp_seq(&rcrap, 169);
sp_frame(&rcrap, 6);
sp_nodraw(&current_sprite, 1)
int &seller = create_sprite(465, 250, 16, 413, 1);
freeze(&seller)
sp_dir(1, 7)
wait(500);
say_stop("`5Whoah!Thanks bud. Now I feel better", &seller);
say_stop("`5Here's your reward", &seller);
add_item("item-sw1",438, 7);
say_stop("Thanks.", 1);
sp_script("hseller")
&sseller = 3;
unfreeze(1);
unfreeze(&seller);
}
if (&sseller == 1)
{
freeze(1);
say_stop("`5 Do you have an elixir for me?", &current_sprite);
say_stop("Nope.", 1);
say_stop("`5Then go...please, I have a family and I don't want to die.", &current_sprite);
unfreeze(1);
&sseller = 2;
}
else
{
freeze(1);
say_stop("`5Ohhh I'm so sick", &current_sprite);
say_stop("Hey are you ok?", 1);
say_stop("`5Yeah...I'm just so sick", &current_sprite);
wait(500);
say_stop("`5Could you get an elixir for me? I'll give you something.", &current_sprite);
say_stop("Ok I'll help you.", 1);
say_stop("`5Thank you.", &current_sprite);
&sseller =1;
}
}
June 2nd 2007, 02:37 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Metatarasal, scripting the script backwards will not do anything. It's the engine. If you don't have goto blah and that, I'm pretty sure it just continues on with the rest of the script.
June 2nd 2007, 03:57 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
It's the engine.

What's the engine? I'm pretty sure that will work, just try it. I'll try to explain it, this was the old structure, with &sseller starting out as 0:

//&sseller is 0 so this will be true:
if (&sseller == 0)
{
say("sseller0 executing...",1);
//now set &sseller to 1:
&sseller = 1;
}

//because we just set &sseller to 1 this is true too:
if (&sseller == 1)
{
say("sseller1 executing...",1);
//now set &sseller to 2:
&sseller = 2;
}

///////////////////////////////////////
This is the new structure:

//&sseller is 0 so this will be false:
if (&sseller == 1)
{
say("sseller1 executing...",1);
//now set &sseller to 2:
&sseller = 2;
}

//&sseller is 0 so this will be true
if (&sseller == 0)
{
say("sseller0 executing...",1);
//now set &sseller to 1:
&sseller = 1;
}

As you see in the second structure only the needed part will be executed, just try it. Remember that a script is not run in a random order but from the beginning to the end.

<EDIT> Znex, your solution might be shorter but it makes it harder to read through. And is gokussj6 ever wants to extend this script further it won't work anymore...
June 2nd 2007, 05:39 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanks but Znex(or metatarasal) you forgot to add unfreeze(1); also with giving elixir didn't work so i made another way to heal him(By giving for him a healing leaf from lumberjack)

OOOPS!I revealed a secret how to get a sword :X.
June 2nd 2007, 06:08 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
If you reverse the order of things, it won't immediately jump to story part 2 once part 1 is done, because part 2 is defined before part 1. That's the advantage of reversing the order.

Normally there'd be an else if () for this, but I don't think Dink supports that.
June 2nd 2007, 09:41 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Ah. I didn't think reversing it would work. But now that you explained it now I know it does.

You learn something new everyday...
June 4th 2007, 08:37 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
I really just wish that else if()s were included with the engine, but seeing as the whole Dink source code is a mess, that probably won't happen (unless I get good at C++ myself ).
June 4th 2007, 09:43 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
I have a problem now when i freeze Dink and NPC then i added a move_stop blablabla and the NPC won't move!What should i do?
June 4th 2007, 10:20 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Really, how can we reply to it like that? Just include the code snippet when you ask something
June 4th 2007, 10:45 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
Besides that, making a new topic for your problem is probably better.
June 4th 2007, 12:05 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
No way!I don't want to spam the forum with all my problems.How would you feel when in one page will be all topics that i made.BTW here's the script:
void main(void)
{
int &fwall = create_sprite(103, 238, 6, 512, 1)
int &fwall2 = create_sprite(121, 217, 6, 512, 1)
int &fwall3 = create_sprite(122, 186, 6, 512, 1)
int &fwall4 = create_sprite(122, 162, 6, 512, 1)
int &fwall5 = create_sprite(98, 155, 6, 512, 1)
int &wbishop = create_sprite(294, 176, 16, 581, 1)
int &chest = create_sprite(85, 188, 0, 177, 1)
freeze(1);
freeze(&wbishop)
sp_base_walk(&wbishop, 580);
say_stop("`6Ah finally the Ancient Book will be in Seth's hand!", &wbishop);
move_stop(&wbishop, 4, 185, 0);
say_stop("`6Heh!These firewalls won't stop me!", &wbishop);
say_npc("`6Hahahahaha!, &wbishop);
playsound(24, 22052, 0, 0, 0);
int &circle = create_sprite(103, 238, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(&fwall, 1);
wait(250);
playsound(24, 22052, 0, 0, 0);
int &circle2 = create_sprite(121, 217, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(&fwall2, 1);
wait(250);
playsound(24, 22052, 0, 0, 0);
int &circle3 = create_sprite(122, 186, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(&fwall3, 1);
wait(250);
playsound(24, 22052, 0, 0, 0);
int &circle4 = create_sprite(122, 162, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(&fwall4, 1);
wait(250);
playsound(24, 22052, 0, 0, 0);
int &circle5 = create_sprite(98, 155, 7, 167, 1);
sp_seq(&circle, 167);
sp_nodraw(&fwall5, 1);
June 4th 2007, 01:05 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Oi!I forgot about speed!dang so that's why Matridge in the intro won't move!.
June 5th 2007, 04:53 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
So, it works now?

No way!I don't want to spam the forum with all my problems.
You're so thoughtful.
June 5th 2007, 08:57 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
I prefer "Spamming" the forum with actual scripting questions over some of the other posts that pop up all over the board.
June 5th 2007, 10:26 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
I think I know what you mean...
June 5th 2007, 12:14 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Ok i want to know how to make Dink say something if boss is killed.
June 5th 2007, 05:50 PM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
You can barely let Dink say anything when an enemy's dying, because the script will be killed. Use your time efficiently and spawn() a seperate script in the die() procedure to continue the cutscene after killing the boss.
June 6th 2007, 02:17 PM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanx.Now i have a problem.After i setted after beating my boss i want to make Dink go near chest but Dink is on diffrent position.How can i do that?The chest is on position x = 81 y = 183.
June 6th 2007, 03:53 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Set dinks x with the sp_x(); command and his y with the sp_y(); command.

For example:
sp_x(1,81);
sp_y(1,183);
June 6th 2007, 04:12 PM
spike.gif
It would be kinda weird to just teleport him there. :/

I'd propably do something like this:

move_stop(1,4,81,1);
move_stop(1,6,81,1);
move_stop(1,2,183,1);
move_stop(1,8,183,1);

Unless I'd want him to dodge objects, at which point it gets more complicated.
June 8th 2007, 02:38 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
I don't even think there is a way to make Dink dodge objects. There may be, but I don't think so. And there's something you've all been missing with your walking (teleporting in metataraslas' case.) (Heh heh). You should make Dink walk beside the chest. Not on top of it!
June 8th 2007, 12:45 PM
spike.gif
I don't even think there is a way to make Dink dodge objects. There may be, but I don't think so.

Well, there's no conventional way to do it (like a command), but it can be done.

And there's something you've all been missing with your walking (teleporting in metataraslas' case.) (Heh heh). You should make Dink walk beside the chest. Not on top of it!

Ha, you're right about that. But goku didn't say which way the chest it facing, so there's not much we can do about that.
June 8th 2007, 08:01 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Yeah, I s'pose you're right.
June 9th 2007, 08:31 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Ok now i have another problem.I made this script:
void talk(void)
{
freeze(1);
choice_start();
"Chat"
(&bbuilder == 3)"Ask about bridge"
"Nevermind"
choice_end();
if (&result == 1)
{
say_stop("`6Oh man*hic*...", &current_sprite);
say_stop("Hey are you ok?", 1);
say_stop("`6No but i have to tell you *hic* something in your ear", &current_sprite);
say_stop("Yes what is it?", 1);
wait(750);
say_stop("`6This.*hic*", &current_sprite);
playsound(54, 22052, 0, 0, 0);
wait(2500);
say_stop("HEY!", 1);
say_stop("`6Hahaha!*hic* OWNED!", &current_sprite);
unfreeze(1);
}
if (&result == 2)
{
if (&bbuilder == 3)
{
say_stop("Hey do you know how to fix the bridge?", 1);
say_stop("`6No.", &current_sprite);
say_stop("Too bad i must go to the Temple of the Ancients.", 1);
say_stop("`6Wait!I know how to get pass the bridge!", &current_sprite);
say_stop("You know?!Then tell me!", 1);
say_stop("`6Just go left from the bridge into the end*hic*.In the nearest bush there is a secret stairs and take this*hic*.", &current_sprite);
say_stop("Thanks!", 1);
add_magic("item-sfb", 437, 2);
say_stop("Hellfire?But i'm not powerful to do this!", 1);
say_stop("`6Hey *hic* i don't have any weak magics for you *hic* you have to use this now *hic*", &current_sprite);
wait(500);
say_stop("`6Anyway *hic* there are some strange glowing monsters.", &current_sprite);
say_stop("`6Er...", &current_sprite);
playsound(55, 22052, 0, 0, 0);
wait(250);
int &barf = create_sprite(361, 136, 7, 941, 1);
sp_seq(&barf, 941);
unfreeze(1);
say("`6*barf*", &current_sprite);
}
&bbuilder = 4;
}
if (&result == 3)
{
unfreeze(1);
}
}
And when i talk to him about bridge and when Dink say's "You know!Then tell me!" the computer crashed!
June 9th 2007, 09:17 AM
spike.gif
"Just go left from the bridge into the end*hic*.In the nearest bush there is a secret stairs and take this*hic*." is too long for one say_stop. His next line possibly as well.
June 9th 2007, 10:09 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
I don't think that's it. Might be, but I don't think so. Just get rid of the:

if (&bbuilder == 3)
etc.

You don't need it because that will only show up if &bbuilder equals 3. So if it doesn't equal 3 then it won't show up so there's no point. It's probably not it, but it's worth a try.
June 10th 2007, 01:19 AM
spike.gif
DinkDude: Don't think.