Author Topic: Hard Coded Alien Mission Races  (Read 10845 times)

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Hard Coded Alien Mission Races
« on: January 28, 2015, 04:36:50 pm »
Is there a way to unset the hard coded alien races? I have deleted the floater race from aliens, and not used it in my alien missions file, but the game is crashing on a terror mission because it's still trying to place them. If I remove the deletion and set to a 0% encounter the game doesn't crash, but the floaters appear even though I haven't defined them. Or do I need to run a delete on all alien missions before defining? I'm assuming there's a workaround because TFTD has different aliens, unless the plan is to reuse the strings for the race names, which I can do but feels wrong.

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #1 on: January 28, 2015, 04:48:22 pm »
I don't have much experience with this, but what if instead of deleting, you replaced them? Mod in a "new" race of sectoids and replace the floaters with them.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #2 on: January 28, 2015, 05:10:07 pm »
Is there a way to unset the hard coded alien races? I have deleted the floater race from aliens, and not used it in my alien missions file, but the game is crashing on a terror mission because it's still trying to place them. If I remove the deletion and set to a 0% encounter the game doesn't crash, but the floaters appear even though I haven't defined them. Or do I need to run a delete on all alien missions before defining? I'm assuming there's a workaround because TFTD has different aliens, unless the plan is to reuse the strings for the race names, which I can do but feels wrong.

I think you need to run a delete, otherwise the settings for the Floaters remain loaded into the game.

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #3 on: January 28, 2015, 05:18:43 pm »
I tried a delete on the terror mission followed by my declaration, but that seemed not to work. Barring a proper mechanism I'll have to reuse the floaters as my container race. Not a deal breaker, but messier than I like. May play around with deletions a bit more first just to 100% confirm. Maybe it chained together from a terror ship? Since I didn't delete those I suppose it's possible that the default array still has floaters listed. I ran into this same issue for the first encounter which seems hard wired for sectoids, so there I ended up reusing the race string.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #4 on: January 28, 2015, 05:32:17 pm »
I tried a delete on the terror mission followed by my declaration, but that seemed not to work. Barring a proper mechanism I'll have to reuse the floaters as my container race. Not a deal breaker, but messier than I like. May play around with deletions a bit more first just to 100% confirm. Maybe it chained together from a terror ship? Since I didn't delete those I suppose it's possible that the default array still has floaters listed. I ran into this same issue for the first encounter which seems hard wired for sectoids, so there I ended up reusing the race string.

The 1st alien mission is hard coded to be Sectoid Research but I've just checked the code and there's no specific mention of any alien races on the code, other than the ruleset (this is for the latest nightlies though). From what I've seen of the TFTD ruleset it doesn't reuse the existing strings.

Offline clownagent

  • Colonel
  • ****
  • Posts: 380
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #5 on: January 28, 2015, 09:16:54 pm »
I use this code in the alienMissions section and it worked for me in the latest nightly:

Code: [Select]
  - type: STR_ALIEN_TERROR
    points: 10
    raceWeights:
      0:
        STR_OWNRACE: 100
        STR_SECTOID: 0
        STR_FLOATER: 0
      1:
        STR_OWNRACE: 100
        STR_SECTOID: 0
        STR_FLOATER: 0
      3:
        STR_OWNRACE: 100
        STR_SECTOID: 0
        STR_SNAKEMAN: 0
        STR_FLOATER: 0
      5:
        STR_OWNRACE: 100
        STR_SECTOID: 0
        STR_SNAKEMAN: 0
        STR_ETHEREAL: 0
        STR_MUTON: 0
        STR_FLOATER: 0
      7:
        STR_OWNRACE: 100
        STR_SECTOID: 0
        STR_SNAKEMAN: 0
        STR_ETHEREAL: 0
        STR_MUTON: 0
        STR_FLOATER: 0

Of course STR_OWNRACE must be defined in the alienRaces section.
I changed also all other alienMissions like this and encounter only STR_OWNRACE in all UFOs and terror sites.
« Last Edit: January 28, 2015, 09:19:44 pm by clownagent »

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #6 on: January 28, 2015, 09:27:39 pm »
I didn't have success with 0 weights before, but I'll revisit, along with my other tests.

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #7 on: January 29, 2015, 04:01:36 am »
Strange. I tried race 0 weights with latest nightly but I still get STR_FLOATER assigned in the deployment. I'm using a saved game to test, maybe some of the values are cached once the game is started? I'm afraid without a more concrete suggestion for how to address I'm going to work with the existing strings to make it bulletproof, at least until I can see if TFTD rules provide additional insight.

Weird, testing with a new game and made it past a ton of terror mission encounters just fine. Made it to the 3rd tier encounters in month 4, so maybe something else was going on. I did find a STR error in my deployments, but that shouldn't have let to the floater error, unless the game was doing some sort of default load because my rule was messed up.

I guess I'll do some more play testing fresh and if it pops up again I'll switch the strings to use the existing races.
« Last Edit: January 29, 2015, 04:09:50 am by jackstraw2323 »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #8 on: January 29, 2015, 03:28:49 pm »
Strange. I tried race 0 weights with latest nightly but I still get STR_FLOATER assigned in the deployment. I'm using a saved game to test, maybe some of the values are cached once the game is started? I'm afraid without a more concrete suggestion for how to address I'm going to work with the existing strings to make it bulletproof, at least until I can see if TFTD rules provide additional insight.

Weird, testing with a new game and made it past a ton of terror mission encounters just fine. Made it to the 3rd tier encounters in month 4, so maybe something else was going on. I did find a STR error in my deployments, but that shouldn't have let to the floater error, unless the game was doing some sort of default load because my rule was messed up.

I guess I'll do some more play testing fresh and if it pops up again I'll switch the strings to use the existing races.

You shouldn't use saved games to test this: alien missions can be prolonged into the next month if you shoot down UFOs.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #9 on: January 30, 2015, 07:15:39 am »
none of the races are hard coded, not even the sectoids in the first month.
you can't retro-actively remove a race from the ruleset for a saved game, either. if there's a mission being run with said race (eg: floater) and you try to remove floaters and continue that game, you're gonna have a bad time. when messing with things like that, make sure to start a fresh game.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #10 on: January 30, 2015, 09:10:55 am »
none of the races are hard coded, not even the sectoids in the first month.

Hmmm, am I reading wrong the propose of the GeoscapeState::determineAlienMissions function? Ah, I think I got it. It picks the top race for the mission?
« Last Edit: January 30, 2015, 09:16:35 am by Hobbes »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #11 on: January 30, 2015, 09:48:49 am »
yes, the first alien listed, not sectoid specifically (in tftd it's aquatoid)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #12 on: January 30, 2015, 01:24:00 pm »
yes, the first alien listed, not sectoid specifically (in tftd it's aquatoid)

And I've just found out that you can actually define another mission as the first one... including new mission types.
« Last Edit: January 30, 2015, 02:01:39 pm by Hobbes »

Offline jackstraw2323

  • Colonel
  • ****
  • Posts: 206
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #13 on: February 03, 2015, 03:38:41 pm »
For anyone else who runs into this can confirm that deleting and re-declaring missions seems to be the way to go, at least in the current build, and does not require using STR_SECTOID for first aliens.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Hard Coded Alien Mission Races
« Reply #14 on: February 03, 2015, 04:07:15 pm »
For anyone else who runs into this can confirm that deleting and re-declaring missions seems to be the way to go, at least in the current build, and does not require using STR_SECTOID for first aliens.

I've actually 'hardcoded' the initial mission on my current mod using this: the first mission on alienMissions is called 'Introduction' and it is only used during the first month, since afterwards it is not assigned to any region. It works without a problem and it uses a special alien crew (no Sectoids) that is listed at the top of alienRaces.

Quote
alienMissions:
  - delete: STR_ALIEN_RESEARCH
  - delete: STR_ALIEN_HARVEST
  - delete: STR_ALIEN_ABDUCTION
  - delete: STR_ALIEN_INFILTRATION
  - delete: STR_ALIEN_BASE
  - delete: STR_ALIEN_TERROR
  - delete: STR_ALIEN_RETALIATION
  - delete: STR_ALIEN_SUPPLY
  - type: STR_ALIEN_INTRODUCTION
    points: 50
    raceWeights:
      0:
          STR_OVERLORD: 100
    waves:
« Last Edit: February 03, 2015, 04:17:02 pm by Hobbes »