Fallout Modding 2: Dialogue

Discuss the creation and scripting of new fan-made games and mods for the Fallout series of games.
Post Reply
Temaperacl
Vault Veteran
Vault Veteran
Posts: 292
Joined: Fri Apr 19, 2002 11:51 am

Fallout Modding 2: Dialogue

Post by Temaperacl »

Requirements
In order to edit Dialogue in Fallout or Fallout 2, you will need:

1) The Script Decompiler and the Script Compiler.
Or
2) A hex editor ( I recommend BreakPoint Software's Hex Workshop.

The files you will need to extract from the DAT files are the appropriate MSG file from under \text\english\dialog (may be different for different languages, of course.) and the appropriate INT file from under \scripts. A file that might be useful to look at to help you determine which files you need to extract/modify is SCRNAME.MSG under \text\english\game.


1) Using the Compiler/Decompiler
First step now is to decompile the INT file into an IPP file. Use the script decompiler to do this (Load up the decompiler, select the INT file, click save, select a new name for the IPP file, click save, repeat until you are done decompiling all the files, and then click Cancel.). [Note: Often these file will not be able to recompile automatically, and you will have to alter them to get them to compile - it is probably easier to set one up from scratch. Writing something up about general scripting is going to be much longer, so I'm going to put that off for now- I might do it later if people want, although I know that there are those out there with a lot more practice and experience with the scripting than I.. In any case, the rest of (1) assumes that you have a compilable script.]


The functions that are important to know for Dialogue editing are
talk_p_proc
OpenDialog(v1,v2,v3,v4,v5)
CloseDialog
SayWOAnswer(v1,v2,v3)
SayForAnswer(v1,v2)
Answer(v1,v2,v3,v4,v5)

talk_p_proc
This is the function that is called when the player tries to talk to the person the script refers to.

OpenDialog(v1,v2,v3,v4,v5)
is used to Start up the dialog- fairly simple.
I haven't messed around with this function much, so I'm not sure of all the parameters, but:

v1 should be the script ID (or _script_)
v2 should be Self
v4 is the talking head that will be shown (The zero-base line number from HEAD.LST in art\heads [So the head indicated on the second line would be '1', on the third line '2', etc.])
I think v5 has to do with the sound, but I'm not sure about it or v3- if anybody knows, please let us know.

CloseDialog
Used to close the Dialog Box.

SayWOAnswer(v1,v2,v3)
This function displays a message, and only presents the [done] option as an 'answer'.
v1- The ID number for the script/message files. Most of the time, you will just use _script_ here.
v2- the Message to display (See MessageString below.)
v3- Unknown- I think it has to do with the display for the 'Empathy' perk, but It doesn't seem to do anything, so..

SayForAnswer(v1,v2)
This function is used to display a message and should be followed by Answers.
v1- the ID number for the script/message files. Just use _script_ here unless you want to display a message from a different MSG file.
v2- The message to display (see MessageString below.).

Answer(v1,v2,v3,v4,v5)
This is used to display replies to "SayForAnswer" messages.
v1- The minimum intelligence that this message is displayed for. All messages display for 7 intelligences. (So if v1=3, it will show for INT 3 to 9.) The usual settings are -3 for low INT chars, 4 for average and high, and for high INT only.
v2- The ID number for the script/message files. Just use _script_ here unless you want to display a message from a different MSG file.
v3- The message you want to display (see MessageString below.).
v4- The node that will be gone to if this answer is selected (should be a function name prepended with a '@'.
v5- The color to shade this based on Empathy. The color/number correspondences are:
49- blue
50- green
51- red
Any number other than these three may cause some strange effects.

MessageString
This determines what string to select from the MSG file. It should either be a number corresponding to the number of the message you want to display, or it should be a comination of calls (I've only seen GetStr and GetName used, both detailed here:)

GetStr(v1,v2) - v1 is the message/script file ID (use _script_, and v2 is the ID of the line to use (from the MSG file).

GetName(v1) - v1 is the ID of the person who's name you will display (Player to display the player's name.



You can use these functions to build up a dialog, then use the script compiler to compile your IPP file into an INT file and put it and your MSG files into the appropriate directories under your fallout data directory (/script and /text/english/dialog for exampe).


Example:
If you have any questions about the example, feel free to ask.
Excerpt from IPP file:

procedure talk_p_proc;
begin
OpenDialog(_script_,Self,4,-1,-1);
Node01;
CloseDialog;
end;

procedure NodeEND;
begin end;

procedure Node01;
begin
SayForAnswer(_script_,111);
Answer(-3,_script_,112,@Node03,49);
Answer(4,_script_,113,@Node02,50);
Answer(7,_script_,114,@NodeEND,49);
end;

procedure Node02;
begin
SayForAnswer(_script_,116);
Answer(4,_script_,GetName(Player),@Node04,50);
Answer(4,_script_,118,@OtherOne,50);
Answer(7,_script_,114,@NodeEND,49);

end;

procedure Node03;
begin
SayWOAnswer(_script_,115,50);
end;

procedure Node04;
begin
SayForAnswer(_script_,GetStr(_script_,119)+GetName(Player)+GetStr(_script_,121));
Answer(4,_script_,122,@NodeEND,50);
end;

procedure OtherOne;
begin
SayForAnswer(_script_,120);
Answer(4,_script_,112,@NodeEND,50);

end;


MSG File:
{111}{}{How may I help you?}
{112}{}{Uh...}
{113}{}{I have some questions}
{114}{}{(ignore him)}
{115}{}{I don't think I could help you..}
{116}{}{And you are?}
{118}{}{Your worst nightmare.}
{119}{}{I'm sorry, }
{120}{}{My worst nightmare involved a pack of rabid wolves. I was stuck somewhere in the Yukon. And there were tall skinny rabbits, and they were drinking heavily.}
{121}{}{, but I am not allowed to answer any questions for you}
{122}{}{(run away sobbing)}



2)
I'll type up the stuff for editing dialog/scripts directly later. If you have any questions, or if my explanations above weren't clear, please let me know..
Last edited by Temaperacl on Tue Apr 23, 2002 11:45 pm, edited 1 time in total.
User avatar
Gareth
SDF!
SDF!
Posts: 8
Joined: Thu Apr 18, 2002 9:25 pm
Location: right here!
Contact:

Post by Gareth »

hmmm. Thats very interesting. But I have a slight problem with the decompiler. Every time I try to decompile an int file it gives me an error message saying "Unable to initialize DAO/Jet db engine.". any help would be much appreciated.
RadAway: 500$
Combat Shotgun: 2750$
Planting live explosives on the thieving inhabitants of "the den": Priceless
Temaperacl
Vault Veteran
Vault Veteran
Posts: 292
Joined: Fri Apr 19, 2002 11:51 am

Post by Temaperacl »

You could try downloading this and running it, then restart your computer and try again. Note that this is just a guess based on what I think might be the problem. The decompiler isn't my program, so I can't be sure at all.. If you try it, let us know if it works or not..
User avatar
Gareth
SDF!
SDF!
Posts: 8
Joined: Thu Apr 18, 2002 9:25 pm
Location: right here!
Contact:

Post by Gareth »

Yes! it worked! now I can figure out why those damn raiders keep saying that im Garl's father and Ive come to kill my own son. Thanks a bunch Temaperacl.
RadAway: 500$
Combat Shotgun: 2750$
Planting live explosives on the thieving inhabitants of "the den": Priceless
Post Reply