Removing karma gains from killing evil critters

Discussion in 'Fallout General Modding' started by Parttimedevil17, Jun 5, 2019.

  1. Parttimedevil17

    Parttimedevil17 First time out of the vault

    Jun 5, 2019
    Hi guys, I would like to know how to amend Fallout 2 files so that I do not gain karma from killing evil critters. I am hoping to do an evil bastard playthrough and constant karma gains would be counterproductive.

    Sorry to bring back this old topic here: http://www.nma-fallout.com/threads/karma-from-killing.194968/ but it seems like the thread was kinda dead.

    Now, Lexx mentions this:

    Check their script in the destroy_p_proc function for "inc_evil_critter", this should be the karma macro. Removing the line should "fix" this problem.

    Code:
    #define inc_evil_critter if (source_obj == dude_obj) then begin \
    set_global_var(GVAR_BAD_MONSTER, (global_var(GVAR_BAD_MONSTER) + 1)); \
    if (critter_kill_type(self_obj) == KILL_TYPE_children_kills) then \
    inc_childkiller \
    CHECK_REP_BERSERKER \
    CHECK_REP_CHAMPION \
    inc_general_rep(REP_BONUS_KILLED_EVIL_CRITTER); \
    set_global_var(TOWN_REP_VAR,(global_var(TOWN_REP_VAR)+REP_TOWN_KILL_EVIL)); \
    debug_msg("Added "+REP_TOWN_KILL_EVIL+" to Town Rep"); \
    end


    However; I am not sure on which folder or file I need to open to view this. Sorry, I'm a dumbass. Is it ddraw? All I get is a bunch of nonsense when I open it with notepad. I'm using the GOG Fallout 2 version on a windows 10 laptop. Some help would be very appreciated!
     
  2. Lexx

    Lexx Background Radiant
    Moderator

    Apr 24, 2005
    What do you mean? You have to open the respective critter script. This has nothing to do with ddraw.
     
  3. Parttimedevil17

    Parttimedevil17 First time out of the vault

    Jun 5, 2019
    Okay, but where is the respective critter script? I have the folder C:\Games\Fallout 2\data\Scripts open but I see no critter script anywhere. For reference, I have attached what I see when I first open this folder. I searched for any reference to critters here but see nothing, or are you saying I must open each and every named critter within this folder and change them?
     

    Attached Files:

  4. Lexx

    Lexx Background Radiant
    Moderator

    Apr 24, 2005
    These are compiled scripts. You need the non-compiled scripts. Either from the mapper, which comes with the original Fallout 2 scripts, or the sources from the mod you're working with (there is abby.int, so I'm guessing restoration project or something?)
     
  5. Parttimedevil17

    Parttimedevil17 First time out of the vault

    Jun 5, 2019
    That is correct, I'm using the restoration patch. Which folder would the non compiled scripts be located in the restoration patch version? Or would I need to uninstall the RP and I find the folder that way?
     
  6. .Pixote.

    .Pixote. Venerable Relic of the Wastes
    Modder

    Sep 14, 2009
    Easy...just become a baby killer, and then kill all the bounty hunters that come after you, each bounty hunter is worth about -20 karma. At high levels bounty hunters carry gauss guns, kill them for the weapons and ammo.

    :flameon:
     
  7. Parttimedevil17

    Parttimedevil17 First time out of the vault

    Jun 5, 2019
    That is an option... but I'm trying to stay away from the Childkiller option, as this could affect questgivers.
     
  8. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
    You can track the change of karma through a special hook script, in addition to other hook handlers, to track the moment of death of the critter.
    See doc for sfall.
     
  9. Parttimedevil17

    Parttimedevil17 First time out of the vault

    Jun 5, 2019
    Sorry I really don't know much about how to do that kind of stuff. I would like to know which folder or file I need to go into to change the following:

    Code:
    #define inc_evil_critter if (source_obj == dude_obj) then begin \
    set_global_var(GVAR_BAD_MONSTER, (global_var(GVAR_BAD_MONSTER) + 1)); \
    if (critter_kill_type(self_obj) == KILL_TYPE_children_kills) then \
    inc_childkiller \
    CHECK_REP_BERSERKER \
    CHECK_REP_CHAMPION \
    inc_general_rep(REP_BONUS_KILLED_EVIL_CRITTER); \
    set_global_var(TOWN_REP_VAR,(global_var(TOWN_REP_VAR)+REP_TOWN_KILL_EVIL)); \
    debug_msg("Added "+REP_TOWN_KILL_EVIL+" to Town Rep"); \
    end

    I have uninstalled the RP so now I am just working with the vanilla game.
     
  10. Darek

    Darek is currently unavailable

    Jan 7, 2008
    Every critter (npc) have a script. And every one of those scripts have code for what happens when the player kills them.
    You will either have to change the macro code and compile all evil critters in the game and then replace those scripts, or decompile the scripts and edit them individually and then compile them and replace them. There are many scripts so it's a pretty big job.
    The only way to do it with one script is what Mr.Stalin is suggesting. So either learn how to write a sfall script or ask someone who can if they are willing to do it for you.
     
  11. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    Code:
    variable math;
    
    procedure start;
    
    procedure start begin
       if(game_loaded) then begin
          set_global_script_repeat(60);
          set_global_script_type(1);
          set_sfall_global("KARMA_01", global_var(0));
       end
       if(global_var(0) != get_sfall_global_int("KARMA_01")) and not(game_loaded) then begin
          math := global_var(0) - get_sfall_global_int("KARMA_01");
          if(math > 0) then begin
             display_msg("Your Karma has increased by " + math + ".");
             //add karma set_global_var(0, global_var(0) + x);           
          end else if (math < 0) then begin
             display_msg("Your Karma has decreased by " + (-math) + ".");
             //subtract karma set_global_var(0, global_var(0) - x);
          end
          set_sfall_global("KARMA_01", global_var(0));
       end
    end
     
  12. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
    Bad example.
    By the same, sfall global variables should not be used where they are not needed. Use ordinary global script variables.
     
  13. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    what exactly does using an sfall global in this instance cause thats bad?
     
  14. burn

    burn Where'd That 6th Toe Come From?
    Modder

    Apr 22, 2012
    Don't know about sfall global vars, but set_global_script_repeat is ugly. Better use hooks whenever possible instead.
     
  15. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    isnt possible in this case AFAIK
     
  16. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    HOOK_ONDEATH should work for this case.
     
  17. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    fair enough
     
  18. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
    Русскую поговорку знаешь, "забивать гвозди не тем инструментом" вот так и c глобальными переменными, используют там где это не нужно и избыточно.
     
  19. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    Oct 29, 2015
    And HOOK_SETGLOBALVAR