Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
John514 said:
you mean the mesh name and they can't have the same id?

I will say one more time: syntax are rules you must follow. There is no room for error. Its either you follow the rules, or it won't work  :smile:

note how you did not include a comma after your mesh "none" to separate it from the list []
 
imado552 said:
what i'm trying to do is use invasion mod to create a new factions (one clan ((let us say clan A)) rising from a rebellion and taking half of another clan ((lets say clan B)) lands and starting a war with them)

VC has a system for this, it is on trigger commented by "restaurar". It starts a civil war/rebellion by restoring a destroyed faction.

May serve as a inspiration for what you need

Code:
    #########
    #restaurar faccion chief
    (30*24*5/(10*12), #MOTO randomize (see below). Idea faction revolt every month on average in end game
                    #takes about 10 attempts to revolt, about 15 average Charisma, which is 7+10 = 17. 22-17 chance of revolt out of 22-10 chances
      [
        (store_skill_level, ":skill", "skl_leadership", "trp_player"),
        (val_min, ":skill", 10),
        (store_attribute_level, ":charisma", "trp_player", ca_charisma),
        (val_div, ":charisma", 2),
        (val_min, ":charisma", 10),
        (store_add, ":testval", ":skill", ":charisma"),
        (store_random_in_range, ":rand", 10, 22), #player starting charisma 9
        
        (try_begin),
          (this_or_next|eq, "$cheat_mode", 1),
          (lt, ":testval", ":rand"),  #player loses control
          
          (store_random_in_range, ":original_faction", npc_kingdoms_begin, npc_kingdoms_end),
          (try_begin),
            (eq, "$cheat_mode", 1),
            # (try_for_range, ":faction_no", npc_kingdoms_begin, npc_kingdoms_end),
              # (neg|faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
              # (assign, ":original_faction", ":faction_no"),
            # (try_end),
            
            (store_current_day, reg1),
            (str_store_faction_name,s1,":original_faction"),
            (display_message, "@DEBUG rebellion: checking faction {s1} on day {reg1}"),
          (try_end),
          (neg|faction_slot_eq, ":original_faction", slot_faction_state, sfs_active),
          
          (store_sub, ":original_king", ":original_faction", npc_kingdoms_begin),
          (val_add, ":original_king", kings_begin),
          (assign, ":rand", 0), #test condition: no lords to lead revolt
          (assign, ":message_level", 1),  #level of revolt development
          (assign, ":end_lord", lords_end),
          (try_for_range, ":cur_troop", active_npcs_begin, ":end_lord"),  #NPCs, kings, lords
            (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
            (troop_slot_eq, ":cur_troop", slot_troop_original_faction, ":original_faction"),
            
            (store_troop_faction, ":faction_no", ":cur_troop"),
            (is_between,  ":faction_no", kingdoms_begin, kingdoms_end), #exclude defeated kings, who are in fac_commoners, and adventurers
            (neq, ":faction_no", ":original_faction"),
            
            (assign, ":num_walled_centers", 0),
            (try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
              (party_slot_eq, ":walled_center", slot_town_lord, ":cur_troop"),
              (val_add, ":num_walled_centers", 1),
            (try_end),
            (store_random_in_range, ":rand", 1, 4), #1-3
            (try_begin),
              (gt, ":num_walled_centers", 0), ## has a walled center, so he has support behind for rebellion.
              (store_random_in_range, reg0, -1, 4), #-1 to 3
              (val_add, reg0, ":num_walled_centers"), #0-4+
              (val_add, ":rand", reg0), #1-7+
            (try_end),
            
            (try_begin),
              (lt, ":rand", 7),
              (try_begin),
                (lt, ":message_level", ":rand"),
                (assign, ":message_level", ":rand"),
              (try_end),
              
            (else_try),
              (faction_get_slot, ":current_leader", ":faction_no", slot_faction_leader), #his current king
              (call_script, "script_troop_get_relation_with_troop", ":current_leader", ":cur_troop"),
              (assign, ":relation_with_currentking", reg0),
              
              (try_begin),
                (gt, ":relation_with_currentking", 10),
                (call_script, "script_troop_change_relation_with_troop", ":current_leader", ":cur_troop", -30),
                
              #restoration
              (else_try),
                #transfer leader if needed
                (try_begin),
                  (store_troop_faction, ":faction_no_2", ":original_king"),
                  (neq, ":faction_no_2", ":original_faction"),
                  (call_script, "script_change_troop_faction", ":original_king", ":original_faction"),
                  (faction_set_slot, ":original_faction", slot_faction_leader, ":original_king"),
                (try_end),
                
                (call_script, "script_change_troop_faction", ":cur_troop", ":original_faction"),
                
                #set up other lords for transfer
                (try_for_range, ":cur_troop_2", active_npcs_begin, lords_end),
                  (troop_slot_eq, ":cur_troop_2", slot_troop_occupation, slto_kingdom_hero),
                  (troop_slot_eq, ":cur_troop_2", slot_troop_original_faction, ":original_faction"),
                  (neq, ":cur_troop_2", ":cur_troop"),
                  (neq, ":cur_troop_2", ":original_king"),
                  
                  (store_troop_faction, ":faction_no_2", ":cur_troop_2"),
                  (neq, ":faction_no_2", ":original_faction"),
                  
                  (try_begin),
                    (neg|is_between,  ":faction_no", kingdoms_begin, kingdoms_end), #adventurers etc.
                    (troop_set_slot, ":cur_troop_2", slot_troop_change_to_faction, ":original_faction"),

                  (else_try),
                    #bribe
                    (store_random_in_range,":random_gold",1000,3000),
                    (troop_get_slot, ":wealth", ":cur_troop_2", slot_troop_wealth),
                    (val_add, ":wealth", ":random_gold"),
                    (troop_set_slot, ":cur_troop_2", slot_troop_wealth, ":wealth"),
                    
                    #construct normal distribution
                    (store_random_in_range, ":testval", -45, 45),
                    (store_random_in_range, reg0, -45, 45),
                    (val_add, ":testval", reg0),  #-90 to 90
                    (try_begin),
                      (lt, ":testval", 0),
                      (val_mul, ":testval", -1),  #0 to 90
                    (try_end),
                    (val_div, ":random_gold", 100), #10-29
                    (val_add, ":testval", ":random_gold"),  #relation to overcome with bribe is at least 10, because otherwise they would have started this revolt (see above)
                    
                    (faction_get_slot, ":current_leader_2", ":faction_no_2", slot_faction_leader), #his current king
                    (call_script, "script_troop_get_relation_with_troop", ":current_leader_2", ":cur_troop_2"),
                    (le, reg0, ":testval"),
                    
                    (troop_set_slot, ":cur_troop_2", slot_troop_change_to_faction, ":original_faction"),
                  (try_end),
                (try_end),  #transfer lords
                
                (call_script, "script_add_notification_menu", "mnu_notification_kingdom_reborn", ":cur_troop", ":faction_no"),
                (try_begin),
                  (eq, "$cheat_mode", 1),
                  (store_current_day, reg1),
                  (str_store_faction_name,s1,":original_faction"),
                  (display_message, "@DEBUG rebellion: faction {s1} reborn on day {reg1}"),
                (try_end),
                (assign, ":end_lord", ":cur_troop"),
              (try_end),  #restoration
            (try_end),  #plotting restoration
          (try_end),  #outer troop loop
          
          (try_begin),
            (is_between, ":rand", 1, 7),
            (str_store_troop_name, s14, ":original_king"),
            (try_begin),
              (eq, ":message_level", 1),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is still alive.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 2),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is stockpiling weapons and is seeking support among the Franks.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 3),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} meets in secret with his faithful.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 4),
              (display_message, "@(Possible Rebellion) Rumors say that people favor the restoration of {s14}.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 5),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is gathering an army to regain his throne.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 6),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is stockpiling weapons.", 0xFF0000),
          (try_end),
        (try_end),  #player loses control
    ]),
    ## restoration end chief
    ###random events siege
 
kalarhan said:
imado552 said:
what i'm trying to do is use invasion mod to create a new factions (one clan ((let us say clan A)) rising from a rebellion and taking half of another clan ((lets say clan B)) lands and starting a war with them)

VC has a system for this, it is on trigger commented by "restaurar". It starts a civil war/rebellion by restoring a destroyed faction.

May serve as a inspiration for what you need

Code:
    #########
    #restaurar faccion chief
    (30*24*5/(10*12), #MOTO randomize (see below). Idea faction revolt every month on average in end game
                    #takes about 10 attempts to revolt, about 15 average Charisma, which is 7+10 = 17. 22-17 chance of revolt out of 22-10 chances
      [
        (store_skill_level, ":skill", "skl_leadership", "trp_player"),
        (val_min, ":skill", 10),
        (store_attribute_level, ":charisma", "trp_player", ca_charisma),
        (val_div, ":charisma", 2),
        (val_min, ":charisma", 10),
        (store_add, ":testval", ":skill", ":charisma"),
        (store_random_in_range, ":rand", 10, 22), #player starting charisma 9
        
        (try_begin),
          (this_or_next|eq, "$cheat_mode", 1),
          (lt, ":testval", ":rand"),  #player loses control
          
          (store_random_in_range, ":original_faction", npc_kingdoms_begin, npc_kingdoms_end),
          (try_begin),
            (eq, "$cheat_mode", 1),
            # (try_for_range, ":faction_no", npc_kingdoms_begin, npc_kingdoms_end),
              # (neg|faction_slot_eq, ":faction_no", slot_faction_state, sfs_active),
              # (assign, ":original_faction", ":faction_no"),
            # (try_end),
            
            (store_current_day, reg1),
            (str_store_faction_name,s1,":original_faction"),
            (display_message, "@DEBUG rebellion: checking faction {s1} on day {reg1}"),
          (try_end),
          (neg|faction_slot_eq, ":original_faction", slot_faction_state, sfs_active),
          
          (store_sub, ":original_king", ":original_faction", npc_kingdoms_begin),
          (val_add, ":original_king", kings_begin),
          (assign, ":rand", 0), #test condition: no lords to lead revolt
          (assign, ":message_level", 1),  #level of revolt development
          (assign, ":end_lord", lords_end),
          (try_for_range, ":cur_troop", active_npcs_begin, ":end_lord"),  #NPCs, kings, lords
            (troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_hero),
            (troop_slot_eq, ":cur_troop", slot_troop_original_faction, ":original_faction"),
            
            (store_troop_faction, ":faction_no", ":cur_troop"),
            (is_between,  ":faction_no", kingdoms_begin, kingdoms_end), #exclude defeated kings, who are in fac_commoners, and adventurers
            (neq, ":faction_no", ":original_faction"),
            
            (assign, ":num_walled_centers", 0),
            (try_for_range, ":walled_center", walled_centers_begin, walled_centers_end),
              (party_slot_eq, ":walled_center", slot_town_lord, ":cur_troop"),
              (val_add, ":num_walled_centers", 1),
            (try_end),
            (store_random_in_range, ":rand", 1, 4), #1-3
            (try_begin),
              (gt, ":num_walled_centers", 0), ## has a walled center, so he has support behind for rebellion.
              (store_random_in_range, reg0, -1, 4), #-1 to 3
              (val_add, reg0, ":num_walled_centers"), #0-4+
              (val_add, ":rand", reg0), #1-7+
            (try_end),
            
            (try_begin),
              (lt, ":rand", 7),
              (try_begin),
                (lt, ":message_level", ":rand"),
                (assign, ":message_level", ":rand"),
              (try_end),
              
            (else_try),
              (faction_get_slot, ":current_leader", ":faction_no", slot_faction_leader), #his current king
              (call_script, "script_troop_get_relation_with_troop", ":current_leader", ":cur_troop"),
              (assign, ":relation_with_currentking", reg0),
              
              (try_begin),
                (gt, ":relation_with_currentking", 10),
                (call_script, "script_troop_change_relation_with_troop", ":current_leader", ":cur_troop", -30),
                
              #restoration
              (else_try),
                #transfer leader if needed
                (try_begin),
                  (store_troop_faction, ":faction_no_2", ":original_king"),
                  (neq, ":faction_no_2", ":original_faction"),
                  (call_script, "script_change_troop_faction", ":original_king", ":original_faction"),
                  (faction_set_slot, ":original_faction", slot_faction_leader, ":original_king"),
                (try_end),
                
                (call_script, "script_change_troop_faction", ":cur_troop", ":original_faction"),
                
                #set up other lords for transfer
                (try_for_range, ":cur_troop_2", active_npcs_begin, lords_end),
                  (troop_slot_eq, ":cur_troop_2", slot_troop_occupation, slto_kingdom_hero),
                  (troop_slot_eq, ":cur_troop_2", slot_troop_original_faction, ":original_faction"),
                  (neq, ":cur_troop_2", ":cur_troop"),
                  (neq, ":cur_troop_2", ":original_king"),
                  
                  (store_troop_faction, ":faction_no_2", ":cur_troop_2"),
                  (neq, ":faction_no_2", ":original_faction"),
                  
                  (try_begin),
                    (neg|is_between,  ":faction_no", kingdoms_begin, kingdoms_end), #adventurers etc.
                    (troop_set_slot, ":cur_troop_2", slot_troop_change_to_faction, ":original_faction"),

                  (else_try),
                    #bribe
                    (store_random_in_range,":random_gold",1000,3000),
                    (troop_get_slot, ":wealth", ":cur_troop_2", slot_troop_wealth),
                    (val_add, ":wealth", ":random_gold"),
                    (troop_set_slot, ":cur_troop_2", slot_troop_wealth, ":wealth"),
                    
                    #construct normal distribution
                    (store_random_in_range, ":testval", -45, 45),
                    (store_random_in_range, reg0, -45, 45),
                    (val_add, ":testval", reg0),  #-90 to 90
                    (try_begin),
                      (lt, ":testval", 0),
                      (val_mul, ":testval", -1),  #0 to 90
                    (try_end),
                    (val_div, ":random_gold", 100), #10-29
                    (val_add, ":testval", ":random_gold"),  #relation to overcome with bribe is at least 10, because otherwise they would have started this revolt (see above)
                    
                    (faction_get_slot, ":current_leader_2", ":faction_no_2", slot_faction_leader), #his current king
                    (call_script, "script_troop_get_relation_with_troop", ":current_leader_2", ":cur_troop_2"),
                    (le, reg0, ":testval"),
                    
                    (troop_set_slot, ":cur_troop_2", slot_troop_change_to_faction, ":original_faction"),
                  (try_end),
                (try_end),  #transfer lords
                
                (call_script, "script_add_notification_menu", "mnu_notification_kingdom_reborn", ":cur_troop", ":faction_no"),
                (try_begin),
                  (eq, "$cheat_mode", 1),
                  (store_current_day, reg1),
                  (str_store_faction_name,s1,":original_faction"),
                  (display_message, "@DEBUG rebellion: faction {s1} reborn on day {reg1}"),
                (try_end),
                (assign, ":end_lord", ":cur_troop"),
              (try_end),  #restoration
            (try_end),  #plotting restoration
          (try_end),  #outer troop loop
          
          (try_begin),
            (is_between, ":rand", 1, 7),
            (str_store_troop_name, s14, ":original_king"),
            (try_begin),
              (eq, ":message_level", 1),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is still alive.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 2),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is stockpiling weapons and is seeking support among the Franks.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 3),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} meets in secret with his faithful.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 4),
              (display_message, "@(Possible Rebellion) Rumors say that people favor the restoration of {s14}.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 5),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is gathering an army to regain his throne.", 0xFF0000),
            (else_try),
              (eq, ":message_level", 6),
              (display_message, "@(Possible Rebellion) Rumors say that {s14} is stockpiling weapons.", 0xFF0000),
          (try_end),
        (try_end),  #player loses control
    ]),
    ## restoration end chief
    ###random events siege
not exactly what i wanted but it should help thanks

and the faction that i want to restore (create or revive) wasn't even in the game at the start (since my mod is trying to be historic accurate )

  The Faction i'm trying to revive was eaten by Clan B before the time or the date of my mod but was revived by the death of Clan B Leader (yep those basterd toke the chance and simply retoke their lands and by the time they become the new eater)

well i'll try to see what i can do to make it work !!
but thanks again Kalarhan !
 
Hello again!

I am trying to modify my own mods multiplayer. I know that this can be a stupid idea to people who get used to native multi, but I would like to create faster-pace shooting slasher, not a simulation. On the other hand if you take into consideration that I have all kind of firearms from blunderbus to plasma lasers, from medieval swords to lightsabers... well there is a plan in this madness. I have in mind not COD, but rather something in style like Jedi Knight Academy Pace or little slower.

!EDIT!: It seems I am dumber than it was predicted. I changed MBwarband to steam version and in path I forgot "/" at the end of the pathline. All edits troop edits are now ok.

However I would still apreciate help with question 2 and 3 as they would give me opportunity to improve multi (question 2) and singlelayer (question 3) as well.

My problem is that I can't alter any multiplayer unit stats. I tried this:

Code:
#Multiplayer ai troops
 ["swadian_crossbowman_multiplayer_ai", "Swadian Crossbowman", "Swadian Crossbowmen", tf_guarantee_all, no_scene, reserved, fac_kingdom_1, [itm_bolts,itm_crossbow,itm_sword_medieval_a,itm_tab_shield_heater_b,itm_leather_jerkin,itm_leather_armor,itm_ankle_boots,itm_footman_helmet], def_attrib_multiplayer|agi_200, wp_melee(90), knows_common|knows_ironflesh_4|knows_athletics_6|knows_shield_5|knows_power_strike_3, swadian_face_young_1, swadian_face_old_2 ],

agi_200
(I created also
Code:
agi_200           = bignum | 0x0000C800
in header_troops)


I tried to do this:
["swadian_crossbowman_multiplayer","Swadian Crossbowman","Swadian Crossbowmen",tf_guarantee_all,0,0,fac_kingdom_1,[itm_bolts,itm_crossbow,itm_sword_medieval_b_small,itm_tab_shield_heater_a,itm_red_shirt,itm_ankle_boots],str_14|agi_15|
Code:
def_attrib_multiplayer
|level(19),wpe(90,60,180,90),knows_common_multiplayer|knows_ironflesh_2|knows_athletics_4|knows_shield_5|knows_power_strike_2|knows_riding_1,swadian_face_young_1,swadian_face_old_2],

Code:
def_attrib_multiplayer = agi_200 |int_30 | cha_30

Probably there is some kind of mechanism that spawns actors based on basic look of troops with default stats, but his I don't understand.

Question 1: How do I change stats of multiplayer troops?

I was wandering if could use somehow coding which was posted by this guys - "Quick-Commands for Modding" - https://forums.taleworlds.com/index.php/topic,94641.45.html.
There are some codes for synchronizing (for example) animations. I also found this code:
Code:
(else_try),
		    (eq, ":event_type", multiplayer_event_skill_server),
			(store_script_param, ":troop", 3),
			(store_script_param, ":skill", 4),
			(store_script_param, ":amount", 5),
			(troop_raise_skill, ":troop", ":skill", ":amount"),
			(get_max_players, ":max"),
			(try_for_range, ":i", 1, ":max"),
			    (player_is_active, ":i"),
				(multiplayer_send_3_int_to_player, ":i", multiplayer_event_skill_client, ":troop", ":skill", ":amount"),
			(try_end),

This code is for raising skill for all troops that are for example swadian_crossbowman or whatever else, but I don't know how to make it work? Somebody had a question 
With the troop skill command  did you just find a way in which to lower a player's skill temporarily or the whole troop as in swadian infantry?  Or is it like an add bonus' to weapon or items? Can you explain maybe a few examples of  how this type of command can be used in game?
and the answer was:
You will see a example soon, once I finish my Warcry script. The Warcry script utilizes all of the previous quick-commands.
Unfortunately answer wasn't given... Or I couldn't found it. I could easly alter this code to raise agility (I hope).
So the question 2 is: How do I call this code "multiplayer_event_skill_server" ? Like a script? I tried to find similar "multiplayer_event_" and try to learn from them how to use it, but I have to admit it was to hard for me. I couldn't find tutorials on altering multi troops - stats, just modifing items, which I have learned so far.

Third option to "give agility" I think could by by "enchanting" item. There is script for raising skill by items:
Code:
#script_game_get_skill_modifier_for_troop  #modificators bonus to skills #bonusitems
  # This script is called from the game engine when a skill's modifiers are needed
  # INPUT: arg1 = troop_no, arg2 = skill_no
  # OUTPUT: trigger_result = modifier_value
  ("game_get_skill_modifier_for_troop",
   [(store_script_param, ":troop_no", 1),
    (store_script_param, ":skill_no", 2),
    (assign, ":modifier_value", 0),
    (try_begin),
      (eq, ":skill_no", "skl_wound_treatment"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
	  
    (else_try),
      (eq, ":skill_no", "skl_trainer"),
      (call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
      (gt, reg0, 0),
      (val_add, ":modifier_value", 1),
	(else_try), (and so on, and so on................)

So question 3: Is it possible to alter this script to raise not only skill but also also attribute,[glow=red,2,300] something like this -
Code:
(troop_raise_attribute, "trp_player",ca_agility,20),
???

 
imado552 said:
and the faction that i want to restore (create or revive) wasn't even in the game at the start

a destroyed faction is basically a faction that is inactive (so won't have info on the game notes) and with no land/lords. If your dead faction had lords that moved to other clans make sure to setup their original faction flags, that way you can decide if they should join the civil war or not

but in essence they are the same thingy. Your dead faction had territory that was conquered (so some towns/castles will be marked as theirs originally, which will influence the AI for campaign targets). You can choose how the diplomatic relations will bet set on rebirth (with all the others). Which lords in the world should move back home. Which shouldn't. Which territory should flip at the start, and which territory should be the war goal.

a interesting point is if you want fixed diplomacy or not with the other clan, so no peace/truce will be made (total war, only one will survive)
 
kalarhan said:
imado552 said:
and the faction that i want to restore (create or revive) wasn't even in the game at the start

a destroyed faction is basically a faction that is inactive (so won't have info on the game notes) and with no land/lords. If your dead faction had lords that moved to other clans make sure to setup their original faction flags, that way you can decide if they should join the civil war or not

but in essence they are the same thingy. Your dead faction had territory that was conquered (so some towns/castles will be marked as theirs originally, which will influence the AI for campaign targets). You can choose how the diplomatic relations will bet set on rebirth (with all the others). Which lords in the world should move back home. Which shouldn't. Which territory should flip at the start, and which territory should be the war goal.
ah i see what you mean here i'll try to do that (that might work perfectly lol) thanks!
kalarhan said:
a interesting point is if you want fixed diplomacy or not with the other clan, so no peace/truce will be made (total war, only one will survive)
that is exactly my idea they will have a marriage alliance with one clan behind them (unlimited alliance not sure how i'm gonna do it but i saw other mods did it like ACOK mod so i think its possible) and total war with Clan B so only one clan will survive and after that the surviving clan will have the preset relations with other clans !!
thanks again Kalarhan !
 
I am trying to add some new armor and weapons to my mod. I separated the armor meshes I want and imported them into OpenBrf, but the textures could not be found. SO, I found the textures and put them in the texture folder of my mod, but the textures are still not found.

Also, each armor has like 3 different versions that look slightly different, to successfully add armor to my mod, do I need these alternate versions as well?

Can anybody help?

 
Fredrick said:
I am trying to add some new armor and weapons to my mod. I separated the armor meshes I want and imported them into OpenBrf, but the textures could not be found. SO, I found the textures and put them in the texture folder of my mod, but the textures are still not found.

Also, each armor has like 3 different versions that look slightly different, to successfully add armor to my mod, do I need these alternate versions as well?

Can anybody help?

Where exactly are the "textures not found"? Is it in game, or in openBRF?

Make sure the .brf file is in your resources folder, and also that it's loaded in your module.ini.

If they're not showing up in open BRF, you have to set the module to the one where the textures are. There should be an option in one of the menus on the top bar ("file", "edit", etc.).
 
Ok i rewrote the code i believe this time it's good
But when compiling it i receive this
Exporting game menus data...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 31, in save_game_menus
    save_game_menu_item(ofile,variable_list,variable_uses,menu_item,tag_uses,quick_strings)
  File "process_game_menus.py", line 12, in save_game_menu_item
    save_statement_block(ofile,0, 1, menu_item[1], variable_list, variable_uses,tag_uses,quick_strings)
  File "C:\Users\Sorcyre\Desktop\Juan\Warband Modding\Module_system 1.171\process_operations.py", line 44
9, in save_statement_block
    save_statement(ofile,opcode,no_variables,statement,variable_list,variable_uses,local_vars, local_var_
uses,tag_uses,quick_strings)
  File "C:\Users\Sorcyre\Desktop\Juan\Warband Modding\Module_system 1.171\process_operations.py", line 39
8, in save_statement
    ofile.write("%d %d "%(opcode, lenstatement))
TypeError: %d format: a number is required, not str
 
John514 said:
  File "process_game_menus.py", line 31, in save_game_menus
TypeError: %d format: a number is required, not str

you have a syntax error on a game menu. Compiler wanted a number, you gave it a string. Crash  :mrgreen:

You did not update your Github repo or posted it here, so can't say more.
 
kalarhan said:
John514 said:
  File "process_game_menus.py", line 31, in save_game_menus
TypeError: %d format: a number is required, not str

you have a syntax error on a game menu. Compiler wanted a number, you gave it a string. Crash  :mrgreen:

You did not update your Github repo or posted it here, so can't say more.

ok thanks kalarhan i already updated it,its here
https://github.com/JohnM514/Warband/blob/Testing/module_game_menus.py

I'm so excited after i read your post i did some minor changes to the code and  it works!!!!!
Thanks kalarhan :mrgreen:!!!!
 
John514 said:
  File "process_game_menus.py", line 31, in save_game_menus
TypeError: %d format: a number is required, not str

https://github.com/JohnM514/Warband/blob/Testing/module_game_menus.py

Code:
      ("take_deposit_1000",(ge,"$player_deposit",1000),
        "Withdraw 1000 denars from your deposit.",[
          (val_sub,"$player_deposit",1000),
          (troop_add_gold,"trp_player",1000),
      ]),
      ("take_deposit",(ge,"$player_deposit","$player_deposit"),
        "Withdraw your entire deposit from the bank.",[
          (troop_add_gold,"trp_player","$player_deposit"),
          (val_sub,"$player_deposit","reg6"),

syntax is: ("name", [ ], "text displayed", [ ]),
 
emir512 said:
I want to add combat animations enhancement  to freelancer 1.6 please guide me. If anyone knows.

start by: do the homework, gather all links, and read the instructions.

then when you have doubts: include the links (for the combat animations, for freelancer 1.6 source). Detail what you did and what did not work. Include any error messages you got. Screenshots and videos can help greatly to explain your issues.

you can also visit the tutorial section and look for guides on how to work with animations. That should help you learn how they work, and how you can replace Native ones with alternatives. Use the search box and you will find several links like this one https://forums.taleworlds.com/index.php/topic,72992.msg1895426.html#msg1895426
 
I have a question about the triggers in module_mission_templates.

Are all of the triggers defined before the mission_templates = [, the common_ and multiplayer_ stuff, are those technically constants? Could those, theoretically, be moved to a different file? Actually I don't know what purpose that would serve other than to shorten the mission_templates file, but is it possible?
 
mercury19 said:
but is it possible?

yes, just import the file before you start the mission_templates = [ .... ] list, and make sure the new file (or files) have the dependencies (imports) they need (like the header_XXX files).

they are used to reduce code duplication. Imagine a trigger that is used on 50 mission templates. If you need to copy+paste the same code 50x, it will just make the file bigger. It will also be a nightmare for maintenance (as you need to remember to apply any change on all 50 places).

the mission_templates.txt has all 50 duplicates (copies) in there, on each mission template.

a example is the file multi_missions.py from VC code
 
kalarhan said:
yes, just import the file before you start the mission_templates = [ .... ] list, and make sure the new file (or files) have the dependencies (imports) they need (like the header_XXX files).

they are used to reduce code duplication...

That's kind of what I figured, but most other constants only have one line, usually just an int, so I wanted to make sure. Thanks!
 
just one small stupid questions : is having space there(look in the picture below) will effect anything while compiling or should i make them the same as the ones before thanks !
V5PhFOQ.jpg
 
imado552 said:
just one small stupid questions

only stupid question is the one you never ask

imado552 said:
is having space there(look in the picture below) will effect anything while compiling

no. It is part of a list (array), so the format is just to make it easier for us to read it. It doesn't matter

a = [ [  ], [    ], ]

a = [
[  ],
[  ],
]
 
Status
Not open for further replies.
Back
Top Bottom