Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Any reason why this doesn't work? :???:


Code:
I pasted this over the first #Aftermath talks mission template. (There are two, paste it over the one that comes first)
Code:
	  #Aftermath talks
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
				
		(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
		(agent_is_wounded, "$g_main_attacker_agent"),
      ],
      [
        (mission_enable_talk),
      
		(try_for_agents, ":agent"),
		  (agent_is_alive, ":agent"),
		  (agent_get_position, pos4, ":agent"),
		  (agent_set_scripted_destination, ":agent", pos4),
		(try_end),
               (try_begin),
                                (eq, "$g_main_attacker_agent", "trp_belligerent_drunk"),
				(agent_is_wounded, "$g_main_attacker_agent"),
                                (assign, "$belligerent_drunk_wounded", "$g_encountered_party"),
               (try_end),
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),	 
	  ]),

A new simple trigger. :smile:
Code:
  (2,
	[
(try_begin),
(neq, "$belligerent_drunk_wounded", 0),
(set_spawn_radius,0),
(spawn_around_party,"$belligerent_drunk_wounded","pt_drunk"),
(assign,"$belligerent_drunk_wounded",reg(0)),
(party_set_ai_behavior,"$belligerent_drunk_wounded",ai_bhvr_track_party),
(party_set_ai_object,"$belligerent_drunk_wounded","p_main_party"),
(try_end)
	]),

Paste this anywhere above #TAVERN DRUNK DIALOGS (directly above it works fine)
Code:
   [anyone, "start", 
   [
        (eq, "$talk_context", tc_party_encounter),
	(eq, "$g_talk_troop", "trp_belligerent_drunk"),
	],
   "Ah, I've managed to catch up to you before you left.", "drunk_wants_to_join_party", 
   [
   ]],
   [anyone|auto_proceed, "drunk_wants_to_join_party", 
   [
	],
   "", "drunk_wants_to_join_party_1", 
   [
	(store_random_in_range, "$belligerent_drunk_wounded", 0, 2),
   ]],
   [anyone, "drunk_wants_to_join_party_1", 
   [
        (eq, "$belligerent_drunk_wounded", 0),
	],
   "I was not myself in there, and you spared me from death. In the past years, I've lost most of my friends, my wife, and my health to drinking. If you would be willing to accept me into your party, I would be very grateful.", "drunk_wants_to_join_party_can_he", 
   [
        (assign, "$belligerent_drunk_wounded", 0),
   ]],
   [anyone, "drunk_wants_to_join_party_1", 
   [
        (eq, "$belligerent_drunk_wounded", 1),
	],
   "I must admit, that was the first time that I got that drunk. A few days earlier, I was disowned by my father. My father is quite good friends with the lord here, so when I was caught trespassing on the lord's property, he was quite angry. Then, when he forbade me from leaving the house, and again, I disobeyed him. He then disowned me. I spent my last few days on the streets, and my last gold went to the drink. If you could accept me into your party, I would be extremely grateful.", "drunk_wants_to_join_party_can_he", 
   [
        (assign, "$belligerent_drunk_wounded", 0),
   ]],
   [anyone|plyr, "drunk_wants_to_join_party_can_he", 
   [
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), 
     (ge, ":free_capacity", 1),
	],
   "Very well. Welcome to the legion of {playername}!", "close_window", 
   [
     (party_add_members, "p_main_party", "trp_belligerent_drunk", 1),
     (remove_party, "pt_drunk"),
   ]],
   [anyone|plyr, "drunk_wants_to_join_party_can_he", 
   [
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), 
     (lt, ":free_capacity", 1),
	],
   "I'm afraid I don't have room for more men in my party. You have my sincere apologies.", "close_window", 
   [
   (remove_party, "pt_drunk"),
   ]],
   [anyone|plyr, "drunk_wants_to_join_party_can_he", 
   [
	],
   "I have no wish to accept drunkards to my party. Goodbye.", "close_window", 
   [
   (remove_party, "pt_drunk"),
   ]],

Code:
  ("drunk","Beligerent Drunk",icon_peasant,0,fac_innocents,merchant_personality,[(trp_belligerent_drunk,1,1)]),




No errors upon compiling, but just nothing happens in-game. :sad:
 
Why are you adding a trigger for the sole purpose of something that will happen immediately anyway? Instead of doing all that work with the extra trigger, you can spawn a party directly from dialogs (it should work if you get rid of agent_is_wounded, unless you want it to only happen when the player knocks him out). Better yet, get rid of the party following the player with a targeted behaviour and start an encounter directly. Better yet, start a map conversation without the party so there's no clean-up involved (which you don't seem to be doing properly as you are attempting to remove a party template).
Zamensis said:
Is there a way to make some ammunition item increase the accuracy of a ranged weapon? Since it works with damage, I tried to add accuracy stats to some ammo, hoping it would be added to the weapon value when used together, but it didn't work.
Accuracy is linked to the damage of the ranged weapon - which is why you'll see some mods severely nerf bow damage and put most of it in the ammo instead. Do what Lumos recommended, but make sure you're checking the top stack of ammo and whether that stack is empty before checking the next one with its difference in accuracy.
 
This is what I did before, instead of the trigger; it didn't work either: (It doesn't use the trigger, instead it does it straight from the menu when the player leaves town)


Code:
	  #Aftermath talks
      (3, 0, ti_once, 
      [
	    (neg|conversation_screen_is_active),
		(eq, "$talk_context", tc_tavern_talk),
		(gt, "$g_main_attacker_agent", 0),
				
		(this_or_next|neg|agent_is_alive, "$g_main_attacker_agent"),
		(agent_is_wounded, "$g_main_attacker_agent"),
      ],
      [
        (mission_enable_talk),
      
		(try_for_agents, ":agent"),
		  (agent_is_alive, ":agent"),
		  (agent_get_position, pos4, ":agent"),
		  (agent_set_scripted_destination, ":agent", pos4),
		(try_end),
               (try_begin),
                                (eq, "$g_main_attacker_agent", "trp_belligerent_drunk"),
				(agent_is_wounded, "$g_main_attacker_agent"),
                                (assign, "$belligerent_drunk_wounded", 1),
               (try_end),
		(party_get_slot, ":tavernkeeper", "$g_encountered_party", slot_town_tavernkeeper),
		(start_mission_conversation, ":tavernkeeper"),	 
	  ]),

Code:
   [anyone, "start", 
   [
        (eq, "$belligerent_drunk_wounded", 1),
	(eq, "$g_talk_troop", "trp_belligerent_drunk"),
	],
   "Ah, I've managed to catch up to you before you left.", "drunk_wants_to_join_party", 
   [
   ]],
   [anyone|auto_proceed, "drunk_wants_to_join_party", 
   [
	],
   "", "drunk_wants_to_join_party_1", 
   [
	(store_random_in_range, "$belligerent_drunk_wounded", 0, 2),
   ]],
   [anyone, "drunk_wants_to_join_party_1", 
   [
        (eq, "$belligerent_drunk_wounded", 0),
	],
   "I was not myself in there, and you spared me from death. In the past years, I've lost most of my friends, my wife, and my health to drinking. If you would be willing to accept me into your party, I would be very grateful.", "drunk_wants_to_join_party_can_he", 
   [
        (assign, "$belligerent_drunk_wounded", 0),
   ]],
   [anyone, "drunk_wants_to_join_party_1", 
   [
        (eq, "$belligerent_drunk_wounded", 1),
	],
   "I must admit, that was the first time that I got that drunk. A few days earlier, I was disowned by my father. My father is quite good friends with the lord here, so when I was caught trespassing on the lord's property, he was quite angry. Then, when he forbade me from leaving the house, and again, I disobeyed him. He then disowned me. I spent my last few days on the streets, and my last gold went to the drink. If you could accept me into your party, I would be extremely grateful.", "drunk_wants_to_join_party_can_he", 
   [
        (assign, "$belligerent_drunk_wounded", 0),
   ]],
   [anyone|plyr, "drunk_wants_to_join_party_can_he", 
   [
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), 
     (ge, ":free_capacity", 1),
	],
   "Very well. Welcome to the legion of {playername}!", "close_window", 
   [
     (party_add_members, "p_main_party", "trp_belligerent_drunk", 1),
   ]],
   [anyone|plyr, "drunk_wants_to_join_party_can_he", 
   [
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"), 
     (lt, ":free_capacity", 1),
	],
   "I'm afraid I don't have room for more men in my party. You have my sincere apologies.", "close_window", 
   [
   ]],
   [anyone|plyr, "drunk_wants_to_join_party_can_he", 
   [
	],
   "I have no wish to accept drunkards to my party. Goodbye.", "close_window", 
   [
   ]],

Code:
      ("town_leave",[],"Leave...",
      [
        (assign, "$g_permitted_to_center",0),
        (change_screen_return,0),
       
      ],"Leave Area.",
      [
       (try_begin),
      (eq, "$belligerent_drunk_wounded", 1),
      (call_script, "script_get_meeting_scene"), 
      (assign, ":meeting_scene", reg0),
      (set_jump_mission,"mt_conversation_encounter"),
      (jump_to_scene,":meeting_scene"),
      (change_screen_map_conversation, "trp_belligerent_drunk"),	
       (try_end),
      ]),
OR
Code:
      ("town_leave",[],"Leave...",
      [
        (assign, "$g_permitted_to_center",0),
        (change_screen_return,0),
       (try_begin),
        (eq, "$belligerent_drunk_wounded", 1),
      (call_script, "script_get_meeting_scene"), 
      (assign, ":meeting_scene", reg0),
      (set_jump_mission,"mt_conversation_encounter"),
      (jump_to_scene,":meeting_scene"),
      (change_screen_map_conversation, "trp_belligerent_drunk"),	
       (try_end),
      ],"Leave Area."),

That didn't work either. :???:


And yes, I want to use agent_is_wounded, because the whole dialog is about thanking the player for sparing the drunk from death. :???:
 
@Lumos: I might check that as soon as I'm feeling comfortable enough with scripts. Speaking of which...

I successfully assigned one non-default troop type (or troop tree) to some specific lords by adjusting the reinforcement scripts. I then made it able for the the player to recruit the two troop types in a single village. I thought I was finally done with implementing this feature, but I found that lords also get reinforced when they're visiting villages and that here too I have to tell which lords are going to get which volunteers:
Code:
  #Currently called from process_ai_state, could be called from elsewhere
  #It is used for lord to (1)Court ladies (2)Collect rents (3)Look for volunteers
  ("troop_does_business_in_center",
Hoping it's the last thing I need to edit, it try to apply the same trick as before:
At the beginning of the script, I add this:
Code:
("troop_does_business_in_center",
  [
    (store_script_param, ":troop_no", 1),
    (store_script_param, ":center_no", 2),
### These two lines :
	(store_script_param, ":party_no", 3),
	(party_stack_get_troop_id, ":party_leader", ":party_no", 0),
A few lines further, I put the same kind of conditions as before:
Code:
(try_begin),
(this_or_next|eq, ":party_leader", "trp_knight_1_10"),
(this_or_next|eq, ":party_leader", "trp_knight_1_11"),
...

Compiling goes fine but, once in game, I have an error saying:
Code:
SCRIPT ERROR ON OPCODE 23: Invalid Script Parameter ID:2; LINE NO:2:
At script: troop_does_business_in_center
I understand that I probably made something stupid in the beginning but what?
 
So what are you suggesting? I thought I was storing party so that I could store the troop ID of their leader, so that I could put it as a condition to determine which type of troop to use as a volunteer. I was wrong obviously but I still don't understand.
 
Script parameter 1 (stored in :troop_no) is already the lord doing the business.

For the record, the reason you're getting an error is probably because you didn't change where the script is called. It'll be something like (call_script, "script_troop_does_business_in_center", ":commander", ":party_is_in_town"), where ':commander' is script param 1 and ':party_is_in_town' number 2. If you want to store a third parameter you have to add it to the call_script operation.
 
Oh right, so the first parameter will do the trick as well? I'll then have to remove those two lines in the beginning and use ":troop_no" instead of ":party_leader" like this:
Code:
(try_begin),
(this_or_next|eq, ":troop_no", "trp_knight_1_10"),
(this_or_next|eq, ":troop_no", "trp_knight_1_11"),
...
...right? In any case, I don't have an error message anymore.
 
Okay, i have a problem. Can anybody tell me how to correct this:
9ntu.jpg
The bolt is on the "wrong" side of the bow, and the bow is held vertical, and it is supposed to be horizontal.
 
Michadr said:
Okay, i have a problem. Can anybody tell me how to correct this:
9ntu.jpg
The bolt is on the "wrong" side of the bow, and the bow is held vertical, and it is supposed to be horizontal.

Did you already try rotating it with OpenBRF?
 
DanyEle said:
Michadr said:
Okay, i have a problem. Can anybody tell me how to correct this:
9ntu.jpg
The bolt is on the "wrong" side of the bow, and the bow is held vertical, and it is supposed to be horizontal.

Did you already try rotating it with OpenBRF?
Well, that is the problem. I do not know how :/
 
Hello people! I have question that how to change armors on openbrf from vanilla format to warband format? This is real problem with me because some of the shaders of vanilla format armors look none shading in the actuall game but not in openbrf.
 
Knight of calradia said:
Hello people! I have question that how to change armors on openbrf from vanilla format to warband format? This is real problem with me because some of the shaders of vanilla format armors look none shading in the actuall game but not in openbrf.

Save as/warband ressource V1 ? (not m&b ressources at "type")



Any idea for this please ?


FantasyWarrior said:
I'm interested about an animated windmill,and animated water mill and you ?

I don't know for the animations  :neutral:
I just made animated birds like particules based on fall_leaf, but it's not an animation.

I think it's a scene prop with :

  ("windmill",0,"windmill","bo_windmill",
  [
  (ti_on_scene_prop_init,   
   
    [

:?:

        (play_sound, "snd_windmill_turning", sf_looping),

  ]),
  ]),


Or

  ("windmill_fan_turning",sokf_moveable,"windmill_fan_turning","bo_windmill_fan_turning", []),
And module animation ?

Do you have an idea for this please ?

Of course  he must run slowly.


EDIT : the solution is given here :
http://forums.taleworlds.com/index.php/topic,209078.0.html




And if you are interested...i work for better generated grass, the actual grass with grass shader is a little bit...

eMVub.jpg

I want the grass more dark and with shadows ! i try a diferent shader (the same than bush or trees) but not shadow with generated grass).
the solution is : paint with a texture (no generated grass now) a diferent shader like flora shader/ place the grass herself, and...make a transparent model at 2 faces and name it ".lod1"
= new generated grass with shadow and good lighting  :razz: i was make screen shots later...
 
A few days ago, I had a problem with troops getting the same type of weapons multiple times:

Zamensis said:
Somebody said:
What item types are they? The engine doesn't spawns agents with more than 1 item of the same type (so 1 spear/halberd, 1 axe/sword), and Native doesn't have many troops with 3 different item types.
I suspected that indeed. Sorry for the inconvenience.

I forgot it for a while but I actually have this problem. See, these troops have two types of one-handed weapons.

h8vl.png


Here's the code:
Code:
["swadian_inf_multiplayer_ai","3_milicien_vet", "Swadian Sergeants", tf_guarantee_all, no_scene, reserved, fac_kingdom_7, [itm_mace_3,itm_mace_4,itm_spiked_mace,itm_cartridges,itm_swadia_pistol,itm_spiked_helmet,itm_leather_boots,itm_nomad_boots,itm_red_shirt,itm_red_shirt_sp,itm_tabard,itm_1752_tabard_a,itm_1752_tabard_b,itm_1752_tabard_c], level_3_attrib, wpz(120,100,100), knows_common_3, swadian_face_young_1, swadian_face_middle_2 ],

Code:
["spiked_mace",         "Spiked Mace 28b", [("spiked_mace_new",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip,180 , weight(3.5)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(28 , blunt) | thrust_damage(0 ,  pierce),imodbits_pick ],
["mace_3",         "SpikedDick 23", [("mace_c",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 152 , weight(2.75)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(23 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
["mace_4",         "Winged 24", [("mace_b",0)], itp_type_one_handed_wpn|itp_can_knock_down|itp_merchandise| itp_primary|itp_wooden_parry, itc_scimitar|itcf_carry_mace_left_hip, 212 , weight(2.75)|difficulty(0)|spd_rtng(98) | weapon_length(70)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
 
Oh, that's just multiplayer, there's some differences in the items agents spawn with (they all turned out to be clones) and I believe I gave them just one item set. If you want variety, you can always add more bot types (as long as you adjust the presentation box).
 
Status
Not open for further replies.
Back
Top Bottom