Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
KnightV said:
What to do if i dont want to implement wreck etc

study the tutorial for WRECK to learn how the syntax works, then convert it back to normal-old-style MBScript. It is a quick process.

like

Code:
l.XXXX
to

Code:
":XXXX"
 
kalarhan said:
KnightV said:
What to do if i dont want to implement wreck etc

study the tutorial for WRECK to learn how the syntax works, then convert it back to normal-old-style MBScript. It is a quick process.

like

Code:
l.XXXX
to

Code:
":XXXX"


Thank you for help. Now could you say where is error in the following codes. I added it and when i have speak with tavern keeper appearing exchange menu but i see only myself and no any troop

#----------------------------------------------------------------------------------
  [anyone|plyr,"tavernkeeper_talk", [], "I need to hire some soldiers. Can you help me?", "tavernkeeper_buy_peasants",[]],
  [anyone,"tavernkeeper_buy_peasants",
  [
      (store_encountered_party,reg(3)),
      (store_faction_of_party,reg(4),reg(3)),
      (store_relation,reg(5),"fac_player_supporters_faction",reg(4)),
      (lt, reg(5), -3),
    ], "I don't think anyone from this town will follow somebody like you. Try your luck elsewhere.", "tavernkeeper_buy_peasants_2",[]],
  [anyone,"tavernkeeper_buy_peasants", [], "I know a few fellows who would follow you if you paid for their equipment.", "tavernkeeper_buy_peasants_2",[(store_encountered_party,reg(2)),(party_get_slot,"$tavernkeeper_party",reg(2)),slot_town_mercs),(set_mercenary_source_party,"$tavernkeeper_party"),(change_screen_buy_mercenaries)]],
  [anyone,"tavernkeeper_buy_peasants_2", [], "Anything else?", "tavernkeeper_talk",[]],
#----------------------------------------------------------------------------------
#----------------------------------------------------------------------------------
      (store_add, ":cur_object_no", "p_town_merc_1", ":eek:ffset"),
      (party_set_slot,":town_no", slot_town_mercs,":cur_object_no"),
#----------------------------------------------------------------------------------   

#----------------------------------------------------------------------------------
#no input/output
#could need a faction check
#that's from the 808 module system

  ("add_tavern_troops",
      [
        (try_for_range,reg(2),merc_parties_begin,merc_parties_end),
              (store_party_size,reg(6),reg(2)),
            (lt,reg(6),30), #never have many more than 20 troops in the tavern
            (store_random,reg(7),:cool:,
            (party_add_members,reg(2),"trp_townsman",reg(7)),
            (store_random,reg(:cool:,5),
            (party_add_members,reg(2),"trp_refugee",reg(:cool:),
            (store_random,reg(9),5),
            (party_add_members,reg(2),"trp_manhunter",reg(9)),
        (try_end),
               
      ]),
#----------------------------------------------------------------------------------
i am trying to implement it on 1.171 module system
 
hi everybody, so, somehow i succseded adding my prop to the scene, but now, i have another problem, that is, my prop looks alright on openBRF but looks like ****e in game here the ss

openbrf
SYxQGA0.png

yUoKxvb.png

MuajR3b.png

ingame
44AiNgL.jpg

3BbYtk1.jpg

5J1mSNd.jpg

i wonder what went wrong? usually its working just fine

im saving the texture with mip maps if that helps (i assume its for adapting screen resolution?)

thanks in advance
 
Kalarhan, may i ask you something. From all the heart i ask you to answer my posts like "i dont know the solution" if you havent any idea because i always wait for your response and think that you are offline.

And now, i have several problems

first, how to fix this "DEBUG -- ERROR: More than 15 trade routes are given for Ahmerrad.
DEBUG -- ERROR: More than 15 trade routes are given for Ahmerrad."


And another, i reread your sentences for hundreds times kalarhan and understood something. So after all the my evening i have deleted all and have rewrite again following the guide for every step. These annoying errors have disappeared but almost all banners in game havent texture, they are quite white. What caused this. Please help me anybody
 
KnightV said:
first, how to fix this "DEBUG -- ERROR: More than 15 trade routes are given for Ahmerrad.
DEBUG -- ERROR: More than 15 trade routes are given for Ahmerrad."

locate this string on your modsys (module_scripts.py). The Native trade system has some rules and you just broke one of them (you can study the script to see what you did wrong, but the message should be self-explanatory).



 
kalarhan said:
KnightV said:
first, how to fix this "DEBUG -- ERROR: More than 15 trade routes are given for Ahmerrad.
DEBUG -- ERROR: More than 15 trade routes are given for Ahmerrad."

locate this string on your modsys (module_scripts.py). The Native trade system has some rules and you just broke one of them (you can study the script to see what you did wrong, but the message should be self-explanatory).

What about banners , any ideas ?

P.S. Do you how can i contqct with developer of the mod Naruto
 
reza said:
hi everybody, so, somehow i succseded adding my prop to the scene, but now, i have another problem, that is, my prop looks alright on openBRF but looks like **** in game here the ss

openbrf
SYxQGA0.png

yUoKxvb.png

MuajR3b.png

ingame
44AiNgL.jpg

3BbYtk1.jpg

5J1mSNd.jpg

i wonder what went wrong? usually its working just fine
Usually a wrong shader and/or material flags.
Check out other scene prop's materials to get a reference.

reza said:
im saving the texture with mip maps if that helps (i assume its for adapting screen resolution?)
Mip maps are used to speed up the rendering and to reduce aliasing artifacts.
 
Just getting into the modsys a bit and was wondering about some small things. for-warned I have basically no programing experience so please excuse my ignorance. What I am trying to do it make it so that all hero characters including the player get an age for their slot_troop_age assigned on game start and I don't seem to understand how try_for_range works entirely. I basically cannibalized the start of the initialize_aristocracy script for King ages in module_scripts but I don't know where the info for kings_begin and kings_end is stored so that I may add my own or select a paring that would make sense for all hero characters. Any info on this would be appreciated.

Also on an unrelated note about my specific first question, it seems really hard to try and do all the research about how everything is, does, and, works with the warband script system. Are there any wikis that have a conglomerate of all the information about what everything does or would I just have to personally spend months scouring the forums to find any tidbits of info myself?

EDIT: so funnily enough it now builds correctly when I set it to heroes_begin and heroes_end instead of heros.... my mistake. I think I've also found out where some of these are stated and its in the module_troops file. but it seems to be only on some and some of them also in there don't seem to work like kingdom_heroes_including_player_begin at line 894 for the try_for_range atleast
 
dragoon_103 said:
how try_for_range works

kings_begin and kings_end is stored

works with the warband script system.

try_for_range is a simple step loop (a basic coding function). Example:

Code:
(try_for_range, reg1, 0, 10),
  (display_message, "@{reg1}"),
(try_end),

would print
Code:
0
1
2
3
4
5
6
7
8
9

The basic function of a loop is to remove duplicated code. So instead of doing this line by line

Code:
(troop_set_age, "trp_1", slot_age, 40),
(troop_set_age, "trp_2", slot_age, 45),
...

you can use a loop (as long the age can be choosen by a random value or some other logic)

Code:
(try_for_range, ":troop_id", lords_begin, lords_end),
  (troop_set_age, ":troop_id", slot_age, SOMETHING),
(try_end),

(note the code is just a snippet/example, dont try to copy it as is)



get a good text editor like SublimeText, VS code, Atom, ... and use full text search to look inside all files on your modsys. For SublimeText that would be CTRL+SHIFT+F. For a constant you can search for "kings_begin =" (it will take you to module_constants.py).



You should start with the basic MBScript tutorials to learn about the syntax and how to use the modsys. Specific game mechanics have a few tutorials, but mostly it will require you to look at the code and see how it works, then you can make any changes you want to. Most game features/mechanics are not hardcoded, so you can remove them, tweak them, change them, replace them with something different. Modsys is quite open to a game designer to do whatever you want on a basic Warband-like game.
 
hey mate, got another problem here, it seems like, whatever i try to do with the module system compiler, the result is null.

i was trying to add a new item and add it to the vaegir spearman ai multiplayer troop

so i downloaded morgh's latest version and do my thing like i usually did, turns out the script that morgh's generated and the script that current mb provide is actually different, so when compiling i got all error about itm_bow_javelin and such, no problem, i just add it manually then, so i tried to copy the template in module_items.py which is this

Code:
["sword_viking_1", "Nordic Sword", [("sword_viking_c",0),("sword_viking_c_scabbard ", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
147 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(94)|swing_damage(28 , cut) | thrust_damage(20 , pierce),imodbits_sword_high ] ,

and turn it into this

Code:
["jw", "Pedang Jawa", [("jw1",0),("jw1scab1", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_longsword|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn,
147 , weight(1.5)|difficulty(0)|spd_rtng(99) | weapon_length(94)|swing_damage(28 , cut) | thrust_damage(20 , pierce),imodbits_sword_high ] ,

next to each other, so im sure my item line is placed before item_end

and then on the module_troop.py ut goes something like this

Code:
["vaegir_spearman_multiplayer_ai","Vaegir Spearman","Vaegir Spearmen",tf_guarantee_all_wo_ranged,0,0,fac_kingdom_2,
[itm_jw,itm_ts,itm_tk,itm_ka, itm_hse, itm_ub, itm_mace_1, itm_javelin],
def_attrib|str_12|level(19),wp_melee(90),knows_ironflesh_4|knows_athletics_6|knows_power_throw_3|knows_power_strike_3|knows_shield_2,vaegir_face_young_1, vaegir_face_older_2],

so i went ahead and saved those, and compile the module, and the compile was sucsseded, no problem, however, when i checked into the game, no change has been made, and then i looked into the itemskind1 text and look for my item name, but it was not there, so, kinda confused here

something strange i notice is on the D:\rejul\steam\steamapps\common\MountBlade Warband\Modules

there is a lot of text file with projectalas(my mod) as the prefix i.e project alasitem_kinds1

i wonder if the problem is cause i did something wrong on setting the phyton/ module system

this is my path to the module

Code:
D:\rejul\steam\steamapps\common\MountBlade Warband\Modules\projectalas

this is the path on module_info

Code:
D:/rejul/steam/steamapps/common/MountBlade Warband/Modules/projectalas

and this is my envirovement variable path

Code:
C:\Program Files\AMD APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Python27

so, what went wrong? thanks in advance
 
you are missing a slash on your path

but my module is not inside the native folder? is that a must?, i guess i'll try to change it

also review a tutorial on how to add items to a MP troop, which is not the same as a SP troop.

no no i did not attempt to add a mp slot item kinda thing, i just wanted to change the bot vaegir spearman item so i can see in game how my item looks
i tried to tweak the textfile of the troop and it worked, but still, i wanted to work it the modsys way

also, forgive me for my ignorance as i am relatively new, but isn't it when your item non-existent int itemskind1.txt, that means your item ddoesn't got added to the game?, thus, can't be used anywhere?

thanks for the reply mate, much appreciated

edit: now the text with prefixes moves within the native module folder, but now it works! thanks much man
 
oh im so dumb, you were tryin to say its suppose to be like this:

D:/rejul/steam/steamapps/common/MountBlade Warband/Modules/projectalas/

right, im sorry mate

EDIT

it seems like, my previous attempt on scene tweaking on the modsys, got compiled, and override my already done scene that i made by the text file
the thing is, its only change 2 scene prop into random warband prop, and mess the ground elevation really good

here is the scene prop in .py

Code:
("civ_candi_court",0,"civ_candi_court","bo_civ_candi_court", []),
  ("civ_candi_grand_statue",0,"civ_candi_grand_statue","bo_civ_candi_grand_statue", []),
  ("civ_candi_dungeon",0,"civ_candi_dungeon","bo_civ_candi_dungeon", []),
  ("civ_candi_gate",0,"civ_candi_gate","bo_civ_candi_gate", []),
  ("civ_candi_house",0,"civ_candi_house","bo_civ_candi_house", []),
  ("civ_candi_gubuk",0,"civ_candi_gubuk","bo_civ_candi_gubuk", []),
  ("civ_rotan_house",0,"civ_rotan_house","bo_civ_rotan_house", []),
  ("civ_rotan_house1",0,"civ_rotan_house1","bo_civ_rotan_house1", []),
  ("civ_rotan_tavern",0,"civ_rotan_tavern","bo_civ_rotan_tavern", []),

and here is on the .txt

Code:
spr_civ_candi_court 0 0 civ_candi_court bo_civ_candi_court 0


spr_civ_candi_grand_statue 0 0 civ_candi_grand_statue bo_civ_candi_grand_statue 0


spr_civ_candi_dungeon 0 0 civ_candi_dungeon bo_civ_candi_dungeon 0


spr_civ_candi_gate 0 0 civ_candi_gate bo_civ_candi_gate 0


spr_civ_candi_house 0 0 civ_candi_house bo_civ_candi_house 0


spr_civ_candi_gubuk 0 0 civ_candi_gubuk bo_civ_candi_gubuk 0


spr_civ_rotan_house 0 0 civ_rotan_house bo_civ_rotan_house 0


spr_civ_rotan_house1 0 0 civ_rotan_house1 bo_civ_rotan_house1 0


spr_civ_rotan_tavern 0 0 civ_rotan_tavern bo_civ_rotan_tavern 0


spr_civ_Wall 0 0 civ_wall bo_civ_wall 0

i guess i can just re edit the prop manually but it would be nice if this can be fixed

also, does anyone know where the ground elevation data is stored? i tried to look after in my back up scene text, only to find out that the 0xcode is still the same as before i edited the scene, and i copied the 0xcode to the current scene.text, but nothing changed

so where does it stored?
 
I have misterious bug or error, i dont know. So i have a new one animation in game while jumping and i want to remove it. But in module_animation in section @jump@ there isnt the animation, i see only default native animation. Help anybody. What could cause these? It is true that animations can call not only file module_animation. thanks in advance
 
Need help with scene editing. I'm trying to make teleport doors for singleplayer sieges. In singleplayer all objects with sokf_moveable|spr_use_time(0) are not highlighted to be use with F for some reason, they become just a destructible targets so I had to put teleport in ti_on_scene_prop_hit trigger. And it works, but mostly for me, and the goal was to be able to take my archers/companions with me using F1-F2 order. Any idea how to make it possible for them to come with me? I'm trying to do it through a distance comparison so that all agents that are closer than 5 meters to the door will be moved to the end destination. But this code doesn't work, compiler doesn't show any errors but in game nothing happens within 5m radius either. What I'm doing wrong?
("teleport_1side_5",sokf_moveable,"door_c","bo_door_a", [
###Not working code, I know its something wrong here but what exactly?
  (ti_on_init_scene_prop,
    [
      (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_variation_id, ":door_link_number", ":instance_id"),
    (scene_prop_get_num_instances, ":door_count", "spr_teleport_1side_5"),
    (try_for_agents, ":agent"),
  (try_for_range, ":eek:ther_instance_no", 0, ":door_count"),     
      (scene_prop_get_instance, ":eek:ther_instance_id", "spr_teleport_1side_5_destination", ":eek:ther_instance_no"),
      (neq, ":eek:ther_instance_id", ":instance_id"),
      (prop_instance_get_variation_id, ":eek:ther_door_link_number", ":eek:ther_instance_id"),
      (eq, ":eek:ther_door_link_number", ":door_link_number"),
      (prop_instance_get_position, pos1, ":eek:ther_instance_id"),
  (prop_instance_get_position, pos2, ":instance_id"),
      (position_move_y, pos1, 50),  
    (ge,":agent",0),
    (agent_is_active,":agent"),
    (agent_is_alive, ":agent"),
(agent_get_position, pos0, ":agent"),
(get_distance_between_positions_in_meters, ":distance_to_target_pos", pos0, pos2),
(lt, ":distance_to_target_pos", 5),
    (agent_set_position, ":agent", pos1), 
        (assign, ":door_count", -1),
  (try_end),
 
    (try_end), 
    ]),


###Perfectly working code but having it on scene prop hit is not enough
  (ti_on_scene_prop_hit,
      [
    (store_trigger_param_1, ":instance_id"),
    (prop_instance_get_variation_id, ":door_link_number", ":instance_id"),
    (scene_prop_get_num_instances, ":door_count", "spr_teleport_1side_5"),
    (try_for_range, ":eek:ther_instance_no", 0, ":door_count"),
  (set_fixed_point_multiplier, 1),
          (position_get_x, ":attacker_agent_id", pos2),
          (get_player_agent_no, ":player_agent"),
          (eq, ":player_agent", ":attacker_agent_id"),
      (scene_prop_get_instance, ":eek:ther_instance_id", "spr_teleport_1side_5_destination", ":eek:ther_instance_no"),
      (neq, ":eek:ther_instance_id", ":instance_id"),
      (prop_instance_get_variation_id, ":eek:ther_door_link_number", ":eek:ther_instance_id"),
      (eq, ":eek:ther_door_link_number", ":door_link_number"),
      (prop_instance_get_position, pos1, ":eek:ther_instance_id"),
      (position_move_y, pos1, 50),
      (agent_set_position, ":player_agent", pos1),
      (assign, ":door_count", -1),
    (try_end), 
    ]),
]),

  ("teleport_1side_5_destination", 0, "pointer_arrow", "0", []),

KnightV said:
I have misterious bug or error, i dont know. So i have a new one animation in game while jumping and i want to remove it. But in module_animation in section @jump@ there isnt the animation, i see only default native animation. Help anybody. What could cause these? It is true that animations can call not only file module_animation. thanks in advance
Pay attention to the names in quotes.
6c46f8627550b83b4d2d5898d9f1780f-full.png
These are names of the animation resource in brf-s and they are the only thing that matters. If in your module_animations.py they differ from my pic, then just rename them to match it and problem will be solved. Good luck.
 
UndeadDuke said:
(...) all agents that are closer than 5 meters to the door (...)

use try_for_agents with a filter

Code:
try_for_agents          =   12  #(try_for_agents, <destination>, [<position_no>], [<radius_fixed_point>]),
                                # Runs a cycle, iterating all agents on the scene. Optional parameters can be used to limit it to a circle area. Avoid using pos0.
 
Status
Not open for further replies.
Back
Top Bottom