Author Topic: [Solved] [REQUEST] X-Com Files: define UFO to be spawned through mapScripts  (Read 8306 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
I wasn't sure if this should go in Yankes' OXCE thread, or maybe Meriian's improvement thread, so finally I decided to put it here. I hope it will be read by our extremely talented coders. ;)

So, I'm making a mod. I've been rather vocal about this, especially considering how little I've done yet, but I'm totally excited about it and I promise it'll be a completely new experience if I manage to finish a releasable version. Which will probably happen in a few months.

Anyway, there's a feature I badly need, and I feel that it'll be useful to most mods which modify missions, too. So, one of your basic initial actions is a cult investigation mission, where you "investigate" a safehouse used by alien-worshipping cultists (which means go in guns blazing) and "arrest" the perpetrators (which means hoping one of them will not die from your 9mm pistols).
This mission is an alert type (like alien terror). It generates fine, but the problem is that there's no actual house - it just happens on the given terrain with no additional objects. Which kind of ruins the mood.

What do I need to fix it? A simple improvement to the mapScripts command "addUFO", which would allow me to define a specific UFO, like STR_HARVESTER or STR_SMALL_SCOUT, and in this case STR_CULTHOUSE (which wouldn't appear anywhere else).

I think that would be pretty simple to do, though of course I'm not sure. Please let me know if it's possible.
« Last Edit: February 07, 2016, 11:12:22 am by Solarius Scorch »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #1 on: January 25, 2016, 09:32:52 pm »
What do I need to fix it? A simple improvement to the mapScripts command "addUFO", which would allow me to define a specific UFO, like STR_HARVESTER or STR_SMALL_SCOUT, and in this case STR_CULTHOUSE (which wouldn't appear anywhere else).

Already implemented:

Code: [Select]
  - type: COMPLEXRESEARCH
    commands:
    - type: addUFO
      UFOName: STR_NKF_APC_COMPLEX

Give a thank you to Warboy1982 for it ;)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #2 on: January 25, 2016, 09:57:51 pm »
Already implemented:

Code: [Select]
  - type: COMPLEXRESEARCH
    commands:
    - type: addUFO
      UFOName: STR_NKF_APC_COMPLEX

Give a thank you to Warboy1982 for it ;)



OK, I need to go test it... Thanks, and if it works, thread locked. :)


EDIT:
I tried adding

Code: [Select]
    - type: addUFO
      UFOName: STR_CULTHOUSE

to various Terror mapscripts (the only maps I have that don't have landed UFO on them), but it does nothing. The map generates as normal, but the house is nowhere to be seen.

What am I doing wrong?

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #3 on: January 25, 2016, 10:14:28 pm »
EDIT:
I tried adding

Code: [Select]
    - type: addUFO
      UFOName: STR_CULTHOUSE

to various Terror mapscripts (the only maps I have that don't have landed UFO on them), but it does nothing. The map generates as normal, but the house is nowhere to be seen.

What am I doing wrong?

I suppose you defined STR_CULTHOUSE as an entry on ufos? If so, then the issue most likely is with the mapScript (it can't place the ufo for some reason)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #4 on: January 25, 2016, 10:30:17 pm »
Yeah, I still don't know what's wrong.

Here's the ufo:

Code: [Select]
  - type: STR_CULTHOUSE
    size: STR_SMALL
    modSprite: interception_jammed
    damageMax: 500
    speedMax: 5000
    accel: 10
    power: 40
    range: 20
    score: 700
    reload: 32
    breakOffTime: 500
    battlescapeTerrainData:
      name: STR_CULTHOUSE
      mapDataSets:
        - BLANKS
        - PORTROADS
        - PORTURBITS
        - ROADS
        - URBITS
        - FRNITURE
      mapBlocks:
        - name: CULTHOUSE01
          width: 10
          length: 10

Here's the mapscript:

Code: [Select]
  - type: RAILYARDURBAN
    commands:
    - type: addCraft
    - type: addLine
      label: 1
      direction: vertical
      executionChances: 50
    - type: addUFO
      UFOName: STR_CULTHOUSE
    - type: addLine
      label: 2
      conditionals: -1
      executionChances: 50
      direction: horizontal
    - type: addLine
      conditionals: [-1, -2]
      direction: both
    - type: addBlock
      size: 2
      executions: 4
    - type: fillArea
      blocks: [0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
      freqs: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #5 on: January 25, 2016, 10:52:07 pm »
It is possible that OXCE doesn't support that function yet - it was added by Warboy quite recently.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #6 on: January 25, 2016, 10:54:38 pm »
It is possible that OXCE doesn't support that function yet - it was added by Warboy quite recently.

Yeah, that'd explain stuff. :) Well, good things come to the patient ones...

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #7 on: January 26, 2016, 01:37:46 am »
Yeah, otherwise the code looks fine to me.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #8 on: January 26, 2016, 01:59:23 am »
Thanks. Then I'll carry on with stuff.

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #9 on: January 26, 2016, 12:25:52 pm »
I hope that is not a "tip of the iceberg"
about source code branches divergence
:'(


Offline Dioxine

  • Commander
  • *****
  • Posts: 5455
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #10 on: January 26, 2016, 05:37:15 pm »
There's no secret to it, there is no divergence but a time lag. OXCE is based on a September OXC build AFAIK, and anything that came later isn't available in OXCE yet.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #11 on: January 26, 2016, 07:00:27 pm »
There's no secret to it, there is no divergence but a time lag. OXCE is based on a September OXC build AFAIK, and anything that came later isn't available in OXCE yet.
Exactly, I simply focus on my own work instead of tracking nightly. In around month I should probably catch up to recent nightly.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #12 on: January 28, 2016, 12:30:19 am »
Exactly, I simply focus on my own work instead of tracking nightly. In around month I should probably catch up to recent nightly.

If you happen to work in sequence, I'd appreciate if this part is released earlier. I want to test this feature, pretty please. :)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [REQUEST] X-Com Files: define UFO to be spawned through mapScripts
« Reply #13 on: January 28, 2016, 12:42:01 am »
If it merge clearly, then yes.

[ps]

it seem to merge without any big problems, one bug left to fix and I probably release it soon (tm Valve or Blizzard :>) .
« Last Edit: January 28, 2016, 02:07:27 am by Yankes »