perks per level mod(just a script)

Nirran

Vault Senior Citizen
Modder
edit :no need to read this thread(long dead anyway),just follow the link for a script that can change the levels between perks

i update these fairly regularly,as with all my mods,feel free to do whatever you like with them

download the perks_per_level script here

http://www.nirran.com/Pages/Fallout2Scripts.htm

enjoy
 
something interesting you can do with this,in this example i set levels_per_perk to 10 with rapid learned trait,then made rapid perks perk,9 ranks,that increase perk gain by 1 each rank

the original script is a little different,better function to get weather or not the player deserves a perk

now nothing in the first script needs to be modified,the value for the global "perk_per" is all u need to set in any script,its the levels per perk

Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))

procedure start begin
   set_global_script_repeat(1);
   if (game_loaded) and (get_sfall_global_int("perk_per") > 0)then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else begin
            set_perk_owed(1);
         end
         set_sfall_global("toonlevl", dude_level);
      end
   end else if(get_sfall_global_int("perk_per") > 0) then begin
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
         return;
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         set_perk_owed(1);
         set_sfall_global("perkowed", 1);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end else if (dude_level != 1) then begin
         set_perk_owed(0);
         set_sfall_global("perkowed", 0);
      end
   end
end

above is the perks per level function

Code:
procedure start;

#define dude_level                                                              (get_pc_stat(1))

#define LowGravity                                                              "Low gravity"
#define Ironwall                                                                "Ironwall"
#define Swift                                                                   "Swift"
#define RapidLearner                                                            "Rapid learner"
#define JackOfTrades                                                            "Jack of all trades"
#define DiligentLearner                                                         "Diligent learner"
#define PatheticAim                                                             "Pathetic aim"
#define VileBreath                                                              "Vile breath"

procedure setup_perk_dialog begin
	set_perkbox_title("Choose a trait");
	hide_real_perks;
	perk_add_mode(1);
	set_selectable_perk(LowGravity, 1, 10, "You've always found that the lightest touch has been enough to send your opponents flying. Unfortunately, the same applies to your opponents attacks against you, too.");
	set_selectable_perk(Ironwall, 1, 11, "You stand where you like, and even a rocket to the face isn't going to move you. Heck, even _you_ sometimes find it difficult to move you.");
	set_selectable_perk(Swift, 1, 15, "You can move a little faster than those around you, but you lack a little of the reflexes required to use your excessive speed.");
	set_selectable_perk(RapidLearner, 1, 22, "Although you don't have the natural gifts held by others, you make up for it by being able to make much better use of your day to day experiences.");
	set_selectable_perk(JackOfTrades, 1, 38, "Although you seem to be able to succeed in anything you put your mind too, you lack the concentration to master any one ability.");
	set_selectable_perk(DiligentLearner, 1, 39, "You might take a little longer than most to fully grasp a lesson, but you usually manage to pick up a few extra ticks that no one else would have noticed.");
	set_selectable_perk(PatheticAim, 1, 46, "No matter how hard you aim, you just can't seem to hit anything. On the other hand, no matter how long you stand around doing nothing, nobody seems to be able to hit you either.");
	if(get_pc_base_stat(3) > 2) then begin
		set_selectable_perk(VileBreath, 1, 52, "You are afflicted by a serious case of oral misodor. People tend to avoid your company, but your ability to dazzle your foes with a single exhalation gives you a head start in combat.");
	end
end

procedure apply_traits_repeat begin
	if(has_fake_trait(LowGravity)) then begin
		set_attacker_knockback(dude_obj, 1, 3.0);
		set_target_knockback(dude_obj, 1, 3.0);
	end
	if(has_fake_trait(Ironwall)) then begin
		set_target_knockback(dude_obj, 0, 0);
	end
	if(has_fake_trait(LowGravity)) then begin
		set_attacker_knockback(dude_obj, 1, 3.0);
		set_target_knockback(dude_obj, 1, 3.0);
	end
	if(has_fake_trait(JackOfTrades)) then begin
		set_critter_skill_mod(dude_obj, 100);
	end
	if(has_fake_trait(PatheticAim)) then begin
		set_base_hit_chance_mod(50, -5);
	end
end

procedure apply_traits begin
	if(has_fake_trait(Ironwall)) then begin
		set_pc_extra_stat(8, get_pc_extra_stat(8) - 1);
		critter_add_trait(dude_obj, 0, 104, 1);
	end
	if(has_fake_trait(DiligentLearner)) then begin
		set_xp_mod(190);
		set_sfall_global("perk_per", 6);
		set_sfall_global("selected", 1);
	end
	if(has_fake_trait(RapidLearner)) then begin
		//set_xp_mod(50);
		set_sfall_global("perk_per", 10);
		set_sfall_global("selected", 1);
	end
	if(has_fake_trait(Swift)) then begin
		set_pc_extra_stat(8, get_pc_extra_stat(8) + 1);
		set_pc_extra_stat(13, get_pc_extra_stat(13) - get_pc_base_stat(13) );
	end
	if(has_fake_trait(JackOfTrades)) then begin
		critter_mod_skill(dude_obj, 00, 10);
		critter_mod_skill(dude_obj, 01, 10);
		critter_mod_skill(dude_obj, 02, 10);
		critter_mod_skill(dude_obj, 03, 10);
		critter_mod_skill(dude_obj, 04, 10);
		critter_mod_skill(dude_obj, 05, 10);
		critter_mod_skill(dude_obj, 06, 10);
		critter_mod_skill(dude_obj, 07, 10);
		critter_mod_skill(dude_obj, 08, 10);
		critter_mod_skill(dude_obj, 09, 10);
		critter_mod_skill(dude_obj, 10, 10);
		critter_mod_skill(dude_obj, 11, 10);
		critter_mod_skill(dude_obj, 12, 10);
		critter_mod_skill(dude_obj, 13, 10);
		critter_mod_skill(dude_obj, 14, 10);
		critter_mod_skill(dude_obj, 15, 10);
		critter_mod_skill(dude_obj, 16, 10);
		critter_mod_skill(dude_obj, 17, 10);
	end
	if(has_fake_trait(VileBreath)) then begin
		set_pc_base_stat(3, get_pc_base_stat(3) - 2);
		set_pc_base_stat(13, get_pc_base_stat(13) + 15);
	end
end

procedure start begin
	variable mode;
	if (game_loaded) then begin
		mode:=get_sfall_global_int("ts_trt00");
		if(mode==-1) then begin
			return;
		end else if(mode==0) then begin
			if(dude_level>1) then begin
				display_msg("Error: Extra trait mod works for new games only");
				set_sfall_global("ts_trt00", -1);
				return;
			end
			display_msg("Visit the character screen before your first level up to pick your new trait");
			set_perk_owed(1);
			set_global_script_repeat(100);
			call setup_perk_dialog;
		end else begin
			call apply_traits_repeat;
		end
	end else begin
		if(dude_level>1) then begin
			clear_selectable_perks;
			set_perk_owed(get_perk_owed - 1);
			set_global_script_repeat(0);
			set_sfall_global("ts_trt00", 1);
			return;
		end
		if(get_perk_owed>0) then begin
			return;
		end
		clear_selectable_perks;
		set_global_script_repeat(0);
		set_sfall_global("ts_trt00", 1);
		call apply_traits;
		call apply_traits_repeat;
	end
end

above is the traits script timeslip wrote

Code:
procedure start;
procedure LevelChange;
procedure PickedPerk;

//imported traits
#define RapidLearner                                                            "Rapid learner"
#define DiligentLearner                                                         "Diligent learner"
//perks
#define RapidPerks                                                              "Rapid Perks"
	
#define dude_global                                                             (get_sfall_global_int("perks_00"))
#define dude_level                                                              (get_pc_stat(1))
                                                                                
procedure LevelChange begin
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 0) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 1);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 1) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 2);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 2) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 3);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 3) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 4);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 4) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 5);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 5) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 6);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 6) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 7);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 7) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 8);
	end
	if(has_fake_trait(RapidLearner) and has_fake_perk(RapidPerks) == 8) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 9);
	end
	if(get_sfall_global_int("rapid_01") == 10) then begin
	       set_selectable_perk(RapidPerks, 0, 1, "");
        end
end

procedure PickedPerk begin
	if(has_fake_perk(RapidPerks) == 1 and get_sfall_global_int("rapid_01") == 1) then begin
		set_sfall_global("rapid_01", 2);
		set_sfall_global("perk_per", 9);
                //display_msg("rapid_01");	
	end
	if(has_fake_perk(RapidPerks) == 2 and get_sfall_global_int("rapid_01") == 2) then begin
		set_sfall_global("rapid_01", 3);
		set_sfall_global("perk_per", 8);
                //display_msg("rapid_2");		
	end
	if(has_fake_perk(RapidPerks) == 3 and get_sfall_global_int("rapid_01") == 3) then begin
		set_sfall_global("rapid_01", 4);
		set_sfall_global("perk_per", 7);
                //display_msg("rapid_3");		
	end
	if(has_fake_perk(RapidPerks) == 4 and get_sfall_global_int("rapid_01") == 4) then begin
		set_sfall_global("rapid_01", 5);
		set_sfall_global("perk_per", 6);
                //display_msg("rapid_4");		
	end
	if(has_fake_perk(RapidPerks) == 5 and get_sfall_global_int("rapid_01") == 5) then begin
		set_sfall_global("rapid_01", 6);
		set_sfall_global("perk_per", 5);
                //display_msg("rapid_5");		
	end
	if(has_fake_perk(RapidPerks) == 6 and get_sfall_global_int("rapid_01") == 6) then begin
		set_sfall_global("rapid_01", 7);
		set_sfall_global("perk_per", 4);
                //display_msg("rapid_6");		
	end
	if(has_fake_perk(RapidPerks) == 7 and get_sfall_global_int("rapid_01") == 7) then begin
		set_sfall_global("rapid_01", 8);
		set_sfall_global("perk_per", 3);
                //display_msg("rapid_7");		
	end
	if(has_fake_perk(RapidPerks) == 8 and get_sfall_global_int("rapid_01") == 8) then begin
		set_sfall_global("rapid_01", 9);
		set_sfall_global("perk_per", 2);
                //display_msg("rapid_8");		
	end
	if(has_fake_perk(RapidPerks) == 9 and get_sfall_global_int("rapid_01") == 9) then begin
		set_sfall_global("rapid_01", 10);
		set_sfall_global("perk_per", 1);
                //display_msg("rapid_9");		
	end
	call LevelChange;
end

procedure start begin
	set_global_script_repeat(1);
        if(dude_global != dude_level)then begin
               call LevelChange;
	       set_sfall_global("perks_00", dude_level);
	end
	call PickedPerk;
end

and lastly,above is the script telling the game to add what timeslip calls fake perks,they are all the same perk,have to code each rank,maybe he will add ranks later ^^

enjoy


edit : forgot to add code to make perks unselectable after all ranks had been chosen,corrected it,add this at the bottom of LevelChange procedure


Code:
	if(get_sfall_global_int("rapid_01") == 10) then begin
	       set_selectable_perk(RapidPerks, 0, 1, "");
        end
[/code]
 
found another bug and fixed it,previously if you select a perk midway in game that alters perk gain rate,the game would immediately give the player a perk,also added some fake perks,not sure if i altered traits script but here they are


perk per level script
Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))

procedure start begin
   set_global_script_repeat(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else begin
            set_perk_owed(1);
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         set_sfall_global("perk_per", 3);
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         set_sfall_global("perk_per", 3);
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         set_perk_owed(1);
         set_sfall_global("perkowed", 1);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end else if (dude_level != 1) then begin
         set_perk_owed(0);
         set_sfall_global("perkowed", 0);
      end
   end
end


trait script
Code:
procedure start;

#define dude_level                                                              (get_pc_stat(1))
#define DiligentLearner                                                         "Diligent learner"
#define Ironwall                                                                "Ironwall"
#define JackOfTrades                                                            "Jack of all trades"
#define LowGravity                                                              "Low gravity"
#define PatheticAim                                                             "Pathetic aim"
#define UnarmedMaster                                                           "Unarmed Master"
#define Swift                                                                   "Swift"
#define VileBreath                                                              "Vile breath"

procedure setup_perk_dialog begin
	set_perkbox_title("Choose a trait");
	hide_real_perks;
	perk_add_mode(1);
	set_selectable_perk(DiligentLearner, 1, 39, "Doubles all experience earned.Adds 3 levels to perk gain.");
	set_selectable_perk(Ironwall, 1, 11, "You stand where you like, and even a rocket to the face isn't going to move you. Heck, even _you_ sometimes find it difficult to move you.");
	set_selectable_perk(JackOfTrades, 1, 38, "Although you seem to be able to succeed in anything you put your mind too, you lack the concentration to master any one ability.");
	set_selectable_perk(LowGravity, 1, 10, "You've always found that the lightest touch has been enough to send your opponents flying. Unfortunately, the same applies to your opponents attacks against you, too.");
	set_selectable_perk(PatheticAim, 1, 46, "No matter how hard you aim, you just can't seem to hit anything. On the other hand, no matter how long you stand around doing nothing, nobody seems to be able to hit you either.");
	set_selectable_perk(UnarmedMaster, 1, 22, "Greatly increase your unarmed skill and your battle sequence.Sets the maximum to hit to 100%.Sets your maximum health to 50.Gives you the Gecko skinning perk.Adds 3 levels to perk gain.");
	set_selectable_perk(Swift, 1, 15, "You can move a little faster than those around you, but you lack a little of the reflexes required to use your excessive speed.");
	if(get_pc_base_stat(3) > 2) then begin
		set_selectable_perk(VileBreath, 1, 52, "You are afflicted by a serious case of oral misodor. People tend to avoid your company, but your ability to dazzle your foes with a single exhalation gives you a head start in combat.");
	end
end

procedure apply_traits_repeat begin
	if(has_fake_trait(LowGravity)) then begin
		set_attacker_knockback(dude_obj, 1, 3.0);
		set_target_knockback(dude_obj, 1, 3.0);
	end
	if(has_fake_trait(Ironwall)) then begin
		set_target_knockback(dude_obj, 0, 0);
	end
	if(has_fake_trait(LowGravity)) then begin
		set_attacker_knockback(dude_obj, 1, 3.0);
		set_target_knockback(dude_obj, 1, 3.0);
	end
	if(has_fake_trait(JackOfTrades)) then begin
		set_critter_skill_mod(dude_obj, 100);
	end
	if(has_fake_trait(PatheticAim)) then begin
		set_base_hit_chance_mod(50, -5);
	end
	if(has_fake_trait(UnarmedMaster)) then begin
		set_hit_chance_max(100);	
	end
end

procedure apply_traits begin
	if(has_fake_trait(Ironwall)) then begin
		set_pc_extra_stat(8, get_pc_extra_stat(8) - 1);
		critter_add_trait(dude_obj, 0, 104, 1);
	end
	if(has_fake_trait(DiligentLearner)) then begin
		set_xp_mod(200);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") + 3);
	end
	if(has_fake_trait(UnarmedMaster)) then begin
                critter_mod_skill(dude_obj, 03, 50);
                set_pc_extra_stat(13, 25);
                set_pc_extra_stat(7, (50 - get_pc_base_stat(7)));
                critter_heal(dude_obj,(50 - get_pc_base_stat(35)));
                critter_add_trait(dude_obj, 0, 73, 1);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") + 3);
	end
	if(has_fake_trait(Swift)) then begin
		set_pc_extra_stat(8, get_pc_extra_stat(8) + 1);
		set_pc_extra_stat(13, get_pc_extra_stat(13) - get_pc_base_stat(13) );
	end
	if(has_fake_trait(JackOfTrades)) then begin
		critter_mod_skill(dude_obj, 00, 10);
		critter_mod_skill(dude_obj, 01, 10);
		critter_mod_skill(dude_obj, 02, 10);
		critter_mod_skill(dude_obj, 03, 10);
		critter_mod_skill(dude_obj, 04, 10);
		critter_mod_skill(dude_obj, 05, 10);
		critter_mod_skill(dude_obj, 06, 10);
		critter_mod_skill(dude_obj, 07, 10);
		critter_mod_skill(dude_obj, 08, 10);
		critter_mod_skill(dude_obj, 09, 10);
		critter_mod_skill(dude_obj, 10, 10);
		critter_mod_skill(dude_obj, 11, 10);
		critter_mod_skill(dude_obj, 12, 10);
		critter_mod_skill(dude_obj, 13, 10);
		critter_mod_skill(dude_obj, 14, 10);
		critter_mod_skill(dude_obj, 15, 10);
		critter_mod_skill(dude_obj, 16, 10);
		critter_mod_skill(dude_obj, 17, 10);
	end
	if(has_fake_trait(VileBreath)) then begin
		set_pc_base_stat(3, get_pc_base_stat(3) - 2);
		set_pc_base_stat(13, get_pc_base_stat(13) + 15);
	end
end

procedure start begin
	variable mode;
	if (game_loaded) then begin
		mode:=get_sfall_global_int("ts_trt00");
		if(mode==-1) then begin
			return;
		end else if(mode==0) then begin
			if(dude_level>1) then begin
				display_msg("Error: Extra trait mod works for new games only");
				set_sfall_global("ts_trt00", -1);
				return;
			end
			display_msg("Visit the character screen before your first level up to pick your new trait");
			set_perk_owed(1);
			set_global_script_repeat(100);
			call setup_perk_dialog;
		end else begin
			call apply_traits_repeat;
		end
	end else begin
		if(dude_level>1) then begin
			clear_selectable_perks;
			set_perk_owed(get_perk_owed - 1);
			set_global_script_repeat(0);
			set_sfall_global("ts_trt00", 1);
			return;
		end
		if(get_perk_owed>0) then begin
			return;
		end
		clear_selectable_perks;
		set_global_script_repeat(0);
		set_sfall_global("ts_trt00", 1);
		call apply_traits;
		call apply_traits_repeat;
	end
end


fake perks script
Code:
procedure start;
procedure LevelChange;
procedure PickedPerk;

//imported traits
#define UnarmedMaster                                                           "Unarmed Master"
#define DiligentLearner                                                         "Diligent learner"
//perks
#define RapidPerks                                                              "Rapid Perks"
#define ToughBastard                                                            "Tough Bastard"
#define AllStats                                                                "Massive Stat Gain"
	
#define dude_global                                                             (get_sfall_global_int("perks_00"))
#define dude_level                                                              (get_pc_stat(1))
                                                                                
procedure LevelChange begin
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 0) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 1);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 1) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 2);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 2) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 3);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 3) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 4);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 4) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 5);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 5) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 6);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 6) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 7);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 7) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 8);
	end
	if(get_sfall_global_int("perk_per") > 1 and has_fake_perk(RapidPerks) == 8) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
		set_sfall_global("rapid_01", 9);
	end
	if(dude_level >1) and (has_fake_perk(ToughBastard) == 0) then begin
		set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
		set_sfall_global("Tbastard", 1);
	end
	if(dude_level >1) and (has_fake_perk(ToughBastard) == 1) then begin
		set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
		set_sfall_global("Tbastard", 2);
	end
	if(dude_level >1) and (has_fake_perk(ToughBastard) == 2) then begin
		set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
		set_sfall_global("Tbastard", 3);
	end
	if(dude_level >1) and (has_fake_perk(ToughBastard) == 3) then begin
		set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
		set_sfall_global("Tbastard", 4);
	end
	if(dude_level >1) and (has_fake_perk(ToughBastard) == 4) then begin
		set_selectable_perk(ToughBastard, 1, 1, "For each level of this perk you gain 100 health.");
		set_sfall_global("Tbastard", 5);
	end
	if(dude_level >1) and (has_fake_perk(AllStats) == 0) then begin
		set_selectable_perk(AllStats, 1, 1, "For each level of this perk you gain one to all primary stats and adds 2 levels to perk gain rate.");
		set_sfall_global("AllStats", 1);
	end
	if(dude_level >1) and (has_fake_perk(AllStats) == 1) then begin
		set_selectable_perk(AllStats, 1, 1, "For each level of this perk you gain one to all primary stats and adds 2 levels to perk gain rate.");
		set_sfall_global("AllStats", 2);
	end
	if(get_sfall_global_int("perk_per") == 1)then begin
	       set_selectable_perk(RapidPerks, 0, 1, "For each level of this perk you reduce the levels between perks by one.");
        end
 	if(get_sfall_global_int("Tbastard") == 6) then begin
	       set_selectable_perk(ToughBastard, 0, 1, "For each level of this perk you gain 100 health.");
        end
 	if(get_sfall_global_int("AllStats") == 3) then begin
	       set_selectable_perk(AllStats, 0, 1, "For each level of this perk you gain one to all primary stats and adds 2 levels to perk gain rate.");
        end
end

procedure PickedPerk begin
	if(has_fake_perk(RapidPerks) == 1 and get_sfall_global_int("rapid_01") == 1) then begin
		set_sfall_global("rapid_01", 2);
                set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_01");	
	end
	if(has_fake_perk(RapidPerks) == 2 and get_sfall_global_int("rapid_01") == 2) then begin
		set_sfall_global("rapid_01", 3);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_2");		
	end
	if(has_fake_perk(RapidPerks) == 3 and get_sfall_global_int("rapid_01") == 3) then begin
		set_sfall_global("rapid_01", 4);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_3");		
	end
	if(has_fake_perk(RapidPerks) == 4 and get_sfall_global_int("rapid_01") == 4) then begin
		set_sfall_global("rapid_01", 5);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_4");		
	end
	if(has_fake_perk(RapidPerks) == 5 and get_sfall_global_int("rapid_01") == 5) then begin
		set_sfall_global("rapid_01", 6);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_5");		
	end
	if(has_fake_perk(RapidPerks) == 6 and get_sfall_global_int("rapid_01") == 6) then begin
		set_sfall_global("rapid_01", 7);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_6");		
	end
	if(has_fake_perk(RapidPerks) == 7 and get_sfall_global_int("rapid_01") == 7) then begin
		set_sfall_global("rapid_01", 8);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_7");		
	end
	if(has_fake_perk(RapidPerks) == 8 and get_sfall_global_int("rapid_01") == 8) then begin
		set_sfall_global("rapid_01", 9);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_8");		
	end
	if(has_fake_perk(RapidPerks) == 9 and get_sfall_global_int("rapid_01") == 9) then begin
		set_sfall_global("rapid_01", 10);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("rapid_9");		
	end
	if(has_fake_perk(ToughBastard) == 1 and get_sfall_global_int("Tbastard") == 1) then begin
		set_sfall_global("Tbastard", 2);
		set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
                //display_msg("bastard 1");		
	end
	if(has_fake_perk(ToughBastard) == 2 and get_sfall_global_int("Tbastard") == 2) then begin
		set_sfall_global("Tbastard", 3);
		set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
                //display_msg("bastard 2");		
	end
	if(has_fake_perk(ToughBastard) == 3 and get_sfall_global_int("Tbastard") == 3) then begin
		set_sfall_global("Tbastard", 4);
		set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
                //display_msg("bastard 3");		
	end
	if(has_fake_perk(ToughBastard) == 4 and get_sfall_global_int("Tbastard") == 4) then begin
		set_sfall_global("Tbastard", 5);
		set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
                //display_msg("bastard 4");		
	end
	if(has_fake_perk(ToughBastard) == 5 and get_sfall_global_int("Tbastard") == 5) then begin
		set_sfall_global("Tbastard", 6);
		set_pc_extra_stat(7, (100 + get_pc_extra_stat(7)));
                //display_msg("bastard 5");		
	end
	if((has_fake_perk(AllStats) == 1) and get_sfall_global_int("AllStats") == 1) then begin
		set_sfall_global("AllStats", 2);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") + 2);
                set_pc_base_stat(0, (get_pc_base_stat(0) + 1));
                set_pc_base_stat(1, (get_pc_base_stat(1) + 1));
                set_pc_base_stat(2, (get_pc_base_stat(2) + 1));
                set_pc_base_stat(3, (get_pc_base_stat(3) + 1));
                set_pc_base_stat(4, (get_pc_base_stat(4) + 1));
                set_pc_base_stat(5, (get_pc_base_stat(5) + 1));
                set_pc_base_stat(6, (get_pc_base_stat(6) + 1));
                //display_msg("AllStats 1");		
	end
	if((has_fake_perk(AllStats) == 2) and get_sfall_global_int("AllStats") == 2) then begin
		set_sfall_global("AllStats", 3);
		set_sfall_global("perk_per", get_sfall_global_int("perk_per") + 2);
                set_pc_base_stat(0, (get_pc_base_stat(0) + 1));
                set_pc_base_stat(1, (get_pc_base_stat(1) + 1));
                set_pc_base_stat(2, (get_pc_base_stat(2) + 1));
                set_pc_base_stat(3, (get_pc_base_stat(3) + 1));
                set_pc_base_stat(4, (get_pc_base_stat(4) + 1));
                set_pc_base_stat(5, (get_pc_base_stat(5) + 1));
                set_pc_base_stat(6, (get_pc_base_stat(6) + 1));
                //display_msg("AllStats 2");		
	end
	call LevelChange;
end

procedure start begin
	set_global_script_repeat(1);
        if(dude_global != dude_level)then begin
               call LevelChange;
	       set_sfall_global("perks_00", dude_level);
	end
	call PickedPerk;
end

enjoy
 
figured a way to make Rapid Perks perk unlimited as long as perk gain rate is greater then 1,dont hafta code umpteen million of them if your mod has multiple ways to increase perk gain,also a little script that fully heals the player when he/she levels up

level up heal
Code:
procedure start;

#define dude_level                                                              (get_pc_stat(1))
#define dude_global                                                             (get_sfall_global_int("level_up"))

procedure start begin
   set_global_script_repeat(1);
   if (game_loaded) then begin
      set_sfall_global("level_up", dude_level);
   end else begin
      if(dude_level != dude_global) then begin
         display_msg("You have achieved level "+ dude_level+".");
         set_sfall_global("level_up", dude_level);
         critter_heal(dude_obj,(get_critter_stat(dude_obj,7) - get_critter_stat(dude_obj,35)));
      end
   end
end

perk per level script
Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))

procedure start begin
   set_global_script_repeat(1);
   set_global_script_type(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else begin
            set_perk_owed(1);
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         set_sfall_global("perk_per", 3);
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         set_sfall_global("perk_per", 3);
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         set_perk_owed(1);
         set_sfall_global("perkowed", 1);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end else if (dude_level != 1) then begin
         set_perk_owed(0);
         set_sfall_global("perkowed", 0);
      end
   end
end

endless rapid perks ranks as long as perk gain is higher then one level
Code:
procedure start;
procedure LevelChange;
procedure PickedPerk;

#define RapidPerks                                                              "Rapid Perks"
	
#define dude_global                                                             (get_sfall_global_int("perks_00"))
#define dude_level                                                              (get_pc_stat(1))
                                                                                
procedure LevelChange begin
	if(dude_level >1 and get_sfall_global_int("perk_per") > 1) then begin
		set_selectable_perk(RapidPerks, 1, 1, "For each level of this perk you reduce the levels between perks by one.");
	end
	if(get_sfall_global_int("perk_per") == 1)then begin
	       set_selectable_perk(RapidPerks, 0, 1, "For each level of this perk you reduce the levels between perks by one.");
        end
end

procedure PickedPerk begin
	if(has_fake_perk(RapidPerks) > get_sfall_global_int("rapid_02")) then begin
		set_sfall_global("rapid_02", get_sfall_global_int("rapid_02") + 1);
                set_sfall_global("perk_per", get_sfall_global_int("perk_per") - 1);
                //display_msg("Rapid Perks "+ has_fake_perk(RapidPerks));	
	end
	call LevelChange;
end

procedure start begin
	set_global_script_repeat(1);
        if(dude_global != dude_level)then begin
               call LevelChange;
	       set_sfall_global("perks_00", dude_level);
	end
	call PickedPerk;
end

enjoy

edit: oops took out some code unintentionaly
 
minor update to level per perk script to take into account skilled trait

Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))

procedure start begin
   set_global_script_repeat(1);
   set_global_script_type(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else begin
            set_perk_owed(1);
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         set_perk_owed(1);
         set_sfall_global("perkowed", 1);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end else if (dude_level != 1) then begin
         set_perk_owed(0);
         set_sfall_global("perkowed", 0);
      end
   end
end
 
now the perks_per_level script grants all the perks you would have gained had you leveled 1 level at a time,assuming you gained multiple levels,nothing else is changed,should not have to start a new game for this update

Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))
#define number_of_perks                                                         ((dude_level - last_perk_level) / levels_per_perk)

procedure start begin
   set_global_script_repeat(1);
   set_global_script_type(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else if (get_sfall_global_int("perkowed") > 0) then begin
            set_perk_owed(get_sfall_global_int("perkowed"));
            if(get_sfall_global_int("perkowed") == 1) then begin
               display_msg("You have a Perk waiting to be chosen.");
            end else if(get_sfall_global_int("perkowed") > 1) then begin
               display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
            end
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         //display_msg("Number of Perks : "+ number_of_perks);
         set_perk_owed(number_of_perks);
         set_sfall_global("perkowed", number_of_perks);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         if(get_sfall_global_int("perkowed") == 1) then begin
            display_msg("You have a Perk waiting to be chosen.");
         end else if(get_sfall_global_int("perkowed") > 1) then begin
            display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
         end
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end
   end
end
 
fixed a bug with the new count how many perks owed and deliver code,previously if you gained more then 1 perk and picked one,then saved with remaining perks owed,when you loaded the save game it would be reset to the amount of perks you gained when you last leveled,nasty heh

Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))
#define number_of_perks                                                         ((dude_level - last_perk_level) / levels_per_perk)

procedure start begin
   set_global_script_repeat(1);
   set_global_script_type(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else if (get_sfall_global_int("perkowed") > 0) then begin
            set_perk_owed(get_sfall_global_int("perkowed"));
            if(get_sfall_global_int("perkowed") == 1) then begin
               display_msg("You have a Perk waiting to be chosen.");
            end else if(get_sfall_global_int("perkowed") > 1) then begin
               display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
            end
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         //display_msg("Number of Perks : "+ number_of_perks);
         set_perk_owed(number_of_perks);
         set_sfall_global("perkowed", number_of_perks);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         if(get_sfall_global_int("perkowed") == 1) then begin
            display_msg("You have a Perk waiting to be chosen.");
         end else if(get_sfall_global_int("perkowed") > 1) then begin
            display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
         end
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end
      set_sfall_global("perkowed", get_perk_owed);
   end
end
 
minor update,previously if you started a new game and immediately gave yourself a park rate of 1,when you leveled to level 2 the script would grant you 2 perks,corrected it

Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))
#define number_of_perks                                                         ((dude_level - last_perk_level) / levels_per_perk)

procedure start begin
   set_global_script_repeat(1);
   set_global_script_type(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else if (get_sfall_global_int("perkowed") > 0) then begin
            set_perk_owed(get_sfall_global_int("perkowed"));
            if(get_sfall_global_int("perkowed") == 1) then begin
               display_msg("You have a Perk waiting to be chosen.");
            end else if(get_sfall_global_int("perkowed") > 1) then begin
               display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
            end
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         //display_msg("Number of Perks : "+ number_of_perks);
         if(last_perk_level == 0) then begin
            set_perk_owed(1);
         end else begin
            set_perk_owed(number_of_perks);
         end
         set_sfall_global("perkowed", number_of_perks);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         if(get_perk_owed == 1) then begin
            display_msg("You have a Perk waiting to be chosen.");
         end else if(get_perk_owed > 1) then begin
            display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
         end
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end
      set_sfall_global("perkowed", get_perk_owed);
   end
end

enjoy
 
as far as i can tell this will be the last update,nothing else i can foresee that can be done

now this script will remember if you have a perk that is owed to you,for instance,if you level to 3 and gain a perk but don't chose it,when you level to 6 you will now have 2 perks owed but the game over writes the one with another one(instead of adding them),this script will now add them(though you have to choose one then click done all the way out of the character screen then re-open character screen and choose the other one),heh fun doing scripting ^^

Code:
procedure start;

#define levels_per_perk                                                         get_sfall_global_int("perk_per")
#define dude_global                                                             get_sfall_global_int("toonlevl")
#define last_perk_level                                                         get_sfall_global_int("perklevl")
#define dude_level                                                              (get_pc_stat(1))
#define number_of_perks                                                         ((dude_level - last_perk_level) / levels_per_perk)

procedure start begin
   variable total_perks;
   set_global_script_repeat(1);
   set_global_script_type(1);
   if (game_loaded) then begin
      if(dude_level != 1) then begin
         if(get_sfall_global_int("perkowed") == 0) then begin
            set_perk_owed(0);
         end else if (get_sfall_global_int("perkowed") > 0) then begin
            set_perk_owed(get_sfall_global_int("perkowed"));
            if(get_sfall_global_int("perkowed") == 1) then begin
               display_msg("You have a Perk waiting to be chosen.");
            end else if(get_sfall_global_int("perkowed") >= 2) then begin
               display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
            end
         end
         set_sfall_global("toonlevl", dude_level);
      end
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
   end else begin
      if(get_sfall_global_int("perk_per") == 0)then begin
         if(has_trait(2,dude_obj,14)) then begin
            set_sfall_global("perk_per", 4);
         end else begin
            set_sfall_global("perk_per", 3);
         end
      end
      if(get_sfall_global_int("toonlevl") == dude_level) then begin
         if(get_perk_owed == 0)then begin
            set_perk_owed(0);
            set_sfall_global("perkowed", 0);
         end
      end else if(dude_level != 1) and (dude_global != dude_level) and ((dude_level - last_perk_level) >= levels_per_perk) then begin
         //display_msg("Number of Perks : "+ number_of_perks);
         if(last_perk_level == 0) then begin
            set_perk_owed(1);
         end else begin
            total_perks := (number_of_perks + get_sfall_global_int("perkowed"));
            set_perk_owed(total_perks);
         end
         set_sfall_global("perkowed", get_perk_owed);
         set_sfall_global("perklevl", dude_level);
         set_sfall_global("toonlevl", dude_level);
         if(get_sfall_global_int("perkowed") == 1) then begin
            display_msg("You have a Perk waiting to be chosen.");
         end else if(get_sfall_global_int("perkowed") >= 2) then begin
            display_msg("You have "+ get_sfall_global_int("perkowed") + " Perks waiting to be chosen.");
         end
         //display_msg("last_perk_level "+ last_perk_level +" levels_per_perk "+ levels_per_perk);
      end
      set_sfall_global("perkowed", get_perk_owed);
   end
end

edit : compiled versions of this and a few other things can be found at www.nirran.com
enjoy!
 
Hi! I had to register when I saw this as it's pretty much exactly what I'm trying to do. Well, close. What I want to do is fairly simple. I just want a perk every level. Unfortunately I don't know squat about coding. :(

Anyway I tried downloading the two files from your site, the levelsperperk file and the custom perks file. I am using the Restoration Mod 1.2.

I installed both int files under data/scripts but they cause the game to crash. When I take out the customperks and just leave perksperlevel, it doesn't crash but perks seam to come every 3 levels as normal.

Then I tried messing with the source file and recompiling, but I got an "undefined symbol" error on "dude_level". I also got the same error attempting to compile the unmodified source file downloaded from your site.

Anyway if you could give me any advice or point me in the right direction I'd be very appreciative.

Thanks :)
 
the source files can only be compiled with sFall compiler,in order for these scripts to work you must have sFall mod installed with extended_scripting_functions enabled
 
Nirran said:
the source files can only be compiled with sFall compiler,in order for these scripts to work you must have sFall mod installed with extended_scripting_functions enabled

Thanks for the quick reply! :)

This is where I was getting somewhat confused. It seemed like the sFall mod was included in the Restoration Project Mod. There is an option for extended script support in the ddraw.ini file that comes with it. Do I have to install sFall on top of that?

Also the program I tried to use to compile the ssl file was this one from the page that you linked toward the top of the thread.

http://timeslip.chorrol.com/current/sslc.7z

Is that the right one?


Please bear with me as much of this is new to me.
 
yea thats the right one,i couldn't get dos4gw.exe that comes with that download to work,instead remove the reference to that file from the compile command in p.bat


Code:
@..\dos4gw ..\compile temp.ssl

channge to 

@..\compile temp.ssl


and use the one that comes with watcom,donno why dude_level is causing an error

no frp comes with sfall you dont need to install on top of it,iirc you dont need to change any settings either
 
and use the one that comes with watcom
And get something like that: DOS/4G fatal error (1008): can't load executable format for file COMPILE.EXE [1] :newevil:
Timeslip's compile.exe is a native Windows NT console application and DOS4G(W) is completely NOT required.
Dos4gw.exe bundled with the compiler is a fake, provided just to simplify a life for non-experienced users. If it fails to load main executable, it's sufficient to just remove dos4gw call from the batch file. Attempts to replace fake with a real DOS extender will do nothing good.
 
thats true but it IS requiered for the watcom precompiler,without it the precompile will fail with a dos4gw error
 
I'm not sure, what version of the preprocessor you are using. This one definitely dose not require the extender.
If yours depends on DOS4GW, it's better to put Watcom's dos4gw.exe into one of the directories specified in the PATH variable rather to have it along with the compile.exe. DOS4G-based application loaders will find your extender automatically in this case. And there will be no need to mention DOS4GW in the batch file at all.
 
I never saw a p.bat in the file I downloaded. Is that something I should write myself? I just opened a dos window, navigated to the folder with ssl file and the compile.exe and typed compile perksperlevel.ssl.
 
Hi again. :)

So I tried it a few more times and it looks like it's the custom perks file that's causing the error. When I start a new game with only the custom perks file but no perks per level file, there is a "you have a perk waiting to be chosen" message at the very start of the game. Then it crashes. If you're quick you can choose the perk before the crash, but the only one available is quick pockets. Then it crashes.
 
ok then the problem is probably the version of sfall your using,download sfall from timeslip page and be sure to copy over all the settings in ddraw.ini in the one restoration installed to the new one should fix it
 
2Telecide:
AFAICS, you are trying to compile a source code which contains preprocessor directives without a preprocessor at all. No wonder that you get 'Undefined symbol' error and other unexpected behavior.

Download the preprocessor by the link I gave before.

Make p.bat with the following contetnts:
Code:
@if not exist %1.ssl goto DONE

@copy %1.ssl temp.c

@wcc386 temp.c /pc /fo=temp.i /w4

@copy temp.i temp.ssl 

@compile temp.ssl
@if not errorlevel == 0 goto ERROR

@copy temp.int %1.int

@del temp.c
@del temp.i
@del temp.ssl
@del temp.int
@goto DONE

:ERROR
@echo ERROR: %_CWDS%%1.ssl >> errors.log

:DONE

And compile your scripts like this (note filename WITHOUT SSL extention):
Code:
p.bat perksperlevel

My example assumes that all binaries and source code a located in the same directory. So may want to change pathnames in the batch file suitable to your project's structure.
 
Back
Top