Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
is there any way (or trick) to force a party to have a constant speed on the map? (even if the party will get more troops, or more items, or it is night, the speed remain constat)
 
Somebody said:
You're supposed to have another one linking to the conversation state sandor_master_talk for other values of $g_talk_troop_met. If you want another fallback dialog, do something like this

Code:
anyone, "start", [
  (troop_is_hero, "$g_talk_troop"),
  (eq, "$talk_context", tc_tavern_talk),
  ],
   "u wot m8?", "close_window", [(agent_play_sound, "$g_talk_agent", "snd_encounter_nobleman")]],

Thanks man.


Does anyone know which entry points works for castle interiors? Other than the ones assigned to lords and ladies?

So far I've found that 1, 2, 3, 4, 10 and 11 allows you to assign new npc's, but can't get any others to work.

Also, is there any way to have those NPC's be removed once the town/castle they're in is conquered? To simulate them being executed.
 
Cozur said:
Does anyone know which entry points works for castle interiors? Other than the ones assigned to lords and ladies?

So far I've found that 1, 2, 3, 4, 10 and 11 allows you to assign new npc's, but can't get any others to work.

Try to differentiate between mtef_scene_source and mtef_visitor_source.
 
dunde said:
Cozur said:
Does anyone know which entry points works for castle interiors? Other than the ones assigned to lords and ladies?

So far I've found that 1, 2, 3, 4, 10 and 11 allows you to assign new npc's, but can't get any others to work.

Try to differentiate between mtef_scene_source and mtef_visitor_source.

Yeap, figured that out.
 
does anyone added all the native items to multiplayer?all i am asking is the "(item_set_slot, "itm_", slot_item_multiplayer_item_class, multi_item_class_type_), " part for all the items, because there are too many to add (default are like 250 items, but the total number of items is 601) . It will skip me a lot of time if someone would give me the code.
 
You can do it automatically if you have access to the item flags, damage flags and such. This would probably easier to implement with real python though.
Code:
(try_for_range, ":items", all_items_begin, all_items_end),
  (item_slot_eq, ":items", slot_item_multiplayer_item_class, 0),
  (item_get_type, ":itp", ":items"),
  (assign, ":class", 0),
  (try_begin), #easiest example
    (eq, ":itp", itp_type_horse),
    (item_set_slot, ":items", slot_item_multiplayer_item_class, multi_item_class_type_horse),
  (else_try),
    (is_betwen, ":itp", itp_type_one_handed_wpn, itp_type_arrows),
    (item_get_slot, ":flag", ":items", slot_item_flag),
    (item_get_slot, ":swing_damage", ":items", slot_item_swing_damage),
    (item_get_slot, ":stab_damage", ":items", slot_item_thrust_damage),
    (try_begin), 
      (eq, ":itp", itp_type_polearm),
      (store_and, ":has_flag", ":flag", itp_couchable),
      (try_begin),
        (gt, ":has_flag", 0),
        (assign, ":class", multi_item_class_type_lance),
      (else_try),
        (assign, ":class", multi_item_class_type_spear),
      (try_end),
    (else_try), #blunt
      (ge, ":swing_damage", 512),
      (assign, ":class", multi_item_class_type_blunt),
    (else_try), #pierce
      (is_between, ":swing_damage", 255, 512),
      (assign, ":class",  multi_item_class_type_war_picks),
    (else_try), #cutting, ignore cleavers
      (is_between,  ":swing_damage", 0, 256),
      (store_and, ":has_flag", ":flag", itp_bonus_against_shield),
      (try_begin),
        (eq, ":has_flag", 0),
        (assign, ":class", multi_item_class_type_sword),
      (else_try),
        (assign, ":class", multi_item_class_type_axe),
      (try_end),
      (try_begin), #offset
        (eq, ":itp", itp_type_two_handed_wpn),
        (val_add, ":class", 5),
      (try_end),
    (try_end),
.. 
  (item_set_slot, ":items', slot_item_multiplayer_item_class, ":class"),
  (try_end),
(try_end),
For light/medium armors you can use the imodbits_cloth/armor/plate values.
 
Where in the module system from WFaS can I change the classes which you choose if you play mp? I want add some classes to have more variety.
 
Could really need some help.

Is there any way to make a troop only appear if the scene they appear at is owned by a certain faction?

So when town 16 is owned by faction 9, this guy appears there:

Code:
["sandor", "Sandor Clegane", "Sandor Clegane", tf_hero|tf_guarantee_boots|tf_guarantee_armor|tf_guarantee_shield, scn_town_16_castle|entry(1), reserved, fac_kingdom_9, [itm_sandors_plate_armor,itm_sandors_boots,itm_sandors_sword], def_attrib|level(5), wp(20), knows_common, 0x000000018000c01236db6db6db6db6db00000000001db6f80000000000000000 ],

But if the town is conquered by faction 10, he disappears, to re-appear if the town is re-conqured?
 
I have some stupid questions relation to dialog conditions: :oops:

How can you make it so if you have a positive relation with the outlaws faction (yes I took out max player relation -30) you can have a different dialog with them?

And how can I make it so if you are a lord of kingdom_8 you will have a different dialog with bandits than you would normally have?
 
Lumos said:
First, the
Code:
scn_*|entry(x)
configuration is deprecated.

Not sure I understand that.

Lumos said:
And I believe that last time you were directed to script_enter_court which is everything you need. :razz:

I thought that was for setting which entry points would allow which NPC to be placed. Any chance you could be a bit more specific?
 
cwr said:
How can you make it so if you have a positive relation with the outlaws faction (yes I took out max player relation -30) you can have a different dialog with them?
And how can I make it so if you are a lord of kingdom_8 you will have a different dialog with bandits than you would normally have?
They're both possible. However, it's 00:19 at the time of writing right now, which means that I'm (very soon) going to start losing my mind for the night. I won't be talking you through everything thouroughly, but basically, dialogues are read from start to finish every time one must be used, and the first acceptable is chosen. Therefore, if you want to have specific dialogue options only replacing Native's under certain conditions, you should place them above the dialogue line you want to replace, and put their conditions there.
Let's say that you want to replace the dialogue the player gets with the travelling peasants if it's between late summer and late autumn. Here's the dialogue they've got now:
Code:
[party_tpl|pt_village_farmers,"start", [(eq,"$talk_context",tc_party_encounter),
                                    (agent_play_sound, "$g_talk_agent", "snd_encounter_farmers"),
],
" My {lord/lady}, we're only poor farmers from the village of {s11}. {reg1?We are taking our products to the market at {s12}.:We are returning from the market at {s12} back to our village.}", "village_farmer_talk",
[(party_get_slot, ":target_center", "$g_encountered_party", slot_party_ai_object),
(party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
(party_get_slot, ":market_town", ":home_center", slot_village_market_town),
(str_store_party_name, s11, ":home_center"),
(str_store_party_name, s12, ":market_town"),
(assign, reg1, 1),
(try_begin),
(party_slot_eq, ":target_center", slot_party_type, spt_village),
(assign, reg1, 0),
(try_end),
]],
Therefore, we insert our new dialogue above it and change its conditions, like so:
Code:
#-## NEW CODE
[party_tpl|pt_village_farmers,"start", [
	(eq,"$talk_context",tc_party_encounter),
	(store_current_hours, ":hours"),
	(call_script, "script_game_get_date_text", 0, ":hours"),
	(is_between, s1, "str_july_reg1_reg2", "str_november_reg1_reg2"),
], "It's almost...", "village_farmer_talk_new", []],

[anyone|plyr,"village_farmer_talk_new",   [], "Harvesting season?", "village_farmer_talk_new_2", []],
[anyone		,"village_farmer_talk_new_2", [], "How did you know what I was going to say?", "village_farmer_talk_new_3", []],
[anyone|plyr,"village_farmer_talk_new_3",   [], "Oh, it was naught but a lucky guess.", "close_window", []],
#-## NEW CODE end

[party_tpl|pt_village_farmers,"start", [(eq,"$talk_context",tc_party_encounter),
                                    (agent_play_sound, "$g_talk_agent", "snd_encounter_farmers"),
],
" My {lord/lady}, we're only poor farmers from the village of {s11}. {reg1?We are taking our products to the market at {s12}.:We are returning from the market at {s12} back to our village.}", "village_farmer_talk",
[(party_get_slot, ":target_center", "$g_encountered_party", slot_party_ai_object),
(party_get_slot, ":home_center", "$g_encountered_party", slot_party_home_center),
(party_get_slot, ":market_town", ":home_center", slot_village_market_town),
(str_store_party_name, s11, ":home_center"),
(str_store_party_name, s12, ":market_town"),
(assign, reg1, 1),
(try_begin),
(party_slot_eq, ":target_center", slot_party_type, spt_village),
(assign, reg1, 0),
(try_end),
]],
And now you will get to see the first dialogue if the conditions are met. Of course, you can do whatever you want with this principle.

Now, Cozur...
Cozur said:
Not sure I understand that.
I'm not sure I understand you as well. Just don't use it.
This way of placing people around (scene_*|entry(x) in the troop definition) was the first way of doing it, and it still works, yes. However, you shouldn't use it. It's rigid and static, and it's not made for relocating things. It's made for having a person appear at only one point during the entire game, period. And that's quite boring. Of course, you can use it in extreme special situations, but it's a good practice not to, and you're better off just using the current system of placing people based on certain conditions, like what we need with script_enter_court.

Cozur said:
I thought that was for setting which entry points would allow which NPC to be placed.
Exactly. And isn't that what you want? Here's an example from my own mod. I've got a certain NPC, a general that is very close to the ruler of one of my factions. I want him to appear in the court scene, doing things, at least for the beginning of the game, so I've got this in my script_enter_court:
Code:
... # beginning of the script here
      (set_visitor, 6, ":guard_troop"),
      (set_visitor, 7, ":guard_troop"),

	#-## TBS - General Radoslavov
	(try_begin),
		# mission conditions, none in the beta
		(eq, ":center_no", "p_town_8"),      # If we are in Thornstadt
		(set_visitor, 15, "trp_gen_radoslavov"),
	(try_end),
	#-## TBS end
And the general pops up happily and contently where he ought to be. And... yeah, you can see that I've got no amazing conditions. Yet. :wink:
Hope I've managed to help with any unclarities you might have had. If I've still not helped, I blame the late hour. Please aks me again tomorrow mo(u)rning.
 
Yeah I know how to set dialog conditions; I'm just asking specifically about how to set conditions for faction relations, and for if your a vassal of a certain faction. :smile:

What I usually use for the conditions doesn't work in this case, because I use
Code:
(assign,"$variable",1)
and
Code:
(eq,"$variable",1)
for the dialog that I make.

Also: that code you posted is interesting, I may use a variation of that on making a mages guild at some point... Thanks! :grin:
 
Ah, thanks man, I get it know.

What does the condition look like that removes that particular troop in case of a castle/town/village being conquered? Or where can I look that up myself?
 
What does this error mean (How do i fix it)?
0abm.jpg
 
Could someone point to what I am doing wrong here? I am trying to set a visitor in a mission template (in single-player). The triggers functions, however, the troops do not want to spawn. I have experimented with placing in the ti_before_mission_start and ti_after_mission_start, but to no avail. Remarkable though, in the ti_after_mission_start I can spawn three troops, but not that the other one I want to.

Code:
        (ti_after_mission_start, 0, 0, [],
        [  
	(store_current_scene, ":cur_scene"),
	(modify_visitors_at_site, ":cur_scene"),	
	(set_visitor, 1, "trp_cc_evernett"),
        (set_visitor, 2, "trp_cc_cuil"),	
	(set_visitor, 3, "trp_cc_berrick"),
	]),
Code:
        (0, 0, ti_once, 
	[
	(entry_point_get_position, pos1, 14),
	(get_player_agent_no, ":player_agent"),
	(agent_get_position, pos2, ":player_agent"),
	(get_distance_between_positions_in_meters, ":dist", pos1, pos2),
	(le, ":dist", 10),
	],
        [		
	(store_current_scene, ":cur_scene"),
	(modify_visitors_at_site, ":cur_scene"),
        (set_visitor, 10, "trp_cc_rimmer"),	
	(set_visitor, 11, "trp_cc_rat_bandit_1"),
	(set_visitor, 12, "trp_cc_rat_bandit_2"),
	(set_visitor, 13, "trp_cc_rat_bandit_3"),
	(display_message, "@Distance close enough."),
	(assign, "$pr_c_01", 9),
	(assign, "$next_box", 1), 				
	(start_presentation, "prsnt_rw_character_mice"),	
	]),

And my configured entry points should also be correct.
Code:
  (
	"rw_cc_intro_01",0,-1, 
	"MT character creation.",  
         [
	(0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
	(1,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
	(2,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
	(3,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
	(5,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
	(10,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
	(11,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
	(12,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
	(13,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
	],
 
Status
Not open for further replies.
Back
Top Bottom