Results 1 to 9 of 9

Thread: Destroying buildings - scripting question?

  1. #1
    EB insanity coordinator Senior Member khelvan's Avatar
    Join Date
    Sep 2002
    Location
    Oakland, CA
    Posts
    8,449

    Default 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?
    Cogita tute


  2. #2
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default 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...


  3. #3
    EB insanity coordinator Senior Member khelvan's Avatar
    Join Date
    Sep 2002
    Location
    Oakland, CA
    Posts
    8,449

    Default 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.
    Cogita tute


  4. #4

    Default 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.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  5. #5
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default 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...

  6. #6
    Member Member Nero's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    52

    Default 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?

  7. #7
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default 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.

  8. #8

    Default 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
    Last edited by Epistolary Richard; 04-25-2005 at 15:18.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  9. #9

    Default Re: Destroying buildings - scripting question?

    ^Wow

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO