📧 Message Board Archive

scripting questions
Ok, i am trying to write a dmod. but I can't figure out how to change the storyline. I know you enter something like

&story= (whatever number)

but what number do you initially enter when you first change the story? how do you get it to change what people say? HELP!



thanx in advance
Re: scripting questions
: Ok, i am trying to write a dmod. but I can't figure out how to change the storyline. I know you enter something like



: &story= (whatever number)



: but what number do you initially enter when you first change the story? how do you get it to change what people say? HELP!



: thanx in advance



Okay... There's nothing special about the story variable, that's just what most d-mod (and the original) call the global variable they use to track the main plot.



So first of all, make sure you have the correct stament in main.c to create &story in the first place, it should look like this:



make_global_int("&story", 0);



Though 0 could be 1 any other sumber if you like. But assuming &story starts out 0 then when Dink does the first quest in he main plot (say picks up the Amulet of Akizamen) you would go:



&story = 1;



Then when he does the next part (say give the amulet to the king) you would go:



&story = 2;



That's all there is to it. To have it effect what people say you mostly just the if stament. So in my last example, the following would go in the king's talk procedure:



if (&story == 0)

{

 say("'4Bring me the Amulet of Akizamen!", &current_sprite);

 say("Okay Kingy!", 1);

}

if (&story == 1)

{

 say("'4Ah! Amulet of Akizamen!", &current_sprite);

 say("No problem.", 1);

 &story = 2;

 return;

 //return so the next part doesn't run right away

}

if (&story > 1)

{

 say("'4Thanks for that amulet you got me ealier Dink.", &current_sprite);

 say("Oh yeah, any time.", 1);

}
Re: scripting questions
Thank you SO much! I have it working now, i hope :) .
Re: scripting questions
I was wondering that too. Thanks Paul!