Modding Q&A [For Quick Questions and Answers]

正在查看此主题的用户

状态
不接受进一步回复。
kalarhan 说:
INH-1107 说:
Hello. :razz:
This may seem like an odd question, but how exactly would you go about adding a new slot_troop constant and using it similar to renown? I have some parts of it set up (I think...), but the game doesn't seem to be acknowledging its existence outside of just compiling. Code I have so far is below.
module_constants.py
插入代码块:
slot_troop_renown              = 7
slot_troop_notoriety           = 79
...
slot_troop_return_renown        = 84
slot_troop_return_notoriety     = 83

module_game_menus.py
插入代码块:
  ("reports",0,
   "Character Renown: {reg5}^Notoriety: {reg8}^Honor Rating: {reg6}^Party Morale: {reg8}^Party Size Limit: {reg7}^",
   "none",
   [(call_script, "script_game_get_party_companion_limit"),
    (assign, ":party_size_limit", reg0),
    (troop_get_slot, ":renown", "trp_player", slot_troop_renown),
    (troop_get_slot, ":notoriety", "trp_player", slot_troop_notoriety),
    (assign, reg5, ":renown"),
    (assign, reg6, "$player_honor"),
    (assign, reg7, ":party_size_limit"),
    (assign, reg8, ":notoriety"),
    (party_get_morale, reg8, "p_main_party"),
   ],
...
I assume I'm missing something in module_scripts, but I'm not entirely sure.

1) you need to use a empty slot. It seens #79 is fine, but we dont know what modsys you are using, so double check it.
2) why do you have 2 (two) {reg8} in there? The last one for morale is removing the effect of notoriety. That is, from what you show us, your bug.
3) you can simplify your code with

插入代码块:
(troop_get_slot, reg5, "trp_player", slot_troop_renown),
if you want to. No need to use the local variable as it doesnt add readability or has any effect. Not a big deal tho, and it will work regardless.
same with
插入代码块:
(assign, reg7, reg0),
Ah, I didn't see reg8 was being used... Explains a lot, and thanks for clearing it up! :grin:
 
Are slots, e.g. agent, prop slots something that can be created easily? Would you simply add a new one in the module_constants file or does it require more?
 
pete99 说:
Are slots, e.g. agent, prop slots something that can be created easily? Would you simply add a new one in the module_constants file or does it require more?

you dont create slots, they are already there. You just choose to use them when needed it.

see SLOTS section https://forums.taleworlds.com/index.php/topic,142422.0.html

double check if a slot is not in use for that specific subtype of your entity. A troop, as a example, can be a lord, a soldier, a vendor, a elder... and they dont have the same slots (a soldier, as a example, doesnt need the slots for relationship with other lords).
 
I'm thinking for more in a MP sense. I have seen a number of people suggesting you can add new slots though in module_constants, and in NW they added the god mode slot in a patch, so i just assumed they were something you could add in, or create new ones that could be used?
 
pete99 说:
people suggesting you can add new slots though in module_constants

You create a troop

It has a list of slots

You use a slot

You use another slot

For some slots you have a easy to remember reference on module_constants.py. Better to read "slot_troop_this_thingy" then "its number 56, now figure out what it does"

Not all slots are listed on module_constants.py in a explicit form, because some are used inside a range. From slot #50 to #300 you have values for this or that (example).

So you dont create a slot. You pick one that is not in use (value inside it is a zero). You decide to store something inside it. That value remains there until things reset. For SP you have them stored inside the savegame, so their value is not lost (it stays there between gaming sections). MP doesn have a savegame file. It can use a server and other mechanics to store the values when needed it.

Agent #444
  Slot #1: 0
  Slot #2: -30 (slot_agent_X)
  Slot #3: 0
  Slot #4: 56 (slot_agent_Y)

Remember the slots are generic integer values. They dont hold any meaning, unless you tell them to. Its like aparments in a building. A empty apartment is still there, but no one is living inside it, so its empty, waiting... waiting...
 
Khamukkamu 说:
What does has_forced_particles do in module.ini?

good question, as it is often the case with the stuff without documentation  :grin:

this 2015 post discuss module.ini and may help you

Baskakov_Dima 说:
MagnesiumDew 说:
has_forced_particles = 0
Needed for mods where particles are used to limit your vision -- for example, by smoke from muskets or by fog, like in NW.
 
Is this true for Warband? (for store_time_of_day operation)
p2kcbb5.png
 
maater66241 说:
Hello, while I was adding items into my mod, I came across 2 issues.
1. In OpenBrf, it shows this
isR7Y.png
However, in game, it shows this
uFS8Q.jpg
I checked the textures folder, and the required textures were there. I'm not sure of what I did wrong.

Sometimes this is caused by a mismatch of letter case. Openbrf sees "item" and "Item" as the same  thing, but the M&B engine does not. I know that's something that has caused me quite a bit of frustration. So make sure that your props are referencing the materials and textures by their EXACT name.
 
Needed for mods where particles are used to limit your vision -- for example, by smoke from muskets or by fog, like in NW.

Ohh interesting, we had some issues in warsword where our particles were being culled when their origin was outside the camera frustum. I wonder if those are related
 
Is there some way to set a players clothes/items/horse before he spawns via some sort of operation? I've seen a few people using something like this:

(player_add_spawn_item, <player_id>, <item_slot_no>, <item_id>),

Though I can't really get it to do anything. (Doing it server side in NW).
 
You need to override it after the regular default MP item selection is checked. Look up how equipped weapons are carried between rounds in Native.
 
UndeadDuke 说:
Is this true for Warband? (for store_time_of_day operation)
p2kcbb5.png

why?

in any case you can just test it out. Print out the time of the day and follow the game messages.

Keep in mind that code wise the night period is not well defined. There are places using the night operation, others from MB era using time range that can vary a bit. So check the game code if that matters to you for some sort of feature you are working on.
 
"Talk" button on the party window, I am trying to change conversation_scene that appear while player and the troop in player's party talking. But i couldnt find which codes work when the player clicked "Talk" button on party window. Does anyone know which code i should edit?
 
Does anyone know how to use "itp_covers_hair_partially" flag? It shows the whole hair and clipping through the helm just like "itp_doesnt_cover_hair" does.

Is that needs a secondary tonsured hair for every hair styles to work? If so, what is the naming rule?
 
DtheHun 说:
Does anyone know how to use "itp_covers_hair_partially" flag?

did you examine the item flags and how the meshes are created on VC? You can use that as a example/template.
 
插入代码块:
  ("cwe_caravan_map",0,"caravan_icon_map", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_arab_bandit",0,"icon_arab_bandit", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  
  ("cwe_patryl_Jerusalem",0,"icon_patryl_Jerusalem", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_patryl_antioh",0,"icon_patryl_antioh", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_patryl_hospitaller",0,"icon_patryl_hospitaller", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_patryl_ibelin",0,"icon_patryl_ibelin", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_patryl_tamplier",0,"icon_patryl_tamplier", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_patryl_tevton",0,"icon_patryl_tevton", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_patryl_tripoli",0,"icon_patryl_tripoli", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  
  ("cwe_saracin_knight",0,"icon_saracin_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_saracin_patryl",0,"icon_saracin_patryl", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  
  ("cwe_tyrk_bandit",0,"icon_tyrk_bandit", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  
  ("cwe_Jerusalem_knight",0,"ikon_Jerusalem_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_antioh_knight",0,"ikon_antioh_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_hospitaller_knight",0,"ikon_hospitaller_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_ibelin_knight",0,"ikon_ibelin_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_templar_knight",0,"ikon_templar_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_tevton_knight",0,"ikon_tevton_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),
  ("cwe_tripoli_knight",0,"ikon_tripoli_knight", avatar_scale, snd_gallop, 0.15, 0.173, 0),

插入代码块:
        (troop_get_slot, ":cur_troop_culture", ":troop_no", slot_troop_cur_culture),
        (try_begin),
          (eq, ":cur_troop_culture", "fac_culture_teutonic"),
            (party_set_icon, "$pout_party", "icon_cwe_tevton_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_templar"),
            (party_set_icon, "$pout_party", "icon_cwe_templar_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_hospitaller"),
            (party_set_icon, "$pout_party", "icon_cwe_hospitaller_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_antioch"),
            (party_set_icon, "$pout_party", "icon_cwe_antioh_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_tripoli"),
            (party_set_icon, "$pout_party", "icon_cwe_tripoli_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_ibelin"),
            (party_set_icon, "$pout_party", "icon_cwe_ibelin_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_jerusalem"),
            (party_set_icon, "$pout_party", "icon_cwe_Jerusalem_knight"),
        (else_try),
          (eq, ":cur_troop_culture", "fac_culture_mamluke"),
            (party_set_icon, "$pout_party", "icon_cwe_saracin_knight"),
        (try_end),
So i'm getting this issue. No icon visible even though i get no errors in the compiler and the icons are in the .brf and are being loaded by the module.ini. Why?

插入代码块:
# script_cf_get_random_enemy_center
# Input: arg1 = faction_no
# Output: reg21 = center_no
("get_random_faction_walled_center",
  [
    (store_script_param_1, ":faction_no"),
    
    (assign, ":result", -1),
    (assign, ":total_faction_centers", 0),
    (assign, ":cur_slot", 300),
    
    (try_for_range, ":center_no", walled_centers_begin, walled_centers_end),
      (store_faction_of_party, ":center_faction", ":center_no"),
      (eq, ":center_faction", ":faction_no"),
        (troop_set_slot, "trp_temp_array_a", ":cur_slot", ":center_no"),
        (val_add, ":cur_slot", 1),
    (try_end),
    
    (val_add, ":cur_slot", 1),
    (call_script, "script_rand", 300, ":cur_slot"),
    (assign, reg21, reg0),
]),
Does anyone have any idea why the script above isn't returning a random walled center from the faction?
 
kalarhan 说:
DtheHun 说:
Does anyone know how to use "itp_covers_hair_partially" flag?

did you examine the item flags and how the meshes are created on VC? You can use that as a example/template.

No, I don't have VC.

I need it for a Native mod.
 
DtheHun 说:
kalarhan 说:
DtheHun 说:
Does anyone know how to use "itp_covers_hair_partially" flag?

did you examine the item flags and how the meshes are created on VC? You can use that as a example/template.

No, I don't have VC.

I need it for a Native mod.
Don't you know you can download the VC module system without needing to own VC?
 
KratosMKII 说:
DtheHun 说:
kalarhan 说:
DtheHun 说:
Does anyone know how to use "itp_covers_hair_partially" flag?

did you examine the item flags and how the meshes are created on VC? You can use that as a example/template.

No, I don't have VC.

I need it for a Native mod.
Don't you know you can download the VC module system without needing to own VC?
I know, but I won't see how those partial models are named or done in the brf files.
 
状态
不接受进一步回复。
后退
顶部 底部