Author Topic: alien Deployment link with the mapscript (nodes question)  (Read 7597 times)

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 681
    • View Profile
alien Deployment link with the mapscript (nodes question)
« on: June 27, 2017, 07:09:33 pm »
Can someone help with this strange question :
The alien nodes works fine in a fixed map size, but when they get mixed in the random generating mapscript they are also deployed random. So my intent is to have alien in the fixed nodes like in the fixed size map and ufos.
So how does the mapscript messes the deployment? is when i add lines? when i fill area? i tried to go around by adding ufo craft but none deploys in that nodes if it´s not a ufo mission.
Can someone shed some light on subject?
tried all by now so they obey nodes, but i´m kind of stuck..

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11529
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: alien Deployment link with the mapscript (nodes question)
« Reply #1 on: June 27, 2017, 07:20:15 pm »
AFAIK nothing like this is possible, but I have wanted more control of what spawns where for quite some time.

I think it would be good to start with something simple:
- Force the game to spawn all aliens in the UFO or craft (theoretically you can already set percentageOutsideUfo to 0, but it won't really work),
- Force the game to spawn all civilians in the UFO or craft.

The next step would be spawning units on certain mapblock coordinates (like items on the ground).

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 681
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #2 on: June 27, 2017, 07:44:49 pm »


1- Force the game to spawn all aliens in the UFO or craft (theoretically you can already set percentageOutsideUfo to 0, but it won't really work),
2- Force the game to spawn all civilians in the UFO or craft.

3-The next step would be spawning units on certain mapblock coordinates (like items on the ground).

1- Tried, don´t work, percentageOutsideUfo only works in ufo missions ( the ufo becomes empty)
2- Tried, don´t work  even if i force aliens to spawn in a specific mapblock that block randomize the nodes aliens still

3- Bring it please  :P (next step evolution on openxcom)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #3 on: June 27, 2017, 08:33:02 pm »
3- Bring it please  :P (next step evolution on openxcom)

There's little that can be done because most limitations regarding map nodes and spawns come from the .MAP file format :)

But there are workarounds once you get to know how the system works, although there are things that you can't simply do

Can someone help with this strange question :
The alien nodes works fine in a fixed map size, but when they get mixed in the random generating mapscript they are also deployed random. So my intent is to have alien in the fixed nodes like in the fixed size map and ufos.

I'm not sure I'm understanding you correctly, and there are a few things that I'm not 100% sure at the moment (but Warboy1982 knows for sure)
* On UFOs and fixed map sizes (could you explain better what are fixed maps?) all the values for the rank flag for each node is used. This means that Navigators, Engineers, etc., appear on nodes assigned to the corresponding values and only use them when patrolling (to avoid them leaving the UFO while patrolling)
* However, on the rest of the maps there are only 3 values that work: 0, which is used to spawn Civilians/Terror Units, 1 for XCOM units, and 2 for Soldier, which includes all other ranks. This is also to prevent alien leaders/commanders/etc. who are inside the UFO from using any route nodes outside when patrolling.
* Patrolling is one of 4 possible modes that are assigned by the AI to each unit it controls. All alien units start the mission with this setting but once they see an enemy (XCOM or civilian) they will then switch to either Combat, Escape or Ambush. If they don't see any enemy anymore they'll eventually (based on the alien's Intelligence stat) revert to Patrol mode. While on Patrol mode the AI will move the unit between specific nodes based on several factors.
* Each unit also has a flag which is usually called 'scout' and that determines if it starts inside or outside the UFO. This is determined randomly and uses the percentageOutsideUfo setting on alienDeployments

What I imagine from your question is that you're trying to control the spawns of certain units on any map that isn't a UFO (meaning that it is placed using the addUFO command on MapScript). Where there are only 2 flags that work, 0 (Civ/Terrorists) and 2 (Soldiers), so for those maps there isn't really any current solution for this issue. The only possible workaround would be changing the code to all for all the rank values to be used when generating a battlescape that doesn't contain a 'addUFO' map. But this could bring also undesirable side effects for the vanilla maps, would need to be checked.

However, one possible current solution for this issue would be to use the 'addUFO' command several times to generate the entire Battlescape. You'll still need 1 map assigned to the terrain to serve as the 'ground' where the 'ufos' are placed over. Or just cover most of the battlescape with enough 'ufos' and then use fillArea for the rest. That might also give you a closer spawning to what you need.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11529
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: alien Deployment link with the mapscript (nodes question)
« Reply #4 on: June 27, 2017, 08:52:25 pm »
But there are workarounds once you get to know how the system works, although there are things that you can't simply do

Yes, I meant new code. :)

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 681
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #5 on: June 27, 2017, 09:04:19 pm »
correct i´m trying to control certain spawn points of certain units , it works on "fixed maps" with UFO mapscript (i make 100 inside ufo works 100%) , and fixed sized map script (only add block 50x50 per ex. , add craft, done )


* On UFOs and fixed map sizes (could you explain better what are fixed maps?) all the values for the rank flag for each node is used. This means that Navigators, Engineers, etc., appear on nodes assigned to the corresponding values and only use them when patrolling (to avoid them leaving the UFO while patrolling)

Where is the main question , what is written above is only true on maps that dosen´t used other mapscript propreties (add line , fill area , add block) even when i give all the right properties in map and routes still it messes all up when generating the area
i want to control spawn point in random maps like urban that adds roads , but this randomness messes the deployment :'(




However, one possible current solution for this issue would be to use the 'addUFO' command several times to generate the entire Battlescape. You'll still need 1 map assigned to the terrain to serve as the 'ground' where the 'ufos' are placed over. Or just cover most of the battlescape with enough 'ufos' and then use fillArea for the rest. That might also give you a closer spawning to what you need.

i´ve done the addUFO line , with 100% deployment inside , the ufo appear ...but they all spawn in diferent terrain and random. i might try the all ufo terrain just for the kick´s but i doubt to work
 (i think because deployment is not link to the ufo in question but to the terrain)


Still i´ve done lots of trial and error , invert mapscript order so it add the block first, made a block with spawns only , lot´s of crazy stuff, i can be all wrong and missing something

--- posts merged ---

well , i just check your mappack 4.0 , that contains the ports/harbors with the "ufo" ship and you manage to spawn units in it , so your mapscript goes as

  - type: PORTCARGOSHIP
    commands:
    - type: addUFO
      UFOName: STR_CARGOSHIPPORT
      rects:
        - [3, 0, 3, 7]
    - type: addCraft
      rects:
        - [0, 5, 2, 2]
    - type: addBlock
      rects:
        - [2, 0, 1, 1]
      blocks: 35
    - type: addBlock
      rects:
        - [2, 2, 1, 1]
      blocks: [33, 34, 36]
    - type: addBlock
      rects:
        - [2, 0, 1, 7]
      executions: 8
      blocks: [2, 3, 4, 5, 6, 7, 8, 9]
      maxUses: [1, 1, 1, 1, 1, 1, 1, 1]
    - type: addBlock
      groups: 5
      size: 2
      rects:
        - [0, 0, 2, 2]
    - type: addBlock
      size: 2
      executions: 2
    - type: fillArea

my script goes
  - type: WARSCRIPT
    commands:
    - type: addUFO
      UFOName: STR_PREDATOR_UFO
      rects:
        - [0, 4, 1, 2]
    - type: addBlock
      size: 3
      executions: 1
      blocks: [5]
      maxUses: [1]
      rects:
        - [1, 1, 3, 4]
    - type: addCraft
      rects:
        - [4, 2, 2, 2]   
    - type: addLine
      label: 1
      direction: vertical
      executionChances: 50
      rects:
        - [1, 1, 4, 1]
    - type: addLine
      label: 2
      conditionals: -1
      executionChances: 50
      direction: horizontal
      rects:
        - [1, 1, 1, 4]
    - type: addLine
      conditionals: [-1, -2]
      direction: both
      rects:
        - [1, 1, 4, 4]
    - type: addBlock
      size: 2
      executions: 3
      blocks: [6, 7, 8, 9]
      maxUses: [1, 1, 1, 1,]
    - type: fillArea
      blocks: [3, 4, 10, 11, 12, 13, 14]
      freqs: [1, 1, 2, 2, 2, 2, 2]
      maxUses: [2, 2, 2, 2, 2, 2, 2]

so i even tried to remove the addlines scripts , still no spawn in the ufo
and i give rects to all block´s even to help.. but still nothing
 ( the only diference i see is that your ship is like a megablock with ground) mine is a smal 10x10 ufo  that was no ground and goes in a plain the terrain )
i will try other bigger ufo to see the results
« Last Edit: June 28, 2017, 11:43:31 pm by Solarius Scorch »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #6 on: June 29, 2017, 09:22:21 am »
addendum to what hobbes said above: on missions that aren't crashed or landed UFOs, the scout flag is assumed "enabled" for all alien units.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #7 on: June 29, 2017, 01:35:29 pm »
addendum to what hobbes said above: on missions that aren't crashed or landed UFOs, the scout flag is assumed "enabled" for all alien units.

Which explains why any other ranks than Soldier are ignored when placing units :)

--- posts merged ---


  - type: WARSCRIPT
    commands:
    - type: addUFO
      UFOName: STR_PREDATOR_UFO

Can you post the relevant .MAP/.RMP files (and include the list of tilesets it uses)?
« Last Edit: June 29, 2017, 07:03:12 pm by Solarius Scorch »

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 681
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #8 on: June 29, 2017, 10:24:42 pm »
OK, i undestand now , after seeing the route of liner, all spawn are civ/scout, and all ufo are defined to others rank´s. so when the scout flag is enable they all spawn as CIV/Scout
Thnks hobbes for the hand but i see now it has nothing to do with mapscript
So now the question is-> is it possible to aliens not assume scout flag on missions that aren't crashed or landed UFO?

If no the inverse solution is to treat a UFO land has as an alert, is it possible? (give the alert like as terror site?)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #9 on: June 29, 2017, 10:33:12 pm »
If no the inverse solution is to treat a UFO land has as an alert, is it possible? (give the alert like as terror site?)

You can create a missionSite (aka terror site) and then use addUFO in the mapScript for that terrain. But from Warboy's post, I'd say that the scout flag is enabled for all alien units, so I don't think that's what you're looking for

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #10 on: June 30, 2017, 02:16:59 am »
probably worth noting that if it finds no scout node, it tries to find a non-scouting one to deploy the alien instead. (and vice-versa)

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 681
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #11 on: June 30, 2017, 03:01:47 am »
probably worth noting that if it finds no scout node, it tries to find a non-scouting one to deploy the alien instead. (and vice-versa)

actually i removed all the scout nodes, and they spawn random around in the non-scout. but what i want to accomplish , is that they go for the same rules for the ufo and the single block map where they spawn the commander on the  commander node, the terrorist on the terrorist node etc.

After all this i find strange that in a complete block 60x60 map the aliens go for the right spawn, bringing me to the beginning hehe and making no sense
mapScripts:
  - type: SM
    commands:
    - type: addCraft
      rects:
        - [4,2,1,2] #[y,x,mapSize_width,mapSize_heigth]
    - type: addBlock
      size: [6,6]   


the wrong one
 - type: WARSCRIPT
    commands:
    - type: addBlock
      size: 3
      executions: 1
      blocks: [5]
      maxUses: [1]
      rects:
        - [1, 1, 3, 4]
    - type: addCraft
      rects:
        - [4, 2, 2, 2]   
    - type: addLine
      label: 1
      direction: vertical
      executionChances: 50
      rects:
        - [1, 1, 4, 1]
    - type: addLine
      label: 2
      conditionals: -1
      executionChances: 50
      direction: horizontal
      rects:
        - [1, 1, 1, 4]
    - type: addLine
      conditionals: [-1, -2]
      direction: both
      rects:
        - [1, 1, 4, 4]
    - type: addBlock
      size: 2
      executions: 3
      blocks: [6, 7, 8, 9]
      maxUses: [1, 1, 1, 1,]
    - type: fillArea
      blocks: [3, 4, 10, 11, 12, 13, 14]
      freqs: [1, 1, 2, 2, 2, 2, 2]
      maxUses: [2, 2, 2, 2, 2, 2, 2]


on basic the only thing that changes is the map script , there are no scout nodes on both and they are both terrain not ufo

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #12 on: June 30, 2017, 03:52:20 am »
Ohhhh!!!! The "commander"/"terrorist" are actually turrets? Nice! I had thought something familiar for a Terminator total conversion

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 681
    • View Profile
Re: alien Deployment link with the mapscript (nodes question)
« Reply #13 on: July 03, 2017, 10:19:02 pm »
well.. i cracked the case, turns out it was working because i made spawn on sky for flying units ,and no other spawn on ground, so turrets cant´ spawn on sky only the remainder flying units



so case closed , still now i need to find a way to work on races that don´t fly .. any idea?

Ohhhh!!!! The "commander"/"terrorist" are actually turrets? Nice! I had thought something familiar for a Terminator total conversion

yes i use both terrorist units for turret´s