Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Somebody said:
Code:
          (try_begin),
            (faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
            (faction_slot_eq, ":center_faction", slot_faction_ai_object, ":center_no"),
            (store_random_in_range, ":troop", tavern_minstrels_begin, tavern_minstrels_end),
            (set_visitor, 32, ":troop"),
          (try_end),

It has worked. Thank you very much! Koktengri(ancient turkish god) bless you :grin:
 
@somebody Do you know why this doesn't work?
Hi,
I added this script look like:
("player_arrived",
  [
      (assign, ":player_faction_culture", "fac_culture_1"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("vaegir",
  [
      (assign, ":player_faction_culture", "fac_culture_2"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("kergit",
  [
      (assign, ":player_faction_culture", "fac_culture_3"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("nord",
  [
      (assign, ":player_faction_culture", "fac_culture_4"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("rodok",
  [
      (assign, ":player_faction_culture", "fac_culture_5"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
("sarranid",
  [
      (assign, ":player_faction_culture", "fac_culture_6"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_culture, ":player_faction_culture"),
      (faction_set_slot, "fac_player_faction",  slot_faction_culture, ":player_faction_culture"),
]),
and uncomment this
("continue",[], "Continue...",
      [       
        (assign, "$g_starting_town", "$current_town"),
        (call_script, "script_player_arrived"),
        (party_set_morale, "p_main_party", 100),
        (set_encountered_party, "$current_town"),
        (call_script, "script_prepare_alley_to_fight"),
then add this menus:
("kultur1",0,
  "Select a cheat:",
  "none",
  [
    ],
    [
      ("svadya",[], "Choose Swadia culture...",
      [(call_script,"script_player_arrived"),
       
  ]
      ),
  ("vaegir",[], "Choose Vaegir culture...",
      [(call_script,"script_vaegir"),
       
  ]
      ),
  ("kergit",[], "Choose Khergit culture...",
      [(call_script,"script_kergit"),
       
  ]
      ),
  ("nord",[], "Choose Nord culture...",
      [(call_script,"script_nord"),
       
  ]
      ),
  ("rodok",[], "Choose Rhodok culture...",
      [(call_script,"script_rodok"),
       
  ]
      ),
  ("sarranid",[], "Choose Sarranid culture...",
      [(call_script,"script_sarranid"),
       
  ]
      ),
  ("geri",[], "Go back...",
      [
        (jump_to_menu, "mnu_camp_action"),
  ]
      ),
  ]
  ),
then When I choose a culture dosn't work, anyone know why?
 
dragos said:
Bearomir said:
Could you guys tell me what this means?
Code:
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),

It arranges what the troops spawned in that entry points do. For instance, the troop spawned in entry point 1 is defender and it is alarmed which means it will start atacking when you jump the scene.
what about the array at the end?
 
Bearomir said:
dragos said:
Bearomir said:
Could you guys tell me what this means?
Code:
     (1,mtef_defenders|mtef_team_0,0,aif_start_alarmed,12,[]),
     (0,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,12,[]),
     (4,mtef_attackers|mtef_team_1,0,aif_start_alarmed,0,[]),

It arranges what the troops spawned in that entry points do. For instance, the troop spawned in entry point 1 is defender and it is alarmed which means it will start atacking when you jump the scene.
what about the array at the end?

first thing you do on any file is read the comments in it:

#    5.6) list of equipment to add to troops spawned from here (maximum :cool:.

Code:
####################################################################################################################
#   Each mission-template is a tuple that contains the following fields:
#  1) Mission-template id (string): used for referencing mission-templates in other files.
#     The prefix mt_ is automatically added before each mission-template id
#
#  2) Mission-template flags (int): See header_mission-templates.py for a list of available flags
#  3) Mission-type(int): Which mission types this mission template matches.
#     For mission-types to be used with the default party-meeting system,
#     this should be 'charge' or 'charge_with_ally' otherwise must be -1.
#     
#  4) Mission description text (string).
#  5) List of spawn records (list): Each spawn record is a tuple that contains the following fields:
#    5.1) entry-no: Troops spawned from this spawn record will use this entry
#    5.2) spawn flags.
#    5.3) alter flags. which equipment will be overriden
#    5.4) ai flags.
#    5.5) Number of troops to spawn.
#    5.6) list of equipment to add to troops spawned from here (maximum 8).
#  6) List of triggers (list).
#     See module_triggers.py for infomation about triggers.
#
#  Please note that mission templates is work in progress and can be changed in the future versions.
# 
####################################################################################################################
 
(For native MP):
Ive created 3 new player slots and am now trying to add a value (1) to them when the player gets a kill.
It has worked when I tried it global vars at first, but with the slots it doesnt work anymore:
Code:
        (try_begin),
            (this_or_next|eq, ":troop_no", "trp_vaegir_archer_multiplayer"),                  #
            (this_or_next|eq, ":troop_no", "trp_nord_archer_multiplayer"),                   #
            (this_or_next|eq, ":troop_no", "trp_swadian_crossbowman_multiplayer"),          # Checks player class
            (this_or_next|eq, ":troop_no", "trp_rhodok_veteran_crossbowman_multiplayer"),    #
            (this_or_next|eq, ":troop_no", "trp_khergit_veteran_horse_archer_multiplayer"),    #
            (eq, ":troop_no", "trp_sarranid_archer_multiplayer"),                              #
            (val_add, slot_player_rngexp, 1),                      
            (str_store_string,s1,"@Added 1 to rng"),                                                                  #Stores the string and later displays it(this part works)
I have tried using player_get_slot to assign it to a variable, add 1 there and use player_set_slot to set the slot=variable after that, but it didnt work either... What am I doing wrong here?
 
frozenpainter said:
@somebody Do you know why this doesn't work?
What do you define as "working"? How are you check what culture the player faction is using?
Namakan said:
(For native MP):
Ive created 3 new player slots and am now trying to add a value (1) to them when the player gets a kill.
It has worked when I tried it global vars at first, but with the slots it doesnt work anymore:
The contents of slots are properties of an array. You are literally adding slot_player_rngexp by 1 (which won't work when you have the constant as the lefthand value).
In that script there will be a place where you can find the player id. This is the value you use with player_get/set_slot operations, not the troop id, not the agent id. Read header_operations to see how slot operations work, it's fairly simple once you realize the slots you define in module_constants are indices to an array.
 
Somebody said:
frozenpainter said:
@somebody Do you know why this doesn't work?
What do you define as "working"? How are you check what culture the player faction is using?

I assume looking for the troops recruited from the faction's villages or town walkers.
 
Hello all i'm new to moddelling and moding and i have a problem that i can't see what is wrong that is i've been trying to put the spear bracing to work and i don't what more to do.
my problem is
Code:
Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Traceback (most recent call last):
  File "process_animations.py", line 61, in <module>
    write_actions(animations,len(action_codes),action_codes,"actions.txt")
  File "process_animations.py", line 39, in write_actions
    file.write("%f %f %f  "%elem[6])
TypeError: not enough arguments for format string
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

i have this to animations and i'm including the shield bash animation and the unused below just because i'm new to this and i don't know really what could it be
Code:
  ["shield_bash", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
    [0.50, "defend_shield_parry_all", 1, 50, blend_in_defense], #Adjust duration for balance.  Currently at 0.50 seconds, fixed.
    [0.50, "defend_shield_right", 1, 50, blend_in_defense],
    [0.50, "defend_shield_left", 1, 50, blend_in_defense],
    [0.50, "defend_shield_right", 1, 50, blend_in_defense],
	], 
["shield_strike", acf_enforce_all|acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
    [1.0, "anim_human", blow+5000, blow+5010, arf_blend_in_3|arf_make_custom_sound],
    [1.7, "anim_human", blow+5400, blow+5453, arf_blend_in_2|arf_make_custom_sound],
    [1.44, "anim_human", blow+5400, blow+5445, arf_blend_in_2|arf_make_custom_sound],   
],
["spearwall_hold", acf_thrust|acf_enforce_all|acf_align_with_ground, 0,
   [4.0, "anim_human", combat+7310, combat+7310, 0, 69, blend_in_ready],
 ],

 ["unused_human_anim_47", 0, 0, [1.0, "anim_human", 0, 1, 0]],
thx all for your time :smile:.
P.S. Srry for my english.
 
How do I concatenate a variable to a string?
Code:
(assign, ":enemy_count", 0),
(display_message,"@Enemies on the field: {:enemy_count}"),
The code above displays "Enemies on the field: unrecognized token" or something like that. I tried without the colon and it doesn't work either.
 
Bearomir said:
How do I concatenate a variable to a string?
Code:
(assign, ":enemy_count", 0),
(display_message,"@Enemies on the field: {:enemy_count}"),
The code above displays "Enemies on the field: unrecognized token" or something like that. I tried without the colon and it doesn't work either.

Code:
(assign, ":enemy_count", 0),
(assign, reg0, ":enemy_count"),
(display_message,"@Enemies on the field: {reg0}"),
 
Ok so I'm finally gonna start modelling stuff (well actually its just gonna be the world map for now :razz:) but I'm torn as to which modelling software I should start with. Its a choice between Blender and Wings3D.

I have little to no modelling experience so Wings3D looks a lot simpler to use although I'm not sure if it will have all the features I will be needing (modelling, texturing, rigging and I'll eventually be doing a few custom animations)

So, which one should I be starting with?
 
I'm tryig to add "itm_dedal_kufel" to the entries between 16, 32 in "visit_town_castle" mission. here the codes I added to enter_court script:
      (try_for_range, ":cur_pos", 16, 32), #was (assing, ":cur_pos", 16),
      (mission_tpl_entry_clear_override_items,"mt_visit_town_castle",":cur_pos"),
      (mission_tpl_entry_add_override_item,"mt_visit_town_castle",":cur_pos","itm_dedal_kufel"),


  (try_begin),
(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
    (gt, ":player_spouse", 0),
(troop_slot_eq, ":player_spouse", slot_troop_cur_center, ":center_no"),
        (set_visitor, ":cur_pos", ":player_spouse"),
        (val_add,":cur_pos", 1),
  (else_try),
(troop_get_slot, ":player_betrothed", "trp_player", slot_troop_betrothed),
    (gt, ":player_betrothed", 0),
(troop_slot_eq, ":player_betrothed", slot_troop_cur_center, ":center_no"),
        (set_visitor, ":cur_pos", ":player_betrothed"),
        (val_add,":cur_pos", 1),
  (try_end),

  (try_begin),
(eq, "$g_player_court", ":center_no"),
(gt, "$g_player_minister", 0),
(neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_player_minister"),
        (set_visitor, ":cur_pos", "$g_player_minister"),
        (val_add,":cur_pos", 1),
  (try_end),
    ##diplomacy begin
    (try_begin),
      (gt, "$g_player_chamberlain", 0),
      (call_script, "script_dplmc_appoint_chamberlain"),  #fix for wrong troops after update
      (party_get_slot, ":town_lord", ":center_no", slot_town_lord),
      (eq, ":town_lord", "trp_player"),
      (set_visitor, ":cur_pos", "$g_player_chamberlain"),
      (val_add,":cur_pos", 1),
    (try_end),

    (try_begin),
      (gt, "$g_player_constable", 0),
      (call_script, "script_dplmc_appoint_constable"),  #fix for wrong troops after update
      (party_get_slot, ":town_lord", ":center_no", slot_town_lord),
      (eq, ":town_lord", "trp_player"),
      (set_visitor, ":cur_pos", "$g_player_constable"),
      (val_add,":cur_pos", 1),
    (try_end),

I added the red ones and changed the blue one. But the kufel spawns only on the the troop who spawn entry 16's hand, it does not spawn for the other entries. How can I make it spawn for all the entries between 16 and 32?
 
The_dragon said:
@litdum try_for_range needs to have a corresponding try_end, so you need to add (try_end), at the bottom.

Do you mean as "at the bottom" here :
        (try_for_range, ":cur_pos", 16, 32),
      (mission_tpl_entry_clear_override_items,"mt_visit_town_castle",":cur_pos", val_add,":cur_pos", 1),
      (mission_tpl_entry_add_override_item,"mt_visit_town_castle",":cur_pos","itm_dedal_kufel", val_add,":cur_pos", 1),
    (try_end),

  (try_begin),
(troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
    (gt, ":player_spouse", 0),
(troop_slot_eq, ":player_spouse", slot_troop_cur_center, ":center_no"),
        (set_visitor, ":cur_pos", ":player_spouse"),
        (val_add,":cur_pos", 1),
  (else_try),
(troop_get_slot, ":player_betrothed", "trp_player", slot_troop_betrothed),
    (gt, ":player_betrothed", 0),
(troop_slot_eq, ":player_betrothed", slot_troop_cur_center, ":center_no"),
        (set_visitor, ":cur_pos", ":player_betrothed"),
        (val_add,":cur_pos", 1),
or here(nearly at the end of "enter_court" script):
  (try_begin),
#If the player is unmarried, reserve zero to 8 slots for women
(lt, ":player_spouse", 1),
(store_random_in_range, ":reserved", 0, 9),
  (else_try),
#If the player is married, reserve zero to four slots for women
(store_random_in_range, ":reserved", 0, 5),
  (try_end),
  (store_sub, ":non_lady_max", 32, ":reserved"),
      #diplomacy end+
      (party_get_num_companion_stacks, ":num_stacks","p_temp_party"),
      (try_for_range, ":i_stack", 0, ":num_stacks"),
        (party_stack_get_troop_id, ":stack_troop","p_temp_party",":i_stack"),
##diplomacy start+
        #(lt, ":cur_pos", 32), # spawn up to entry point 32 - is it possible to add another 10 spots?
(lt, ":cur_pos", ":non_lady_max"),#Leave some room for ladies in huge feasts
##diplomacy end+
        (set_visitor, ":cur_pos", ":stack_troop"),
        (val_add,":cur_pos", 1),
      (try_end),
                  (try_end),   
      (try_for_range, ":cur_troop", kingdom_ladies_begin, kingdom_ladies_end),
    (neq, ":cur_troop", "trp_knight_1_1_wife"), #The one who should not appear in game
        #(troop_slot_eq, ":cur_troop", slot_troop_occupation, slto_kingdom_lady),
  ?
Anyway. Both do not work for me  :sad: . After i added this try_end, only 1 troop spawns and he\she spawns on only entry 31. The other troops are not seen in court. I think this problem can be about (val_add,":cur_pos", 1), lines. Do you know what it means? and Do you think the problem can be about this?
 
@litdum I think this might do the trick?

(try_for_range, ":cur_pos", 16, 32), #was (assing, ":cur_pos", 16),
      (mission_tpl_entry_clear_override_items,"mt_visit_town_castle",":cur_pos"),
      (mission_tpl_entry_add_override_item,"mt_visit_town_castle",":cur_pos","itm_dedal_kufel"),
(try_end),
 
    (assing, ":cur_pos", 16),

 
    (try_begin),
      (troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
      (gt, ":player_spouse", 0),
      (troop_slot_eq, ":player_spouse", slot_troop_cur_center, ":center_no"),
        (set_visitor, ":cur_pos", ":player_spouse"),
    .... rest of the code ....
 
The_dragon said:
@litdum I think this might do the trick?

(try_for_range, ":cur_pos", 16, 32), #was (assing, ":cur_pos", 16),
      (mission_tpl_entry_clear_override_items,"mt_visit_town_castle",":cur_pos"),
      (mission_tpl_entry_add_override_item,"mt_visit_town_castle",":cur_pos","itm_dedal_kufel"),
(try_end),
 
    (assign, ":cur_pos", 16),

 
    (try_begin),
      (troop_get_slot, ":player_spouse", "trp_player", slot_troop_spouse),
      (gt, ":player_spouse", 0),
      (troop_slot_eq, ":player_spouse", slot_troop_cur_center, ":center_no"),
        (set_visitor, ":cur_pos", ":player_spouse"),
    .... rest of the code ....

Thank you so much! It has worked.
 
Status
Not open for further replies.
Back
Top Bottom