AI

Discussion in 'Mod Discussions' started by startege1, August 6, 2015.

  1. startege1

    startege1 Active Member

    Messages:
    355
    Likes Received:
    58
    Hi,

    I wanted to ask if anyone knows me whether there is a thred for AI programming / template.

    I wanted to in a mod that the ai Nure a certain einheitbaut. in a certain number.

    There a pattern how it should look?

    Yours sincerely

    startege1

    in german:

    Hi,

    ich wollte fragen ob mir jemand weiß ob es einen thred gibt für ai programmierung /vorlage.

    Ich wollte gerne In einem mod das die ai nure eine bestimmte einheitbaut. in einer bestimmten anzahl.

    Gibt es ein muster wie es aussehen soll?

    Mit freundlichen Grüßen

    startege1
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Quitch likes this.
  3. startege1

    startege1 Active Member

    Messages:
    355
    Likes Received:
    58
    @Quitch how and where can I set the the Commander only builds a factory and the factory continually builds an official amount unit. How it should look like. For example, if it were a Dox.
  4. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    The fabber folder is where all the fabber building is controlled and the factory folder controls factory building.

    Each fabber entry will have a block which looks something like:

    Code:
          "builders": [
            "AnyBasicFabber",
            "AnyAdvancedFabber"
          ],
    So if you only want the Commander to build factories you would remove the reference to the Commander from everything except the factories you want it to build. However, you also need to given consideration to the following:

    Code:
          "instance_count": 1,
          "shared_instance_count": "BasicFactory",
    This would mean that only one instance of this build job can occur on a planet at one time. This instances is checked against all other instances using the same shared instance count. So if a fabber kicks off a factory using the BasicFactory instance count, the Commander won't build it if the instance_count number has been hit.

    For factories, find all the builders references to BasicBotFactory and remove every full block that isn't building Dox. For example:

    Code:
        {
          "name": "Uber - Grenadier",
          "to_build": "BasicArtilleryBot",
          "instance_count": -1,
          "max_num_assisters": 10,
          "priority": 97,
          "builders": [
            "BasicBotFactory"
          ],
          "build_conditions": [
            [
              {
                "test_type": "HasPersonalityTag",
                "string0": "uber",
                "boolean": true
              },
              {
                "test_type": "HasPersonalityTag",
                "string0": "infernodier",
                "boolean": false
              },
              {
                "test_type": "HasPersonalityTag",
                "string0": "oldschool",
                "boolean": false
              },
              {
                "test_type": "CanDeployLandFromBase",
                "boolean": true
              },
              {
                "test_type": "CanAffordBuildDemand"
              }
            ]
          ]
        },
    You would either delete all that, or set the priority to 0 so the block is ignored.
  5. startege1

    startege1 Active Member

    Messages:
    355
    Likes Received:
    58
    @Quitch Is there a way that the AI 100 units produced.
  6. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    In what context do you want '100 units'? You want the ai to make 100 dox before attacking? Or be limited to a total of 100 dox and then stop building them until some are destroyed?
  7. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    Yes, look into the tests UnitCount and UnitCountOnPlanet.
  8. startege1

    startege1 Active Member

    Messages:
    355
    Likes Received:
    58
    I'm working on a tower defense mod. and the AI will build the waves. 1 Shaft 50 Dox. 2 shaft 50 Dox 50 grenadiers ...
  9. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    I'm not sure the defualt AI system is the way to achieve that? I thought there was a way to spawn in units anyway?

Share This Page