Author Topic: [DONE][Suggestion] Mapscript commands filter by craft (group)  (Read 2219 times)

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
[DONE][Suggestion] Mapscript commands filter by craft (group)
« on: August 10, 2022, 04:07:13 pm »
So it´s basically to simulate stuff happening outside the craft block ( like bombardments, paratroopers, supply caches)
crafts:
    battlescapeTerrainData:
  - type: STR_TEST
      mapBlocks:
        - name: TEST
          width: 10
          length: 20
          items:
            STR_TEST:
              - [x, x, x]
          items SCATTER (randomize) outside map block:
            STR_BOMB
            STR_BOMB
            STR_BOMB
            STR_BOMB
          fuseTimers:
            STR_BOMB: [0, 0]

Is this possible or too hard to do?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: [Suggestion] Craft Item add outisde craft block
« Reply #1 on: August 11, 2022, 09:21:00 am »
the "randomize" part is rather tricky... without precise placement, you'll get paratroopers drowning in water, supply caches on top of trees/buildings, etc.

also, how far outside the craft? 1 tile, 2 tiles, 10 tiles, 50 tiles?

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
Re: [Suggestion] Craft Item add outisde craft block
« Reply #2 on: August 11, 2022, 12:27:43 pm »
well if paras drown, they are spawned units not regular, so not much loss , also caches in tops its like paradrop.
but if we can have min and max i suggest minimum 10 tiles away from the craft

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
Re: [Suggestion] Craft Item add outisde craft block
« Reply #3 on: August 19, 2023, 07:08:32 pm »
ok after misinterpreting the multiple craft spawn, i now see simple solution...
Just on mapscript the hability to spawn an tile that has that item, but that tile must be linked to a craft
EX:

crafts:
  - type: STR_CRAFT
      mapBlocks:
        - name: CRAFT
          width: 10
          length: 20
        groups: [50EX]

mapScripts:
    commands:
    - type: addCraft
    - type: addUFO
    - type: addBlock
      conditionals: [50EX]
      size: 1
      executions: 1
      blocks: [17]
    - type: fillArea
      blocks: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
      freqs: [6, 6, 6, 6, 6, 6, 6, 3, 3, 4, 2, 2, 2, 2]
      maxUses: [-1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 1, 1]

Meaning when the craft with that "conditional" is present the block tile 16 of the map is spawned (that has an explosive or something), can this happen?
ps: i know that´s not how conditionals and groups works, but just want a similar name

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: [Suggestion] Craft Item add outisde craft block
« Reply #4 on: August 31, 2023, 10:17:22 am »
Yes, this is doable.

Does one craft need to belong to multiple groups or can each craft belong to just one group?

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
Re: [Suggestion] Craft Item add outisde craft block
« Reply #5 on: August 31, 2023, 03:26:52 pm »
Well the idea is to give make a specific  craft´s  the capability to spawn a map tile, i want to have several craft´s that will spawn that tile, and other type craft´s that will spawn other tiles. so i guess the answer is each craft belong to a specific group. I will have several map tiles on hold on map script so it spawns the correct ones by craft entry. But if a craft can have multiple groups the better.

    - type: addBlock
      conditionals: [40]     #( ex a craft with bombard)
    - type: addBlock
      conditionals: [50]     #( ex a craft with paratropers)
    - type: addBlock
      conditionals: [60]     #( ex a craft with sensor deployment)

i think this will add a good pre game dynamic and for me will make artillery crafts viable, meaning players can now choose to take less units to battle but have some prebombarment on the battlefield. also will make some open map faster late game, that player don't want to repeat (like in mods that just spawn a tons of bases and events  ::)  40k issue)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: [DONE][Suggestion] Mapscript commands filter by craft (group)
« Reply #6 on: January 14, 2024, 05:59:32 pm »
ok after misinterpreting the multiple craft spawn, i now see simple solution...
Just on mapscript the ability to spawn a map block that has that item, but that map block must be linked to a craft

Done.

https://github.com/MeridianOXC/OpenXcom/commit/d724b3f7b8b3554671ab080ec1b359d7028a8778

The filter applies to all commands AFTER a successful craft deployment (i.e. after successful `addCraft` command).
Before craft deployment, the `craftGroups` filter is simply ignored.

Example:

Code: [Select]
crafts:
  - type: STR_SKYRANGER
    groups: [42, 666]

Code: [Select]
mapScripts:
  - type: DEFAULT # forest, mountain
    commands:
    - type: addUFO
    - type: addCraft
    - type: addBlock
      craftGroups: [27, 42]              # <------------
      executions: 2
      terrain: POLAR
    - type: addBlock
      size: 2
      executions: 2
    - type: fillArea
« Last Edit: January 14, 2024, 06:05:13 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: [DONE][Suggestion] Mapscript commands filter by craft (group)
« Reply #7 on: January 14, 2024, 06:01:13 pm »
I hope I understood it correctly.

If not, let me know.

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
Re: [DONE][Suggestion] Mapscript commands filter by craft (group)
« Reply #8 on: January 14, 2024, 07:11:35 pm »
Yes, i think its correct , thks, is there a way to test it or a new  ocxe is around the corner

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8616
    • View Profile
Re: [DONE][Suggestion] Mapscript commands filter by craft (group)
« Reply #9 on: January 14, 2024, 07:24:50 pm »
Test build is here: https://lxnt.wtf/oxem/builds//Extended/Extended-7.11-d724b3f7b-2024-01-14-win64.7z

New OXCE release will come out probably in the second half of February.

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
Re: [DONE][Suggestion] Mapscript commands filter by craft (group)
« Reply #10 on: January 15, 2024, 02:18:31 am »
it works perfectly, but now i got to ask for the  fuseTimers:  item: [0, 0] to blow up like the spawner itens (i will open a new request)