Author Topic: [DONE][Question] Spawn nodes for civilians  (Read 1044 times)

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8906
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
[DONE][Question] Spawn nodes for civilians
« on: August 03, 2018, 11:44:17 am »
Sorry for hijacking the thread, but I think it's related enough: would it be possible to restrict spawns of some/all civilians to craft or UFO?
The issue is with defence missions, where you are supposed to save a building with inhabitants from attack... Yet these inhabitants tend to spawn somewhere in the woods, while some enemies spawn in the building. I can live with the latter (infiltrators!), but the former makes the mission harder and pretty weird.
« Last Edit: October 17, 2019, 09:18:56 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5557
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [Question] Spawn nodes for civilians
« Reply #1 on: August 03, 2018, 12:02:34 pm »
Civilians spawn on nodes with rank 0... which are usually outside of the UFO.

But if you remake all the maps and put rank 0 nodes inside the UFO, they will spawn inside... of course "percentageOutsideUfo" for aliens will start doing exact opposite.
« Last Edit: August 03, 2018, 01:03:28 pm by Meridian »

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8906
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Question] Spawn nodes for civilians
« Reply #2 on: August 03, 2018, 02:06:04 pm »
Yes, I know that of course. But I'm not going to duplicate all possible terrains this building may spawn on and then edit several hundred maps to ensure there are no Civ/Scout nodes anywhere. :)
Besides, the building must be X-Com craft, not a UFO, to make sure the soldiers and the equipment stash spawn properly.

So TL;DR: I have considered these solutions, but they aren't viable here. I see no other way to improve such missions than an actual code feature, forcing civilians to spawn inside. If it's not possible (or sensible), I will leave it as it is.
(But I think such a feature would be beneficial to all mods, potentially.)

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5557
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [Question] Spawn nodes for civilians
« Reply #3 on: August 03, 2018, 02:18:09 pm »
There is no concept of "inside".
There are only spawn nodes of different ranks.

Would it help you if you could say what node rank civilians should use (per deployment)?

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8906
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Question] Spawn nodes for civilians
« Reply #4 on: August 03, 2018, 02:41:18 pm »
There is no concept of "inside".
There are only spawn nodes of different ranks.

Which is why I was specifically talking about UFO/craft blocks all the time... ::)

Would it help you if you could say what node rank civilians should use (per deployment)?

Hmmm, maybe? It's far from ideal, but if we tell them for example to spawn on terror units' nodes, it might work... We'll still potentially get terror units in the building, but it's acceptable.
« Last Edit: August 03, 2018, 02:43:25 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5557
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [Question] Spawn nodes for civilians
« Reply #5 on: August 03, 2018, 02:46:07 pm »
I was thinking more of using the xcom spawn nodes (type 1)... if you want them inside the craft.

What would be an ideal solution then?
(and I repeat, there is no concept of "inside")

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8906
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Question] Spawn nodes for civilians
« Reply #6 on: August 03, 2018, 02:50:50 pm »
And I repeat I have never thought there was, that would make me really dumb. :P

Yeah, X-Com spawns would definitely be best.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5557
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [Question] Spawn nodes for civilians
« Reply #7 on: August 03, 2018, 02:57:47 pm »
And I repeat I have never thought there was, that would make me really dumb. :P

I'm imagining things... must be from this hellish heat outside.

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8906
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Question] Spawn nodes for civilians
« Reply #8 on: August 03, 2018, 08:48:08 pm »
I'm imagining things... must be from this hellish heat outside.

Yeah, it's quite harsh... Cycling helps, because the wind is such a blessing. :)

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5557
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [DONE][Question] Spawn nodes for civilians
« Reply #9 on: October 17, 2019, 09:24:11 pm »
Code: [Select]
alienDeployments:
  - type: STR_MEDIUM_SCOUT
    civilians: 40
    civilianSpawnNodeRank: 4   # leader/commander node rank

civilianSpawnNodeRank: 0 is vanilla default

civilianSpawnNodeRank between 1 and 8 can be used to put civilians on various places based on map design... most obvious choice being inside the UFO or a building

Also, when using value higher than 0... civilians are spawned BEFORE the aliens.

Ruleset example above produces output as illustrated on the attached screenshot.

--

Node ranks roughly correspond to:
0 = Civilian / "Scout"
1 = X-Com
2 = Alien Soldier
3 = Alien Navigator
4 = Alien Leader / Commander
5 = Alien Engineer
6 = "Misc1"
7 = Alien Medic
8 = "Misc2"

but every veteran modder knows that aliens can spawn also on nodes which are not exactly their rank following this matrix:

Quote
/* following data is the order in which certain alien ranks spawn on certain node ranks */
/* note that they all can fall back to rank 0 nodes - which is scout (outside ufo) */
const int Node::nodeRank[8][7] = {
   { 4, 3, 5, 8, 7, 2, 0 }, //commander
   { 4, 3, 5, 8, 7, 2, 0 }, //leader
   { 5, 4, 3, 2, 7, 8, 0 }, //engineer
   { 7, 6, 2, 8, 3, 4, 0 }, //medic
   { 3, 4, 5, 2, 7, 8, 0 }, //navigator
   { 2, 5, 3, 4, 6, 8, 0 }, //soldier
   { 2, 5, 3, 4, 6, 8, 0 }, //terrorist
   { 2, 5, 3, 4, 6, 8, 0 }  }; //also terrorist

« Last Edit: October 17, 2019, 09:34:24 pm by Meridian »

Online Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8906
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE][Question] Spawn nodes for civilians
« Reply #10 on: October 17, 2019, 10:09:35 pm »
Wow, this is a nice surprise! Thanks!