• The forum has been updated. For an explanation of some of the changes, head over here.

WB Coding Make AI lords update their banner when they join another faction

Currently viewing this thread:

John25-

Sergeant
Hi there, I know how to make lords use their faction's banner - but I am looking for a way to make them update their banner if they join another faction. Is that possible?
 

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
It is possible, yes, not sure though if there is already an OSP-Script around from which you can take inspiration for that. At game_start you have this section here
Code:
# Troops:

# Assign banners and renown.
Starting with
Code:
(try_for_range, ":kingdom_hero", active_npcs_begin, active_npcs_end),
the banners are getting assigned to the lords via the operation (troop_set_slot, ":kingdom_hero", slot_troop_banner_scene_prop, ":banner_id"),
This is basically the operation which you need to reuse for the same slots to reassign the lords a new banner of the respective faction. Be aware however that in theory a faction could have more lords than it has factions available, in Native there is one big texture sheet with 18 (?) banners per faction iirc. You would need to find a workaround here or have enough placeholder banners for each faction at hand.
 
Upvote 0

John25-

Sergeant
Right so if I understand well you are talking about the situation in which the lords use their own banner, in order to make them use their faction's (→ liege's) banner? But in the case they already use the same banner as their faction's leader, is there a way to make that script run again when they renounce to their current faction and join another - including the player's newly created kingdom? i.e. they have let's say the Swadian 'national' banner, and so they adopt the Vaegir - etc. 'national' banner if they get indicted or renounce to the Kingdom of Swadia and then join another faction, or even the player's kingdom 'national' banner (?)
 
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
You first need to explain how your bannersystem works or is supposed to work. Do you have one banner per faction? Or does every lord have his own individual banner? Depending on that the solution might be easier or more complicated.
 
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Then you have the script which determines the chance of defecting per lord. There you add lines in which you also check for the new faction to which the lord defects and assign to him the banner of the respective faction as new banner. The easiest solution which comes into my mind.
 
Upvote 0
Top Bottom