Fallout 2 mod FO2 Engine Tweaks (Sfall)

Discussion in 'Fallout General Modding' started by Dude101, Jul 30, 2007.

  1. Mario_Dweller

    Mario_Dweller It Wandered In From the Wastes

    153
    Apr 9, 2004
    Is somehow possible to modify dude skills? There is an original FO2 function critter_mod_skill. But it does not work with negative values (-20, MAXINT - 20). They are treated as positive ones. I need to add +10 to all dude skills and then revert them back if some condition passes. And it is possible to modify only 2 skills per perk(using more perks causes they are all visible in the CHAR screen).

    In sfall function list there is some function set_critter_skill_mod(CritterPtr, int max, int mod).
    But it does not accept 3 arguments (script editor throws an error), it accept only first 2.

    So i've found memory offsets of all skills via Cheat Engine. It changes skill values reliably.

    Small guns are 0051C4AC and every next 4 bytes are next skills up to 0051C4F0 - Outdoorsman.

    So I changed my ddraw.dll to debug one and added to ddraw.ini (is it really needed to use debug version of sfall?)
    [Debugging]
    ...
    AllowUnsafeScripting=1
    ...

    And tried in critter_p_proc in obj_dude
    write_int(5358764, 10); // should change Small Guns to minimum by SPECIAL + 10 but it does not work
    display_msg("value: " + read_int(5358764)); // it does not display anything :-/

    I've also tried read/write_byte. Does somebody(Timeslip? :))) have an idea where the mistake is? Thanks.

    EDIT: It seems those offset functions do not work for me. I have the latest sfall and script compiled with Script Editor from the latest modders pack.
    EDIT2: I've compiled sfall and removed that #ifdef TRACE before bool AllowUnsafeScripting... and now it seems to work properly even in non debug version of sfall.

    It seems that "AllowUnsafeScripting" options should be in the Misc section instead of Debug section as it is in ddraw.ini in debug version of sfall in modders pack.
     
  2. Mario_Dweller

    Mario_Dweller It Wandered In From the Wastes

    153
    Apr 9, 2004
    Killap: For the Educated Perk. I think It can be repaired by a global script. Maybe i will try it someday. But I'm afraid that script added points will display after CHAR screen is reopened again. Even the perk is confirmed after closing CHAR screen (it can be canceled).
     
  3. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    Swift Learner doesn't change the display of experience earned in message window.

    For example killing rats it says 25 points even though you're getting 26 (rank 1) or 27 (rank 2).

    Is this something that can be fixed through Sfall?

    EDIT: nevermind, Nirran made a script for this.
     
  4. sea

    sea Vault Senior Citizen

    Oct 5, 2009
    I'm not sure if others have posted about this, but whenever I have sfall installed and running in DX9 mode, the game runs very poorly. Framerate is low (even on the main menu) and I get tons of mouse lag. This problem disappears as soon as I disable it, or run in mode 0, though I get funky colours that way.

    Thought at first it was the version I downloaded being buggy, or the high-res patch, but it seems to happen even on a clean install and with multiple versions of sfall.

    Running an NVIDIA GTX 470 with the latest drivers, Windows 7 64-bit, no compatibility modes set.
     
  5. valcik

    valcik So Old I'm Losing Radiation Signs

    Dec 20, 2008
    sea:
    You can get rid of that funky colours by setting 16/32-bit colour mode in High-Res patch, while sfall is running in a default 8-bit graphics mode.
    If you are running sfall in one of DX9 modes, try to turning on GPU blitting function in sfall's settings.
     
  6. sea

    sea Vault Senior Citizen

    Oct 5, 2009
    Well sure, I can turn off the DX9 stuff, but I was kind of hoping I could keep using it. :P GPU Blitting does not help.
     
  7. Dude101

    Dude101 Vault Fossil
    Modder

    Aug 3, 2005
    Has anyone got play_sfall_sound and stop_sfall_sound to work? I can't get it working. I'll ask the guys on my team as well. Is this bugged / disabled due to lack of interest? or am I being stoopid.
     
  8. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Do you have AllowDShowSound=1 in the [Sound] section of ddraw.ini? hmm... actually, looking at the code, that should only be needed for replacing existing sound files with other formats. What does the script that you're trying to call it with look like?
     
  9. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
  10. Dude101

    Dude101 Vault Fossil
    Modder

    Aug 3, 2005
    Code:
    variable playing_music;
    
    procedure spatial_p_proc begin
       if (source_obj == dude_obj) then begin
          if (playing_music == 0) then begin
             playing_music:=1;
             play_sfall_sound("data\sound\SFX\piano10.mp3",0);
             add_timer_event(self_obj,game_ticks(3),0); //the event resets var playing_music to 0, to prevent stacking
          end
       end
    end
    I placed a spatial script at the entrance to a bar, as I you want the sound to play when the Player enters the joint. The mp3 file is located in data/sound/SFX. AllowDShowSound=1 is in effect.
     
  11. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    You need to escape your backslashes. \n is a newline, \t a tab, \\ is a backslash.

    Although \s and \p are meaningless, so you should be getting 'Unrecognised escape character '\s' on line xxx' warnings. Do you have warnings disabled?
     
  12. gvx

    gvx First time out of the vault

    86
    Apr 4, 2008
    What display_msg newline is it?
     
  13. gvx

    gvx First time out of the vault

    86
    Apr 4, 2008
    Can you tell me about Night person code in gltschardev.ssl?
     
  14. Ardent

    Ardent A Smooth-Skin
    Modder

    681
    Jul 24, 2009
    Hello again. I have a request for sfall, something which is probably a bug report and a question:

    REQUEST: Is it possible to change the number of Skill Points gained per level via Perks.ini? Or alternatively, the number of Levels you get a Perk at?
    I would like to mod Gifted, so that you get Perks every 4 levels, instead of every 3 levels. I was thinking to use Skilled (because it has the appropriate effect) and simulate Gifted with the options available in the Perks.ini, but Skilled gives you +5 Skill Points, while Gifted should give you -5 skill points. That's 10 points difference and it breaks the idea.

    BUG REPORT: I was fiddling with the command force_aimed_shots(), giving aiming options to a couple of weapons that normally don't have it (because e.g. they deal explosive or fire damage). When I did that, most other weapons lost the ability to do called shots, despite normally having it.
    Initially, it only affected a couple select weapons (e.g. I gave aiming capabilities to a thrown explosive weapon and all thrown weapons lost the ability to make called shots), so I just remedied the problem by using the force_aimed_shots() command on the rest of the affected weapons. I also experienced a reverse effect - e.g. I made a melee weapon dealing fire damage and I gave it the option to make called shots. After that, a couple of other weapons dealing fire damage also got the ability (e.g. a flare gun), although I didn't intend them to.
    Now I'm in a bit of a mess, because ever since I added a couple more special "aimed" weapons to the list, the effect of disabled called shots extended on virtually every weapon in the game, including unarmed blows. The only exceptions are weapons included in the "force_aimed_shots" list.
    Before you ask, no, I didn't play a character with Fast Shot :P

    QUESTION: I want to play some movies while the player is travelling on the world map (like Hakunin's dream sequences really), but I don't want just to replace the original Hakunin sequences, because I need more control over what is being displayed and when (the displaying of the movies depends on the Player's actions and in some cases, the movies may not be displayed at all or sometimes they may be delayed). I wrote a global script for that, but it doesn't seem to work. Here's my code, can you please tell me if I got the conditions right? Maybe you can offer some insights on what I'm doing wrong?

    EDIT: Aw, crud. Why don't the code tags work? Every time I put some <> brackets, it ignores what's between them and displays the whole thing wrong. :evil:

    Let's try this anyway:

    Code:
    procedure start; 
    
    #include "..\HEADERS\sfall.h" 
    #include "C:\Gry\Fallout 2\Fallout 2 Mapper\scripts\HEADERS\DEFINE.H"
    #include "C:\Gry\Fallout 2\Fallout 2 Mapper\scripts\HEADERS\COMMAND.H"
    
    #define NAME                    SCRIPT_GLMOVIES
    
    /* aditional headers here */ 
    
    procedure start begin 
       if (game_loaded) then begin
          set_global_script_type(2); //only works on world map
       end
       else begin
          //Dude must be on the world map, and Cassidy hasn't been saved
          if ((in_world_map == true) and (global_var(GVAR_CASSIDY_STATUS) < 6)) then begin 	 
       	  	 if ((game_time *is_greater_than* global_var(GVAR_HEART_TIME_LIMIT1)) and (global_var(GVAR_CASSIDY_STATUS) *is_lesser_than* 2)) then begin
       	  	 	set_global_var(GVAR_CASSIDY_STATUS,2); //Cassidy's state deteriorates
       	  	 	play_gmovie(AFAILED_MOVIE);
       	  	 end
          end
       end
    end
    I'm very sorry for the weird replacement of the greater_than and lesser_than signs, but I wanted to paste the code here for convenience.
    If you can offer any insights on how to make this work, I'd be grateful. Thanks in advance!
     
  15. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Sorry I've been away so long. Real life has been butting its head in far too often lately. (On the plus side, I'm now officially a doctor. :) )

    I've made a quick update to sfall to fix critical hits against horrigan and the player. I also disabled the update check, since sfall is updated so infrequently these days. I'll try and work my way through the more recent requests/bug reports in this thread sometime soon...
     
  16. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    Wow! Congratulations! Do you mind sharing what the field is?
     
  17. .Pixote.

    .Pixote. Carbon Dated and Proud
    Modder

    Sep 14, 2009
    I'm thinking medical, am I wrong? 8-)
     
  18. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    Timeslip, is this possible?

     
  19. Ardent

    Ardent A Smooth-Skin
    Modder

    681
    Jul 24, 2009
    Savegames display the in-game date and hour - you can easily determine the last save by this (unless you reloaded an earlier savegame and didn't get to some point in time that your bad save game was at or whatever)
     
  20. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    Of course, but what the user was saying is if it's possible for the game to automatically select (jump to) the most recent one instead of having to scroll down when loading a fresh instance of the exe. I think it's a pretty cool idea.