Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Khamukkamu said:
What operation can I use to force move a party AFTER it has spawned?

Or is there a way to check terrain before the party is spawned?

you can use party operations to relocate a party, it doesn't matter the type (a lord army or a town). You can even use map operations to get a valid location nearby (water or land).

IIRC the party spawns on the same terrain as the reference center (worth testing IF it is the case with the latest versions).

VC uses this script to remove a bandit lair that spawns on invalid locations (too close to a center, or in the water, or too close to the water)
Code:
  #script_spawn_lairs
  # INPUT: spawn point
  # OUTPUT: none
  ("spawn_lairs", [
      (store_script_param, ":bandit_spawn_point", 1),
      (party_get_slot, ":bandit_lair_party", ":bandit_spawn_point", slot_party_lair_party),
      (try_begin),
        (le, ":bandit_lair_party", "p_spawn_points_end"),
        
        (party_get_slot, ":bandit_template", ":bandit_spawn_point", slot_party_bandit_type),
        (set_spawn_radius, 10), #chief cambiado
        (party_template_get_slot, ":bandit_lair_template", ":bandit_template", slot_party_template_lair_type),
        (gt, ":bandit_lair_template", 0),
        (spawn_around_party, ":bandit_spawn_point", ":bandit_lair_template"),
        (assign, ":new_camp", reg0),
        (party_set_slot, ":new_camp", slot_party_type, spt_bandit_lair),
        
        (str_store_party_name, s4, ":new_camp"),
        #(party_set_flags, ":new_camp", pf_icon_mask, 1),
        (party_get_current_terrain, ":new_camp_terrain", ":new_camp"),
        ##	(position_get_z, ":elevation", pos4),
        ##	(position_get_y, ":lair_y", pos4),
        
        (assign, ":center_too_close", 0),
        (try_for_range, ":center", centers_begin, centers_end),
          (eq, ":center_too_close", 0),
          (store_distance_to_party_from_party, ":distance", ":new_camp", ":center"),
          (lt, ":distance", 5),
          (assign, ":center_too_close", 1),
        (try_end),
        
        (party_get_slot, ":flags", ":bandit_spawn_point", slot_party_spawn_flags),
        (try_begin),
          (eq, ":center_too_close", 0),
          (store_and, reg1, ":flags", spsf_coastal),
          (neq, reg1, 0),	#landed sea raiders
          
          (neq, ":new_camp_terrain", rt_water),
          (neq, ":new_camp_terrain", rt_river),
          (neq, ":new_camp_terrain", rt_bridge),
          (party_get_position, pos4, ":new_camp"),
          (map_get_water_position_around_position, pos5, pos4, 4),
          
          (party_set_slot, ":bandit_spawn_point", slot_party_lair_party, ":new_camp"),
          (party_set_flags, ":new_camp", pf_disabled, 1),
          
        (else_try),
          (eq, ":center_too_close", 0),
          (store_and, reg1, ":flags", spsf_coastal|spsf_seaborne),
          (eq, reg1, 0),	#land bandits
          
          (neq, ":new_camp_terrain", rt_water),
          (neq, ":new_camp_terrain", rt_river),
          (neq, ":new_camp_terrain", rt_bridge),
          
          #keep icon out of water
          (party_get_position, pos4, ":new_camp"),
          (try_begin),
            (map_get_water_position_around_position, pos5, pos4, 1),
            (assign, ":center_too_close", 1),
            
          (else_try),
            (party_set_slot, ":bandit_spawn_point", slot_party_lair_party, ":new_camp"),
            (party_set_flags, ":new_camp", pf_disabled, 1),
            (assign, ":center_too_close", 0),
          (try_end),
          
          (eq, ":center_too_close", 0),
          
        (else_try),
          (remove_party, ":new_camp"),
        (try_end),
      (try_end),
  ]),

map_get_water_position_around_position can fail (so it won't allow a bandit lair too close to the coast line, which would put the icon in the water), and it also checks for the terrain type.
 
does everyone know what is this error mean Traceback (most recent call last):
  File "process_presentations.py", line 33, in <module>
    save_presentations(variables,variable_uses,tag_uses,quick_strings)
  File "process_presentations.py", line 16, in save_presentations
    save_simple_triggers(ofile,presentation[3], variable_list,variable_uses,tag_uses,quick_strings)
  File "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\process_operations.py", line 473, in save_simple_triggers
    save_statement_block(ofile,0,1,trigger[1]  , variable_list, variable_uses,tag_uses,quick_strings)
  File "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\process_operations.py", line 451, 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 "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\process_operations.py", line 400, in save_statement
    operand = process_param(statement[i + 1],variable_list,variable_uses,local_vars_list,local_var_uses,tag_uses,quick_strings)
  File "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\process_operations.py", line 380, in process_param
    result = get_identifier_value(param.lower(), tag_uses)
  File "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\process_operations.py", line 109, in get_identifier_value
    (tag_type, id_no) = get_id_value(tag_str,id_str,tag_uses)
  File "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\process_operations.py", line 66, in get_id_value
    id_no = find_object(scripts,identifier)
  File "D:\Program Files (x86)\Mount&Blade Warband\Modules\War of Europe\Module_system 1.166\header_common.py", line 374, in find_object
    if (object[0].lower() == object_id_lowercase):
AttributeError: 'dict' object has no attribute 'lower'

this is new for me so idk how to fix it and im just edit module presentations and it show me this ???
 
HarryPham123 said:
this is new for me so idk

invalid syntax, go back to your latest backup and compare your changes, then check your new code (you can add it back in small parts and compile as you do it)
 
HarryPham123 said:
so i have to download a new module system

nope, it was a mistake you did on your file, all you need to do is fix it.



MadGuarang said:
One user of my mod had a strange error:
WgP2b.jpg

I have tested my mod from 2016 january and never seen anything like that...

which OS did you test on? And which OS is that player using? Mac, as a example, may have issues with custom fonts.

Also provide more info, and let us know if you can play the mod normally (so the problem is only on that other player's machine)
 
Nope this is the only one player that had such error to my best knowledge. I'll try to get more info, for now I am wainting for reply from him. Thanks in advance. 
 
HarryPham123 said:
Hm I see I will do my best to fix that error thanks kalarhan
@Harry you shouldn't spend more than 5 minutes to locate and fix that error. Like said many times, baby steps help (compile often as you write new code), and keep backups (use a source control like Git is even better).

if you can't fix it and you need further help you will need to post your entire modsys (Github, Dropbox, etc).

Cheers
 
Hi! The past few days I've been putting together a mod for my own use. So far using Floris extended as a base, I've added a skeleton skin, imported a number of new meshes, created some items, and then modified the vaegir troop line. As of this morning, everything was running fine. This afternoon I added a pretty significant number of new meshes/mats/textures from some OSP mods, created a bunch of new items, and further modified those same troops from yesterday to make use of the new items. However, now when I try to run it, I get a Run Time error during start-up, just after it finishes loading textures (all other mods are running fine). I'm very much a novice to modding (trying to teach myself a little pre-Bannerlord), so I'm sure my error is something as dumb as it is obvious, but I have no idea where I went wrong or how to find it out. Like I said, I haven't done anything except add meshes/mats/textures using openBRF and edit units/items using Morghs, so the trouble has to be isolated to screwing up one of those. Thanks!
 
Regarding changes to AI scripts (decide_faction_ai, decide_kingdom_party_ais, etc):

If I want to put some changes to that script into a menu for testing purposes, I don't need to start a new game, right? I'll just have to wait for the trigger that calls those scripts to run, and then those changes will occur. Is this assumption correct?

Thanks in advance.
 
Syke said:
Hi! The past few days I've been putting together a mod for my own use. So far using Floris extended as a base, I've added a skeleton skin, imported a number of new meshes, created some items, and then modified the vaegir troop line. As of this morning, everything was running fine. This afternoon I added a pretty significant number of new meshes/mats/textures from some OSP mods, created a bunch of new items, and further modified those same troops from yesterday to make use of the new items. However, now when I try to run it, I get a Run Time error during start-up, just after it finishes loading textures (all other mods are running fine). I'm very much a novice to modding (trying to teach myself a little pre-Bannerlord), so I'm sure my error is something as dumb as it is obvious, but I have no idea where I went wrong or how to find it out. Like I said, I haven't done anything except add meshes/mats/textures using openBRF and edit units/items using Morghs, so the trouble has to be isolated to screwing up one of those. Thanks!

Just to add to this, I have gone through all the basic troubleshooting for a standard runtime error during loading setting data... Load Textures on Demand is checked, tried loading with Force Single Threading checked, deleted the rgl_config file, etc. No dice. I have 16GB of RAM, and like I said before, all my other mods are working, including a lot more resource hungry ones than my little addition. If anyone has any ideas for how I can track down whatever is causing this, I'd super appreciate it!
 
Syke said:
Just to add to this, I have gone through all the basic troubleshooting for a standard runtime error during loading setting data...

go back to your last working backup, and start over to add things in your game, testing it often (to see if you can launch the game and start a new campaign)
 
Thanks again kalarhan. Will make testing much easier... and i'm delving into the abyss that is AI..

Another unrelated question: is it possible for a faction to have 2 marshalls, through modding? Im assuming not.. but might as well ask.
 
Yeah none of it is hardcoded, just make 2 slots. The problem is you need to made sure there's no conflicts like having the active marshal role alternate so armies keep switching between two parties to follow. On larger maps you can try forcing "Marshal of the North/South" restrictions but once centers change hands you'll also run into problematic behavior.
 
Khamukkamu said:
Another unrelated question: is it possible for a faction to have 2 marshalls, through modding?

Somebody said:
Yeah none of it is hardcoded, just make 2 slots

2, 3, 4, ... but keep in mind that you will need to work on the AI decisions so lords stay with their "captain", and that the captain has a valid target and keeps it over time (instead of deciding to go home to visit his wife).

pathfinding is done inside the engine, but the flags that give lords a target (like siege a town) and behavior (like follow XXX) are all done on modsys.

Native only had a few kingdoms, so made more sense in that setting to only have one marshal. Once you start doing bigger stuff you will have to deal with this old limitations by extending the game features.
 
Since pathing is done by the game engine, thats why its almost impossible to make water travel.
 
Hi, just downloaded the prophecy of pendor module v 3.8.4 and tried to add 4 pieces of armor (lich king armor)
I did as usual, copied the brf file to resource folder, dds file to texture folder, added the items to the item_kinds1, added load_mod_resource = ArthasLichKing (the brf file name) in module.ini.
and finally using Morgh's tool to add the items to the player.

somehow the game doesn't read/detect the meshes, it says unable to find mesh for (insert name here)

I am sure I have the right brf and dds files, since I did the same to native and viking conquest, and they worked out.
So I guess the problem lies in where I have to add the load_mod_resource = ArthasLichKing in module.ini ? Of course I've tried to add in in several places already, to no success.

Thanks for any help!
 
Ramaraunt said:
Since pathing is done by the game engine, thats why its almost impossible to make water travel.

it was harder 10 years ago. Now it is quite easy, even more since VC DLC came with updates to the engine for water travelling  (and new code for the modsys) :mrgreen:

cakuyan said:
I did as usual, copied the brf file to resource folder....

1) Test the items on OpenBRF (to make sure you have all the components), as in, do they look normal ?
2) Check your item flags (Morgh's)
3) Make sure you are importing resources on the correct order (if you have separate BRFs for textures, materials and meshes)

 
Only one file brf and one dds, I did the same to native, floris, and viking conquest, without changing item flags, stats, nor name (only placing the items on the player character) and it worked without problem.

It doesn't work for pendor only
 
Status
Not open for further replies.
Back
Top Bottom