village improvements, physically reflected in the general map

Users who are viewing this thread

Hello everyone...
I just did a tutorial to create an animated windmill in my mod, everything turned out fine, despite some drawbacks which I think are fixable ....
I wonder, how could I make a mill appear next to my village that I manage, when I make an improvement?
 
Solution
It is how it always is... Not that easy.
If you assign here a new icon it would work but only if the village stays in normal state.

So if it's raided for example it gets the looted icon and after that the normal icon from the game start.

Solution would be a simple trigger that check village for improvements, assigns the icons and checks the current status of the village. Something similar to the process_village_raids fixes by Caba.

Oh and if it should look nice you need for every improvement 3 icons for the different states - > normal, burnt + deserted
Np :wink:

There's a simple trigger.

Look for
"@Building of {s0} in
After this you see a line with slot_center_has_fish_pond
After that you could assign the icon or make a new simple trigger...
Yes, I had already found it, but creating a triggers is the problem, there are several things I could learn but header_operation doesn't have many descriptions, but I think learning to code by now is not so important in warband

I think you could create a little script to assign icons to all improvements like the script "process_village_raids"
and call the script below the line that you mentioned ... and in each of the improvements ... I don't know more
 
Upvote 0
here is the script
Code:
#script_get_improvement_details
# INPUT: arg1 = improvement
# OUTPUT: reg0 = base_cost
("get_improvement_details",
[(store_script_param, ":improvement_no", 1),
(try_begin),
(eq, ":improvement_no", slot_center_has_manor),
(str_store_string, s0, "@Manor"),
(str_store_string, s1, "@A manor lets you rest at the village and pay your troops half wages while you rest."),
(assign, reg0, 4400), #-45% del valor original 8000 a todas las mejoras, mauro
(else_try),
(eq, ":improvement_no", slot_center_has_fish_pond),
#(call_script,"script_process_village_improvements")
(str_store_string, s0, "@Mill"),
(str_store_string, s1, "@A mill increases village prosperity by 5%."),
(assign, reg0, 3300), #6000
(else_try),
(eq, ":improvement_no", slot_center_has_watch_tower),
(str_store_string, s0, "@Watch Tower"),
(str_store_string, s1, "@A watch tower lets the villagers raise alarm earlier. The time it takes for enemies to loot the village increases by 50%."),
(assign, reg0, 2750),#5000
(else_try),
(eq, ":improvement_no", slot_center_has_school),
(str_store_string, s0, "@School"),
(str_store_string, s1, "@A shool increases the loyality of the villagers to you by +1 every month."),
(assign, reg0, 4950),#9000
(else_try),
(eq, ":improvement_no", slot_center_has_messenger_post),
(str_store_string, s0, "@Messenger Post"),
(str_store_string, s1, "@A messenger post lets the inhabitants send you a message whenever enemies are nearby, even if you are far away from here."),
(assign, reg0, 2200),#4000
(else_try),
(eq, ":improvement_no", slot_center_has_prisoner_tower),
(str_store_string, s0, "@Prison Tower"),
(str_store_string, s1, "@A prison tower reduces the chance of captives held here running away successfully."),
(assign, reg0, 3850),#7000
(try_end),
]),
Code:
 
Upvote 0
Just copy the simple trigger I mentioned?

Your script above is to make the improvements but you want to assign your icon after the improvement is build.
Code:
(12,
   [(try_for_range, ":center_no", centers_begin, centers_end),
      (party_get_slot, ":cur_improvement", ":center_no", slot_center_current_improvement),
      (gt, ":cur_improvement", 0),
      (party_get_slot, ":cur_improvement_end_time", ":center_no", slot_center_improvement_end_hour),
      (store_current_hours, ":cur_hours"),
      (ge, ":cur_hours", ":cur_improvement_end_time"),
      (party_set_slot, ":center_no", ":cur_improvement", 1),
      (party_set_slot, ":center_no", slot_center_current_improvement, 0),
      (call_script, "script_get_improvement_details", ":cur_improvement"),
      (try_begin),
        (party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
        (str_store_party_name, s4, ":center_no"),
        (display_log_message, "@Building of {s0} in {s4} has been completed."),
      (try_end),
      (try_begin),
        (is_between, ":center_no", villages_begin, villages_end),
        (eq, ":cur_improvement", slot_center_has_fish_pond),
        (call_script, "script_change_center_prosperity", ":center_no", 5),
      (try_end),
    (try_end),
    ]),
 
Upvote 0
It is how it always is... Not that easy.
If you assign here a new icon it would work but only if the village stays in normal state.

So if it's raided for example it gets the looted icon and after that the normal icon from the game start.

Solution would be a simple trigger that check village for improvements, assigns the icons and checks the current status of the village. Something similar to the process_village_raids fixes by Caba.

Oh and if it should look nice you need for every improvement 3 icons for the different states - > normal, burnt + deserted
 
Last edited by a moderator:
Upvote 0
Solution
Back
Top Bottom