A feature that needs verifying?

正在查看此主题的用户

状态
不接受进一步回复。

Druidic

Knight
I'm working on adding a feature to my mod that allows you to force peasants into your service as a hostile action for free. This will lower relations with the village and lord, and would dramatically lower morale for the newly gained "free" troops.

I'm using the module system to make this, and I've pretty much copy-pasted the "Recruit" feature into a hostile action category. But what I want to know is, would this work? I edited the basic descriptions of the actions fine, but it's the part where making the troops free that I need an opinion on. I'll copy-paste what I have currently here below.

Original
(
    "recruit_volunteers",0,
    "{s18}",
    "none",
    [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 10),
    (assign, ":party_capacity", ":free_capacity"),
    (val_min, ":party_capacity", ":gold_capacity"),
    (try_begin),
      (gt, ":party_capacity", 0),
      (val_min, ":volunteer_amount", ":party_capacity"),
    (try_end),
    (assign, reg5, ":volunteer_amount"),
    (assign, reg7, 0),
    (try_begin),
      (gt, ":volunteer_amount", ":gold_capacity"),
      (assign, reg7, 1),
    (try_end),
    (try_begin),
      (eq, ":volunteer_amount", 0),
      (str_store_string, s18, "@No one here seems to be willing to join your party."),
    (else_try),
      (store_mul, reg6, ":volunteer_amount", 10),
      (str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
      (try_begin),
        (eq, reg5, 1),
        (str_store_string, s18, "@One {s3} volunteers to follow you."),
      (else_try),
        (str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
      (try_end),
      (set_background_mesh, "mesh_pic_recruits"),
    (try_end),
    ],
    [
      ("continue_not_enough_gold",
      [
        (eq, reg7, 1),
      ],
      "I don't have enough money...",
      [
        (jump_to_menu,"mnu_village"),
      ]),
     
      ("continue",
      [
        (eq, reg7, 0),
        (eq, reg5, 0),
      ], #noone willing to join                 
      "Continue...",
      [
        (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
        (jump_to_menu,"mnu_village"),
      ]),
     
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_village_recruit_volunteers_recruit"),
                       
        (jump_to_menu,"mnu_village"),
      ]),
     
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Forget it.",
      [
        (jump_to_menu,"mnu_village"),
      ]),
    ],
  ),

Modded (Changed values are in bold)
(
    "force_villagers_into_army",0,
    "Force the villagers into your army",
    "none",
    [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 0),
    (assign, ":party_capacity", ":free_capacity"),
    (val_min, ":party_capacity", ":gold_capacity"),
    (try_begin),
      (gt, ":party_capacity", 0),
      (val_min, ":volunteer_amount", ":party_capacity"),
    (try_end),
    (assign, reg5, ":volunteer_amount"),
    (assign, reg7, 0),
    (try_begin),
      (gt, ":volunteer_amount", ":gold_capacity"),
      (assign, reg7, 1),
    (try_end),
    (try_begin),
      (eq, ":volunteer_amount", 0),
      (str_store_string, s18, "@No one here seems to be willing to join your party."),
    (else_try),
      (store_mul, reg6, ":volunteer_amount", 0),
      (str_store_troop_name_by_count, s3, ":volunteer_troop", ":volunteer_amount"),
      (try_begin),
        (eq, reg5, 1),
        (str_store_string, s18, "@One {s3} are dragged to your feet."),
      (else_try),
        (str_store_string, s18, "@{reg5} {s3} are dragged to your feet."),
      (try_end),
      (set_background_mesh, "mesh_pic_recruits"),
    (try_end),
    ],
    [
      ("continue_not_enough_gold",
      [
        (eq, reg7, 1),
      ],
      "I don't have enough money...",
      [
        (jump_to_menu,"mnu_village"),
      ]), (DELETED)
     

      ("continue",
      [
        (eq, reg7, 0),
        (eq, reg5, 0),
      ], #noone willing to join                 
      "Continue...",
      [
        (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
        (jump_to_menu,"mnu_village"),
      ]),
     
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "We'll take them.",
      [
        (call_script, "script_village_recruit_volunteers_recruit"),
                       
        (jump_to_menu,"mnu_village"),
      ]),
     
      ("never_mind",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Never mind.",
      [
        (jump_to_menu,"mnu_village"),
      ]),
 
    ],
  ),

Would this technically work, so far?
 
Think about dividing by 0 and all that entails. If you don't want it to cost gold, remove those lines, don't just replace them randomly by 0.
 
OK, thank you.

I believe I have it working. Only one way to find out though, and I'm nowhere near a working state with the mod, but this helps!
 
状态
不接受进一步回复。
后退
顶部 底部