Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I've been playing around with shaders and trying to make the worldmap oceans look better (tried various ways of making better waves/water, but seems that the worldmap does not like Gerstner waves or any sort of vertex manipulation....  :fruity:).

Anyways, I was wondering if there is some way to increase the amount of waves generated (the foam stuff near the coast on the current world map)?
I've tried digging through the .brfs and shader sources, but I just cannot figure out how the waves are applied to the coast at all (map_foam material uses the same water shader as the main ocean, but map_foam material is never explicitly assigned anywhere to the worldmap, at least that I can find).

Here's what I've come up with so far (new texture (with visible seams, just temporary) + normal + shader (reflections, displacement, distortion only so far, no fresnel etc yet):

http://i.imgur.com/5IH5sv9.jpg
http://i.imgur.com/OOGMC37.jpg

All the white foam past the coast is just part of the texture, but I want to change that...
There are also various visual artifacts still, mostly only visible when zoomed in to 'ocean' level.
 
wrwlf said:
I've been playing around with shaders and trying to make the worldmap oceans look better (tried various ways of making better waves/water, but seems that the worldmap does not like Gerstner waves or any sort of vertex manipulation....  :fruity:).

Are you talking about weird cracks appearing? If so then I would guess you are oscillating using the texture coordinates, this will create cracks on the world map. The reason for this is that warband applies texture coordinates to the worldmap in a very strange way, it applies them in a kind of circular manner, I believe tw's reason for this was to prevent the textures from looking incredibly tiled.

You can in fact displace the vertices on the worldmap, the trick is to use the world position.xy and it should work fine. To prevent cracks appearing at the coast (e.g the vertices where the oscillating ocean faces meet the static land faces), you can then further multiply by the inverse of the vertex color.r channel (if its not the inverse just multiply by the r channel i cant remember), this will prevent the vertices from moving if they are attached to land.


Anyways, I was wondering if there is some way to increase the amount of waves generated (the foam stuff near the coast on the current world map)?
I've tried digging through the .brfs and shader sources, but I just cannot figure out how the waves are applied to the coast at all (map_foam material uses the same water shader as the main ocean, but map_foam material is never explicitly assigned anywhere to the worldmap, at least that I can find).
The waves are created by the engine, we can have very little control over them other than changing their texture or removing them - you could try changing the mesh (cant remember the brf it is in), but im not sure how much this would help you.

An alternative would be to create your own waves by altering your ocean material so that it featured a foamy texture when close to shore - this is what I did in viking conquest to create beaches near the coast. Warband automatically colors ocean vertices which are close to land (the closer to land they are the more they are colored), so you can use vertice color as an indication of how close the sea is to land, and hence add a white foamy texture on top when the sea is very close to land (e.g when the vertex color.r channel is greatest)

Anyways looks good  :smile:

EDIT: On a side note though, gerstner waves could be quite expensive for the world map, you might be better just using a few simple sine waves rather than gerstner waves.
 
How can I check a kingdom defeat?
I found this but how can I use this code? I want to use in a dialog.
# Check if a faction is defeated every day
  (24,
  [
    (assign, ":num_active_factions", 0),
    (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
      (faction_set_slot, ":cur_kingdom", slot_faction_number_of_parties, 0),
    (try_end),
    (try_for_parties, ":cur_party"),
      (store_faction_of_party, ":party_faction", ":cur_party"),
      (is_between, ":party_faction", kingdoms_begin, kingdoms_end),
      (this_or_next|is_between, ":cur_party", centers_begin, centers_end),
  (party_slot_eq, ":cur_party", slot_party_type, spt_kingdom_hero_party),
      (faction_get_slot, ":kingdom_num_parties", ":party_faction", slot_faction_number_of_parties),
      (val_add, ":kingdom_num_parties", 1),
      (faction_set_slot, ":party_faction", slot_faction_number_of_parties, ":kingdom_num_parties"),
    (try_end),
 
La Grandmaster said:
wrwlf said:
I've been playing around with shaders and trying to make the worldmap oceans look better (tried various ways of making better waves/water, but seems that the worldmap does not like Gerstner waves or any sort of vertex manipulation....  :fruity:).

Are you talking about weird cracks appearing? If so then I would guess you are oscillating using the texture coordinates, this will create cracks on the world map. The reason for this is that warband applies texture coordinates to the worldmap in a very strange way, it applies them in a kind of circular manner, I believe tw's reason for this was to prevent the textures from looking incredibly tiled.

You can in fact displace the vertices on the worldmap, the trick is to use the world position.xy and it should work fine. To prevent cracks appearing at the coast (e.g the vertices where the oscillating ocean faces meet the static land faces), you can then further multiply by the inverse of the vertex color.r channel (if its not the inverse just multiply by the r channel i cant remember), this will prevent the vertices from moving if they are attached to land.


Anyways, I was wondering if there is some way to increase the amount of waves generated (the foam stuff near the coast on the current world map)?
I've tried digging through the .brfs and shader sources, but I just cannot figure out how the waves are applied to the coast at all (map_foam material uses the same water shader as the main ocean, but map_foam material is never explicitly assigned anywhere to the worldmap, at least that I can find).
The waves are created by the engine, we can have very little control over them other than changing their texture or removing them - you could try changing the mesh (cant remember the brf it is in), but im not sure how much this would help you.

An alternative would be to create your own waves by altering your ocean material so that it featured a foamy texture when close to shore - this is what I did in viking conquest to create beaches near the coast. Warband automatically colors ocean vertices which are close to land (the closer to land they are the more they are colored), so you can use vertice color as an indication of how close the sea is to land, and hence add a white foamy texture on top when the sea is very close to land (e.g when the vertex color.r channel is greatest)

Anyways looks good  :smile:

EDIT: On a side note though, gerstner waves could be quite expensive for the world map, you might be better just using a few simple sine waves rather than gerstner waves.

Thanks a lot for the feedback and the advice!

Here's the first 'functional' Gerstner wave shader I've been able to put together: https://www.youtube.com/watch?v=Egb8JhuM1K4&feature=youtu.be

Couple of issues still though....mostly the seams in the middle of the ocean and the clipping issues with the land terrain.
I wonder if there is some way I can dampen the effect when closer to land; unfortunately I am about 99% clueless when it comes to this HLSL stuff (I do have a solid math background though, hence why my first inclination was to try implementing the Gerstner waves  :grin:).

I also need to start implementing the reflections/refraction(maybe)/fresnel in the vs/ps. The pixelshader is pretty much blank right now, just assigns the current texture. The previous images I posted were just a test without any Gerstner effects applied (calculating the normal, tangent, binormal gets a lot more tedious with the effect applied).
I also want to do something with the height value of the wave, maybe applying a 'manual' spec effect; ie. height >= some_value, lighten pixel at that point or similar....

Also, I wasn't exactly sure what you mean with multiply by the color.r component. Did you mean multiply the modified position vector by that?
 
rgl_log:

HERR_BUFFER_CAPACITY_EXECCEDED
vdt_normal_map discard_buffer()
vdt_normal_map discard_buffer()
vdt_regular discard_buffer()

Does anyone know what this does mean?
 
wrwlf said:
Couple of issues still though....mostly the seams in the middle of the ocean and the clipping issues with the land terrain.
I wonder if there is some way I can dampen the effect when closer to land; unfortunately I am about 99% clueless when it comes to this HLSL stuff (I do have a solid math background though, hence why my first inclination was to try implementing the Gerstner waves  :grin:).

I told you how to do both of those things in my post (like its literally what the entire post was about)  :wink:, the seams in the middle of the ocean can be fixed by using the world position.xy for your sine wave instead of the texture coordinates. Somewhere in your gerstner equation I assume you are using ".tc" or "Tex0", do not use this, you must use vertice world position.


The seams close to land can be fixed by multiplying your vertex offset (the amount it moves from its original position) by one of the vertex color channels, i simply used the red channel (.r) as an example, it can be any (.r,.g,.b)

La Grandmaster said:
Warband automatically colors ocean vertices which are close to land (the closer to land they are the more they are colored), so you can use vertice color as an indication of how close the sea is to land
So when vertex color is high (close to 1) the vertice is close to land, and when vertice color is low (close to 0) the vertice is out at sea. So to fix the vertices close to land (so that they dont wave) we inverse the vertice color (so that 0 is close to shore and 1 is far out at sea), we then multiply out wave/vertice offset by this value - multiplying the wave by 0 when close to shore will mean that the offset will be 0 - meaning no wave


I also want to do something with the height value of the wave, maybe applying a 'manual' spec effect; ie. height >= some_value, lighten pixel at that point or similar....
Copy the output vertice position.z component (Out.Pos.z) to another output e.g you could change the output structure so that "float2 Tex0" becomes "float3 Tex0". Then you can output vertice z position like this
Code:
Out.Tex0.z = Out.Pos.z;
.
And then input this in your pixel shader and you will get the height of any given pixel, use something like this

Code:
float VerticeHeight = In.Tex0.z
.
 
I tried to use "Updated Water Travel" and i got these errors, any help? thanks.


Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_party_tmps.py", line 2, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_parties.py", line 4, in <module>
    from module_game_menus import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_game_menu
s.py", line 4105
    ),
    ^
IndentationError: unexpected indent
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_game_menus.py", line 5, in <module>
    from module_game_menus import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_game_menu
s.py", line 4105
    ),
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\process_operatio
ns.py", line 17, in <module>
    from module_party_templates import *
  File "C:\Users\Asus\Desktop\Module System\Module_system 1.166\module_party_tem
plates.py", line 162, in <module>
    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
NameError: name 'party_get_current_terrain' is not defined
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
In WB's item scabbards, there is have an vertex animation for equip and unequip the items, but i dont know how to do that for my swords. So, how can i make a scabbard vertex animation ? is it something like copying and pasting the rigg ?
 
HyperCharge said:
In WB's item scabbards, there is have an vertex animation for equip and unequip the items, but i dont know how to do that for my swords. So, how can i make a scabbard vertex animation ? is it something like copying and pasting the rigg ?
Its not rigged so no you cant do that - vertex animations involve no bones and simply move individual vertices. In the context of scabbards, you can think of them as two different versions of the same mesh (notice each frame contains the same number of vertices so they are the same mesh - the position of vertices is the only thing which is different). You can create your own in a modelling program by creating a version with the sword hilt, export this version, the import it as normal in openbrf. Then go back to your modelling program and edit the mesh so that the sword handle is not visible (e.g scale it and hide it inside the scabbard), then export this, and then in openbrf select your initial sword hilt version and then go to import and then import the new version as a frame of vertex animated mesh. You will have to set up your frame numbers in the same way as warbands scabbards are set up though.
 
You can cheat exp on regular troops, it's just weird and applies globally. Either make dedicated duplicates of troops for players (assuming they're "elite" troops anyway) or construct your own custom upgrade menu and apply them to the troops in player's party in the context of a mission. Second part is probably impossible (if you're talking about hero health vs stack size) without stuff that plays with player party composition while in the hard-coded presentation - you probably don't want to do that.
 
Hello reformists,
I added this menu,
(
    "aban",0,
    "2 kez bura gelmen dikkat cekti",
    "none",
    [(set_background_mesh, "mesh_pic_khergit")],
    [
     
      ("devam",[],"Continue..",[(set_jump_mission,"mt_aban"),(jump_to_scene,"scn_aban"),(change_screen_mission),]),
    #("leave",[],"Leave.",[(party_relocate_near_party, "p_main_party", "p_town_19"),(change_screen_return)]),(change_screen_map),
    ]
  ),
then When I entered scn_aban some troops attack me.
and this mission:
(
    "aban",0,-1,
    "Default town visit",
    [#(0,mtef_scene_source|mtef_team_0,0,0,1,[]),
  (1,mtef_defenders|mtef_team_0,0,0,12,[]),
    # (0,mtef_defenders|mtef_team_0,0,0,0,[]),
   
  #(0,mtef_scene_source|mtef_team_0, af_override_horse, aif_start_alarmed, 1, pilgrim_disguise),
   
    ],
    [
     

      (ti_before_mission_start, 0, 0, [], [(call_script, "script_change_banners_and_chest")]),

      common_inventory_not_available,
     
      (ti_tab_pressed, 0, 0,
      [
        (display_message, "str_cannot_leave_now"),
        ], []),
    # (ti_on_leave_area, 0, ti_once, [],
    #  [(assign,"$auto_menu",-1),(jump_to_menu,"mnu_sharizkalebasarili3"),(finish_mission,0)]),
     

      (0, 0, ti_once, [],
      [
        (call_script, "script_music_set_situation_with_culture", mtf_sit_ambushed),
       
        ]),
      (ti_on_leave_area, 0, 0,
      [
        (try_begin),
          (eq, "$g_defending_against_siege", 0),
          (assign,"$g_leave_town",1),
        (try_end),
        ], []),
      (0, 0, 0,
      [
        (eq, "$kergitdevriye", 0),
      ],
      [
       
       

        (try_for_agents, ":agent_no"),
          (agent_get_troop_id, ":troop_no", ":agent_no"),
          (eq, ":troop_no", "trp_kergit_devriye"),
         
           
          (assign, "$talk_context", tc_back_alley),   
          (start_mission_conversation, ":troop_no"),
        (try_end),
      ]),

     
     
      (1, 2, ti_once,
      [
        (store_mission_timer_a,":cur_time"),
        (ge, ":cur_time", 5),
        (this_or_next|main_hero_fallen),
        (num_active_teams_le,1)
        ],
      [
        (try_begin),
          (main_hero_fallen),
          (jump_to_menu, "mnu_aban_basarisiz"),
        (else_try),
          (jump_to_menu, "mnu_aban_basarili"),

        (try_end),
        (finish_mission),
        ]),
      dismemberment_mod_decap,
      dismemberment_mod_hands1,
      dismemberment_mod_hands2,
      dismemberment_mod_arms1,
      dismemberment_mod_arms2,
      dismemberment_mod_hotkeys,
    toggle_dismemberment,
    random_mixed_gender,
      ],
   
    ),
When I defeated or win game doesn't jump menu_aban_basarili or mnu_aban_basarisiz, anyone have idea?
and this other menus:
(
    "aban_basarili",0,
    "hepsi oldu ve sende ordna ayrildin",
    "none",
    [(set_background_mesh, "mesh_pic_escape_1")],
    [
     
      ("devam",[],"Continue..",[(call_script, "script_change_player_relation_with_faction", "fac_kingdom_3", -20),
  (setup_quest_text, "qst_diger_komplo"),
(str_store_string, s2, "str_diger_komplo"),(call_script,"script_start_quest","qst_diger_komplo","trp_kingdom_1_lord"),
(assign, "$diger_komplo",1),]),
  #("leave",[],"Leave.",[(party_relocate_near_party, "p_main_party", "p_town_19"),(change_screen_return)]),(change_screen_map),
    ]
  ),
  (
    "aban_basarisiz",0,
    "basarisiz oldun",
    "none",
    [(set_background_mesh, "mesh_pic_prisoner_man")],
    [
     
      ("devam",[],"Continue..",[(change_screen_quit)]),
  #("leave",[],"Leave.",[(party_relocate_near_party, "p_main_party", "p_town_19"),(change_screen_return)]),(change_screen_map),
    ]
  ),

edit:Solved, I must enter anyone scene.
 
I'm having a problem in custom battles where both opponents start the battle on top of each other as if they have the same entry points.
BW uses the exact same code as other mods like Lav's native source files and he doesn't have the same problem.

My question: I would like to edit scenes that I can't access in-game easily quick battle scenes.
I don't want to be chased by a pack of wild saxons while I try to figure out why

What's the best tool to use for this?

I would also like to be able to easily access scenes without being in-game.
thanks!
 
gdwitt said:
My question: I would like to edit scenes that I can't access in-game easily quick battle scenes.

Create a presentation with a number entry field. Use it to jump to a scene.

Or create a dynamic menu with all scenes in the game (there is a OSP pack for that) using Python.

Or if you can't get those two to work: use any shortcut (like a trigger with a key clicked operation) to jump to a specific scene. Change it on your txt or modules source.
 
Status
Not open for further replies.
Back
Top Bottom