Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
No, the first try_for_agent loop counts the amount of cav/infantry bots. (val_add,":cavalry",1), only fires if there's a cav agent (which is only true if the troop has tf_guarantee_horse or the player assigned it from the party menu). Try changing (assign,":cavalry",1), to start the count at an integer, and also change (assign,":infantry",1), and (lt,":cavalry",11), if you want to keep the code working the same way.
 
Lumos 说:
script_randomly_start_war_peace.

What about defining a positive relationsships in the module_factions, right from the start, is that possible? Using Diplomacy.
 
Ive followed this turorial to enable recruiting from towns
http://forums.taleworlds.com/index.php/topic,202029.0.html
and ive done the 2nd part of it, the one that explains how to make seperate troop trees

tutorial is pretty messy, outdated and kinda confusing, it had some errors but i somehow handled them and now i can recruit nobles from towns and regulars from villages(also i can recruit regulars from towns)

When i recruit regulars(from villages or towns), i recruit the normal recruits that follow the normal troop tree defined before in module_troops
but
when i recruit nobles, it says this:
mb29_by_gazda1-d5gyin3.jpg

Now, where in that code does it say which troops will the "recruit nobles" function actually recruit? I cant seem to find it, and curently it recruits "Player" troop if i understand it corectly

I appreciate your effort
 
It's recruiting the Player (troop 0) since slot_faction_tier_5_troop is not initialized (from the post you referenced) or you messed up the menu.
 
there are 2 factions that dont have slot_faction_tier_5_troop .I commented it out because these factions have less then 5 troops, i dont know if i can assign 1 troop to 2 tiers at the same time( seems silly). and thats what was causing problems,

thanks for help guys,  :smile:

quick question

can i set more then 5 troop tiers?
 
Sure. I've got eight. Just add them in module_constants with the others.

Go ahead and define as many slots as you please. I'm pretty sure that's not catastrophic advice.
 
In game_menus, I added these

插入代码块:
("recruit_nobles",[(is_between, "$current_town",
        towns_begin, towns_end),     (call_script,   #was castles_begin     	
       "script_cf_town_castle_recruit_volunteers_cond"),]
       ,"Recruit Nobles.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (jump_to_menu, "mnu_recruit_nobles"),
         (try_end),
        ]),

插入代码块:
("recruit_normals",[(is_between, "$current_town",
        towns_begin, towns_end),      (call_script,
       "script_cf_town_recruit_volunteers_cond"),]
       ,"Recruit Volunteers.",
       [
         (try_begin),
           (call_script, "script_cf_enter_center_location_bandit_check"),
         (else_try),
           (jump_to_menu, "mnu_recruit_normales"),
         (try_end),
        ]),

and down bellow on the bottom of the file these

插入代码块:
   (
    "recruit_nobles",0,
    "{s18}",
    "none",
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop), 
     (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", 40),#40 denars per man
     (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), #not enough money
     (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", 40),#40 denars per man
       (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_town"),
      ]),
       
      ("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_town"),
      ]),
       
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_town_castle_recruit_nobles_recruit"),
                        
  (jump_to_menu, "mnu_town"),
      ]),
      
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Forget it.",
      [
  (jump_to_menu, "mnu_town"),
      ]),
    ],
  ),

插入代码块:
(
   "recruit_normales",0,
    "{s18}",
    "none",
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop),  #Notice the changed tier
     (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", 40),#40 denars per man
     (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), #not enough money
     (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", 40),#40 denars per man
       (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_town"),
      ]),
       
      ("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_town"),
      ]),
       
      ("recruit_them",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_town_recruit_nobles_recruit"),
                        
  (jump_to_menu, "mnu_town"),
      ]),
      
      ("forget_it",
      [
        (eq, reg7, 0),
        (gt, reg5, 0),
      ],
      "Forget it.",
      [
  (jump_to_menu, "mnu_town"),
      ]),
    ],
   ),


then theres module_scripts, in there lay these:

插入代码块:
	 #script_cf_town_castle_recruit_volunteers_cond
  # INPUT: none
  # OUTPUT: none
  ("cf_town_castle_recruit_volunteers_cond",
    [(store_faction_of_party, ":town_faction", "$current_town"),
     (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
     (store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
     (ge, ":center_relation", 0),
     (this_or_next|ge, ":center_relation", 5),
     (this_or_next|eq, ":town_faction", "$players_kingdom"),
     (this_or_next|ge, ":town_faction_relation", 0),
     (this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
     (             eq, "$players_kingdom", 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (ge, ":free_capacity", 1),
     ]),
	 
	 #script_cf_town_recruit_volunteers_cond
  # INPUT: none
  # OUTPUT: none
  ("cf_town_recruit_volunteers_cond",  #renamed
    [(store_faction_of_party, ":town_faction", "$current_town"),
     (party_get_slot, ":center_relation", "$current_town", slot_center_player_relation),
     (store_relation, ":town_faction_relation", ":town_faction", "fac_player_faction"),
     (ge, ":center_relation", 0),
     (this_or_next|ge, ":center_relation", 5),
     (this_or_next|eq, ":town_faction", "$players_kingdom"),
     (this_or_next|ge, ":town_faction_relation", 0),
     (this_or_next|eq, ":town_faction", "$supported_pretender_old_faction"),
     (             eq, "$players_kingdom", 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_amount, 0),
     (party_slot_ge, "$current_town", slot_center_volunteer_troop_type, 1),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (ge, ":free_capacity", 1),
     ]),

插入代码块:
#script_town_castle_recruit_nobles_recruit
  # INPUT: none
  # OUTPUT: none
  ("town_castle_recruit_nobles_recruit", #was town_castle_recruit_nobles_recruit
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_5_troop),
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, ":volunteer_amount", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 200),#200 denars per man
     (val_min, ":volunteer_amount", ":gold_capacity"),
     (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
     (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
     (store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
     (troop_remove_gold, "trp_player", ":cost"),
     ]),
	 
	  #script_town_recruit_nobles_recruit
  # INPUT: none
  # OUTPUT: none
  ("town_recruit_nobles_recruit", #renamed
    [(store_faction_of_party, ":cur_faction", "$current_town"),
     (faction_get_slot, ":volunteer_troop", ":cur_faction", slot_faction_tier_1_troop),  #changed tier so it wouldnt recruit nobles.
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, ":volunteer_amount", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 200),#200 denars per man
     (val_min, ":volunteer_amount", ":gold_capacity"),
     (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
     (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
     (store_mul, ":cost", ":volunteer_amount", 200),#200 denars per man
     (troop_remove_gold, "trp_player", ":cost"),
     ]),

now, what would be needed if i wanted to not only recruit tier 5 troop, but to have choice between recruiting tier 5, tier 7, 8 etc troops?
 
Where can I find some new town/castle scenes for singleplayer? Seems most OSP scenes I can find are for multiplayer.
 
Cozur 说:
Where can I find some new town/castle scenes for singleplayer? Seems most OSP scenes I can find are for multiplayer.

You can modify them to work for SP by adding/moving entry points needed by SP's mission template.
 
This might seem like a stupid question. I downloaded the british isles pack, made by Adorno:

http://forums.taleworlds.com/index.php/topic,160029.msg3855876.html#msg3855876

and took the scene for castle 37, renamed it to scn_castle_89_exterior and replaced scn_castle_89_exterior in my module folder.

Entering the game, there was no change when entering the castle exterior.

I was wondering if I missed a step? Do I need to add something to module_scenes? Or something else?


Also, looking for an updated guide on how to add new quests, the one from Kolba is 4 years old, and from what I understand, somewhat outdated.


Furthermore, looking for a way to use winmerge to delete some parts of a .txt file. Is there a way to select all the highlighted differences, and then delete them?
 
Hi! i need help please.

i try to speak english  :lol:

hum...In a quest for my mod with the assassin's faction i can give a glass with poison, i want include a code in dialogues for kill the enemi lord, like :

(troop_set_health, "trp_enemi_lord", 0),

but he dont work...i just need a code for kill the lord at the end of dialogue in curent scene please.

sory for my english.
 
i was wondering ware i can change the movement speed of walking on food i a battle so it will feel like running, can't seem to find it and have been looking for some days now.
 
FantasyWarrior 说:
but he dont work...i just need a code for kill the lord at the end of dialogue in curent scene please.
Put (agent_deliver_damage_to_agent, "$g_talk_agent", "$g_talk_agent"), in the consequence block of the last dialog. If you want it to show up as the player killing the lord, you might need to make the agent hostile first and replace the first parameter.
 
Yes! i got it  :razz:

Thank you so much Somebody !

I have just one demande for later  :mrgreen: ...mh ok, i try it now :

i want include in my mission template, a script for include death in warband système + battle continuation ,he work like this


插入代码块:
In first, in my all quests faileds/ko:

[code]      (1, 3, ti_once, [(main_hero_fallen,0)],
       [
        (mission_enable_talk),
        (call_script, "script_fail_quest", "qst_rebel_entrepotmetz"),
        (call_script, "script_end_quest", "qst_rebel_entrepotmetz"),
        (call_script, "script_change_player_relation_with_faction_ex", "fac_kingdom_3", -6),
        (jump_to_menu,"mnu_captivity_start_castle_defeat"),
      (finish_mission,0),
         ]),

now my script "wounded or death"

  ("rr6",
  [
  (store_random_in_range, "$rand5", 0, 5),
#
      (try_begin),
      (eq,"$rand5",0),
      (display_message, "@Blessures: Vous vous en sortez indèmne !", 0x33DD33),#vert
      (else_try),
      (eq,"$rand5",1),
      (display_message, "@Blessures: Vous vous en sortez indèmne !", 0x33DD33),#vert
      (else_try),
      (eq,"$rand5",2),
      (display_message, "@Blessures: Vous etes légerement blessé !", 0xDDDD33),#jaune
#enlever legere stats et donner variable $leger a 1 debloque le dialogue medecin qui une fois soigné se remet a 0
      (else_try),
      (eq,"$rand5",3),
      (display_message, "@Blessures: Vous etes blessé !", 0xEE7744),#orange
#enlever moyenes stats et donner variable $moyen a 1 debloque le dialogue medecin qui une fois soigné se remet a 0
      (else_try),
      (eq,"$rand5",4),
      (display_message, "@Blessures: Vous etes griévement blessé !", 0x8B0000),#rouge
#enlever grosses stats et donner variable $lourde  a 1 debloque le dialogue medecin qui une fois soigné se remet a 0
      (else_try),
      (eq,"$rand5",5),
      (assign, "$game_death", 1), 
        (jump_to_menu, "mnu_death_game_over"),# menu "mort!"
      (try_end),
  ]),


if it is the death :

插入代码块:
      
        ( "death_game_over",mnf_scale_picture,
          "Y'oure death ! !",
          "none",
         [                          
          (set_background_mesh, "mesh_pic_mort"),
          (music_set_situation, 0),      
          (play_sound, "snd_death"),
          (assign, "$game_death", 0),   #securité meme si a 0 en reprenant une sauvegarde, evite un potentiel "effet memoire" juste pour ultra securiser ses parties.     
         ],
         [
           ("end",[],"Terminer...",             
            [
         (change_screen_quit),             
            ]),
     ]
   ),


the script run like this in my mission template quest/ ko :

插入代码块:
      (1, 3, ti_once, [(main_hero_fallen,0)],
       [
        (mission_enable_talk),
        (call_script, "script_fail_quest", "qst_rebel_entrepmetz"),
        (call_script, "script_end_quest", "qst_rebel_entrepmetz"),
        (call_script, "script_change_player_relation_with_faction_ex", "fac_kingdom_3", -6),
###rr6 begin
         (call_script, "script_rr6"),
         (try_begin),
        (eq, "$game_death", 0),
        (jump_to_menu,"mnu_captivity_start_castle_defeat"),
         (try_end), 
  ### note: si          (eq, "$game_death", 1),  = on ne va pas au castle defeat (prison) ou le menu pour chaques main hero fallen, mais bien au menu "death" et screen return (ecran d'aceuil quois)
###rr6 end
       (finish_mission,0),
         ]),

[/code]

(5/6 chance to be wounded and 1/6 chance to death)

but how can i do include my "rr6" script start for alls defeats like castle sieges/battles in world map (for alls "main hero fallen"...? it's not simply a "main hero fallen" for every ko for alls combats)

If it is difficult for understand me no problème if i dont have help  :???:

thanks  :mrgreen:
 
Somebody knows if the positions (pos) are shared between the client and server at the same time, or you can init pos-only variables?^

Thanks.
 
Hi all ! I have some question.

Our team try to add second sword as a shield .
mb_warband2012-10-1008-51-57-31.jpg



It's look very good but when the arrows stuck on it ...


our code
插入代码块:
["dual", "dual", [("dual",0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield,  277 , weight(3.5)|hit_points(990)|body_armor(2)|spd_rtng(80)|shield_width(0),imodbits_shield ],
(sheld_width = 0 but it's not working)

thank you  :grin:
 
状态
不接受进一步回复。
后退
顶部 底部