PDA

View Full Version : Destroying buildings - scripting question?



khelvan
04-24-2005, 22:05
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?

Myrddraal
04-24-2005, 22:20
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:

khelvan
04-24-2005, 22:21
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.

Epistolary Richard
04-25-2005, 09:36
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.

Myrddraal
04-25-2005, 10:26
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...

Nero
04-25-2005, 11:23
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?

Myrddraal
04-25-2005, 14:41
create building makes the building appear immidiately, not put it on the building queue.

You could do this by simulating the mouse clicks again.

Epistolary Richard
04-25-2005, 15:15
@ Nero
How to: Create Buildings (https://forums.totalwar.org/vb/showpost.php?p=755335&postcount=5) using scripts

@ Myrddraal
Yes, of course, my head was just in completely the wrong place.

So, just to spout code randomly:



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

The_Ferret
04-25-2005, 16:26
^Wow