Fallout 2 mod FO2 Engine Tweaks (Sfall)

Yes, this is correct. I've set DebugMode=1 and in the fallout2.cfg all the options in [debug] to 1 as well. Now the game is writing a *.log file with every action. This is very useful and saved me a lot of wasted bug-searching time already twice now. (I haven't written a single Fallout 2 script since 3 years... I have forgotten more than I thought.)
 
Hey Timeslip. So i've added my new 'tired' and 'hungry' messages to 'intrface.msg', but how do i script a command into an sfall script to display them?
 
Josan12 said:
Hey Timeslip. So i've added my new 'tired' and 'hungry' messages to 'intrface.msg', but how do i script a command into an sfall script to display them?
sfall function notes.txt said:
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to 9 for custom boxes. Remember to add your messages to intrface.msg and setup the font colours in ddraw.ini if you're going to use custom boxes.
sfall function list.txt said:
0x81dc - void show_iface_tag(int tag)
0x81dd - void hide_iface_tag(int tag)
0x81de - int is_iface_tag_active(int tag)
 
It seems the item highlighting in 2.8 debug dll (I use it to play Last Hope since ExtraCRC now only works with debug dll) is broken. Or is there any other option in INI need to change to enable item highlighting?
 
sfall function notes.txt said:
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to 9 for custom boxes. Remember to add your messages to intrface.msg and setup the font colours in ddraw.ini if you're going to use custom boxes.
sfall function list.txt said:
0x81dc - void show_iface_tag(int tag)
0x81dd - void hide_iface_tag(int tag)
0x81de - int is_iface_tag_active(int tag)

Cool. Thank you sir :D

So, would it go something like this:

Code:
         if get_sfall_global_int("reDuStat") > state_EXHAUSTED then
            set_sfall_global("reDuStat",state_EXHAUSTED);
            show_iface_tag(5);
            end
            else if(state_EXHAUSTED != 2) and(in_world_map) 
then begin
         display_msg("You are exhausted");
         force_encounter(0);
         end
   end

Do i have the "show_iface_tag" command right?
And also - earlier in this thread you posted a snippet of example code for a food mod (interestingly enough :cool:) that included the force_encounter command. Well, funnily enough that's perfect for what i want to do. Do i have it correct above??
 
NovaRain said:
It seems the item highlighting in 2.8 debug dll (I use it to play Last Hope since ExtraCRC now only works with debug dll) is broken. Or is there any other option in INI need to change to enable item highlighting?
There's an option to select what key to use.

Josan12 said:
Do i have the "show_iface_tag" command right?
Yup. Just remember to use hide_iface_tag(5) at some point when the player eats.

Josan12 said:
And also - earlier in this thread you posted a snippet of example code for a food mod (interestingly enough :cool:) that included the force_encounter command. Well, funnily enough that's perfect for what i want to do. Do i have it correct above??
That 0 needs to be replaced with the id of the map you want to force an encounter onto, but apart from that yes.
 
Timeslip said:
There's an option to select what key to use.
I know. I leave it as default value, but when I press left shift with some items dropped on the ground, there's no highlight. I also tried to change the binding to other keys (like right shift or ctrl), but still no good. 2.7 debug dll works OK though.
 
NovaRain said:
I know. I leave it as default value, but when I press left shift with some items dropped on the ground, there's no highlight. I also tried to change the binding to other keys (like right shift or ctrl), but still no good. 2.7 debug dll works OK though.
Then I have no idea. I haven't touched the highlight code since v1.49d, and it most certainly hasn't changed since 2.7. Nor is there any difference between the normal sfall build and the one in the modders pack. I've just tried both myself, and a couple of dropped items highlight perfectly.

I would suspect it's the items themselves that are marked unhighlightable, but if you dropped them yourself I doubt you're dropping anything particularly exotic. The only other ddraw.ini option that affects it is the 'Enable=1' in the [Input] section, but I doubt you've had any reason to change that. Of course you're using a modified exe, and I have no idea what's changed in it, so there could be anything weird going on there.
 
Josan12 said:
(...)
So, would it go something like this:

Code:
if get_sfall_global_int("reDuStat") > state_EXHAUSTED then
            set_sfall_global("reDuStat",state_EXHAUSTED);
            show_iface_tag(5);
            end
            else if(state_EXHAUSTED != 2) and(in_world_map) 
then begin
         display_msg("You are exhausted");
         force_encounter(0);
         end
   end

What's the difference between having a "then begin" in an if-check, and not having one? Doesn't an if-block require a "begin-end" if there is more than one statement? I'd assume the first "end" in the above code would end something completely different than the if-block, like for example the script itself, but I may be wrong.
 
Magnus said:
What's the difference between having a "then begin" in an if-check, and not having one? Doesn't an if-block require a "begin-end" if there is more than one statement? I'd assume the first "end" in the above code would end something completely different than the if-block, like for example the script itself, but I may be wrong.

That's right. Conditional statements need a begin-end block if they contain more than one instruction. With complex if-else sentences is also a good idea the use of begin-end to make life easier.

speaking of which,
Code:
else if(state_EXHAUSTED != 2) and(in_world_map) 
then begin

if that state_EXHAUSTED is a defined constant (and for some reason I believe it is), it shouldn't be used that way, since it's not supposed to change, being a constant and all. But that's now off-topic.
 
Yes, I was only looking at the show_iface_tag bit. The rest of the script wont compile as is.


On an unrelated subject, 2.9 is up. This is only a minor release, with a few rather specific changes:
Code:
>New script functions: scan_array, get_tile_fid, modified_ini
>New hook scripts: hs_movecost, hs_hex[type]blocking
>Fixed a crash bug in get_game_mode
>Some more ddraw.ini cleanup
modified_ini could do with a bit of explanation: Most mods include sfall along with their own modified ddraw.ini, and most of those mods set the cities limit removal option on. Until 2.8, that has given a handy way to tell when a user has overwritten the customized ddraw.ini with a vanilla version during an sfall update, because their game suddenly starts crashing on startup. Now that the cities patch is always enabled, that doesn't happen any more, and for the most part anyone overwriting their ini will still be able to get in game, and will suffer far more insidious problems instead. The modified_ini command provides a new way to check for the ini being overwritten by a script; it simply returns the value of a 'ModifiedIni' value in the [Main] section of ddraw.ini. Add that line to your customized ini, and then you can check for it being the correct value from a script, and if it ever jumps back to 0 you know the ini has been overwritten.

The further ddraw.ini changes this time around are that I've removed the [debugging] section from the version of ini included with the normal version of sfall, (Since the whole section only has an effect with the modders version, there seemed little point keeping it. It's included in with the modders pack instead,) and the Enabled option in the [Input] section has been removed and is now forced on at all times. (For similar reasons to ScriptExtender; turning it off has bitrotted.) I'm going to move the DebugMode option into the debugging section next version, but aside from that I think I've made all the ini cleanup I'm going to for now.
 
I just remembered. I asked way back for the possibility to read and modify local variables of a certain object(s) from a global script. The main idea is to change the local variables of each companion which contains party-relevant data (following distance, waiting, ...) from a global script without touching the original npc scripts.

Is this possible now?



Thanks for the new version!
 
One thing I wonder since a while... Timeslip, do you think it might be possible to add different light colors? While creating maps for FOnline, I realized that it's really fun to be able to add what ever light color you wish, even if it's just a red-ish color for burning barrels or firepits, etc.
 
Hey Timeslip: Pelicano and I were discussing how useful it would be to have an sfall function that stops the dude from being able to run. Can this be done?
 
pelicano said:
I just remembered. I asked way back for the possibility to read and modify local variables of a certain object(s) from a global script. The main idea is to change the local variables of each companion which contains party-relevant data (following distance, waiting, ...) from a global script without touching the original npc scripts.

Is this possible now?
Not as part of sfall, but there's already an existing way to do that; mark the variables 'export' in the script you're exporting them from and 'import' in the global script. Of course, that still requires you to modify the original scripts, even if only slightly.

The problem is that the nice names variables have in your scripts aren't preserved quite so nicely in the compiled *.int's for non-exported variables. While I could implement a set-variable-in-another-script function, it would accept an integer as a parameter rather than the string variable name, and you're at the mercy of the compiler as to what id it assigns to each variable. (sslc is simple enough; it just starts at 0 and counts its way up in the order it encounters the variables in the source file. There are no guarantees though.)

Lexx said:
One thing I wonder since a while... Timeslip, do you think it might be possible to add different light colors? While creating maps for FOnline, I realized that it's really fun to be able to add what ever light color you wish, even if it's just a red-ish color for burning barrels or firepits, etc.
No, the the fallout graphics engine has no support for coloured lights.

Josan12 said:
Hey Timeslip: Pelicano and I were discussing how useful it would be to have an sfall function that stops the dude from being able to run. Can this be done?
Break a leg, set_extra_stat their max burden down to zero, or tap_key shift every frame? What do you need it for? All the methods I can think of have side effects, but one might still be appropriate.

Or if you mean to stop movement completely, rather than to force him to walk instead of run, then use the hs_hexmoveblocking hookscript.
 
Timeslip said:
Break a leg, set_extra_stat their max burden down to zero, or tap_key shift every frame? What do you need it for? All the methods I can think of have side effects, but one might still be appropriate.

Hmm. Yes, those would do it but as you say, have the side effect of messing with other aspects of the game. I want to be able to create penalties from being hungry, tired, etc, in the same way as the player is penalized for being overburdened. This was one of the things i want to do.
Even better, would be the option to use a different walking animation when the player is crippled, exhausted, etc....
am i just dreaming??
 
As long as nobody would creates such animations, it's 100% only a dream. :P
 
Lexx said:
As long as nobody would creates such animations, it's 100% only a dream. :P

Well, funny you should say that - cos i may be a noob scripter, but i can sure create new walking animations. In fact, i have a nice simple idea for it on the testing board ;)

Whatcha think Timeslip?
 
Next thing, about elevators again... On page 50, Nirran wrote about it.

I have done it in the same way now, but it just doesn't work. Would "metarule(15, 24);" be correct? Like:

Code:
procedure spatial_p_proc begin
   metarule(15, 24);
   //display_msg("elevatorrrrl!");
end

While 24 == the number in the elevator.ini file. The script compiles, I get no problems. But ingame nothing happens.

In my elevator.ini file:
Code:
[24]
Image=1
ID1=202
Elevation1=0
Tile1=18106
ID2=203
Elevation2=0
Tile2=18106

I used the ini file from the latest RP release as template.

/Edit: God damnit... of course it doesn't work, because Elevators.ini was commented out in the ddraw.ini ....

/Edit #2: Somehow I can't change the elevator image. Regardless what I add, nothing changes. I even tried the 3-elevations elevator that came as example in the sfall modders pack and I still always see the 4 buttons-elevator.

Ideas?

/Edit #3: I don't get it. IDs are correct, still... I use elevator in map A and get to correct map B. I use elevator in map B and don't go back to A, I go to C...

/Edit #4: Now every elevator, except the first two (24 and 25) is working. I still don't get, why it's like that. Even if I make a copy of 24 or 25 elevator and use some other number, like 29, etc. it has the same effect. I can't even change the elevator image.
 
Back
Top