Destroying buildings - scripting question?
Is there any way to force the AI/player, or force the system, to destroy any buildings of a given complex or group of complexes in a given province when that province is taken over?
Alternatively, is there any way to make the building of a building from a particular complex destroy any buildings that exist from another particular complex or group of complexes?
Re: Destroying buildings - scripting question?
I believe ER was working on something like that... What r u up to K? I'm trying to find the connection between ur questions...
:grin:
Re: Destroying buildings - scripting question?
Our system of governing conquered provinces - in order to have the AI use it correctly, we have to have some way of removing the old government when the province is taken over.
Re: Destroying buildings - scripting question?
I first tried the potential destroy_building command using the same parameters as the create_building but with no success.
I then tried the same approach as Myrddraal used in his campaign script for the multiple turns - simulating button clicks but there you need to know what the UI element is called. So I'm now looking for the alleged available_ui_elements.txt that may or may not have come with the demo.
But all this, of course, is reliant on the player clicking a showme button which when the trigger is something that's activated by something in the AI's turn brings its own problems.
Re: Destroying buildings - scripting question?
Unless you incorperate it into one script that runs in the background. A scirpt that checks if the building exists and if so destroys it. I'm not sure if this is possible, but it might be...
Re: Destroying buildings - scripting question?
Another question like this: Is it possible to script building construction, and make a city build a building as soon as it's captured? Maybe something to put a building in the building queue directly after the city is captured? I've just read something about create_building, what does this do?
Re: Destroying buildings - scripting question?
create building makes the building appear immidiately, not put it on the building queue.
You could do this by simulating the mouse clicks again.
Re: Destroying buildings - scripting question?
@ Nero
How to: Create Buildings using scripts
@ Myrddraal
Yes, of course, my head was just in completely the wrong place.
So, just to spout code randomly:
Code:
declare_counter TarquiniiCaptured
monitor_event GeneralCaptureSettlement FactionType romans_julii
and SettlementName Tarquinii
set_counter TarquiniiCaptured 1
inc_counter citiescaptured 1
terminate_monitor
end_monitor
monitor_conditions I_CompareCounter TarquiniiCaptured = 1
console_command destroy_building milita_barracks ; if such a command exists
;don't know if you could destroy AI buildings by mouse clicks
end_monitor
Re: Destroying buildings - scripting question?