How to assign a village to a castle with scripts?

Users who are viewing this thread

Blankin

Squire
Well, I am doing some new town, but one of them, got a vaegir village, that was bound to a castle... For now I will try to put a bigger distance, but anyone knows how to give a village to a castle?
 
I will try, but it probably won't bound the village and may give a crash because one vaegir lord will own a property that doesn't belong to his faction...
 
Blankin - check out the game_start (or is it start_game) script (first script).  It sets up what villages are bound to which walled centers.  You can modify that code, or simply make a change after that runs (its a simple matter of setting the village's bound_center slot to refer to the center you want it to).
 
Blankin said:
I will try, but it probably won't bound the village and may give a crash because one vaegir lord will own a property that doesn't belong to his faction...
It will after script_give_center_to_lord is run. That's part of what it does. If we examine its code:
      (try_begin),
        (eq, ":lord_troop_id", "trp_player"),
        (gt, "$players_kingdom", 0),
        (party_set_faction, ":center_no", "$players_kingdom"),
      (else_try),
        (eq, ":lord_troop_id", "trp_player"),
        (le, "$players_kingdom", 0),
        (party_set_faction, ":center_no", "fac_player_supporters_faction"),
      (else_try),
        (party_set_faction, ":center_no", ":lord_troop_faction"),
      (try_end),
The bit in red is the general case, where the script is giving the centre to a lord who is not the player.

If in doubt what a script does, it's always useful to read the code.
 
Here is my answer to the very close question.
http://forums.taleworlds.com/index.php/topic,6575.msg1422254.html#msg1422254
 
I use it in my script for making new villages.  When they are added, though they are added to the faction I forgot to assign them to a lord, so after a few hours of game time a dialog would pop up asking my who to give the village to.  to fix it, I added this line:

(call_script, "script_give_center_to_lord", ":new_village", ":party_no", 0),

 
Back
Top Bottom