Results 1 to 10 of 10

Thread: Some questions regarding buildings

  1. #1

    Default Some questions regarding buildings

    Hello all. Here are the questions:
    - Is it posible to destroy your own walls building via script?
    - Is it possible to revert a settlement reducing its level, from large city to town for example?

    I'll appreciate any help you can provide
    FOLLOWERS OF THE WHITE HAND - Isengard Submod

  2. #2

    Default Re: Some questions regarding buildings

    No, you can't destroy a specific building in a specific place with the script. The command destroy_building only works on a faction-wide basis.

    No, I don't believe you can reduce the level of a building, see above for why you can't destroy it then script in a replacement.

  3. #3
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Some questions regarding buildings

    Script can't destroy wall buildings at all. All other types it can.

    http://www.twcenter.net/forums/showt...-of-settlement

    Levels can't go back. The only possibility would be, using your example, to covert Large Town (LT) to a Motte & Bailey (MB), then from MB to Town. But there is no LT->MB conversion building and all my attempts to create one failed. I don't know if I tried to create that exact one, but it was some kind of convert-to-lower-level experiment.

    There's no MB->Town conversion either but there is MB->Village. Still, no use if you can't convert down to MB.

  4. #4

    Default Re: Some questions regarding buildings

    Thank you both for your answers. That's a shame, I would like to downgrade settlements. If I understood you corectly this cannot be achived, can't it? Maybe just destroy buildings and lower population via script, but they will still be "big" cities, not Little towns you can later upgrade.
    Can the destroy_buildings command destroy roads, farms, mines...directly or should EDB be modified earlier and remove the hinterland attribute? I read your link but not sure I understood this point.
    FOLLOWERS OF THE WHITE HAND - Isengard Submod

  5. #5

    Default Re: Some questions regarding buildings

    You can't destroy anything with hinterlands.

    Again, destroy_buildings will destroy every instance of that building that the faction holds. It can't be directed at a particular settlement (which is why it's largely useless).

  6. #6

    Default Re: Some questions regarding buildings

    The use I may give the command may be factionwise, so that may not be an issue. So in order to destroy them I should errase the hinterlands entry on EDB?
    Thanks
    FOLLOWERS OF THE WHITE HAND - Isengard Submod

  7. #7
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Some questions regarding buildings

    No, there is no need to remove hinterlands_ in EDB. That just prevents the player/AI from destroying them. Script's destroy_buildings can destroy anything, whether it is hinterland or not, including farms, roads and mines - just not wall buildings.

    However, destroying the road buildings might not remove the roads themselves from the regions. Fairly sure I tested that once. I believe that, like wall buildings, it isn't the presence of the building that makes the roads exist in the region, it's the act of completing the building's construction that triggers the game to make some changes (build roads on the map). Once that's done the building doesn't need to exist for roads to exist.

    And that might also apply to mines (mining models) and farms (cultivated land textures). I haven't tested those. Or are they like ports where destroying them does change the model (back to fishing village)?

  8. #8

    Default Re: Some questions regarding buildings

    Thank you for the detailed answer. I cannot test at the moment. So the visuals will remain, but what about the effects? Will they dissapear with the building?
    On another note, can you take track of what provinces have been affected by the destroy_buildings (as it has faction effect)? Maybe with another monitor_event or an if where the condition is Building Destroyed or something like that?
    FOLLOWERS OF THE WHITE HAND - Isengard Submod

  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Some questions regarding buildings

    The other thing that would need testing, with roads for example, is if a region has dirt roads and the building is destroyed, then when the building is later re-built does the game now show roads as paved roads? Because it knows that roads already exist on the map, so does it see this construction as being an upgrade (to paved roads)? I doubt it.

    So the visuals will remain, but what about the effects? Will they dissapear with the building?
    The EDB capabilities would disappear. Movement bonus though? Not sure.

    On another note, can you take track of what provinces have been affected by the destroy_buildings (as it has faction effect)? Maybe with another monitor_event or an if where the condition is Building Destroyed or something like that?
    BuildingDestroyed is not triggered by scripted destroy_buildings.

    The only way, I think, is to track which settlements DO have it and do belong to the faction you're going to destroy them in. Then, after the destruction, those that did have it you know have now lost it.

    e.g. Destroying roads for england-owned London, York and Nottingham in a FactionTurnStart...

    Code:
    declare_counter has_roads_London
    declare_counter has_roads_York
    declare_counter has_roads_Nottingham
    
    monitor_event PreFactionTurnStart FactionType england
      set_counter has_roads_London 0
      set_counter has_roads_York 0
      set_counter has_roads_Nottingham 0
    end_monitor
    
    monitor_event SettlementTurnStart FactionType england
      and SettlementName London
      and SettlementBuildingExists >= roads
      set_counter has_roads_London 1
    end_monitor
    
    monitor_event SettlementTurnStart FactionType england
      and SettlementName London
      and SettlementBuildingExists >= c_roads
      set_counter has_roads_London 1
    end_monitor
    
    monitor_event SettlementTurnStart FactionType england
      and SettlementName York
      and SettlementBuildingExists >= roads
      set_counter has_roads_York 1
    end_monitor
    
    monitor_event SettlementTurnStart FactionType england
      and SettlementName York
      and SettlementBuildingExists >= c_roads
      set_counter has_roads_York 1
    end_monitor
    
    monitor_event SettlementTurnStart FactionType england
      and SettlementName Nottingham
      and SettlementBuildingExists >= roads
      set_counter has_roads_Nottingham 1
    end_monitor
    
    monitor_event SettlementTurnStart FactionType england
      and SettlementName Nottingham
      and SettlementBuildingExists >= c_roads
      set_counter has_roads_Nottingham 1
    end_monitor
    
    monitor_event FactionTurnStart FactionType england
    
      destroy_buildings england hinterland_roads false
      destroy_buildings england hinterland_castle_roads false
    
      if I_CompareCounter has_roads_London = 1
        ;London had roads and now do not
      end_if
      if I_CompareCounter has_roads_York = 1
        ;York had roads and now do not
      end_if
      if I_CompareCounter has_roads_Nottingham = 1
        ;Nottingham had roads and now do not
      end_if
    
    end_monitor

  10. #10

    Default Re: Some questions regarding buildings

    Thanks, I think this will do!
    FOLLOWERS OF THE WHITE HAND - Isengard Submod

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •