Script that will display extra exp from swift learner perk

Discussion in 'Fallout General Modding' started by Nirran, Sep 22, 2009.

  1. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    copy this into a sfall script(GL_Whatever) and compile,it will display the amount of experience gained from swiftlearner perk(s),currently set to the vanilla game swift_learner_mod of 5%,change "perk_mod := .05;" to what ever your mod is,sometimes will be 1 exp point off because of the ssl floor function,generally happens with small values

    Code:
    procedure start;
    
    procedure start begin
    variable math;
    variable perk_mod := 0.0;
    variable perk_mod_math := 0.0;
    variable perk_math := 0.0;
       if(game_loaded) then begin
          set_global_script_repeat(1);
          set_global_script_type(1);
          set_sfall_global("EXP___01", get_pc_stat(2));
       end else begin
          if(get_pc_stat(2) != get_sfall_global_int("EXP___01")) and (has_trait(0, dude_obj, 50))then begin
             perk_mod := .05;
             perk_math := (has_trait(0, dude_obj, 50) * perk_mod);
             perk_mod_math := perk_math + 1;
             math := get_pc_stat(2) - get_sfall_global_int("EXP___01");
             math := math / perk_mod_math;
             math := math * perk_math;
             display_msg("You gain " + floor(math) + " experience from Swift Learner Perk.");
             set_sfall_global("EXP___01", get_pc_stat(2));
          end
       end
    end
     
  2. Mr.Wolna

    Mr.Wolna Vault Senior Citizen

    Nov 15, 2007
    really nice feature.
     
  3. brother_soifran

    brother_soifran Look, Ma! Two Heads!

    396
    Oct 14, 2008
    HEllo Nirran,
    The noob question.
    Why in Sfall?
    Doesn't work with Jargo's FSE compiler?
    Thanks

    Brother soifran
     
  4. Mr.Wolna

    Mr.Wolna Vault Senior Citizen

    Nov 15, 2007
    other question why not? ^^

    he use sfall globals, it is more confortable as the standart sfall g vars.
     
  5. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    sfall because the script is a global script,impossible with reg ssl scripting
     
  6. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    also i belive if you copy sfall compiler and dos4gw into the folder the fse uses for compiling it will compile in fse,though it wont display the errors correctly,find the compiler and dos4gw here http://timeslip.chorrol.com/sfall.html
     
  7. brother_soifran

    brother_soifran Look, Ma! Two Heads!

    396
    Oct 14, 2008
    Thanks Nirran, I 'll try this.
     
  8. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    btw this script is included in my custom perks mod,though swift_learner_mod is different(20%)

    Nirran
     
  9. Nirran

    Nirran Vault Senior Citizen
    Modder

    Apr 15, 2007
    now the GL_Swift_Learner.int in my custom perks mod uses variables to determine if my custom perks swift learner perk is in use,in other words if all you want is the display of the extra xp but dont want the custom perks mod,download custom perks and use only GL_Swift_Learner.int,the script will do the rest

    Nirran