Results 1 to 9 of 9

Thread: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

  1. #1
    Warcrafthero's Avatar Centenarius
    Join Date
    Aug 2012
    Location
    Italy
    Posts
    806

    Default Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Hello, i would like to know if it is possible to script this particular thing:

    I would like to force the AI, during the Aztecs turn, whenever it conquers a "castle type" settlement, to convert that settlement into a "city" type by building one of the available buildings that are available in the "convert_to_city" section in the vanilla M2TW EDB.

    So, if it conquers a wooden_castle type it will have to build the "wooden_castle_to_village" building and so on with the other levels. It is possible to script such a thing in the vanilla game?. I am using Gigantus's Bare Geomod.

  2. #2
    Jadli's Avatar The Fallen God
    Citizen

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    7,352

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    well, you could use the script command "create_building building_chain_name building_name"

    I also assume that if you made the convert building to be only building that the aztecs can build in castles, they woudl eventually build it.

  3. #3
    Warcrafthero's Avatar Centenarius
    Join Date
    Aug 2012
    Location
    Italy
    Posts
    806

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Hello Jadli, thank you for the advice; yes, the aztecs can only build the "convert_to_city" building in their castles but the AI seems to ignore it completely. I tried to create a script but it does not work, there is a mistake in the code?.

    Code:
        monitor_event GeneralCaptureSettlement SettlementName Toledo
            and FactionType aztecs
            and I_IsFactionAIControlled aztecs
            and SettlementBuildingExists = castle
            and I_SettlementOwner Toledo aztecs
            console_command create_building Toledo castle_to_large_town
            terminate_monitor
        end_monitor

  4. #4

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Using the create_building command to add a wall building to a settlement doesn't result in the settlement being upgraded, so it doesn't surprise me that simply creating the conversion building also has no effect. Perhaps there is a command similar to upgrade_settlement that will convert between city and castle, but I don't know of any.

    Does anyone know if 'convert_' is the hard coded part that allows the city-to-castle and vice versa buildings to work? This would be similar to 'temple_' and 'hinterland_' having hard coded properties. If this is indeed how it works, we could conceivably have multiple city-to-castle and vice versa buildings available.

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

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Yeah, as Callistonian said. What you really need is a command to put the conversion building into the build queue. There's no way I know of to do that. It is the act of that building completing construction that triggers the change, and for that it needs to be in the queue.

  6. #6
    Warcrafthero's Avatar Centenarius
    Join Date
    Aug 2012
    Location
    Italy
    Posts
    806

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    I am sorry for the late reply but thanks everyone for your suggestions; i haven't found a solution so far, however, if i will find one i will post it here. +rep to you

  7. #7
    bitterhowl's Avatar Centenarius
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    892

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Am I wrong with add_to_building_queue command existing?

    My sister, do you still recall
    The blue Hasan and Khalkhin-Gol?

    Because AI is dumb and full of errors.

  8. #8

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Quote Originally Posted by bitterhowl View Post
    Am I wrong with add_to_building_queue command existing?
    Not directly but you can disable it via "filter_settlement_commands" so maybe you can use the scripts that let you click stuff on the UI Shell.

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

    Default Re: Forcing the AI to transform a "castle type" settlement into a "city" one with a script? (Vanilla M2TW)

    Quote Originally Posted by bitterhowl View Post
    Am I wrong with add_to_building_queue command existing?
    There is an AddedToBuildingQueue event but no such command that I know of. I can't see it in the docudemons.

Posting Permissions

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