Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
DtheHun said:
KratosMKII said:
DtheHun said:
kalarhan said:
DtheHun said:
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.

You can download the DLC from TW website. You can’t play it, but that doesn’t stop you from looking at the code (which is open source) or checking the assets (which are not open source, they are limited for submods).

Plus the DLC uses the same engine as Native. What works there (code wise) can be used on any warband.exe mod
 
kalarhan said:
DtheHun said:
KratosMKII said:
DtheHun said:
kalarhan said:
DtheHun said:
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.

You can download the DLC from TW website. You can’t play it, but that doesn’t stop you from looking at the code (which is open source) or checking the assets (which are not open source, they are limited for submods).

Plus the DLC uses the same engine as Native. What works there (code wise) can be used on any warband.exe mod

Thanks, I didn't know about the freely inspectable VC assets - I have found the naked OSP code somewhere else.
I hope BL will have some public docs. It's strange to to dig in MBScripts just like ten years before to get some flag info.
 
For those who are still wondering, itp_covers_hair_partially apparently causes the hair mesh to switch to its alternate frame if it has one, like this:
MHrSt.jpg

Meaning the solution is vertex animation (which I guess makes sense but by golly I really would've preferred having separate meshes)
 
Fredelios said:
For those who are still wondering, itp_covers_hair_partially apparently causes the hair mesh to switch to its alternate frame if it has one, like this:
MHrSt.jpg

Meaning the solution is vertex animation (which I guess makes sense but by golly I really would've preferred having separate meshes)
Many thanks! Just what I needed! :grin:
 
litdum said:
"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?
I searched "scn_conversation_scene" in entire modsys. But the only one i found is this:
module_game_menus.py said:
  (
    "castle_meeting_selected",0,
    "Your request for a meeting is relayed inside, and finally {s6} appears in the courtyard to speak with you.",
    "none",
    [(str_store_troop_name, s6, "$castle_meeting_selected_troop")],
    [
      ("continue",[],
      "Continue...",
      [(jump_to_menu, "mnu_castle_outside"),
#        (modify_visitors_at_site,"scn_conversation_scene"),(reset_visitors),
#        (set_visitor,0,"trp_player"),
#        (set_visitor,17,"$castle_meeting_selected_troop"),
#        (set_jump_mission,"mt_conversation_encounter"),
#        (jump_to_scene,"scn_conversation_scene"),
      (call_script, "script_setup_troop_meeting", "$castle_meeting_selected_troop", -1),
        (assign, "$talk_context", tc_castle_gate),
        (change_screen_map_conversation, "$castle_meeting_selected_troop"),
        ]),
    ]
  ),
I replaced it with the balded line. I am trying to do the same thing for conversation with the troops in the player party as well. Is there any way?

Second question:
Code:
#script_game_on_disembark:
  # This script is called from the game engine when the player reaches the shore with a ship.
  # INPUT: pos0 = disembark position
  # OUTPUT: none
  ("game_on_disembark",
   [(jump_to_menu, "mnu_disembark"),
  ]),
It says the script is called from the engine, so probably there is nothing i can do but just in case still i am asking:
It sometimes doesn't jump to the disembark menu even if i reached the shore. My guessing is that pos0 values changed by another simple_trigger when that happened, so pos0 doesnt represent disembark position sometimes. Is there anyway to force the engine to recheck that pos0(disembark position)? or any other way to solve this issue?
 
litdum said:
I searched "scn_conversation_scene" i

It says the script is called from the engine, so probably there is nothing i can do but just in case still i am asking:

There is a mix here as some code is done directly on menus, while others use the scripts

Code:
script_setup_troop_meeting = 159
script_setup_party_meeting = 160
script_get_meeting_scene = 161
For the dialogs.

Sea stuff:
VC uses the script "map_sea_ai_2" for that (called by a simple trigger), but they have special conditions related to port towns. In any case you can check how they decide if a party should change terrains (distance, terrain, flags, ...) for a example
 
First of all, Thank you for the answer
kalarhan said:
There is a mix here as some code is done directly on menus, while others use the scripts

Code:
script_setup_troop_meeting = 159
script_setup_party_meeting = 160
script_get_meeting_scene = 161
For the dialogs.
  #script_setup_troop_meeting:
  # INPUT:
  # param1: troop_id with which meeting will be made.
  # param2: troop_dna (optional)

  ("setup_troop_meeting",
    [
      (store_script_param_1, ":meeting_troop"),
      (store_script_param_2, ":troop_dna"),
      (call_script, "script_get_meeting_scene"),
      (assign, ":meeting_scene", reg0),
      (modify_visitors_at_site,":meeting_scene"),
      (reset_visitors),
      (set_visitor,0,"trp_player"),
  (try_begin),
(gt, ":troop_dna", -1),
        (set_visitor,17,":meeting_troop",":troop_dna"),
  (else_try),
        (set_visitor,17,":meeting_troop"),
  (try_end),
      (set_jump_mission,"mt_conversation_encounter"),
      (jump_to_scene,":meeting_scene"),
      (change_screen_map_conversation, ":meeting_troop"),
  ]),
 
  #script_setup_party_meeting:
  # INPUT:
  # param1: Party-id with which meeting will be made.
  ("setup_party_meeting",
    [
      (store_script_param_1, ":meeting_party"),
      (try_begin),
        (lt, "$g_encountered_party_relation", 0), #hostile
#        (call_script, "script_music_set_situation_with_culture", mtf_sit_encounter_hostile),
      (try_end),
      (call_script, "script_get_meeting_scene"), (assign, ":meeting_scene", reg0),
      (party_get_current_terrain, ":terrain_type", "p_main_party"),
      (try_begin), #litdum
        (eq, ":terrain_type", rt_water),
        (set_jump_mission,"mt_conversation_encounter_sea"), # Remove horses on the ship.
      (else_try),
        (set_jump_mission,"mt_conversation_encounter"),
      (try_end),
      (modify_visitors_at_site,":meeting_scene"),(reset_visitors),
      (set_visitor,0,"trp_player"),
      (party_stack_get_troop_id, ":meeting_troop",":meeting_party",0),
      (party_stack_get_troop_dna,":troop_dna",":meeting_party",0),
      (set_visitor,17,":meeting_troop",":troop_dna"),
      (jump_to_scene,":meeting_scene"),
      (change_screen_map_conversation, ":meeting_troop"),
  ]),
  #script_get_meeting_scene:
  # INPUT: none
  # OUTPUT: reg0 contain suitable scene_no

  ("get_meeting_scene",
    [
      (party_get_current_terrain, ":terrain_type", "p_main_party"),
      (assign, ":scene_to_use", "scn_random_scene"),
      (try_begin),
        (eq, ":terrain_type", rt_steppe),
        (assign, ":scene_to_use", "scn_meeting_scene_steppe"),
      (else_try),
        (eq, ":terrain_type", rt_plain),
        (assign, ":scene_to_use", "scn_meeting_scene_plain"),
      (else_try),
        (eq, ":terrain_type", rt_snow),
        (assign, ":scene_to_use", "scn_meeting_scene_snow"),
      (else_try),
        (eq, ":terrain_type", rt_desert),
        (assign, ":scene_to_use", "scn_meeting_scene_desert"),
      (else_try),
        (eq, ":terrain_type", rt_steppe_forest),
        (assign, ":scene_to_use", "scn_meeting_scene_steppe"),
      (else_try),
        (eq, ":terrain_type", rt_forest),
        (assign, ":scene_to_use", "scn_meeting_scene_plain"),
      (else_try),
        (eq, ":terrain_type", rt_snow_forest),
        (assign, ":scene_to_use", "scn_meeting_scene_snow"),
      (else_try),
        (eq, ":terrain_type", rt_desert_forest),
        (assign, ":scene_to_use", "scn_meeting_scene_desert"),
      (else_try), #litdum
        (eq, ":terrain_type", rt_water),
        (assign, ":scene_to_use", "scn_meeting_scene_sea"),
      (else_try),
        (assign, ":scene_to_use", "scn_meeting_scene_plain"),
      (try_end),
      (assign, reg0, ":scene_to_use"),
  ]),
None of these script jump to scn_conversation_scene. Actually what i am trying to do is making all map conversations use that three scripts but if we talk the troop in player's party via "Talk" button on the party window, it use the scn_conversation_scene.

kalarhan said:
Sea stuff:
VC uses the script "map_sea_ai_2" for that (called by a simple trigger), but they have special conditions related to port towns. In any case you can check how they decide if a party should change terrains (distance, terrain, flags, ...) for a example
I checked VC codes. It seems it uses the distance between the ship party and centers to check if the ship is on the shore, as far as i understand. And it gave me an idea:
The only way to direct the ship to the land is directing it to a center. So if the ships position on the map doesn't change for 1 or 2 hours while it is directed to a center, that means it stucked to the shore. So i wrote that trigger:
Code:
(0.1, 2.0, 0, [
    (party_get_current_terrain, ":terrain", "p_main_party"),
    (eq, ":terrain", 0),
    (get_party_ai_behavior, ":ai_behavior", "p_main_party"),
    (assign, reg4, ":ai_behavior"),
    (display_message, "@AI behavior: {reg4}"),
    (party_get_slot, ":ai_object", "p_main_party", slot_party_ai_object),
    (str_store_party_name, s1, ":ai_object"),
    (display_message, "@AI object from slot: {s1}"),
    (get_party_ai_object, ":ai_object_op", "p_main_party"),
    (str_store_party_name, s2, ":ai_object_op"),
    (display_message, "@AI object from op: {s2}"),
    (eq, ":ai_behavior", ai_bhvr_travel_to_party),
#    (get_party_ai_object, ":ai_object", "p_main_party"),
    (is_between, ":ai_object", centers_begin, centers_end),
    (party_get_position, 50, "p_main_party"),
    ],
    [
    (party_get_current_terrain, ":terrain", "p_main_party"),
    (eq, ":terrain", 0),
    (get_party_ai_behavior, ":ai_behavior", "p_main_party"),
    (eq, ":ai_behavior", ai_bhvr_travel_to_party),
#    (get_party_ai_object, ":ai_object", "p_main_party"),
    (party_get_slot, ":ai_object", "p_main_party", slot_party_ai_object),
    (is_between, ":ai_object", centers_begin, centers_end),
    (party_get_position, pos2, "p_main_party"),
    (get_distance_between_positions_in_meters, ":distance", pos2, 50),
    (le, ":distance", 1), # 1 meter - after 2 hours main party still on the same position, which means it stucked the shore
    (jump_to_menu, "mnu_disembark"),
    ]),
But when i checked during the game, main party's ai behavior or ai_object from both via the slot and the operation  They are always "0"  no matter what the ship is doing. What may be the mistake in the trigger?
 
litdum said:
None of these script jump to scn_conversation_scene. Actually what i am trying to do is making all map conversations use that three scripts but if we talk the troop in player's party via "Talk" button on the party window, it use the scn_conversation_scene.

like mentioned above it is a mix bag. As the scn_conversation_scene is hardcoded (the ID) you would need a hook to intercept it. A example is

Code:
  #script_game_troop_upgrades_button_clicked
  # This script is called from the game engine when the player clicks on said button from the party screen
  # INPUT: arg1 = troop_id
  ("game_troop_upgrades_button_clicked", [
that was added with VC (a new button on the party screen and this script lets you control what happens when you click it).

other actions come from menus (some are hardcoded, some are not). Other are from dialogs. You need to find a point in the code where you can intercept the event and control it.

for dialogs you can check the initial dialogs (they are used for setup of flags) and try to move to another scene (which is easy), in case you cant find another entry point for your feature.
 
Code:
######################################
# GENERIC MEMBER CHAT
######################################
##diplomacy start+ replace instances of {sir/madam} with {my lord/my lady} or {your highness} if appropriate,
#using s0 and script_dplmc_print_subordinate_says_sir_madame_to_s0"
  [anyone,"member_chat", [(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),], "Your orders {s0}?", "regular_member_talk",[]],
  [anyone|plyr,"regular_member_talk", [], "Tell me about yourself", "view_regular_char_requested",[]],
  [anyone,"view_regular_char_requested", [(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),], "Aye {s0}. Let me tell you all there is to know about me.", "do_regular_member_view_char",[[change_screen_view_character]]],
##diplomacy end+
  [anyone,"do_regular_member_view_char", [], "Anything else?", "regular_member_talk",[]],

##diplomacy start+
#Allow viewing (but not changing) of the equipment of the troops you are leading.
#Code credit to rubik's Custom Commander, with minor string changes.
## CC view regular's equipment
  [anyone|plyr,"regular_member_talk", [],
   "Let me see your equipment.", "dplmc_view_regular_inventory", []
  ],
  [anyone,"dplmc_view_regular_inventory",
    [(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),], "Very well {s0}, here is what I am using...", "dplmc_do_view_regular_inventory",#Use {s0} instead of {sir/madam}
    [
      (call_script, "script_dplmc_copy_inventory", "$g_player_troop", "trp_temp_array_a"),
      (call_script, "script_dplmc_copy_inventory", "$g_talk_troop", "trp_temp_array_b"),

      (try_for_range, ":i_slot", 0, 10),
        (troop_get_inventory_slot, ":item", "trp_temp_array_b", ":i_slot"),
        (gt, ":item", -1),
        (troop_get_inventory_slot_modifier, ":imod", "trp_temp_array_b", ":i_slot"),
        (troop_add_item,"trp_temp_array_b", ":item", ":imod"),
        (troop_set_inventory_slot, "trp_temp_array_b", ":i_slot", -1),
      (try_end),

      (change_screen_loot, "trp_temp_array_b"),
    ]],
  [anyone,"dplmc_do_view_regular_inventory", [(call_script, "script_dplmc_print_subordinate_says_sir_madame_to_s0"),],
   "Is that satisfactory, {s0}?", "dplmc_do_view_regular_inventory_2", []#Use {s0} instead of {sir/madam}
  ],
  [anyone|plyr,"dplmc_do_view_regular_inventory_2",
    [
      (call_script, "script_dplmc_copy_inventory", "trp_temp_array_a", "$g_player_troop"),
    ],
   "Indeed.", "do_regular_member_view_char", []
  ],
## CC view regular's equipment
##diplomacy end+

  [anyone|plyr,"regular_member_talk", [], "Nothing. Keep moving.", "close_window",[]],
No flag seems to be used. I am not sure.    Actually i gave up, since it seems hardcoded to change that conversation scene.

The current challenging issue is that i cannot check the main party's ai_object and behavior. I checked if the problem is that the main party is on the water and the result is same, either the op(get_party_ai_object) or the slot(slot_party_ai_object) doesn't work for p_main_party on land as well.  I couldn't figure out what the problem is. Is there any way to check main party's ai object and behavior?
 
litdum said:
No flag seems to be used

hum guess you didnt understand the dialog bit. Look at the very first dialog. Notice how it never fires. It is a fake dialog. It is only used to check conditions and set flags for the other dialogs. Same for the second one. That is why and how you can use the initial dialogs as a fake-engine hook to re-direct stuff and do whatever you want with a conversation event. It is a handy trick.
 
module_dialogs said:
dialogs = [
[anyone ,"start", [(store_conversation_troop, "$g_talk_troop"),
              (store_conversation_agent, "$g_talk_agent"),
              (store_troop_faction, "$g_talk_troop_faction", "$g_talk_troop"),
#                    (troop_get_slot, "$g_talk_troop_relation", "$g_talk_troop", slot_troop_player_relation),
              (call_script, "script_troop_get_player_relation", "$g_talk_troop"),
              (assign, "$g_talk_troop_relation", reg0),
...
...
        (agent_get_party_id, ":agent_party", "$g_talk_agent"),
(try_begin),
(eq, ":agent_party", "p_main_party"),
        (call_script, "script_setup_troop_meeting", "$g_talk_troop", -1),
(try_end),




              (eq, 1, 0)],
"{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],

[anyone ,"member_chat", [ #This one seems specifically what i need to change?
        (store_conversation_troop, "$g_talk_troop"),
              (try_begin),
                  (is_between, "$g_talk_troop", companions_begin, companions_end),
                  (talk_info_show, 1),
                  (call_script, "script_setup_talk_info_companions"),
              (else_try),
                  (is_between, "$g_talk_troop", pretenders_begin, pretenders_end),
                  (talk_info_show, 1),
                  (call_script, "script_setup_talk_info"),
...
...
              (store_conversation_agent, ":agent"),
        (agent_get_party_id, ":agent_party", ":agent"),
(try_begin),
(eq, ":agent_party", "p_main_party"),
        (call_script, "script_setup_troop_meeting", "$g_talk_troop", -1),
(try_end)
,


              (eq, 1, 0)],
"{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],

[anyone ,"event_triggered", [(store_conversation_troop, "$g_talk_troop"),
                    (try_begin),
                        (is_between, "$g_talk_troop", companions_begin, companions_end),
                        (talk_info_show, 1),
                        (call_script, "script_setup_talk_info_companions"),
                    (try_end),
...
...
              (store_conversation_agent, ":agent"),
        (agent_get_party_id, ":agent_party", ":agent"),
(try_begin),
(eq, ":agent_party", "p_main_party"),
        (call_script, "script_setup_troop_meeting", "$g_talk_troop", -1),
(try_end),



              (eq, 1, 0)],
"{!}Warning: This line is never displayed. It is just for storing conversation variables.", "close_window", []],
As far as i understand, these dialogs works before any dialog even they are never displayed, and probably you guide those dialogs. I added the blue lines but it didn't work.

Edit: And i am still trying to figure out the main party ai issue. There must be a way to check main party's ai_object and behavior because its written as "Running from/Following to/Travelling to A_party_name" when mouse is over the player's party but i couldnt find how can i check them.

Another Edit: How can i start the order menu(which is on the left side on the screen). Could it be done only by the engine? I am trying to start it also by another key than the first three order keys and the group selecting keys. Is it possible?
 
Hi, my name is Karol and I am addicted to warband modding :wink:

Usually I try to solve problems on my own, but these little things are hard to test in game and I couldn't find lot of info about them. They are maybe not very important, however the answers could be very interesting. Especially to other modders.

Well, here we are:

1. I have tried to move party from one place to another.  I wanted to move a town. so:

Code:
#(party_set_position, "p_town_24", -206,-162),
#(party_set_position, "p_town_2", -241,-147),
#(party_set_position, "p_castle_50", -234,-141),
#(party_set_position, "p_town_15", -104,130),
#(party_set_position, "p_town_1", -99,185),
#(party_set_position, "p_town_21", 0,120),
#(party_set_position, "p_town_18", 0,-49),
#(party_set_position, "p_town_8", -155,-127),
#(party_set_position, "p_town_4", 126,-92),
#(party_set_position, "p_town_7", 214,114),
#(party_set_position, "p_town_22", 262,122),
#(party_set_position, "p_castle_10", 94,11),


#also tried:

#(position_set_x, pos1, 262),
#(position_set_y, pos1, 122),
#(party_set_position, "p_town_22", pos1),

#(position_set_x, pos1, 94),
#(position_set_y, pos1, 11),
#(party_set_position, "p_castle_10", pos1),

The result was disappointing. All towns appeared in the same place, probably around 0.0 of my map. What I did wrong? My problem was that I don't know if there is a command like ~assign pos1 x y like (assign, pos1, 100, 200), or something like that.

I am aware of map coordinates
https://forums.taleworlds.com/index.php?topic=148483.0
and that
Why I think the answer could be interesting?
Modder can use that function to easy create different versions of the same map. We can change every party name and if we could change place of town we have countless versions just using same map. (think Pirates Sid Meier different time period 1540, 1600, 1660 etc.)  I created some "scenarios" to choose from, with variants balance of power of different factions. Now I would like to make a version of different time. A command to move party is script would be a godsend to me then.

2. Second question. I will try to explain using example. Below is the code for items, grenade-type-like. For example panzerfaust shell:
Code:
["panzerfaust_grenade","Panzerfaust Grenade", [("kranu_3",0),("kranu_3",ixmesh_inventory),("kranu_3",ixmesh_flying_ammo),("kranu_3",ixmesh_carry)], itp_type_bullets|itp_can_penetrate_shield|itp_default_ammo, 0, 2000,weight(2.25)|abundance(10)|weapon_length(10)|thrust_damage(200,blunt)|max_ammo(6),imodbits_missile,

[(ti_on_missile_hit, [	(store_trigger_param_1,":grenadier"),

#GRENADE STATS
(assign, ":damageMin", 75),
(assign, ":damageMax", 250),
(assign, ":radius", 500),
#explosives
(agent_get_troop_id, ":grenadier_troop", ":grenadier"),   (store_skill_level, ":skl_explosives",  "skl_power_throw", ":grenadier_troop"), (val_add, ":skl_explosives", 1),
(val_div, ":damageMin", 10),
(val_div, ":damageMax", 10),
(val_div, ":radius", 10),
(val_mul, ":damageMin", ":skl_explosives"),
(val_mul, ":damageMax", ":skl_explosives"),
(val_mul, ":radius", ":skl_explosives"),
#explosives end
(call_script, "script_create_explosion_panzerfaust", ":grenadier", ":damageMin", ":damageMax", ":radius"),
])]],

So explosion happens only if grenade will hit agent / troop. But when it hits ground, nothing happens. Is there any way to 'tell' grenade to react on hit on ground?

3. Last question is maybe rather ask for opinion, not for solving problem, on changing of time. I wonder, that maybe if game would act not within lets say vanilla max 3 years (me personally never played more than 400-500 days in-game time). And make scale, flow of time very much faster. So maybe WB mod would become more epic, in a sense that if our story could last 'years' we could even make some script for succesions of thrones, our story would become more like a literature, a history novel, if you know what I mean. It is interesting because that opens to a modder new challenges, but also opportunities to make new features, like managing a dynasty (more like CK2, heh). So how interesting a mod could be if it would happen within of 50, 200, 500 years?
My question is: has anyone tried it? I have two personal concerns: 1. There is a 'turbo' mode in-world map, if we hit ctrl-space then world 'happens' faster, is there a way to use same command to make flow of the days faster? O r there is a way to change just some variables and no 'turbo' mode is needed. 2. Second concern - butterfly effect? I find sometimes testing mod that something I changed 2 days a go is affecting 'unpredicted' part of mod or script... But how much disastrous can be changing time in Warband? How do you think?

Thanks in advance for advice :smile:

 
litdum said:
How can i start the order menu(which is on the left side on the screen). Could it be done only by the engine? I am trying to start it also by another key than the first three order keys and the group selecting keys. Is it possible?

prsnt_battle



MadGuarang said:
1. I have tried to move party from one place to another.  I wanted to move a town

operation is
Code:
party_set_position                    = 1626  # (party_set_position, <party_id>, <position>),
                                              # Teleports party to a specified position on the world map.
you also need to be aware of the scale used for distances (think the difference between 1 meter and 1 kilometer)

for info on operations see header_operations.py. Download Lav's modsys for a better version with documentation. For examples of use you can search other moduless (like Native) and see how they use it.

see this example
Code:
      (set_fixed_point_multiplier, 100),
      (position_set_x, pos2,  22000),
      (position_set_y, pos2, -14000),
      (party_set_position, "p_the_fleet", pos2),
the fixed point multiplier is used for the scale.

MadGuarang said:
2. Is there any way to 'tell' grenade to react on hit on ground?
you can track the position of a object and calculate the distance from the ground. When it hits it you can fire a effect.

Code:
position_get_distance_to_ground_level       =  793  # (position_get_distance_to_ground_level, <destination>, <position>),
                                                    # This will measure the distance between position and the ground level, taking scene props and their collision meshes into account. Operation only works on the scenes and cannot be used on the global map.
MadGuarang said:
3. Last question is maybe rather ask for opinion, not for solving problem, on changing of time. I wonder, that maybe if game would act not within lets say vanilla max 3 years (me personally never played more than 400-500 days in-game time). And make scale, flow of time very much faster.
you can do whatever you want with the time scale, calendar, etc.

module.ini has a configuration for passage of time
script "game_get_date_text" control the calendar display. So you can change date, year, how many months make a year, whatever.
you can also use other changes like how fast a party moves (travel speed) to make them faster or slower. And control balance of the game to whatever you want (XP gain, respawn of lords, and so on).
Native is a fast paced game that depends heavily on several small battles while you are lower level (bandits are XP food). That is just how they designed the game. You can do whatever you want with your own design.
 
kalarhan said:
litdum said:
How can i start the order menu(which is on the left side on the screen). Could it be done only by the engine? I am trying to start it also by another key than the first three order keys and the group selecting keys. Is it possible?

prsnt_battle
It may sound silly question but i ve already tried it and it opens order panel(the one on the top screen). Should i need to add any code or fix before (start_presentation, "prsnt_battle"), for order menu to start?
 
@kalarhan thanks very much, ... that cleared a lot. I have Lav and it helped me a lot countless times.

1. I have certain coordinates from ctrl+e warband, eg. -120, 130.    Is there any way to tell what should be value for set_fixed_point_multiplier? Or is there any way to 'translate' warband-game position to the one in warband-module?

I tried this,
Code:
(set_fixed_point_multiplier, 100),	  
(position_set_x, pos1, 21400),
(position_set_y, pos1, 11400),
(party_set_position, "p_town_7", pos1),


(set_fixed_point_multiplier, 100),	 
(position_set_x, pos1, 12600),
(position_set_y, pos1, -9200),
(party_set_position, "p_town_4", pos1),


## in-game ctrl+e:    262,122 
   
(set_fixed_point_multiplier, 100),	  
(position_set_x, pos1, 26200),
(position_set_y, pos1, 12200),
(party_set_position, "p_town_22", pos1),

(set_fixed_point_multiplier, 100),	 
(position_set_x, pos1, 9400),
(position_set_y, pos1, 1100),
(party_set_position, "p_castle_10", pos1),
but all towns appeared in the same place again, however with different coordinates. x:~108 y:~88 
I couldn't find too many examples in native for that...

2. position_get_distance_to_ground_level  - is there any trigger like on_missile_hit_anything or its position has to be checked every second/frame? I am sorry if that's stupid/obvious question, but I am not experienced much with mt.

3. I have tried the module.ini way of changing time, but multiplying time there staggers map for me, and I see I need more radical solution, if I wanna change hours into days. Even when lowered signifcantly world map speed map staggers because lots of things works by slower time (decisions, weather, recruiting, spawning, wars, tournaments, etc.) to change all this.... ufff. But I see a calendar in the main map view. Where else date is displayed, note, messages log. Maybe it is rather a question of changing HOW calendar displays time. To set up lets say "time_scale_script_ which would change way how time would be count. Or find a way to display itself, make it display different numbers.... Just thinking loudly.

#script_game_get_date_text:  # This script is called from the game engine when the date needs to be displayed. - would be probably responsible for that?

Code:
 #script_game_get_date_text:
  # This script is called from the game engine when the date needs to be displayed.
  # INPUT: arg1 = number of days passed since the beginning of the game
  # OUTPUT: result string = date
  ("game_get_date_text",
    [
      (store_script_param_2, ":num_hours"),
      (store_div, ":num_days", ":num_hours", 24),
      (store_add, ":cur_day", ":num_days", 23),
      (assign, ":cur_month", 6),
      (assign, ":cur_year", 6077),
      (assign, ":try_range", 99999),
      (try_for_range, ":unused", 0, ":try_range"),
        (try_begin),
          (this_or_next|eq, ":cur_month", 1),
          (this_or_next|eq, ":cur_month", 3),
          (this_or_next|eq, ":cur_month", 5),
          (this_or_next|eq, ":cur_month", 7),
          (this_or_next|eq, ":cur_month", 8),
          (this_or_next|eq, ":cur_month", 10),
          (eq, ":cur_month", 12),
          (assign, ":month_day_limit", 31),
        (else_try),
          (this_or_next|eq, ":cur_month", 4),
          (this_or_next|eq, ":cur_month", 6),
          (this_or_next|eq, ":cur_month", 9),
          (eq, ":cur_month", 11),
          (assign, ":month_day_limit", 30),
        (else_try),
          (try_begin),
            (store_div, ":cur_year_div_4", ":cur_year", 4),
            (val_mul, ":cur_year_div_4", 4),
            (eq, ":cur_year_div_4", ":cur_year"),
            (assign, ":month_day_limit", 29),
          (else_try),
            (assign, ":month_day_limit", 28),      
          (try_end),
        (try_end),
        (try_begin),
          (gt, ":cur_day", ":month_day_limit"),
          (val_sub, ":cur_day", ":month_day_limit"),
          (val_add, ":cur_month", 1),
          (try_begin),
            (gt, ":cur_month", 12),
            (val_sub, ":cur_month", 12),
            (val_add, ":cur_year", 1),
          (try_end),
        (else_try),
          (assign, ":try_range", 0),
        (try_end),
      (try_end),
      (assign, reg1, ":cur_day"),
      (assign, reg2, ":cur_year"),
      (try_begin),
        (eq, ":cur_month", 1),
        (str_store_string, s1, "str_january_reg1_reg2"),
		(assign, "$season", 4), #at start as it was spring MadG 1spring 2 summer 3 autumn 4 winter
      (else_try),
        (eq, ":cur_month", 2),
		(assign, "$season", 4), 
        (str_store_string, s1, "str_february_reg1_reg2"),
      (else_try),
        (eq, ":cur_month", 3),
		(str_store_string, s1, "str_march_reg1_reg2"),
		(assign, "$season", 1), 
      (else_try),
        (eq, ":cur_month", 4),
        (str_store_string, s1, "str_april_reg1_reg2"),
		(assign, "$season", 1),
      (else_try),
        (eq, ":cur_month", 5),
        (str_store_string, s1, "str_may_reg1_reg2"),
		(assign, "$season", 1), 
      (else_try),
        (eq, ":cur_month", 6),
        (str_store_string, s1, "str_june_reg1_reg2"),
		(assign, "$season", 2), 
      (else_try),
        (eq, ":cur_month", 7),
        (str_store_string, s1, "str_july_reg1_reg2"),
		(assign, "$season", 2), 
      (else_try),
        (eq, ":cur_month", 8),
        (str_store_string, s1, "str_august_reg1_reg2"),
		(assign, "$season", 2), 
      (else_try),
        (eq, ":cur_month", 9),
        (str_store_string, s1, "str_september_reg1_reg2"),
		(assign, "$season", 3), 
      (else_try),
        (eq, ":cur_month", 10),
        (str_store_string, s1, "str_october_reg1_reg2"),
		(assign, "$season", 3), 
      (else_try),
        (eq, ":cur_month", 11),
        (str_store_string, s1, "str_november_reg1_reg2"),
		(assign, "$season", 3), 
      (else_try),
        (eq, ":cur_month", 12),
        (str_store_string, s1, "str_december_reg1_reg2"),
		(assign, "$season", 4), 
      (try_end),
      (set_result_string, s1),
    ]), 

So changing few variables, can that allow manipulate time?
 
MadGuarang said:
1. position of a center

2. position_get_distance_to_ground_level  - is there any trigger like on_missile_hit_anything or its position has to be checked every second/frame? I am sorry if that's stupid/obvious question, but I am not experienced much with mt.

3.So changing few variables, can that allow manipulate time?

1. why are you trying to move a town with code? Why not do it on setup time (module_parties.py)? Why not spawn it (enable it) at a certain position?

To test map coordinates you can use a display_message to print where your party is currently (a example)

To move centers around on a large scale you can use mapping tools (see tool section)

2. see header_triggers.py for the list of triggers

3. that particular script is a display. It has no gameplay impact. It is just a text for your eyes.

game has the concept of units of time (how many units of time since the creation of the world/campaign). For Native worldmap that is counted on hours/seconds. Also the concept of day/night cycle. The rest is up to you.

Want to change a day to 16 hours? Adapt the scale.

Want a new calendar?

Want a slower campaign that takes 30 years? That implies changing a lot of stuff. It is all there, but as you can imagine that will take days/weeks as you learn every mechanic, how it balances out, and how you can adapt it to fit your design. A simple example: re-scale the game from 3 to 30 years. So just multiple the game triggers by 10, change module.ini too, etc, and you have a slow campaign. Would that be fun/work in this format? That is up to you to find out, test and balance.
 
1.
1. why are you trying to move a town with code? Why not do it on setup time (module_parties.py)? Why not spawn it (enable it) at a certain position?

From story-point-of-view:
to easy create different versions of the same map. We can change every party name and if we could change place of town we have countless versions just using same map. (think Pirates Sid Meier different time period 1540, 1600, 1660 etc.)  I created some "scenarios" to choose from, with variants balance of power of different factions. Now I would like to make a version of different time.

From technical-point-of-view: well, I might create another town. But there I had to create another amorer, weapon mechant, copy scn files, generally setting a town takes precious time. Additionally:
# Party disappears from the map. Note that (try_for_parties) will still iterate over disabled parties, so you need to make additional checks with (party_is_active).
disable_party - So says Lav. My concern about certain iterations, messing with enabling or disabling party considering my skills is like asking for troubles. My mod has grown up a lot and I am afraid that like a butterfly effect it will hit some other part of my mod. On the other hand I see so simple solution: party_set_poition. That means that I can change town's name (party_set_name) and then move it to another place so it can 'pretend' another town in the different timeline. With this I can create strategic variants with different towns, castles and villages position. It opens fantastic opportunities to create huge variety of scenarios using same map in a quick manner.

So for now my solution is that: I used parties "Bridge" as I don't use them originally on my map. Then I have manually entered coordinates where I want to move a town.
Code:
 ("Bridge_2","{!}2",icon_bridge_snow_a|pf_is_static|pf_disabled|pf_no_label, no_menu, pt_none, fac_neutral,0,ai_bhvr_hold,0,(-241.44,-147.88),[],4),
and
Code:
(party_get_position, pos1,"p_Bridge_2"),
(party_set_position, "p_town_2", pos1),
Maybe I overlooked, but I wasn't able to see any example so I could learn what 'fixed multiplier' should be set for coordinates for party_set_position command. Nor Native neither other modules I have in posession do not have example of using that command with actual real numbers like
Code:
(set_fixed_point_multiplier, 1000),	 
(position_set_x, pos2, 126),
(position_set_y, pos2, -92),
(party_set_position, "p_town_4", pos2),

or
Code:
(party_set_position, "p_town_4", -123.00, 98.00),
they always use variable like pos1, pos63 and so on. Variables come from commands like party_get_position so it is a closed circle. I just cannot figure what scale should be used. I made several tests with different multipliers and values of coordinates and failed each one. I don't wanna guess, I'd rather understand it.

To test map coordinates you can use a display_message to print where your party is currently (a example)

To move centers around on a large scale you can use mapping tools (see tool section)
I already know coordinates too well. I use constantly Throgrim Map Editor, but it is not the case. I want to create or rather find an easy tool that will allow to freely move parties at a start of the each 'scenario'. I think that probably party_set_position is the easiest way to it, that's it. In one sentence: instead of whole procedure of creating new town I'd rather recycle an already created town with all its slots, etc.



2. see header_triggers.py for the list of triggers

My issue is that I don't know how to understand 'ground'? Is it agent? Does it have any value? I am not sure, is it 'scene prop' - with that unfortunately I did not have any experience.  How it is recognised by game - earth, ground? I couldn't find any example of using position_get_distance_to_ground_level, at least in Native. I will search VC and Reckoning modsys's maybe I will find something there.

If earth / ground is a prop I could use "ti_on_scene_prop_hit". Is ground a scene prop?

3. Yes, yes, Thanks on opinion in that matter. I have made several tests up to the moment. Listed sysmodule commands, scripts that use time. Well it seems a challenge, interesting. I think its too early for my amateur skill to crack on it, but surely I will try to have a bite sometime later. Step by step.

Thank very much for all advices, helped a lot.
 
MadGuarang said:
1. to easy create different versions of the same map. We can change every party name and if we could change place of town we have countless versions just using same map.


2. If earth / ground is a prop I could use "ti_on_scene_prop_hit". Is ground a scene prop?
1. then just move them, which is fine. Just make sure to use the proper terrain on that location, as it can affect spawn of parties around the town and pathfinding.

you should review this basic tutorial on how to work with the different types of variables like reg and pos https://forums.taleworlds.com/index.php/topic,142422.0.html

2. ground is the floor terrain at a position, or in other words, you use that operation to ask: how high is this point from the ground? 10 cm? 100 cm? 0 cm (on the floor itself)? -50 cm (below the terrain)?

see this operation
Code:
position_get_distance_to_terrain            =  792  # (position_get_distance_to_terrain, <destination>, <position>),
                                                    # This will measure the distance between position and terrain below, ignoring all scene props and their collision meshes. Operation only works on the scenes and cannot be used on the global map.
as mentioned above you should check Lav's header_operations. Working with agents? Read the entire section on agents. And so on. In no time you will memorize most basic operations and learn what you can do with the others (even if you dont remember the name). Know that you can do something, where to look for that something, how to find that something, then use that something. It is how you make use of thousands of operations and other settings.
 
Status
Not open for further replies.
Back
Top Bottom