Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I was looking through the coords for frivolous decimal numbers and spaces. I then realized there was a missing bracket in the second sea raider spawn point.  :oops:

Well I'm glad I've got this out of the way. Thank you very much for your help.  :smile:
 
Afternoon everybody,

How does one know when a vertex mesh animation(like the bow)is in sync with the actual animation that uses that mesh animation?

In other words how can you tell when a mesh animation is in sync with a specific animation?(ex. bow mesh and ready bow animation)
 
Okay, so I've been trying to add extra text to various legendary weapons. But, I am unsure of how to start a new line, as it currently just makes a really small font on one line, and extends across and past the edge of the screen.

I was under the impression that a backslash would work to create a new line, but it's not seeming to work. :???:

Taken from script_game_get_item_extra_text:
Code:
        (try_begin),	  
	  (eq, ":item_no", "itm_mackie_swordcane_blade"),	
          (eq, ":extra_text_id", 0),
          (set_result_string, "@Forged by the great Innui blacksmith Bolen, the legendary Innui Swordcane\
is said to be sharper than any sword created; and was wielded by Ulric Yorn Bradley,\
before he lost it in the maze of dirt streets known as Illisarin."),
          (set_trigger_result, 0xFFEEDD),	
(else_try),
		(eq, ":item_no", "itm_jack_anduril"),	
          (eq, ":extra_text_id", 0),
          (set_result_string, "@The sword of Elendil was forged anew by Elvish smiths,\
and on its blade was traced a device of seven stars set between the\
crescent Moon and the rayed Sun, and about them was written many runes;\
for Aragorn, son of Arathorn was going to war upon the marches of Mordor.\
Very bright was that sword when it was made whole again; the light of the\
sun shone readily in it, and the light of the moon shone cold, and\
its edge was hard and keen. Aragorn gave it a new name and called it\
Anduril, Flame of the West."),
          (set_trigger_result, 0xFFEEDD),	  
        (try_end),
 
I forgot where the settings are to manage how geometry/UVs mirror over for face models.

The mirrored half of my face is displaying the UV in the wrong direction and I need to change it, if that won't work then I need to disable the mirror operation entirely and do it manually myself, anybody know where in openbrf/python modules that I might find the options?
 
Ruthven said:
The slash is only for the module system to read. Use ^ instead.

Thanks! :grin:

Edit: I feel stupid for asking this, but is there a way to only allow thrust attacks, not swing attacks? I set swing damage to 0 but I can still do swing attacks. :sad:
Code:
["mackie_swordcane_blade", "Innui Swordcane", [("mackie_swordcane_blade",0)], itp_type_one_handed_wpn|itp_primary, itc_longsword|itcf_carry_sword_left_hip, 8409, weight(3)|difficulty(14)|spd_rtng(163)|weapon_length(80)|swing_damage(0,cut)|thrust_damage(50,pierce), imodbits_none ],
 
No, I use the module system. Text editing will get overwritten any time I compile the module system, so that won't work.

I looked through header_items, so I'm not even sure that I'll be able to do anything about it. :neutral:
 
you can use morghs for the module system as well as .txt.

basically get rid of itc_longsword, and add in all the abilities you want to give it. itc_longsword is just a package of abilities for quick item creation.
give it all the 2h blocks in each directon, itc_carry_sword_hip or whatever it"s called, 2h stab, and then itc_show_holster_when_drawn if you have a scabbard mesh. there might be a couple more you have to add to most weapons but i'm tired, and my recall sucks
 
I am developing a mod called Myrtana at War which is a mod based on a game called Gothic 3. In the game there is an orc faction (they are orcs) and there are humans that work for the orcs but belong in the same faction. I would like to ask you would it be possible to give an option in a village to either recruit orcs or human mercs. Could somebody please help me with this? All i came to is errors.
 
I was looking into a dismount hotkey, found this:
Phaiak said:
Hi,
got the models from DesideriusDolen. Lynores made them, but it looks like he isnt active anymore. Nobody can ask him. Thats why i dont upload my mod.

Now the button. I wanted a button to jump from a fast riding horse, so i prefere a "rider fall"-animation. I repeplaced it with a normal dismount ani.

Here is the code for the "module_mission_templates.py"
Code:
### vom Pferd springen
  (0, 0, 0, [],
  [
    (key_clicked, key_z),
         (try_begin),
           (get_player_agent_no,":agent_no"),
           (agent_get_horse,":horse", ":agent_no"),
           (neq,":horse",-1),
           (agent_set_animation, ":agent_no" , "anim_dismount_horse"),
           (agent_start_running_away, ":horse"),
           (agent_stop_running_away, ":horse"), #not sure if this works. maybe the horse changes his agent_id after dismounting
         (try_end),
         ]),

I hope i could help...

Doesn't seem to work for me, but does anyone know whether this is possible?
 
Somebody said:
agent_start_running_away does work on horses, in Warband at least.
Be aware (in multiplayer mode, at least): if you use it on a horse to forcibly dismount the rider, they will also have a messed up collision object / collision synchronization with the server will be broken. See bug report (not addressed).
 
9jakub9 said:
I am developing a mod called Myrtana at War which is a mod based on a game called Gothic 3. In the game there is an orc faction (they are orcs) and there are humans that work for the orcs but belong in the same faction. I would like to ask you would it be possible to give an option in a village to either recruit orcs or human mercs. Could somebody please help me with this? All i came to is errors.
look for update_volunteer_troops_in_village

you can change it i something like this:
          #script_update_volunteer_troops_in_village
          # INPUT: arg1 = center_no
          # OUTPUT: none
          ("update_volunteer_troops_in_village",
            [
              (store_script_param, ":center_no", 1),
              (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
              (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
           
              (store_random_in_range, ":random_quality", 1, 6),
              (try_begin),
                (eq,":random_quality",1),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",2),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_2_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",3),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_3_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",4),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_4_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",5),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_5_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
           
              (assign, ":upper_limit", 25),
              (try_begin),
                (ge, ":player_relation", 5),
                (val_add, ":upper_limit", 45),
              (else_try),
                (lt, ":player_relation", 0),
                (assign, ":upper_limit", 0),
              (try_end),
           
              (store_random_in_range, ":amount", 0, ":upper_limit"),
              (party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
          ]),
 
Tocan said:
9jakub9 said:
I am developing a mod called Myrtana at War which is a mod based on a game called Gothic 3. In the game there is an orc faction (they are orcs) and there are humans that work for the orcs but belong in the same faction. I would like to ask you would it be possible to give an option in a village to either recruit orcs or human mercs. Could somebody please help me with this? All i came to is errors.
look for update_volunteer_troops_in_village

you can change it i something like this:
          #script_update_volunteer_troops_in_village
          # INPUT: arg1 = center_no
          # OUTPUT: none
          ("update_volunteer_troops_in_village",
            [
              (store_script_param, ":center_no", 1),
              (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
              (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
           
              (store_random_in_range, ":random_quality", 1, 6),
              (try_begin),
                (eq,":random_quality",1),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",2),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_2_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",3),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_3_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",4),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_4_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",5),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_5_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
           
              (assign, ":upper_limit", 25),
              (try_begin),
                (ge, ":player_relation", 5),
                (val_add, ":upper_limit", 45),
              (else_try),
                (lt, ":player_relation", 0),
                (assign, ":upper_limit", 0),
              (try_end),
           
              (store_random_in_range, ":amount", 0, ":upper_limit"),
              (party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
          ]),

I pasted it in and adjusted it so its all spaced out properly and when i compile this pops up:
Error: Unable to find object:script_update_npc_volunteer_troops_in_village
ERROR: Illegal Identifier:script_update_npc_volunteer_troops_in_village
 
9jakub9 said:
Tocan said:
9jakub9 said:
I am developing a mod called Myrtana at War which is a mod based on a game called Gothic 3. In the game there is an orc faction (they are orcs) and there are humans that work for the orcs but belong in the same faction. I would like to ask you would it be possible to give an option in a village to either recruit orcs or human mercs. Could somebody please help me with this? All i came to is errors.
look for update_volunteer_troops_in_village

you can change it i something like this:
          #script_update_volunteer_troops_in_village
          # INPUT: arg1 = center_no
          # OUTPUT: none
          ("update_volunteer_troops_in_village",
            [
              (store_script_param, ":center_no", 1),
              (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
              (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
           
              (store_random_in_range, ":random_quality", 1, 6),
              (try_begin),
                (eq,":random_quality",1),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",2),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_2_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",3),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_3_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",4),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_4_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
              (try_begin),
                (eq,":random_quality",5),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_5_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),
           
              (assign, ":upper_limit", 25),
              (try_begin),
                (ge, ":player_relation", 5),
                (val_add, ":upper_limit", 45),
              (else_try),
                (lt, ":player_relation", 0),
                (assign, ":upper_limit", 0),
              (try_end),
           
              (store_random_in_range, ":amount", 0, ":upper_limit"),
              (party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
          ]),

I pasted it in and adjusted it so its all spaced out properly and when i compile this pops up:
Error: Unable to find object:script_update_npc_volunteer_troops_in_village
ERROR: Illegal Identifier:script_update_npc_volunteer_troops_in_village

With your script you won't get any tier upgrades if you have a higher relationship with your villages but it is a random effect which tier you get. You could create new troop tiers for your orcs, like slot_faction_tier_1b_troop, etc., this should just work fine. You then would also need a new slot where you can save a value in order to use it in both update_volunteer scripts.

- so, in module_constants
--------------------------

look for the below slots and then add your new constant:

slot_center_npc_volunteer_troop_type  = 90
slot_center_npc_volunteer_troop_amount = 91
slot_center_mercenary_troop_type  = 90
slot_center_mercenary_troop_amount= 91
slot_center_volunteer_troop_type  = 92
slot_center_volunteer_troop_amount= 93

slot_center_volunteer_orc_type = 95 ## this is your new constant



- module_scripts in game_start
----------------------------------
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
  (faction_set_slot "fac_culture_1", slot_faction_tier_1b_troop, "trp_orc_recruit"), ## repeat this for all the other cultures too -- you only need one tier 1 troop as from thereon you follow the upgrade path of the particular orc unit, i.e. you don't need a factionized orc tier_2, tier_3, etc.
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_5_troop, "trp_swadian_knight"),


 
- module_scripts in initialize_faction_troop_types
---------------------------------------------------
        (faction_get_slot, ":troop", ":culture",  slot_faction_tier_1_troop),
        (faction_set_slot, ":faction_no",  slot_faction_tier_1_troop, ":troop"),
        (faction_get_slot, ":troop", ":culture",  slot_faction_tier_1b_troop), ## your new tier_1 orc unit
        (faction_set_slot, ":faction_no",  slot_faction_tier_1b_troop, ":troop"), ## your new tier_1 orc unit
        (faction_get_slot, ":troop", ":culture",  slot_faction_tier_2_troop),
        (faction_set_slot, ":faction_no",  slot_faction_tier_2_troop, ":troop"),
        (faction_get_slot, ":troop", ":culture",  slot_faction_tier_3_troop),
        (faction_set_slot, ":faction_no",  slot_faction_tier_3_troop, ":troop"),
        (faction_get_slot, ":troop", ":culture",  slot_faction_tier_4_troop),
        (faction_set_slot, ":faction_no",  slot_faction_tier_4_troop, ":troop"),
        (faction_get_slot, ":troop", ":culture",  slot_faction_tier_5_troop),
        (faction_set_slot, ":faction_no",  slot_faction_tier_5_troop, ":troop"),  
 
 
 
- these are the 2 marginally modified original scripts, in module_scripts
--------------------------------------------------------------------------
          #script_update_volunteer_troops_in_village
          # INPUT: arg1 = center_no
          # OUTPUT: none
          ("update_volunteer_troops_in_village",
            [
              (store_script_param, ":center_no", 1),
              (party_get_slot, ":player_relation", ":center_no", slot_center_player_relation),
              (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
 
## new stuff begin
              (store_random_in_range, ":random_unit", 0, 10), ## 0-9; random choice, if lower than 5 you get humans, if equal or higher than 5 you get orcs
              (try_begin),
                (lt,":random_unit", 5),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
  (else_try),
                (ge,":random_unit", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1b_troop), ## this is your new orc unit
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),

  (party_set_slot, ":center_no", slot_center_volunteer_orc_type, ":random_unit"), ## this is further needed for the script update_npc_volunteer_troops_in_village
## new stuff end

## ALTERNATIVE new stuff begin -- if you only want to use one and the same orc unit for all factions without declaring a new tier_1b unit (you then have to leave out the changes to initialize_faction_troop_types and game_start in module_scripts)
  (assign, ":volunteer_troop", 0),
              (store_random_in_range, ":random_unit", 0, 10), ## 0-9; random choice, if lower than 5 you get humans, if equal or higher than 5 you get orcs
              (try_begin),
                (lt,":random_unit", 5),
                (faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
  (else_try),
                (ge,":random_unit", 5),
(assign, ":volunteer_troop", "trp_orc_recruit"), ## this is your new orc unit
                (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"),
              (try_end),

  (party_set_slot, ":center_no", slot_center_volunteer_orc_type, ":random_unit"), ## this is further needed for the script update_npc_volunteer_troops_in_village
## ALTERNATIVE new stuff end

  (assign, ":volunteer_troop_tier", 1),
  (store_div, ":tier_upgrades", ":player_relation", 10),
  (try_for_range, ":unused", 0, ":tier_upgrades"),
(store_random_in_range, ":random_no", 0, 100),
(lt, ":random_no", 10),
(store_random_in_range, ":random_no", 0, 2), ## make sure that your orc unit has an upgrade path to higher tier orc units, else you will only receive tier1 orc units
(troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
(try_begin),
  (le, ":upgrade_troop_no", 0),
  (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
(try_end),
(gt, ":upgrade_troop_no", 0),
(val_add, ":volunteer_troop_tier", 1),
(assign, ":volunteer_troop", ":upgrade_troop_no"),
  (try_end),
 
  (assign, ":upper_limit", 12),
  (try_begin),
(ge, ":player_relation", 12),
(assign, ":upper_limit", ":player_relation"),
(val_div, ":upper_limit", 2),
(val_add, ":upper_limit", 6),
  (else_try),
(lt, ":player_relation", 0),
(assign, ":upper_limit", 0),
  (try_end),

  (val_mul, ":upper_limit", 3), 
  (store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
  (val_div, ":upper_limit", ":amount_random_divider"),
 
  (store_random_in_range, ":amount", 0, ":upper_limit"),
  (party_set_slot, ":center_no", slot_center_volunteer_troop_type, ":volunteer_troop"), ## this line was missing in your original script
  (party_set_slot, ":center_no", slot_center_volunteer_troop_amount, ":amount"),
]),


  #script_update_npc_volunteer_troops_in_village
  # INPUT: arg1 = center_no
  # OUTPUT: none
  ("update_npc_volunteer_troops_in_village",
    [
      (store_script_param, ":center_no", 1),
      (party_get_slot, ":center_culture", ":center_no", slot_center_culture),
## new stuff begin
  (party_get_slot, ":eek:rc_yes_or_no", ":center_no", slot_center_volunteer_orc_type),
(try_begin),
(lt, ":eek:rc_yes_or_no", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
  (else_try),
(ge, ":eek:rc_yes_or_no", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1b_troop),
(try_end),
## new stuff end

## ALTERNATIVE new stuff begin -- only one orc unit for all factions without declaring a new tier_1b unit (you then have to leave out the changes to initialize_faction_troop_types and game_start in module_scripts)
  (assign, ":volunteer_troop", 0),
  (party_get_slot, ":eek:rc_yes_or_no", ":center_no", slot_center_volunteer_orc_type),
(try_begin),
(lt, ":eek:rc_yes_or_no", 5),
(faction_get_slot, ":volunteer_troop", ":center_culture", slot_faction_tier_1_troop),
  (else_try),
(ge, ":eek:rc_yes_or_no", 5),
(assign, ":volunteer_troop", "trp_orc_recruit"),
(try_end),
## ALTERNATIVE new stuff end

      (assign, ":volunteer_troop_tier", 1),
      (try_for_range, ":unused", 0, 5),
        (store_random_in_range, ":random_no", 0, 100),
        (lt, ":random_no", 10),
        (store_random_in_range, ":random_no", 0, 2), ## make sure that your orc unit has an upgrade path to higher tier orc units, else you will only receive tier1 orc units
        (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", ":random_no"),
        (try_begin),
          (le, ":upgrade_troop_no", 0),
          (troop_get_upgrade_troop, ":upgrade_troop_no", ":volunteer_troop", 0),
        (try_end),
        (gt, ":upgrade_troop_no", 0),
        (val_add, ":volunteer_troop_tier", 1),
        (assign, ":volunteer_troop", ":upgrade_troop_no"),
      (try_end),
     
      (assign, ":upper_limit", 12),
     
      (store_add, ":amount_random_divider", 2, ":volunteer_troop_tier"),
      (val_div, ":upper_limit", ":amount_random_divider"),
     
      (store_random_in_range, ":amount", 0, ":upper_limit"),
      (party_set_slot, ":center_no", slot_center_npc_volunteer_troop_type, ":volunteer_troop"),
      (party_set_slot, ":center_no", slot_center_npc_volunteer_troop_amount, ":amount"),
    ]),

Or, if you want to create a recruitment option where you can ADDITIONALLY recruit orcs, then you can follow the steps below. This should definitely work, as I used something similar in order to recruit mercenaries from castles.

1) you need a new constant in module_constants
------------------------------------------------
in module constants somewhere around the other slot_center stuff like here, for instance:

slot_center_npc_volunteer_troop_type  = 90
slot_center_npc_volunteer_troop_amount = 91
slot_center_mercenary_troop_type  = 90
slot_center_mercenary_troop_amount= 91
slot_center_volunteer_troop_type  = 92
slot_center_volunteer_troop_amount= 93

slot_center_village_orcs_amount = 94 ## this is your new constant



2) a new menu in module_game_menus
-----------------------------------
("recruit_orcs_village",
  [
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village), ## villages only
(party_slot_ge, "$g_encountered_party", slot_center_village_orcs_amount, 1),
      ],"Recruit Orcs.",     
    [
(try_begin),
  (call_script, "script_cf_enter_center_location_bandit_check"),
(else_try),
  (jump_to_menu, "mnu_recruit_orcs_village"),
(try_end),
]),

###
insert it right after or above the below, in game_menus

      ("village_manage",
      [
        (neg|party_slot_eq, "$current_town", slot_village_state, svs_looted),
        (neg|party_slot_eq, "$current_town", slot_village_state, svs_being_raided),
        (neg|party_slot_ge, "$current_town", slot_village_infested_by_bandits, 1),
        (party_slot_eq, "$current_town", slot_town_lord, "trp_player")
        ]
      ,"Manage this village.",
      [
          (assign, "$g_next_menu", "mnu_village"),
          (jump_to_menu, "mnu_center_manage"),
        ]),
      ("recruit_volunteers",
      [
        (call_script, "script_cf_village_recruit_volunteers_cond"),
      ]
      ,"Recruit Volunteers.",
      [
        (try_begin),
          (call_script, "script_cf_enter_center_location_bandit_check"),
        (else_try),
          (jump_to_menu, "mnu_recruit_volunteers"),
        (try_end),
        ]),

####


3) at the very end of game_menus you insert the below menu (this is referenced by the one above)
---------------------------------------------------------------------------------------------------
  (
    "recruit_orcs_village",0,
    "{s18}",
    "none",
    [
(party_get_slot, ":eek:rc_troop_amount", "$g_encountered_party", slot_center_village_orcs_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":eek:rc_troop_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 20), ## cost is 20 dinar per hired orc unit, adjust it if you wish
(assign, ":party_capacity", ":free_capacity"),
(val_min, ":party_capacity", ":gold_capacity"),
(try_begin),
  (gt, ":party_capacity", 0),
  (val_min, ":eek:rc_troop_amount", ":party_capacity"),
(try_end),
(assign, reg5, ":eek:rc_troop_amount"),
(assign, reg7, 0),
(try_begin),
(gt, ":eek:rc_troop_amount", ":gold_capacity"),
(assign, reg7, 1),
(try_end),
(store_mul, reg6, ":eek:rc_troop_amount", 20), ## cost is 20 dinar per hired orc unit, adjust it if you wish
(str_store_troop_name_by_count, s3, "trp_orc_unit", ":eek:rc_troop_amount"),
(str_store_string, s18, "@{reg5} {s3} volunteer to follow you."),
(set_background_mesh, "mesh_pic_recruits"),
],
[
  ("continue_not_enough_gold",
  [
(eq, reg7, 1),
  ],
"I don't have enough money...",
  [
(jump_to_menu, "mnu_town"),
  ]),
 
  ("recruit_them",
  [
(eq, reg7, 0),
(gt, reg5, 0),
  ],
"Recruit them ({reg6} denars).",
[
(call_script, "script_recruit_orcs_from_villages"),
(jump_to_menu, "mnu_town"),
      ]),
     
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
"Forget it.",
      [
(jump_to_menu, "mnu_town"),
      ]),
    ],
  ),

 
4) in module_scripts
---------------------

a) insert the following right after the script village_recruit_volunteers_recruit

  #script_recruit_orcs_from_villages
  # INPUT: none
  # OUTPUT: none
  ("recruit_orcs_from_villages",
[
(party_get_slot, ":eek:rc_troop_amount", "$g_encountered_party", slot_center_village_orcs_amount),
(party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
(val_min, ":eek:rc_troop_amount", ":free_capacity"),
(store_troop_gold, ":gold", "trp_player"),
(store_div, ":gold_capacity", ":gold", 20), ## cost is 20 dinar per hired orc unit, adjust it if you wish
(val_min, ":eek:rc_troop_amount", ":gold_capacity"),
        (party_add_members, "p_main_party", "trp_orc_unit", ":eek:rc_troop_amount"),
(party_set_slot, "$g_encountered_party", slot_center_village_orcs_amount, 0),
        (store_mul, ":total_cost", ":eek:rc_troop_amount", 20), ## cost is 20 dinar per hired orc unit, adjust it if you wish
        (troop_remove_gold, "trp_player", ":total_cost"),
    ]),


b) insert the following right after the script update_mercenary_units_of_towns

  #script_update_orc_units_villages
  # INPUT: none
  # OUTPUT: none
    ("update_orc_units_villages",
    [
(try_for_range, ":current_village", villages_begin, villages_end), ## you won't even need the try_for_range here, theoretically, but you never know, maybe you want to expand the script one day
(store_random_in_range, ":amount", 5, 16),
(party_set_slot, ":current_village", slot_center_village_orcs_amount, ":amount"),
(try_end),
    ]),


5) in order to have the units updated regularly, you add the following into simple_triggers
--------------------------------------------------------------------------------------------
just look for the below trigger

  # Adding mercenary troops to the towns
  (72,
  [
    (call_script, "script_update_mercenary_units_of_towns"),
    #NPC changes begin
    # removes  (call_script, "script_update_companion_candidates_in_taverns"),
    #NPC changes end
    (call_script, "script_update_ransom_brokers"),
    (call_script, "script_update_tavern_travellers"),
    (call_script, "script_update_tavern_minstrels"),
    (call_script, "script_update_booksellers"),
    (call_script, "script_update_villages_infested_by_bandits"),
    (try_for_range, ":village_no", villages_begin, villages_end),
      (call_script, "script_update_volunteer_troops_in_village", ":village_no"),
      (call_script, "script_update_npc_volunteer_troops_in_village", ":village_no"),
  (call_script, "script_update_orc_units_villages", ":village_no"), ## this is your new script which was added to the trigger, if it throws errors paste the call_script above the try_for_range, without the ":village_no" at the end
    (try_end),
    ]),



==> this works only for 1 specific orc unit, if you want several different orc units to be recruited from your villages or a random one out of a certain range (like mercenary units in taverns), you have to create a 2nd constant where you define the troop type, i.e. slot_center_orc_unit_type or something along the line.

 
Okay, so I've got some problems adding new skins. I thought this would be easy, as the undead resources are already in Native, and ghoul textures are in M&B 0.202. So, I added the undead and ghoul skins to module_skins, here:
Code:
undead_face_keys = []
ghoul_face_keys = []


  (
    "undead", 0,
    "undead_body", "undead_calf_l", "undead_handL",
    "undead_head1", man_face_keys,
 ["man_hair_s","man_hair_m","man_hair_n","man_hair_o", "man_hair_y10", "man_hair_y12","man_hair_p","man_hair_r","man_hair_q","man_hair_v","man_hair_t","man_hair_y6","man_hair_y3","man_hair_y7","man_hair_y9","man_hair_y11","man_hair_u","man_hair_y","man_hair_y2","man_hair_y4"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    ["beard_e","beard_d","beard_k","beard_l","beard_i","beard_j","beard_z","beard_m","beard_n","beard_y","beard_p","beard_o",   "beard_v", "beard_f", "beard_b", "beard_c","beard_t","beard_u","beard_r","beard_s","beard_a","beard_h","beard_g",], #beard meshes ,"beard_q"
    ["hair_blonde"], #hair textures
    ["beard_blonde"], #beard_materials
    [("undeadface",0xffffffff,["hair_blonde"],[0xffffffff, 0xffb04717, 0xff502a19, 0xff19100c]),
     ], #undead_face_textures
[(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_warcry,"snd_man_warcry"),(voice_victory,"snd_man_victory")], #voice sounds
    "skel_human", 1.0,
    psys_game_blood,psys_game_blood_2,
  ),
  
  
    (
    "ghoul", 0,
    "man_body", "man_calf_l", "m_handL",
    "ghoulface", man_face_keys,
    ["man_hair_s","man_hair_m","man_hair_n","man_hair_o", "man_hair_y10", "man_hair_y12","man_hair_p","man_hair_r","man_hair_q","man_hair_v","man_hair_t","man_hair_y6","man_hair_y3","man_hair_y7","man_hair_y9","man_hair_y11","man_hair_u","man_hair_y","man_hair_y2","man_hair_y4"], #man_hair_meshes ,"man_hair_y5","man_hair_y8",
    ["beard_e","beard_d","beard_k","beard_l","beard_i","beard_j","beard_z","beard_m","beard_n","beard_y","beard_p","beard_o",   "beard_v", "beard_f", "beard_b", "beard_c","beard_t","beard_u","beard_r","beard_s","beard_a","beard_h","beard_g",], #beard meshes ,"beard_q"
    ["hair_blonde", "hair_red", "hair_brunette", "hair_black", "hair_white"], #hair textures
    ["beard_blonde","beard_red","beard_brunette","beard_black","beard_white"], #beard_materials
    [("ghoulface",0xffcbe0e0,["ghoulface"],[0xffffffff]),
     ], #man_face_textures,
    [(voice_die,"snd_man_die"),(voice_hit,"snd_man_hit"),(voice_grunt,"snd_man_grunt"),(voice_grunt_long,"snd_man_grunt_long"),(voice_yell,"snd_man_yell"),(voice_stun,"snd_man_stun"),(voice_victory,"snd_man_victory")], #voice sounds
    "skel_human", 1.0,
    psys_game_blood,psys_game_blood_2,
    [[1.7, comp_greater_than, (1.0,face_width), (1.0,temple_width)], #constraints: ex: 1.7 > (face_width + temple_width)
     [0.3, comp_less_than, (1.0,face_width), (1.0,temple_width)],
     [1.7, comp_greater_than, (1.0,face_width), (1.0,face_depth)],
     [0.3, comp_less_than, (1.0,eyebrow_height), (1.0,eyebrow_position)],
     [1.7, comp_greater_than, (1.0,eyebrow_height), (1.0,eyebrow_position)],
     [-0.7, comp_less_than, (1.0,nose_size), (-1.0,nose_shape)],
     [0.7, comp_greater_than, (1.0,nose_size), (-1.0,nose_shape)],
     [2.7, comp_greater_than, (1.0,chin_size), (1.0,mouth_nose_distance), (1.0,nose_height), (-1.0,face_width)],
     ]
  ),

And made sure they were in header_troops as flags. I made some troops for them, and now, I get a crash any time I encounter something with the undead skin, and the ghoul skin doesn't work at all. (just shows up as a normal male)

I know there is something I am missing here, but I'm completely lost as to what it is.

I have first tried it all myself (I didn't think it would be too hard) then I tried it with Keedo's (I think it was Keedo, I'm not completely sure now to be honest) undead pack, but it told me to do exactly what I did, with nothing different. I know Keedo's tutorial was for the original M&B, so I'm wondering if there's something new with Warband that I'm missing, or if anyone knows what is going on here.

Search Function, both in the module system and on the forums, was no help, just leading back to what I have already done.



Edit: Got ghouls working, undead still crash though.
Edit2: Undead don't cause crashes anymore, but the textures don't work properly:
Ch-Wn.png


As you can see, the left hand, as well as the face textures, are bugged. Does anyone have an idea?
 
Status
Not open for further replies.
Back
Top Bottom