Fallout 2 mod FO2 Engine Tweaks (Sfall)

Text errors are fixes in MSG files, not in sfall. in sfal was no such fix.
This can't be really fixed in msg.
The best I can do is to add a space:
“He has %d/%d hps and is wielding a %s. and has crippled limbs.”

An actual fix would need to remove the full stop when "and has crippled limbs.” is added to the line.

Normally the game does this (i.e. adds a full stop or not depending if something is added to the line or not). (see my first post describing the combination of lines in proto.msg, which includes a "comma" (544) and "full stop" (545).)
In this case (awareness + crippled) it fails to do that.

Anyway, it's not a big deal. Just mentioning really.
 
I have updated to the latest modderspack, but I can't compile gl_highlighting anymore. It throws the following error:

Code:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.FormatException: Die Eingabezeichenfolge hat das falsche Format.
   bei System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   bei System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   bei ScriptEditor.CodeTranslation.Compiler.Compile(String infile, String& output, List`1 errors, Boolean preprocessOnly)
   bei ScriptEditor.TextEditor.Compile(TabInfo tab, String& msg, Boolean showMessages, Boolean preprocess)
   bei ScriptEditor.TextEditor.compileToolStripMenuItem1_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   bei System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
   bei System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.8762 (QFE.050727-8700).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
ScriptEditor
    Assembly-Version: 3.5.4.5.
    Win32-Version: 3.5.4.5.
    CodeBase: file:///F:/SVN/SD3/trunk/Fallout2/Modding%20Files/sfall/modderspack_4.1.9.7/ScriptEditor/ScriptEditor.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5491 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.8770 (QFE.050727-8700).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5495 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
System.Xml
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5494 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
ICSharpCode.TextEditor
    Assembly-Version: 3.2.1.6466.
    Win32-Version: 3.2.1.6466.
    CodeBase: file:///F:/SVN/SD3/trunk/Fallout2/Modding%20Files/sfall/modderspack_4.1.9.7/ScriptEditor/ICSharpCode.TextEditor.DLL.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5420 (Win7SP1.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
System.Configuration
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.8762 (QFE.050727-8700).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.

I am suspecting it is related to the parser, because the old version throws an error at HOOK_GAMEMODECHANGE?

Also I've noticed that my hs_keypress script doesn't work anymore. :/

/Edit: The hookscript itself works, but the dik code check doesn't anymore. Did something change here? " if key_pressed(DIK_F) then begin" etc...
 
Last edited:
I use the "basic" script editor included in the modderspack to compile gl_highlighting, and it compiles without any error.
Personally I don't use the script editor so I'm not sure about the problem you got.
 
I've used that one too, with the above mentioned effect. Other scripts compile correctly, just this one and gl_partycontrol don't work.

The errors I'm getting in the other script editor:

gl_partycontrol -> Undefined symbol get_object_data in factor
gl_highlighting ->Undefined symbol HOOK_GAMEMODECHANGE in factor

Guess I am missing some updated files?
 
Yes, that's it exactly! Totally forgot this thing exists.

Compiling works now. Only issue remaining is the not working key_pressed check.
 
Are you sure you include dik.h?
I can compile pelicano's party order script (which uses key_pressed check) with no problem.
 
Yes, it's included and compiling the script is no problem. Just ingame it doesn't work (the hookscript itself works, my debug messages are showing. Checking the key pressed fails).

It worked with the last 4.x sfall version that I was using. The update to the latest makes problems.
 
You use key_press() to check keys in KEYPRESS hook? Why don't you use get_sfall_arg to get the key code?
EDIT: hmm, with 3.8.x I can call key_pressed in KEYPRESS hook. Guess there might be a problem since 4.1.2.
 
Last edited:
I wrote the script years ago and lots of stuff has changed since. At this point I wouldn't even know how to do this.
 
I wrote the script years ago and lots of stuff has changed since. At this point I wouldn't even know how to do this.
Here's a sample script:
Code:
#include ".\headers\sfall.h"
#include ".\headers\dik.h"

procedure start;
procedure KeyPressHandler;

procedure start begin
   if game_loaded then begin
     register_hook_proc(HOOK_KEYPRESS, KeyPressHandler);
   end
end

procedure KeyPressHandler begin
   variable
     event := get_sfall_arg,
     keyDX := get_sfall_arg,
     tmp;

   if ((keyDX == DIK_V) and event) then begin // I guess you use "if key_pressed(DIK_V) then begin" here?
     display_msg("V key pressed.");
   end
end
BTW, the key_pressed in keypress hook is fixed and will be in the next version.
Honestly I never thought of using key_pressed() in the hook before, since it's much easier to get the key code from hook args.
 
Last edited:
Thanks for the example! One thing to note: I had to include main.h and not sfall.h, otherwise it wouldn't compile. Both of these files are the latest version.

Other than that, I had to change it from a hs_ script to gl_ to make it work.
Now it's running perfect again.
 
Thanks for the example! One thing to note: I had to include main.h and not sfall.h, otherwise it wouldn't compile. Both of these files are the latest version.
My example didn't use anything from main.h. I guess you're talking about your keypress script?
 
Huh weird. You're right, it works now - I guess there was still some old stuff in the script before I cleaned it up, which made a conflict. In any case, it's working now. I'm happy.
 
sfall 4.1.9.1 and 3.8.19.1 are released on SourceForge, along with the modders pack for 4.1.9.1. They are maintenance/hotfix releases for the previous version.
Changelog said:
v4.1.9.1
>Fixed the error handling for loading sfallgv.sav to improve backward compatibility with older saved games
>Fixed key_pressed script funtion not working in hs_keypress hook script
>Fixed a bug in NPC combat control that caused perks picked in combat to disappear after switching control to other critters
>Fixed a bug in NPC combat control that caused player's selected weapon mode not to be saved
>Fixed the map elevation check in get/set_can_rest_on_map script functions
>Improved the functionality of add_extra_msg_file script function to allow automatically assigning numbers to msg files
>Changed DebugMode and HideObjIsNullMsg to not require enabling sfall debugging mode
>Added an option to NPC combat control mod to let you set a list of perks to be inherited from the player
Now by default sfall-mods.ini, Awareness and Gecko Skinning perks are inherited from the player.
 
You can use the new "create_win", which creates windows with "MoveOnTop" flag set by default.

Blast from the past.
I got it to work, but now I have a slightly different problem. Right now I am creating a new window over a newly created window - but the second window does not stay on top of the one I created first. As soon as I click on the first window, it will move to the top and the second window - which should remain always on top of the first - moves to the background.

Is there something else I can do about this? Am I missing something?
 
Last edited:
I think you can use 'create_win_flag' macro to set additional 'Exclusive' flag to the second window.
Code:
create_win_flag("WIN2", 120, 170, 100, 150, 0x14); // MoveOnTop + Execlusive
The window with 'Execlusive' flag will be like its layer takes all the screen, so you can't click on the first window until the second gets deleted.
But this will also prevent you from clicking on other opened interface windows (inventory, char, interface bar, etc.)
 
Last edited:
Damn. Yeah, that's not so good - I need to be able to click on other interface stuff.
Guess I will have to split up the image into multiple smaller ones then. Thought I could prevent that.

As alternative.. is it possible to "fetch" the click on the first window, then just move the second window on top again?

/Edit: Actually forget that. I've just split up the images. I was scared there might be flickering, because the window creation sometimes does that, but it's really a non-issue. As of now, it looks perfect to me.
 
Last edited:
Back
Top