Emergent Faction Problems (Warband)

正在查看此主题的用户

SkyShadowing

Sergeant
I'm creating a new faction that emerges for my personal, practice mod.

The 20 "Barons" of my kingdom emerge as expected, but the ruler doesn't appear. In the notes, no line appears, not his name, title, renown, controversy, or lack of fiefs, just "click links to see info". I'm also setting the faction to active the same time (or else they get "defeated" within a few days). I got rid of my active set, and it allowed the faction leader to appear, but the faction never appeared in the notes, and never got declared war on, and only did my scripted declaration of war.

I'm using the 4.0 module system of Sword of Damocles as a base to go off of, here's the code:
插入代码块:
(24,
[
	(store_current_day, ":cur_day"),
	(eq, ":cur_day", 2),
		(call_script, "script_create_kingdom_hero_party", "trp_kingdom_7_lord", "p_town_1"),
		(troop_set_slot, "trp_kingdom_7_lord", slot_troop_wealth, 50000),
                (store_random_in_range, ":faction_no", "fac_kingdom_1", "fac_kingdom_6"),
		(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_7", ":faction_no", 1),
			(try_for_range, ":troop_no", "trp_knight_7_1", "trp_knight_7_20"),
				(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
				#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
				(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
				(neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1),
				(call_script, "script_create_kingdom_hero_party", ":troop_no", "p_town_1"),
				(troop_set_slot, ":troop_no", slot_troop_wealth, 20000),
			(try_end),
                (faction_set_slot, "fac_kingdom_7", slot_faction_state, sfs_active),
			]),

Also, people keep defecting before they are even present, and I'd like to prevent that.
 
Set the lords to be slto_inactive (although this is the same occupation as companions), so that they are no longer checked in the indictment/defection script in module_simple_triggers.py. Political calculations for lords are only done for troops set to slto_kingdom_hero.
You'll also need to set the faction note for your new kingdom when you activate it with (call_script, "script_update_faction_notes", "fac_kingdom_7") after you've activated the faction.
 
Alright, I've put this code into game_start:
插入代码块:
	(try_for_range, ":king7troop_no", "trp_knight_7_1", "trp_knight_7_20"),
	    (troop_set_slot, ":king7troop_no", slot_troop_occupation, slto_inactive),
        (try_end),

And put a slot to swap them back to slto_kingdom_hero in my simple_trigger:
插入代码块:
(24,
[
	(store_current_day, ":cur_day"),
	(eq, ":cur_day", 2),
		(call_script, "script_create_kingdom_hero_party", "trp_kingdom_7_lord", "p_town_1"),
		(troop_set_slot, "trp_kingdom_7_lord", slot_troop_wealth, 50000),
                (store_random_in_range, ":faction_no", "fac_kingdom_1", "fac_kingdom_6"),
		(call_script, "script_diplomacy_start_war_between_kingdoms", "fac_kingdom_7", ":faction_no", 1),
			(try_for_range, ":troop_no", "trp_knight_7_1", "trp_knight_7_20"),
				(troop_slot_eq, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
				#(troop_slot_eq, ":troop_no", slot_troop_is_prisoner, 0),
				(neg|troop_slot_ge, ":troop_no", slot_troop_prisoner_of_party, 0),
				(neg|troop_slot_ge, ":troop_no", slot_troop_leaded_party, 1),
				(call_script, "script_create_kingdom_hero_party", ":troop_no", "p_town_1"),
				(troop_set_slot, ":troop_no", slot_troop_wealth, 20000),
                                (troop_set_slot, ":troop_no", slot_troop_occupation, slto_kingdom_hero),
			(try_end),
                (faction_set_slot, "fac_kingdom_7", slot_faction_state, sfs_active),
			]),
Didn't work, they're still defecting. Anything I did wrong?

Also, any idea why my king won't appear with the rest of his troops? As I said, in his wiki entry, there's absolutely no data about him after he's supposed to appear (no "is the ruler of blah", no renown: controversy:, no "has no fiefs" line). But BEFORE the trigger hits, his data's there as it should be.
 
(call_script, "script_update_troop_notes", ":troop_no"), would update their info.

Also, you want from knight_7_1 to kingdom_1_pretender or lords_end, since try_for_range loops from lower to upper-1.
And it's strange that your lords are defecting, or showing up at all, since in your code there's the following
插入代码块:
(troop_slot_eq, ":troop_no",   slot_troop_occupation, slto_kingdom_hero),
Also, in script_cf_troop_can_intrigue, it should require that the lord's party is active (i.e. on the map), otherwise it won't fire. I'm not sure how it still processes your new lords despite of that.
 
I wouldn't be surprised if they weren't "defecting", but they are going through the standard faction defeated redistribute lords gig. It doesn't say they were sent into exile, the text is "blah blah blah has switched from blah blah blah to blah blah blah". Not willingly leaving the faction.

And the problem isn't that the king's wiki isn't updating, it's that the king himself never appears on the map, ever, anywhere. Nobody can tell me where he is, nothing.
 
You might have forgot to set this
插入代码块:
      (faction_set_slot, "fac_kingdom_7",  slot_faction_culture, "fac_culture_7"),
      (faction_set_slot, "fac_kingdom_7",  slot_faction_leader, "trp_kingdom_7_lord"),
      (troop_set_slot, "trp_kingdom_7_lord", slot_troop_renown, 1200),
The source code from SOD 4.0 might have some extra code you forgot to copy. Search for kingdom_7 specifically, and see if you missed anything.
 
后退
顶部 底部