Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Oh, you couch manually?  :shock:
I'm so bad at the game I didn't even consider the possibility of someone else manually using the lance.  :lol:

Anyway, you can rebind the function to another key, either by code or by changing it from Options. I'd lean towards the latter, since ity will be only for a couple of items.
 
Antonis said:
Oh, you couch manually?  :shock:
I'm so bad at the game I didn't even consider the possibility of someone else manually using the lance.  :lol:

Anyway, you can rebind the function to another key, either by code or by changing it from Options. I'd lean towards the latter, since ity will be only for a couple of items.

Yeah, I initially started doing it because I thought that automatic couching looked ugly when it always triggered at top speed. Then I just got good at using it and kept it that way.

If I rebound the function in options though, wouldn't that apply to all weapons with an alternate mode?
 
Just a quick question.

I've been playing around with Somebody's Diplomacy mod source code.
I've noticed that upon using quicksave (F12) text notifications don't pop up in game.
Where can I find the related strings?
 
hi, i have a problem in dialogs:

EipypQ.png

I want him to give me the narsil sword when the mission is over,  but he gives the river pirate after every hunt. what should I do for this?
he gives sword in starting with "Ah, Yes..." dialog
 
I answered the above on the Modding Discord, but for anyone not on there and having a similar issue, Here's what I said:
[quote author=dstn|Sionfel|SupaNinjaMan]
The code in question is cut off in your screenshot, so I cannot see if you did the consequences block right, but there are a few problems.

You use the dialog name pay_for_river_pirates_3 two different times with the condition block of the first one being always true if you completed even a single quest, which then points to a close_window. I'd recommend changing the condition block of the earlier pay_for_river_pirates_3 or rename the later one and change constable_hareck_reward_2 so that it no longer points to close_window and now points to whatever the new name of your narsil dialogue is

Reading that back, do the second one.
[/quote]

But that was on mobile so it was a pretty half-assed answer, now that I'm on my desktop, here's something with a little more meat to help people looking for dialog help in the future.
Code:
[speaker_troop_id, "dialog_state", [(conditions_block)], "dialog_string", "ending_dialog_state", [consequences_block], "voice_acting_string"],

When solving issues with dialogs you'll want to look at a few things
[list type=decimal]
[*]That the dialog tree can be reached by the proper speaker (Not a problem in this case)
[*]If this isn't the first piece of dialog in the tree, that its name (called dialog_state in the schema provided) is referenced by the previously accessed statement's ending_dialog_state (in the above example, it is technically pointed to, but there are two dialogs with that same dialog_state making it call for the first one with a true conditions_block, FIFO and all that.)
[*]That the conditions_block makes sense in a way that the dialog_state in question can be properly triggered (In the above example it's hard to tell if those values are ever false, and it will always choose the first acceptable dialog_state where the conditions are true)
[*]That the consequences_block is properly written so that when the dialog happens the result is always what you expect it to be. (uncertain in the provided example as we cannot see the consequence block)
[/list]

Personally I would leave the Constable Hareck stuff as is and change the second pay_for_river_pirates_3 to like constable_hareck_reward_3 and change constable_hareck_reward_2 to point to it instead of having the ending_dialog_state of close_window.

But the conditions block of the first pay_for_river_pirates_3 reads to me like it always fires but then again the global variables it looks towards don't seem to be referenced in earlier dialog and seems dependant on older systems so the whole shebang might be in need of an update ¯\_(ツ)_/¯
 
Thanks Ninja!
I will try when I turn on the computer.

Ninja, this is the full code.
It's better if you look here to understand my mistake.

[trp_constable_hareck,"start", [(eq,"$constable_announcement",0)],
"Hear me, people of Zendar, for I bear a message from our town's lord and protector, Count Arrasies.\
As you know, bands of river pirates have infested the vicinity of our town.\
These lawless villains devastate our realm, pillaging, robbing and murdering the innocent.\
The mischief and suffering caused by these scum has become intolerable.\
Thus, our good Count has found it necessary to call to arms his honest and law-abiding subjects against these murderous villains.",
  "constable_hareck_introduce_1",[(assign,"$constable_announcement",1)]],
  [trp_constable_hareck,"constable_hareck_introduce_1", [],
"People of Zendar, our Count invites you to serve him in this cause.\
Those of you that volunteer now will be equipped with arms and armor at the Count's expense\
and shall be granted the right to hunt down the river pirates, ending their miserable lives by death or imprisonment,\
and keeping their ill-gotten gains to yourselves without tax or tribute.\
Moreover, you will be paid a reward of 200 denars from the Count's treasury for every river pirate group you vanquish.", "close_window",[]],

  [trp_constable_hareck,"start", [], "What do you want?", "constable_hareck_talk",[]],

  [trp_constable_hareck|plyr,"constable_hareck_talk", [(eq,"$quest_accepted_zendar_river_pirates",0)],
"I want to sign up to hunt down the river pirates.", "constable_hareck_signup_1",[]],
  [trp_constable_hareck,"constable_hareck_signup_1", [], "Have you worked as a manhunter before?", "constable_hareck_signup_2",[]],
  [trp_constable_hareck|plyr,"constable_hareck_signup_2", [], "Yes I have.", "constable_hareck_signup_3",[]],
  [trp_constable_hareck|plyr,"constable_hareck_signup_2", [], "Not really. But I learn quickly", "constable_hareck_signup_3",[]],
  [trp_constable_hareck,"constable_hareck_signup_3", [],
"That's more than enough for me. Well then. I charge you to hunt down river pirates around Zendar,\
and give you this shield from the Count's armory.\
May God make you victorious.", "constable_hareck_signup_4",[(assign,"$quest_accepted_zendar_river_pirates",1),(start_quest,"qst_hunt_down_river_pirates"),(setup_quest_text, "qst_hunt_down_river_pirates"),(str_store_string, s2, "str_hunt_down_river_pirates"),(troop_add_item, "trp_player","itm_wooden_shield",imod_battered)]],
  [trp_constable_hareck|plyr,"constable_hareck_signup_4", [], "Is that all?", "constable_hareck_signup_5",[]],
  [trp_constable_hareck,"constable_hareck_signup_5", [], "What else do you want, a good luck kiss?\
Now stop chattering and go kill some outlaws. You have to work hard to deserve that shield.", "close_window",[]],
 
  [trp_constable_hareck,"sell_prisoner_outlaws_finished", [], "Well done my {boy/girl}. .", "close_window",[]],

 
  [trp_constable_hareck|plyr,"constable_hareck_talk", [
      (store_num_parties_destroyed_by_player, ":num_river_pirates_destroyed", "pt_river_pirates"),
      (val_min,":num_river_pirates_destroyed",num_max_river_pirates),
      (lt,"$river_pirates_paid_for",":num_river_pirates_destroyed")],
  "I have hunted down some river pirates.", "pay_for_river_pirates",[]],
  [trp_constable_hareck,"pay_for_river_pirates", [],
  "Yes, my scouts informed me. That should make them think twice before wandering near Zendar! Anyway, the reward is 200 denars for every river pirate party. Here is your money, as promised.",
  "pay_for_river_pirates_2",[(store_num_parties_destroyed_by_player, ":num_river_pirates_destroyed", "pt_river_pirates"),
                              (val_min,":num_river_pirates_destroyed",num_max_river_pirates),
                              (store_sub,":river_pirate_bounty",":num_river_pirates_destroyed","$river_pirates_paid_for"),
                              (val_mul,":river_pirate_bounty",200),
                              (troop_add_gold,"trp_player",":river_pirate_bounty"),
                              (assign,"$river_pirates_paid_for",":num_river_pirates_destroyed")]],
  [trp_constable_hareck|plyr,"pay_for_river_pirates_2", [],
  "Thank you, sir.", "pay_for_river_pirates_3",[]],
  [trp_constable_hareck,"pay_for_river_pirates_3", [(neq,"$quest_complete_zendar_river_pirates",0),(eq,"$quest_complete_zendar_river_pirates_ack",0)],
"You certainly deserved your pay. Thanks to hunters like you most of the river pirates have been dealt with.\
The few remaining do not pose a threat any longer. So I thank you in the name of the town of Zendar. You did a mighty good job.","constable_hareck_reward_1",[[add_xp_as_reward,2000],[complete_quest,"qst_hunt_down_river_pirates"],[assign,"$quest_complete_zendar_river_pirates_ack",1]]],
  [trp_constable_hareck|plyr,"constable_hareck_reward_1", [], "Thank you sir. But does that mean you won't be paying any more rewards?", "constable_hareck_reward_2",[]],
  [trp_constable_hareck,"constable_hareck_reward_2", [], "You got that right.\
The truth is, the count's accountant has found out that rewards cost him more than the pirates do.\
So, that means no more rewards for those filthy pirates.\
Nothing is stopping you from taking your own reward from their packs and hideouts, though.", "close_window",[]],
  [trp_constable_hareck,"pay_for_river_pirates_3", [], "Ah, yes... I almost forgot, I have a gift for you. A very mysterious and legendary sword. I'm sure you'il use it well. Good luck...", "close_window",  [(troop_add_item,"trp_player","itm_narsil")]],
 
  [trp_constable_hareck|plyr,"constable_hareck_talk", [], "Nothing. Good-bye.", "close_window",[]],
 
Can i force realistic headshot in module? I mean you can easily enable it by documents but is there anyway to force it in module itself to run no matter if player enabled or disabled it from documents?
 
So I'm using this
Code:
	(troop_get_inventory_capacity, ":player_inventory", "trp_player"),
	(val_sub, ":player_inventory", 9),
	(assign, ":total_items", 0),

        (create_combo_label_overlay, "$g_presentation_obj_admin_panel_19"),
        (overlay_set_position, "$g_presentation_obj_admin_panel_19", pos1),
		(try_for_range, ":item_slot", 10, ":player_inventory"),
			(troop_get_inventory_slot, ":inventory_item", "trp_player", ":item_slot"),
			(neq, ":inventory_item", -1),
			(overlay_set_val, "$g_presentation_obj_admin_panel_19", ":total_items"),
			(assign, reg50, ":inventory_item"),
			(str_store_item_name, s12, ":inventory_item"),
			(overlay_add_item, "$g_presentation_obj_admin_panel_19", s12),
			(val_add, ":total_items", 1),
		(try_end),
to add a button to a presentation that allows you to choose an item that exists in your inventory. This adds the button, but I don't know how to pass the selected item on to the script it's meant to modify. In normal usage where I get to dictate the options I use
Code:
overlay_set_val
to set a variable to tell the script what it's going to be using, but I can't wrap my head around how to make it for something like this.

Does anyone have any pointers for me?

Lol, reading that back I notice I have an overlay_set_val in the loop, buuuut, I also do not know why I put that there. I think that was part of a loop to create a the proper (try_begin), (else_try), loop I would normally expect to use for this sort of thing but forgot to comment it out when it failed me. I cannot be certain, tbh. I wrote this loop moments before going to sleep.
 
SupaNinjaMan said:
This adds the button, but I don't know how to pass the selected item on to the script it's meant to modif

look for the trigger ti_on_presentation_event_state_change and how it is used on other presentations
 
I have, and as I said, I've made other presentations using the same combo_label_overlay, but those were fixed lists and so I always knew what event would be 0, 1, 2 and so on. Since this is making the buttons on the fly based on the player's inventory, I don't know how to determine what was created as 0, 1, 2 and so on.
 
Code:
     (try_begin),
       (store_num_parties_of_template, ":num_parties", "pt_darwyr_rangers"),
       (lt,":num_parties",3),
       (set_spawn_radius, 0),
       (spawn_around_party,"p_darwyr_poi_3","pt_darwyr_rangers"),
	   (party_set_ai_behavior, reg0, ai_bhvr_patrol_party),
	   (party_set_ai_object, reg0, "p_darwyr_poi_3"),
	   (party_set_ai_patrol_radius, reg0, 18),
     (try_end),

Am I using party_set_ai_patrol_radius wrong? These idiots wander halfway across the map and don't seem to stop. (while still saying "patrolling around Loagenbrook", aka p_darwyr_poi_3)
 
SupaNinjaMan said:
Since this is making the buttons on the fly

store the button ID on a global and compare if the event object has that ID value

Code:
      (ti_on_presentation_event_state_change, [
          (store_trigger_param_1, ":object"),
          (try_begin),
            (eq, ":object", "$g_my_presentation_button_do_this_whatever"),
 
Is this the proper way to list items sold only by certain factions or is the placement wrong?
It's at the very end.

Code:
["ormeli_scimitar", "Scimitar", [("khergit_sword_d",0),("ormeli_scimitar", ixmesh_carry)], itp_type_one_handed_wpn|itp_merchandise|itp_primary, itc_scimitar|itcf_carry_sword_left_hip|itcf_show_holster_when_drawn, 384 , weight(1.8)|difficulty(0)|spd_rtng(98) | weapon_length(96)|swing_damage(33 , cut),imodbits_sword_high ], [fac_kingdom_3],
 
Silver Wolf said:
Code:
,imodbits_sword_high ], [fac_kingdom_3],

look at the comments on the file

Code:
####################################################################################################################
#  Each item record contains the following fields:
#  1) Item id: used for referencing items in other files.
#     The prefix itm_ is automatically added before each item id.
#  2) Item name. Name of item as it'll appear in inventory window
#  3) List of meshes.  Each mesh record is a tuple containing the following fields:
#    3.1) Mesh name.
#    3.2) Modifier bits that this mesh matches.
#     Note that the first mesh record is the default.
#  4) Item flags. See header_items.py for a list of available flags.
#  5) Item capabilities. Used for which animations this item is used with. See header_items.py for a list of available flags.
#  6) Item value.
#  7) Item stats: Bitwise-or of various stats about the item such as:
#      weight, abundance, difficulty, head_armor, body_armor,leg_armor, etc...
#  8) Modifier bits: Modifiers that can be applied to this item.
#  9) [Optional] Triggers: List of simple triggers to be associated with the item.
#  10) [Optional] Factions: List of factions that item can be found as merchandise.
####################################################################################################################
count the position (faction needs to be on the #10 position) and make sure to close the () and [] properly. This is wrong " imodbits_sword_high], [fac_XXX"

example
Code:
[
 "practice_crossbow",
 "Sling", 
 [("Sling",0)],
 itp_type_pistol|itp_primary|itp_cant_use_on_horseback,
 itcf_shoot_pistol, 
 250 ,
 weight(0.5)|difficulty(0)|spd_rtng(85) | shoot_speed(55) | thrust_damage(20, blunt)|max_ammo(1)|accuracy(90),
 0,
 [],
 [fac_kingdom_20]
],
you can put each position on a line to make it easier to see/read like above
 
Thanks a lot for the explanation!
Sorry for the basic questions, I'm still a beginner.

I do have one more question...
Now that I got rid of all syntax errors, I get this error after compiling the module with W.R.E.C.K. kit:

Code:
Loading module... FAILED.
MODULE `scripts` ERROR:
Traceback (most recent call last):
  File "compile.py", line 109, in <module>
    from module_scripts import *
  File "C:\Program Files (x86)\Steam\steamapps\common\MountBlade Warband\Modules\TEATRC - Empire in Flames\source\module_scripts.py", line 25, in <module>
    from module_items import *
  File "C:\Program Files (x86)\Steam\steamapps\common\MountBlade Warband\Modules\TEATRC - Empire in Flames\source\module_items.py", line 1926

    ^
SyntaxError: invalid syntax


COMPILATION FAILED.

Line 1926 doesn't even exist in module_items.py, and it's preceded by an empty line of code on 1925.
What am I missing?
 
Silver Wolf said:
Line 1926 doesn't even exist in module_items.py, and it's preceded by an empty line of code on 1925.
What am I missing?
you have a error somewhere on your items that is breaking the entire thingy, the compiler is just saying it couldnt load the items list by poiting to the last line. Review your last changes to find your syntax mistake. A easy way to do that is to delete stuff and bring them back in parts to see what breaks where.
 
Gruß Allen,
how can i stop the player rotation? Can i stop the player rotation whenever i use mouse or keyboard without exceptional scripts? Someone advised to use ti_on_agent_turn but since it's bound to WSE it gives error for unrecognized operation and so on. I also tried within animations but there seems not to be any master flag priority to override those inputs.

thanks
 
Status
Not open for further replies.
Back
Top Bottom