Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hello all, hope i am not too annoying with my questions.
After module system installation when i try to launch build_module.bat the cmd appears for a moment and immediately disappears. Can somebody explain me how to fix this?
 
homicuda said:
Hello all, hope i am not too annoying with my questions.
After module system installation when i try to launch build_module.bat the cmd appears for a moment and immediately disappears. Can somebody explain me how to fix this?

run it in a console/terminal, that way you can see the error messages.

On Windows you can use the normal console (uggly, but works): Windows Key + R, type "cmd", ENTER
Newer versions of Windows come with PowerShell
 
C:\Program Files (x86)\Mount&Blade Warband\Modules\myworkshop\Module_system 1.16
6>build_module
Initializing...
variables.txt not found. Creating new variables.txt file
Compiling all global variables...
variables.txt not found. Creating new variables.txt file
variable_uses.txt not found. Creating new variable_uses.txt file
Traceback (most recent call last):
  File "process_global_variables.py", line 106, in <module>
    save_variables(export_dir, variables,variable_uses)
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\myworkshop\Module_sys
tem 1.166\process_operations.py", line 171, in save_variables
    file = open(export_dir + "variables.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/program files(x86)/Mount&Blade
Warband/modules/myworkshop/variables.txt'
Exporting strings...
Traceback (most recent call last):
  File "process_strings.py", line 25, in <module>
    save_python_header()
  File "process_strings.py", line 18, in save_python_header
    ofile = open("./ID_strings.py","w")
IOError: [Errno 13] Permission denied: './ID_strings.py'
Exporting skills...
Traceback (most recent call last):
  File "process_skills.py", line 31, in <module>
    save_python_header()
  File "process_skills.py", line 24, in save_python_header
    ofile = open("./ID_skills.py","w")
IOError: [Errno 13] Permission denied: './ID_skills.py'
Exporting tracks...
Traceback (most recent call last):
  File "process_music.py", line 22, in <module>
    save_python_header()
  File "process_music.py", line 8, in save_python_header
    ofile = open("./ID_music.py","w")
IOError: [Errno 13] Permission denied: './ID_music.py'
Exporting animations...
Traceback (most recent call last):
  File "process_animations.py", line 60, in <module>
    save_python_header(action_codes)
  File "process_animations.py", line 52, in save_python_header
    ofile = open("./ID_animations.py","w")
IOError: [Errno 13] Permission denied: './ID_animations.py'
Exporting meshes...
Traceback (most recent call last):
  File "process_meshes.py", line 24, in <module>
    save_python_header()
  File "process_meshes.py", line 17, in save_python_header
    ofile = open("./ID_meshes.py","w")
IOError: [Errno 13] Permission denied: './ID_meshes.py'
Exporting sounds...
Traceback (most recent call last):
  File "process_sounds.py", line 51, in <module>
    write_sounds(sound_samples, sounds)
  File "process_sounds.py", line 13, in write_sounds
    ofile = open(export_dir + "sounds.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/program files(x86)/Mount&Blade
Warband/modules/myworkshop/sounds.txt'
Exporting skins...
Traceback (most recent call last):
  File "process_skins.py", line 105, in <module>
    export_skins(skins)
  File "process_skins.py", line 45, in export_skins
    ofile = open(export_dir + "skins.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/program files(x86)/Mount&Blade
Warband/modules/myworkshop/skins.txt'
Exporting map icons...
Traceback (most recent call last):
  File "process_map_icons.py", line 33, in <module>
    save_python_header()
  File "process_map_icons.py", line 27, in save_python_header
    ofile = open("./ID_map_icons.py","w")
IOError: [Errno 13] Permission denied: './ID_map_icons.py'
Exporting faction data...
Traceback (most recent call last):
  File "process_factions.py", line 68, in <module>
    save_python_header()
  File "process_factions.py", line 61, in save_python_header
    file = open("./ID_factions.py","w")
IOError: [Errno 13] Permission denied: './ID_factions.py'
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 61, in <module>
    save_python_header()
  File "process_items.py", line 12, in save_python_header
    file = open("./ID_items.py","w")
IOError: [Errno 13] Permission denied: './ID_items.py'
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 13, in <module>
    save_python_header()
  File "process_scenes.py", line 7, in save_python_header
    ofile = open("./ID_scenes.py","w")
IOError: [Errno 13] Permission denied: './ID_scenes.py'
Exporting troops data
Traceback (most recent call last):
  File "process_troops.py", line 106, in <module>
    save_python_header()
  File "process_troops.py", line 99, in save_python_header
    file = open("./ID_troops.py","w")
IOError: [Errno 13] Permission denied: './ID_troops.py'
Exporting particle data...
Traceback (most recent call last):
  File "process_particle_sys.py", line 61, in <module>
    save_particle_systems()
  File "process_particle_sys.py", line 29, in save_particle_systems
    ofile = open(export_dir + "particle_systems.txt","w")
IOError: [Errno 2] No such file or directory: 'C:/program files(x86)/Mount&Blade
Warband/modules/myworkshop/particle_systems.txt'
Exporting scene props...
Traceback (most recent call last):
  File "process_scene_props.py", line 27, in <module>
    save_python_header()
  File "process_scene_props.py", line 21, in save_python_header
    file = open("./ID_scene_props.py","w")
IOError: [Errno 13] Permission denied: './ID_scene_props.py'
Exporting tableau materials data...
Traceback (most recent call last):
  File "process_tableau_materials.py", line 26, in <module>
    save_python_header()
  File "process_tableau_materials.py", line 20, in save_python_header
    ofile = open("./ID_tableau_materials.py","w")
IOError: [Errno 13] Permission denied: './ID_tableau_materials.py'
so much of errors.....
 
Greetings experts!

I'm creating a native compatible, server side mod.
There's a slight mystery which you guys might be able to help with.
I would need to change a player's name corresponding to the situation.

When a player hits TAB to see the stats_chart, it lists the names of players. Instead of showing my name as "CCC_Muzzle", i would need it to show "*SLEEPING* CCC_Muzzle" for example.
I couldn't yet find any clues on how the clients receive this information. Player names have to come from server tho..

Does anyone know how and where are player names stored?
 
Muzzle C said:
Does anyone know how and where are player names stored?

Code:
str_store_player_username       = 2350  # (str_store_player_username, <string_register>, <player_id>),
                                        # Stores player's multiplayer username in referenced string register. Can be used in multiplayer mode only.

Did you try that operation? Use concatenation of registers to form that special name
Code:
(str_store_player_username, s0, ":player_id"),# you need to get the ID first
(str_store_string, s0, "@(Sleeping) {s0}"),

If that fails  you will need to use the send message operations. As I don't usually play with MP code (or MP at all lol), I will stop here  :mrgreen:
 
kalarhan said:
Muzzle C said:
Does anyone know how and where are player names stored?

Code:
str_store_player_username       = 2350  # (str_store_player_username, <string_register>, <player_id>),
                                        # Stores player's multiplayer username in referenced string register. Can be used in multiplayer mode only.

Did you try that operation? Use concatenation of registers to form that special name
Code:
(str_store_player_username, s0, ":player_id"),# you need to get the ID first
(str_store_string, s0, "@(Sleeping) {s0}"),

If that fails  you will need to use the send message operations. As I don't usually play with MP code (or MP at all lol), I will stop here  :mrgreen:

As far as I know, you can't change players names in just a server sided mod. You'd at least need a client event to change it, too, and I think you'd also need WSE as native doesn't have an operation to set the player name (?).
 
I gave an item through dialogues using troop_add_item. It appeared in my inventory with the descriptor, "cracked". Checked items.py and saw that the item had imodbits_none.

imodbits_none is set to 0.

What could have made this item, "cracked"?
 
Khamukkamu said:
I gave an item through dialogues using troop_add_item. It appeared in my inventory with the descriptor, "cracked". Checked items.py and saw that the item had imodbits_none.

imodbits_none is set to 0.

What could have made this item, "cracked"?

imodbits are the "possible" imods of the item. You need to check the "imod".

imod_plain = 0
imodbit_plain = 1

See the difference?

Code:
troop_add_item                           = 1530  # (troop_add_item, <troop_id>, <item_id>, [modifier]),
                                                 # Adds an item to the troop, optionally with a modifier (see imod_* constants in header_item_modifiers.py).
Check the item again, how you are using the operation, and what imod the item has on your inventory.
Code:
troop_get_inventory_slot_modifier        = 1542  # (troop_get_inventory_slot_modifier, <destination>, <troop_id>, <inventory_slot_no>),
                                                 # Retrieves the modifier value (see imod_* constants in header_items.py) for an item in the specified equipment or inventory slot. Returns 0 when there's nothing there, or if item does not have any modifiers.
 
  #script_spawn_bandits
  # INPUT: none
  # OUTPUT: none
  ("spawn_bandits"
Just 2 more questions :
1) What does exactly mean and how is readed
2)Where is it? In wich file?.py or .txt?
 
When you open a text file, you'll see that it most definitely doesn't contain anything of the sorts. Therefore, it's in a python file.
Furthermore, you can use stuff like Notepad++'s "Find in Files" command and see that the script is in - how exciting! - module_scripts.
To find out which fields mean what, look at the large comment section round the top of each module_* file. There's a guide there as to what each block is for.
 
Ok, it works! Now I will just do a pair of adjustments to make sure large parties spawn less than medium and normal ones! So, I wanted to make noble troop tree too, so I attempted this
(faction_set_slot, "fac_culture_1",  slot_faction_tier_5_noble, "trp_swadian_nobleman"),
and then this
(faction_set_slot, "fac_culture_1",  slot_faction_tier_6_troop, "trp_swadian_nobleman"),
I tought that the best way to recruit nobles was the one used in PoP, so I wanted that your chancellor or whatever will give you a noble recruit of your culture, but I'm missing something....
Also, how can I make a special "kingdom_reinforcement" in order to give some lords and to the rulers household troops?
 
Guys, thanks for quick reply.

kalarhan said:
Code:
(str_store_player_username, s0, ":player_id"),# you need to get the ID first
(str_store_string, s0, "@(Sleeping) {s0}"),

If that fails  you will need to use the send message operations. As I don't usually play with MP code (or MP at all lol), I will stop here  :mrgreen:

This doesn't actually change the player name in anyway, does it?
As i see, it only stores the "@(Sleeping) {s0}"), in a strings.. Not replacing any existing name.

The_dragon said:
@Muzzle C open module_presentations and search for 'str_store_player_username'. Look where it is used and modify the string register which stores the player's name.

If i understand the module system right, all the presentations are ran on client side.. right?
Therefore changing anything in there wouldn't be applied to clients.. Correct me if i understand wrong.

Namakan said:
As far as I know, you can't change players names in just a server sided mod. You'd at least need a client event to change it, too, and I think you'd also need WSE as native doesn't have an operation to set the player name (?).
For me this makes the most sense. WSE has this option player_set_username. I need to apply WSE and investigate if it's possible to set it on serverside or not..

Sigh, always these problems with serverside mods.. But gotta say this community is awesome. You guys help right away.  :smile:
 
How can I store multiple variables in  random_in_range?

For example I have this: (particle_system_burst, "psys_lanse", pos1, 3), #Default = 10 (Higher = Bigger Particles)
I want that particle_system_burst to have  a random chance of choosing between psys_lanse, psys_effect, psys_fire, and psys_water. (Not the number in the end, the actual name of the particle).
How can I achieve this?
 
Get a random number between 0 and 3. If the number is 0, then ":chosen_particle_system" = "psys_lanse"; else if random number is 1, then ":chosen_particle_system" = "psys_effect" else...... and so on. Then call (particle_system_burst, ":chosen_particle_system", pos1, 3)
 
Status
Not open for further replies.
Back
Top Bottom