[Help] Is it possible, in a conquest game mode, to make the game choose random capture points out of the total capture points?

Hello comrades!

I am currently putting work again in an old mod which i thought i would scrap a year ago.

For that i got a question.

Is it possible, in a conquest game mode, to make the game choose the capture points out of random areas?

As an example: I would create 10 capture points in the mod, and i want to make the game choose 5 random of the 10 capture points each time the mod gets launched.

Is that possible?

2 Likes

yes, but you will need to edit capzones through entities.blk and add the groupsector parameter.
otherwise you can’t.

then assign each preset under group_activator

so that you can tell the logic which sector activate first, and the game will choose randomly a preset of capzones with that specific name that you (must) assigned and are linked to each.

just like any invasion / confrontations.

2 Likes

Yeah. It’s possible to do, but you will need to a bit work with code.

1 way - Scene.blk

At first you just need put points on map. Edit their properties and e.t.c.

After that you will need to move capture points entity code inside weather code (to level entity and level__weatherChoice property). Tunisia basic level entity code example:

entity{
  _template:t="level"
  level__blk:t="content/enlisted/levels/tunisia_4x4.blk"
  level__timeRange:p2=5, 19.2
  level__day:i=21
  level__month:i=6

  "level__weatherChoice:object"{
    weather_clear_a:r=0.5
    weather_clear_b:r=1
  }

  "level__timeVec:array"{
    level__timeVec:r=6.5
    level__timeVec:r=7.5
    level__timeVec:r=17
    level__timeVec:r=18
  }
}

So you will need a bit edit level__weatherChoice and add some code. There is example code that contains two domination capture points.

// are just comments and they don’t affect to code. It’s just give some info about each line. You can remove them while do code.

  "level__weatherChoice:object"{
    "weather_poor_a:object"{ //< Use another weather entity instead weather_poor_a. They're should be unique!
      weight:r=0.25 //< Chance for random weather. Something like 25%, but it would be good to have at least one weather with 1.00 in weight.

      "entities:array"{
        "entities:object"{
          template:t="domination_box_capzone" //< Your capture point (or any another entity that you want to create if this weather is selected).

          "components:object"{ //capture point (entity) properties.
           !ENTITY PROPERTIES!
          }
        }

        "entities:object"{
          template:t="domination_box_capzone" //< Your another one capture point.
          "components:object"{ //capture point (entity) properties.
            !ENTITY PROPERTIES!
          }
        }
      }
    }

    "weather_clear_a:object"{ //<<< Another one weather. You can edit it or add another one weather.
      weight:r=1.00 //<<< It will be more often then first weather. As again you can edit it if you want.
    }
  }

Don’t forgot to properly open and close body (with { and }).

Well… After that we need to put inside !ENTITY PROPERTIES! real info or clean it and components too else we will got crash. Where you can find it? In same file. In scene.blk.

So you need to find capture points that you created before. Find something like it:

entity{
  _template:t="domination_box_capzone"
  transform:m=[[1, 0, 0] [0, 1, 0] [0, 0, 1] [182.689, 23.9537, 172.618]]
  capzone__caption:t="capzone/beach_bunker"
  capzone__icon:t="bunker"
  capzone__title:t="A"
  capzone__capTime:r=30
  capzone__decapTime:r=15
}

And copy something like this:

  transform:m=[[1, 0, 0] [0, 1, 0] [0, 0, 1] [182.689, 23.9537, 172.618]]
  capzone__caption:t="capzone/beach_bunker"
  capzone__icon:t="bunker"
  capzone__title:t="A"
  capzone__capTime:r=30
  capzone__decapTime:r=1

And delete domination entity code. You will not need it. And after that you need to put these copied properties inside !ENTITY PROPERTIES!. One of point is ready. Same steps for others points. If you want to make another group then make another weather choice or edit weather_clear_a. Need to add entities and their components.

Just don’t forgot to look at body code. They must be properly opened/closed.

2 way - Entities.blk (untested)

Or you can try to edit entities. Try to add groupName for domination capture points. But I didn’t test it. Code for entities.blk probably will looks like:

domination_box_capzone{
  _override:b=yes

  _tracked:t="groupName"

  "groupName:t"{
    value:t=""
    _info:t="groupName"
  }
}

domination_sphere_capzone{
  _override:b=yes

  _tracked:t="groupName"

  "groupName:t"{
    value:t=""
    _info:t="groupName"
  }
}

domination_poly_capzone{
  _override:b=yes

  _tracked:t="groupName"

  "groupName:t"{
    value:t=""
    _info:t="groupName"
  }
}

Zip file contains entities.blk with this code: entities.zip (278 Bytes)
Need just to put file inside your mod folder.

After that you should be able set groupName. Unqiue sector id for these points. For turn on random sector/groupName when game starts you will need to edit group__activator and set activator__activateChoice.

You can also create some group__activator entities. Not just one.

1 Like