Fallout Modding 4: Script (IPP) files

Discuss the creation and scripting of new fan-made games and mods for the Fallout series of games.
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

Red wrote:If you could add to the DB this stuff:
... skipped ...
It'd be really cool, as I can't save in Access97 format...
I only need to know, which of those opcodes have the return value. :wink:
Red wrote:

Code: Select all

[*] 8061	sayMsgTimeout -> SayMsgTimeout
And what is the difference? :? The compiler is case-insensitive.
Red wrote: Also if you have any idea how the "Dopcom" works, it'd probably help me a lot...
The "DopComs" and "nDopCom" fields allow to make several different interpretations of base Opcode ("FirstCom" field) depending on what bytes follow it.
Take a look at opcode 800d. There are two possible treatments of this code: RetF and RetN. If decompiler encounters sequence 800d  8019 802a 8029 800c 801c 802a 8029 801c (nDopCon=8 additional words), it will place RetF into the source code. But if there are only 5 matching additional words 800d  8019 802a 8029 800c 801c and then c001 for example, RetN will be produced.
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

I've only included those without return values, as I'm still not certain wether I understand how the return values are represented in the decompiled int format.

Although this last statement might mean that they return something and I don't know about it :)

As for the "say" part, it's just to be consistant with all other named variables, nothing more.
...
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

Red wrote:I've only included those without return values, as I'm still not certain wether I understand how the return values are represented in the decompiled int format.
The return values are not reflected directly in the INT - they are just pushed onto the stack (decompiler is instructed to use this value by stack:= in the database).
Red wrote: Although this last statement might mean that they return something and I don't know about it :)
They can return some values. CanHear surely does, and others most likely don't.
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

OK, well, here's the revised list. Note that it's smaller, I'll discuss it below.

Code: Select all

[+] 801b	Unknown801B(p2,p1)
[+] 8027	Unknown8027(p3,p2,p1)
[*] 8044	ABS -> Floor (Very different...)
[+] 804d	Fo1DialogEnd
[+] 804e	Fo1DialogStart
[+] 8052	Fo1DialogReply(p2,p1)
[+] 8054	Fo1SayWOAnswer(p2,p1)
[+] 80cd	AnimateStandObj2(p1)
[+] 80f5	stack:=Hear(p5,p4,p3,p2,p1)
[+] 8126	RegAnimateForever(p2,p1)
[+] 814e	SetBarterModifier(p1)
[+] 8152	Flee(p2,p1)
How do you handle opcodes with semmingly variable number of variables, and others with a few specific number of variables (say 3, 7 and 9)?
...
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

New revision of database and headers is available here: http://return0.pisem.net/Opcodes/deco&ipp_04.06.rar
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

Kickass, thanks.
...
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

Here's the additions:

Code: Select all

[+] 80a2 return(p1)
[+] 80de FO1OpenDialog(p5,p4,p3,p2,p1)					(FO1)
[+] 80df FO1CloseDialog(p5,p4,p3,p2,p1)					(FO1)
[+] 8110 RegAnimReverse(p4,p3,p2,p1)
And these are some which I still don't understand, but I looked into the number of variables they take, so here's a list hoping you can do something with that.

Code: Select all

[+] 80c7 stack:=ScriptAction(p1[,...])					(FO1)
[+] 80f1 RemoveTimer(Critter)	(Critter,Critter)	(Critter,loc,Critter)
[*] 8102 AddTrait		10, 8, 5, 4
	Depending on something, you can trigger to set, add or substract a
	value.  You can specify more then one Trait/Perk.
[+] 8103 RemoveTrait		8, 5, 4
	Behaves similarely to AddTrait.
[+] 8113 RegAnimMoveToTile	3, 4, 5, 7, 8				(FO1)
[+] 811f SayOption(p4,p3,p2,p1[,...])					(FO1)
	Arrays of 4 options are repeated to form the available dialog options
...
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

AH finally!

I love you!

OK, well, not exactly, but thanks a lot!
...
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Needed this as reference

Post by Red »

Since I needed this just rencently I figured I'd post in this thread to bring it back up again :)
...
ABel
Scarf-wearing n00b
Scarf-wearing n00b
Posts: 33
Joined: Tue May 28, 2002 12:44 pm
Location: Krasnoyarsk, Russian Wasteland
Contact:

Post by ABel »

I've just uploaded new revision of decompiler base and header files. You can get the package here: http://return0.pisem.net/opcodes/fodb_20030108.rar

This update includes:
1. Variable declarations removed from SYSTEM.IPP (since they are added by decompiler).
2. SeaWolf contributed new version of STATS.IPP.
3. RetF fixed.

If you find some error, please post in this thread.

In the same folder (http://return0.pisem.net/opcodes/) there is offline version of so called Fallout Opcode Playground - this is some kind of FO opcode reference (functions, descriptions etc). Some opcode descriptions are in russian, but I hope they will be translated soon.
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

well
I think i found a bug when decompiling file kcsulik.int.
It loks like that:

Code: Select all

Answer(4,383,GetStr(14,@Node1001,50);
and it schuld be like that:

Code: Select all

Answer(4,383,GetStr(14,10001),@Node1001,50);
Functions Answer(); and Getstr(); dont work propelry together.
User avatar
Briareus
I Make Games!
I Make Games!
Posts: 48
Joined: Wed Jan 08, 2003 1:24 am

Re: Fallout Modding 4: Script (IPP) files

Post by Briareus »

Warning: I never did any scripting for either Fallout game, but I did do scripting on Klingon Academy, and it uses the same language (but different engine functions, obviously). Hopefully, this post will help more than hinder you...

Temaperacl wrote:ScriptLibs- Again, one I haven't messed around with much- basically the list of the lib files to use. This is just a comma-delimited list of other ipp files (minus the ipp extension). (The basic ones which you'll need to include are "system,stdlib").
If you're going to be making your own scripts, there's no reason you can't make your own lib files. They're just script files without an entry point for the engine (the 'main' procedure in Klingon -- I don't know what was used in the Fallouts, probably just the callbacks...).
Temaperacl wrote:ProcedureList- An optional list of the procedures in the script file in the format procedure ProcedureName;forward;. there is no problem with not including this.
Actually, it's optional only if you have the procedure defined before it's used in the script. For example, if you have:

Code: Select all

procedure Proc1()
begin
   Proc2();
end

procedure Proc2()
begin
   DoSomething();
end
Then you need to define Proc2 in the proclist. Otherwise, you've got to prototype Proc2 before you define Proc1. Even though it's optional, I'd recommend just defining all your procs in the list to avoid any compile time errors.

Temaperacl wrote:DebugPrint(msg)
Should print a message out to the Debug window (or maybe to the normal message window, but when you are in debug mode?) - I haven't been able to get into debug mode, so I can't be sure- if anybody knows how, let me know, please.
Without a debug version of the .exe, this isn't going to work for you. When scripting, the engine can output this to either Visual Studio's debug window, or a monochrome monitor if you've got one hooked up. It was very handy while scripting and for QA to use.

Edit: I see you got it working. Kudos. :wink:


Red wrote:This is true, however I'd like to point out that the compiler doesn't process this properly, as instead of creating a local variable for the function, it creates a global one. This means that every time you create a new variable it needs to have a unique name even though others are not within the scope of the function... This is quite annoying, especially dealing with decompiled scripts which use local variables.
Are you sure you're placing the definition for the new vars in the correct spot? To create a local variable to a procedure, you should have something like:

Code: Select all

procedure MyProc()
begin
   variable myVar := 1;
end;

Red wrote:There is also \.
If it's used inside a string, it's an escape character so that the symbol after it is printed. For example:

Code: Select all

debug( "Print the double-quote " symbol." );
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Re: Fallout Modding 4: Script (IPP) files

Post by Red »

First, keep in mind that the compiler was build by fans, it's not the original KA compiler. Though the KA compiler might have inspired the authors of that compiler. Either way it MIGHT behave differently then the KA compiler (for more reasons then it being for another game). I have no idea, and until recently didn't even know the compiler for KA was ever released.
Are you sure you're placing the definition for the new vars in the correct spot? To create a local variable to a procedure, you should have something like:

Code: Select all

procedure MyProc()
begin
   variable myVar := 1;
end;
It's possible, I hadn't considered that the compiler might work like that (as in C/C++/Java) since the decompiler works as pascal...
Red wrote:There is also \.
If it's used inside a string, it's an escape character so that the symbol after it is printed. For example:

Code: Select all

debug( "Print the double-quote " symbol." );
What was the topic of the converstaion about that since I can't find it in the thread (though I didn't re-read all of it, just did a search)... You're pulling stuff we talked about ages ago :D.

Again I'd like to point out I assumed Pascal workings (escaping the quote by double quoting).
...
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

I found next bug in decompiler (or compiler) :roll:
file kcsulik.int
Decompiler writes more than 255 symbols in single line and compiler read only 255 symbols in a line (and cuts the rest ).
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

Yeah, there's plenty of that. I don't really know how the decompiler should really handle that but we're stuck with it.
...
Jargo
Respected
Respected
Posts: 85
Joined: Fri Dec 27, 2002 6:17 pm
Location: FMC (Poland)
Contact:

Post by Jargo »

Ok one more question :]
Is there any way to get value of variable(SVAR) from one script to another script without using global and map variables (MVAR,GVAR)?
User avatar
Red
Hero of the Glowing Lands
Hero of the Glowing Lands
Posts: 2085
Joined: Wed May 15, 2002 11:58 am
Location: Nowhere (important anyway)
Contact:

Post by Red »

Um, no. That's the whole point of SVARs...
...
Our Host!
Post Reply