FeelTheRads
Vault Senior Citizen

Hi,
Does anyone have an example script with how to add new perks with sfall?
There are those examples that come with the modder pack, but those also add traits and the code is too complicated for me to figure out.
I only got as far as making a perk show up with set_selectable_perk in the map start procedure, but I assume they need to go in a sfall global script and anyway, I don't know what to do besides that.
Thanks.
OK, so I tried this by just copy/pasting stuff from the example scripts:
However, it's not really working. It's only showing up if I do "dude_level>=1".
If I do "dude_level>=3" it's not showing up.
Also, it shows up for every perk pick, even though the condition is there to not do that... as far as I get it.
And obviously it's missing the part with the effects of the perk... which I of course also need help with.
Does anyone have an example script with how to add new perks with sfall?
There are those examples that come with the modder pack, but those also add traits and the code is too complicated for me to figure out.
I only got as far as making a perk show up with set_selectable_perk in the map start procedure, but I assume they need to go in a sfall global script and anyway, I don't know what to do besides that.
Thanks.
OK, so I tried this by just copy/pasting stuff from the example scripts:
Code:
procedure start;
#define dude_level (get_pc_stat(1))
//perks
#define Perkname "Perkname" //ts_chp04
procedure LevelChange begin
if(dude_level>=1 and has_fake_perk(Perkname)==0) then begin
set_selectable_perk(Perkname, 1, 50, "Perk Description");
end else begin
set_selectable_perk(Perkname, 0, 1, "");
end
end
procedure start begin
variable mode;
mode:=get_sfall_global_int("dlevel00");
if(mode!=dude_level) then begin
call LevelChange;
set_sfall_global("dlevel00", dude_level);
end
end
However, it's not really working. It's only showing up if I do "dude_level>=1".
If I do "dude_level>=3" it's not showing up.
Also, it shows up for every perk pick, even though the condition is there to not do that... as far as I get it.
And obviously it's missing the part with the effects of the perk... which I of course also need help with.
Last edited: