#CHAD edit
(assign,"$g_attributes_raised", 0), #Needed if character has Insomniac perk
(assign,"$g_perk_points",0), #Perk upgrade points. When this is at 1 or above, you can upgrade a Perk
(assign,"$perk_bonus_swift_learner",3), # % Bonus to XP per Perk rating - ex: Swift Learner 1 grants 3% bonus XP
(assign,"$perk_bonus_weapons_adept",3), # Bonus points to Weapon Proficiencies per point of Weapons Adept
(assign,"$perk_bonus_fortune_seeker",5), # % Bonus to Money per point of Fortune Seeker
#CHAD EDIT
("perk_swift_learner_description", "Whether they are mistakes or successes, you learn from you experiences more quickly than a typical person. Each level of this perk grants you an additional 3% Experience Points whenever a quest is completed."),
("perk_weapons_adept_description", "You show exceptional potential with any weapon you pick up. For every point in this Perk, you automatically increase all Weapon Proficiencies by 3 points whenever you level up. (Note: The higher your Weapons Proficiencies, the harder they are to upgrade.)"),
("perk_scholar_description", "Some call you a bookworm, but that has never been an insult in your eyes. You have learned to pick up subtle details in your studying, which a casual reader might have missed. Every level of this perk grants you an additional bonus point whenever you finish a book."),
("perk_fortune_seeker_description", "Cheat, steal, or negotiate, you always manage to come out of any situation with a few extra coins. Each level of this perk grants you 5% more Denars whenever money is earned."),
("perk_insomniac_description", "You have a natural affinity for the night. For each level of this perk, you receive one bonus point to Strength, Agility, Power Strike, Power Draw, Power Throw, and Athletics when the sun is down."),
#CHAD EDIT
("start_mod_2",0,
"Choose one perk, which will modify the way your character advances as you play the game.",
"none",
[(assign,"$perk_swift_learner",0),
(assign,"$perk_weapons_adept",0),
(assign,"$perk_scholar",0),
(assign,"$perk_fortune_seeker",0),
(assign,"$perk_insomniac",0),
(assign,"$character_level_up",2),], #The character's next level: A trigger when check for when this level is reached, and apply bonuses for the Weapons Adept perk, if it has been taken.
[
("swift_learner",[],"Swift Learner: Gains XP more quickly",
[
(assign,"$perk_swift_learner",1),
(assign,"$perk_next_upgrade",3), #This is the next level at which you can upgrade your Perks
(jump_to_menu,"mnu_start_mod_3"),
]
),
("weapons_adept",[],"Weapon Adept: Gains bonuses to Weapon Proficiencies with each level",
[
(assign,"$perk_weapons_adept",1),
(assign,"$perk_next_upgrade",3),
(jump_to_menu,"mnu_start_mod_3"),
]
),
("scholar",[],"Scholar: Receives bonuses whenever a book is read",
[
(assign,"$perk_scholar",1),
(assign,"$perk_next_upgrade",3),
(jump_to_menu,"mnu_start_mod_3"),
]
),
("fortune_seeker",[],"Fortune Seeker: Gains money more quickly",
[
(assign,"$perk_fortune_seeker",1),
(assign,"$perk_next_upgrade",3),
(jump_to_menu,"mnu_start_mod_3"),
]
),
("insomniac",[],"Insomniac: Attributes are increased at night.",
[
(val_add,"$perk_insomniac",1),
(assign,"$perk_next_upgrade",3),
(jump_to_menu,"mnu_start_mod_3"),
]
),
]
),
#CHAD EDIT for viewing Perks
("camp_view_perks",0,"Below is a list of all available Perks. Click on the name of any Perk to view its details.",
"none",
[
(assign, reg1, "$perk_swift_learner"),
(assign, reg2, "$perk_weapons_adept"),
(assign, reg3, "$perk_scholar"),
(assign, reg4, "$perk_fortune_seeker"),
(assign, reg5, "$perk_insomniac"),
],
[
("swift_learner",[],"Swift Learner (Current Level: {reg1})",
[
(assign, "$cur_perk", 1),
(assign, reg10, "$perk_swift_learner"),
(str_store_string, s1, "str_perk_swift_learner_description"),
(jump_to_menu, "mnu_camp_upgrade_perks"),
]
),
("weapons_adept",[],"Weapons Adept (Current Level: {reg2})",
[
(assign, "$cur_perk", 2),
(assign, reg10, "$perk_weapons_adept"),
(str_store_string, s1, "str_perk_weapons_adept_description"),
(jump_to_menu, "mnu_camp_upgrade_perks"),
]
),
("scholar",[],"Scholar (Current Level: {reg3})",
[
(assign, "$cur_perk", 3),
(assign, reg10, "$perk_scholar"),
(str_store_string, s1, "str_perk_scholar_description"),
(jump_to_menu, "mnu_camp_upgrade_perks"),
]
),
("fortune_seeker",[],"Fortune Seeker (Current Level: {reg4})",
[
(assign, "$cur_perk", 4),
(assign, reg10, "$perk_fortune_seeker"),
(str_store_string, s1, "str_perk_fortune_seeker_description"),
(jump_to_menu, "mnu_camp_upgrade_perks"),
]
),
("insomniac",[],"Insomniac (Current Level: {reg5})",
[
(assign, "$cur_perk", 5),
(assign, reg10, "$perk_insomniac"),
(str_store_string, s1, "str_perk_insomniac_description"),
(jump_to_menu, "mnu_camp_upgrade_perks"),
]
),
("back",[],"Back to Camp Menu...",
[
(jump_to_menu, "mnu_camp"),
]
),
]
),
#CHAD EDIT for perk upgrade
("camp_upgrade_perks",0,"{s1}",
"none",
[],
[
("upgrade",[(ge,"$g_perk_points",1),],"Upgrade this Perk (Current Level: {reg10})", #If the character has at least one Perk Point, give the option to upgrade
[
(try_begin),
(eq, "$cur_perk", 1),
(val_add,"$perk_swift_learner",1),
(val_sub,"$g_perk_points",1),
(display_message, "@Swift Learner Perk has been upgraded."),
(jump_to_menu, "mnu_camp_view_perks"),
(else_try),
(eq, "$cur_perk", 2),
(val_add,"$perk_weapons_adept",1),
(val_sub,"$g_perk_points",1),
(display_message, "@Weapons Adept Perk has been upgraded."),
(jump_to_menu, "mnu_camp_view_perks"),
(else_try),
(eq, "$cur_perk", 3),
(val_add,"$perk_scholar",1),
(val_sub,"$g_perk_points",1),
(display_message, "@Scholar Perk has been upgraded."),
(jump_to_menu, "mnu_camp_view_perks"),
(else_try),
(eq, "$cur_perk", 4),
(val_add,"$perk_fortune_seeker",1),
(val_sub,"$g_perk_points",1),
(display_message, "@Fortune Seeker Perk has been upgraded."),
(jump_to_menu, "mnu_camp_view_perks"),
(else_try),
(eq, "$cur_perk", 5),
(val_add,"$perk_insomniac",1),
(val_sub,"$g_perk_points",1),
(display_message, "@Insomniac Perk has been upgraded."),
(jump_to_menu, "mnu_camp_view_perks"),
(try_end),
]
),
("back",[],"Back to Perks list...",
[
(jump_to_menu, "mnu_camp_view_perks"),
]
),
]
),
#CHAD edit to check for Insomniac perk
(1.0, 0, 0, [(ge,"$perk_insomniac",1)], [
(assign,":insomniac_bonus","$perk_insomniac"),
(try_begin),
(neq, "$g_attributes_raised", 1),
(is_currently_night),
(troop_raise_attribute, "trp_player",ca_strength,":insomniac_bonus"),
(troop_raise_attribute, "trp_player",ca_agility,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_power_draw,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_power_throw,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_power_strike,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_athletics,":insomniac_bonus"),
(assign,"$g_attributes_raised", 1),
(else_try),
(neq, "$g_attributes_raised", 0),
(neg|is_currently_night),
(val_sub,":insomniac_bonus","$perk_insomniac"),
(val_sub,":insomniac_bonus","$perk_insomniac"),
(troop_raise_attribute, "trp_player",ca_strength,":insomniac_bonus"),
(troop_raise_attribute, "trp_player",ca_agility,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_power_draw,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_power_throw,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_power_strike,":insomniac_bonus"),
(troop_raise_skill,"trp_player",skl_athletics,":insomniac_bonus"),
(assign,"$g_attributes_raised", 0),
(try_end),
]),
#CHAD - Has character leveled up?
(0.1, 0, 0, [
(store_character_level,":cur_level","trp_player"),
(ge,":cur_level","$character_level_up"),
],
[ #Then let's give him/her some WP points, if the Weapons Adept Perk has been taken.
(try_begin),
(ge,"$perk_weapons_adept",1),
(store_mul,":weapons_adept_bonus","$perk_weapons_adept","$perk_bonus_weapons_adept"), #Multiply the Perk rating by the bonus
(troop_raise_proficiency,"trp_player",wpt_one_handed_weapon,":weapons_adept_bonus"),
(troop_raise_proficiency,"trp_player",wpt_two_handed_weapon,":weapons_adept_bonus"),
(troop_raise_proficiency,"trp_player",wpt_polearm,":weapons_adept_bonus"),
(troop_raise_proficiency,"trp_player",wpt_archery,":weapons_adept_bonus"),
(troop_raise_proficiency,"trp_player",wpt_crossbow,":weapons_adept_bonus"),
(troop_raise_proficiency,"trp_player",wpt_throwing,":weapons_adept_bonus"),
(display_message, "@Your weapon proficiencies have been increased.",0xFF00FF00),
(try_end),
(store_character_level,":cur_level","trp_player"),
(store_add,":next_level",":cur_level",1),
(assign,"$character_level_up",":next_level"), #Update $character_level_up so we can tell when he/she levels up again
]
),
#CHAD - Time to upgrade a perk?
(0.1, 0, 0, [
(store_character_level, ":cur_level", "trp_player"),
(ge,":cur_level","$perk_next_upgrade"),
],
[
(val_add,"$g_perk_points",1), #Add a perk point, so that we can upgrade a perk
(val_add,"$perk_next_upgrade",3), #Add 3, because we gain a perk point every 3 levels
(display_message, "@You may now upgrade one of your perks from the Camp menu.",0xFF00FF00),
(play_sound,"snd_man_victory"),
]
),
#script_troop_add_gold
# INPUT: arg1 = troop_no, arg2 = amount
# OUTPUT: none
("troop_add_gold",
[(store_script_param, ":troop_no", 1),
(store_script_param, ":amount", 2),
#CHAD EDIT
(try_begin),
(eq,":troop_no","trp_player"),
(try_begin),
(ge,"$perk_fortune_seeker",1), #Has Fortune Seeker been taken?
(store_mul, ":perk_bonus", "$perk_fortune_seeker", "$perk_bonus_fortune_seeker"),
(val_add, ":perk_bonus", 100),
(val_div,":amount",100),
(val_mul,":amount",":perk_bonus"), #Then add the bonus
(try_end),
(try_end),
#CHAD EDIT END
(troop_add_gold, ":troop_no", ":amount"),
(try_begin),
(eq, ":troop_no", "trp_player"),
(play_sound, "snd_money_received"),
(try_end),
]),
#CHAD EDIT
#script_chad_troop_add_xp
("chad_troop_add_xp",
[(store_script_param, ":amount", 1),
(store_script_param, ":troop_no", 2),
(try_begin),
(eq,":troop_no","trp_player"),
(try_begin),
(ge,"$perk_swift_learner",1), #Swift Learner taken?
(store_mul, ":perk_bonus", "$perk_swift_learner", "$perk_bonus_swift_learner"),
(val_add, ":perk_bonus", 100),
(val_div,":amount",100),
(val_mul,":amount",":perk_bonus"), #Then add the bonus
(try_end),
(try_end),
(add_xp_to_troop, ":amount", ":troop_no"),
]
),
#CHAD EDIT END
#script_chad_add_xp_as_reward
("chad_add_xp_as_reward",
[(store_script_param, ":amount", 1),
(try_begin),
(ge,"$perk_swift_learner",1),
(store_mul, ":perk_bonus", "$perk_swift_learner", "$perk_bonus_swift_learner"),
(val_add, ":perk_bonus", 100),
(val_div,":amount",100),
(val_mul,":amount",":perk_bonus"),
(try_end),
(add_xp_as_reward, ":amount"),
]
),
#CHAD EDIT for Scholar perk
(assign,":book_reward",1), #Books always reward at least 1 point
(try_begin),
(ge,"$perk_scholar",1), #If the character has the Scholar perk...
(val_add,":book_reward","$perk_scholar"), #We add the perk rating to the book reward
(try_end),
(try_begin),
(eq, "$g_player_reading_book", "itm_book_tactics"),
(troop_raise_skill, "trp_player", "skl_tactics", ":book_reward"),
(str_store_string, s2, "@ Your tactics skill has increased."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_persuasion"),
(troop_raise_skill, "trp_player", "skl_persuasion", ":book_reward"),
(str_store_string, s2, "@ Your persuasion skill has increased."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_leadership"),
(troop_raise_skill, "trp_player", "skl_leadership", ":book_reward"),
(str_store_string, s2, "@ Your leadership skill has increased."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_intelligence"),
(troop_raise_attribute, "trp_player", ca_intelligence, ":book_reward"),
(str_store_string, s2, "@ Your intelligence has increased."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_trade"),
(troop_raise_skill, "trp_player", "skl_trade", ":book_reward"),
(str_store_string, s2, "@ Your trade skill has increased by."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_weapon_mastery"),
(troop_raise_skill, "trp_player", "skl_weapon_master", ":book_reward"),
(str_store_string, s2, "@ Your weapon master skill has increased."),
(else_try),
(eq, "$g_player_reading_book", "itm_book_engineering"),
(troop_raise_skill, "trp_player", "skl_engineer", ":book_reward"),
(str_store_string, s2, "@ Your engineer skill has increased."),
(try_end),
(dialog_box, "@You have finished reading {s1}.{s2}", "@Book Read"),
(assign, "$g_player_reading_book", 0),
]),
I'm a newbie with Python too, so I'm probably not the best one to offer suggestions, but at first glance it looks like you actually have the code to be executed in the conditions block. I'm not sure how that might negatively be effecting things, but it could be. What you might want to try is moving your code into the second set of brackets, and just put the required conditions into the first bracket.SupaNinjaMan 说:
(1.0, 0, 0, [(check_quest_active, "qst_perk_insomniac"),],
[
(try_begin),
(neq, "$g_attributes_raised", 1),
(is_currently_night),
(troop_raise_attribute, "trp_player",ca_strength,3),
(troop_raise_attribute, "trp_player",ca_agility,3),
(troop_raise_skill, "trp_player",skl_athletics,1),
(troop_raise_skill, "trp_player",skl_ironflesh,1),
(troop_raise_skill, "trp_player",skl_power_strike,1),
(assign,"$g_attributes_raised", 1),
(else_try),
(neq, "$g_attributes_raised", 0),
(neg|is_currently_night),
(troop_raise_attribute, "trp_player",ca_strength,-4),
(troop_raise_attribute, "trp_player",ca_agility,-4),
(troop_raise_skill, "trp_player",skl_athletics,-1),
(troop_raise_skill, "trp_player",skl_ironflesh,-1),
(troop_raise_skill, "trp_player",skl_power_strike,-1),
(assign,"$g_attributes_raised", 0),
(try_end),
]),
Yep, that's no problem. I added the condition to it and made sure it worked properly. Thanks again. That was incredibly simple...I probably would have ended up trying it in some other roundabout way that wouldn't have been nearly as effective.Keedo420 说:
Haha, yeah, I agree with you on Python. This is my first experience with it, and so far I am not loving it. As for your suggestion, I'll give it a try, but I'm not sure that would work either. I don't really know this for sure, but it seems like the portion of that code (for example: difficulty(10)) is looking for a direct numerical input. I couldn't get it to read that as a variable at all when I was messing with it.Mayhem 说:
SupaNinjaMan 说: