OpenXcom Forum

Modding => Work In Progress => Topic started by: Thirsk on February 07, 2017, 03:40:58 pm

Title: How to trigger a base defense mission?
Post by: Thirsk on February 07, 2017, 03:40:58 pm
I know you can trigger a retaliation mission where ufo's come flying around in attempt to locate your base and attack it, but the odds of them succeeding seems rather low (unless you force a huge wave of ufo's but that seems a little ridiculous.)

Is it possible to force it with 100% possibility? Even if it means skipping the scene where ground defenses fire at the invading battleship, and going straight into the battlescape.
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 07, 2017, 03:49:32 pm
Even if it means skipping the scene where ground defenses fire at the invading battleship, and going straight into the battlescape.

Just don't build base defences?

For future I have the "skip base defense GUI" feature on my todo list for OXCE+, but it's just laziness... you can just as well not build it in the first place.
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 07, 2017, 04:11:12 pm
Just don't build base defences?

For future I have the "skip base defense GUI" feature on my todo list for OXCE+, but it's just laziness... you can just as well not build it in the first place.

Oops I should have been more clear.. what I meant was that the odds of them locating the base was rather low unless you spawn lots of ufos. I'm more than happy to have the base defense scene. Just not too happy about having to spawn so many ufo's for a *chance* that they will find my base, without definite certainty.
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 07, 2017, 04:26:36 pm
Unless you build your base in a VERY specific location, they will find your base rather easily.
From my experience almost each retaliation wave finds my base.

You can increase the chances by:
- not building mind shields
- building bigger bases
- turning on "aggressive retaliation" option in advanced settings
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 07, 2017, 04:46:18 pm
Oh that's odd..I try to trigger it through mission scripts but they end up flying around searching and giving up. Was it because I didn't fly out to attack them with interceptors that they couldn't locate my base?

What does aggressive retaliation do? I never really understood it. Does it mean every time I shoot down a ufo craft, they'd try to find my base?
Title: Re: How to trigger a base defense mission?
Post by: ohartenstein23 on February 07, 2017, 04:51:25 pm
It makes every UFO capable of spotting your base, not just the ones on retaliation missions.  The way your base is spotted is that a UFO has to fly close enough over it - if your base isn't close enough to the game's pre-defined flight paths, you may never be found.
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 07, 2017, 05:01:54 pm
What! That's brilliant, I can't believe I've overlooked it all this time..I'll enable it immediately since I love base defense missions.

Also since I'm using Robin's Mib mod at the moment, is it possible to customise it so that (in base defense missions) the Mib race gets human guns and rifles rather than the default alien plasma weaponry?
Title: Re: How to trigger a base defense mission?
Post by: Hobbes on February 07, 2017, 09:11:01 pm
I know you can trigger a retaliation mission where ufo's come flying around in attempt to locate your base and attack it, but the odds of them succeeding seems rather low (unless you force a huge wave of ufo's but that seems a little ridiculous.)

The location of your base has a major impact since some areas are more likely to be overflown by UFOs hunting for XCOM bases
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 07, 2017, 11:31:02 pm
Hmm now that I think about it, having aggressive retaliation on isn't exactly what I had in mind. Say if I wanted to trigger a base defense mission 100% in month 10, how would I go about that?
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 07, 2017, 11:32:44 pm
Edit the save.
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 07, 2017, 11:56:49 pm
Edit the save.

Oh ok.. is there any other way?
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 07, 2017, 11:59:25 pm
Oh ok.. is there any other way?

Well, everything mentioned earlier... it's just not 100%.
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 08, 2017, 12:02:16 am
Ah I see, I guess it was wishful thinking. Thanks for the help.
Title: Re: How to trigger a base defense mission?
Post by: Countdown on February 08, 2017, 10:26:29 am
Thirsk, just to share my experience, I too rarely have base defense missions even with though I play with aggressive retaliation on. I don't know why this is because others say they have them often, but I get maybe one in an entire campaign.

Just to test, if I just let time run without shooting down any of the UFOs I detect, I'll get a base defense mission fairly quickly. But if I play the game through properly and shoot down every UFO I detect, then I almost never get base defense missions. I agree with you that they're fun and a change of pace from the regular crash site missions, so I wish I got them more often.

Asking a follow-up question, is it "moddable" to change the chance (as a % I assume) of the aliens detecting your base when flying by? I assume this is hard-coded because I haven't seen it in the rulesets, but asking in case.
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 08, 2017, 10:50:33 am
Of course, if you shoot down everything that searches for your base, they won't find you.... duh.

Asking a follow-up question, is it "moddable" to change the chance (as a % I assume) of the aliens detecting your base when flying by? I assume this is hard-coded because I haven't seen it in the rulesets, but asking in case.

Hard-coded (based on several things tho):
https://github.com/SupSuper/OpenXcom/blob/master/src/Geoscape/GeoscapeState.cpp#L1037
https://github.com/SupSuper/OpenXcom/blob/master/src/Savegame/Base.cpp#L1317
Title: Re: How to trigger a base defense mission?
Post by: Countdown on February 08, 2017, 12:28:52 pm
Of course, if you shoot down everything that searches for your base, they won't find you.... duh.
Well then why do others have them "fairly easily" as you say? Do you not shoot down all detected UFOs that you can?

I don't shoot down the "very large" craft, but they aren't always the ones doing the retaliation searching and even when they do, they often fly right over my base without detecting (as there is only a chance of detection, not a guarantee).
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 08, 2017, 12:32:40 pm
Well then why do others have them "fairly easily" as you say? Do you not shoot down all detected UFOs that you can?

Heck no!
In vanilla, I don't shoot down anything except Terror Ships with Chryssalids.

Everything else is much more valuable when landed.
Title: Re: How to trigger a base defense mission?
Post by: Thirsk on February 08, 2017, 12:37:28 pm
Thirsk, just to share my experience, I too rarely have base defense missions even with though I play with aggressive retaliation on. I don't know why this is because others say they have them often, but I get maybe one in an entire campaign.

Just to test, if I just let time run without shooting down any of the UFOs I detect, I'll get a base defense mission fairly quickly. But if I play the game through properly and shoot down every UFO I detect, then I almost never get base defense missions. I agree with you that they're fun and a change of pace from the regular crash site missions, so I wish I got them more often.

Asking a follow-up question, is it "moddable" to change the chance (as a % I assume) of the aliens detecting your base when flying by? I assume this is hard-coded because I haven't seen it in the rulesets, but asking in case.

Yes, finally someone who agrees! Yea there's simply not enough of them in a campaign. I mean, just knowing you cannot afford to lose otherwise goodbye base and most likely game, it really intensifies the game. Plus having a good tour of your base is fun too :P

I haven't tried aggressive retaliation yet since I'm still tweaking the game here and there, but hopefully it'll have the intended effect. If only there was a way to increase detection..is it possible to edit the radar range of UFOs?

Heck no!
In vanilla, I don't shoot down anything except Terror Ships with Chryssalids.

Everything else is much more valuable when landed.

Ah I'm quite guilty of shooting everything down...lol
Title: Re: How to trigger a base defense mission?
Post by: Countdown on February 08, 2017, 12:58:20 pm
Heck no!
In vanilla, I don't shoot down anything except Terror Ships with Chryssalids.

Everything else is much more valuable when landed.
Hmm, interesting. I always thought that was just really beneficial to attack landed supply ships and it was best to shoot everything else down because the aliens score points for "accomplishing their missions" and if you don't shoot them down they'll be more successful in turning countries against you. Also, I didn't think retaliation missions landed anyway (and if you have a hyperwave decoder you know what type of mission the UFO is on)?
Title: Re: How to trigger a base defense mission?
Post by: Meridian on February 08, 2017, 01:51:50 pm
Also, I didn't think retaliation missions landed anyway (and if you have a hyperwave decoder you know what type of mission the UFO is on)?

Retaliation missions won't spawn, if you don't shoot down UFOs.
And the "regular" ones, which are generated monthly usually come when I already finished the game or when I'm very close to it.

And, you don't have to do every mission anyway... few missions a month is more than enough, especially when they're landed.
One landed battleship takes care of all your monthly problems.
Title: Re: How to trigger a base defense mission?
Post by: Hobbes on February 08, 2017, 04:50:14 pm
Everything else is much more valuable when landed.

Until you have a 1000 unit Elerium stockpile sitting in one of your bases and start realizing that you don't really need more stuff.

Unless, of course, the aliens decide to raid and destroy the base that you use to store all your loot. In which case, it's sad.
Title: Re: How to trigger a base defense mission?
Post by: pipanni on August 28, 2021, 02:37:16 pm
Edit the save.

Hi Meridian. So exactly how would I change the save file in order to trigger a base defense mission? (and yes, I also love these missions and think there's too few of them)
Title: Re: How to trigger a base defense mission?
Post by: pipanni on September 02, 2021, 03:34:27 pm
Bump!

Anyone knows how to do this?
Title: Re: How to trigger a base defense mission?
Post by: The Reaver of Darkness on September 09, 2021, 02:44:34 pm
Alien craft have a very narrow scan radius. This along with their limited flight paths means that several parts of the globe never or almost never get scanned, while other parts may get scanned repeatedly. To balance it out, you can increase the UFO scan radius "sightRange: 600", however this will greatly increase the odds of them successfully detecting the X-Com base. I further balanced it in my mod by adding "mindPower: 3" to the Access Lift, which required raising the Mind Shield to "mindPower: 3".
The equation for this is:
Access Lift: Mind Power X
Mind Shield: Mind Power A*X
where A is the mindPower value it previously had.


Hi Meridian. So exactly how would I change the save file in order to trigger a base defense mission? (and yes, I also love these missions and think there's too few of them)
If you get a save file that has a base defense mission incoming, you can open the save file (ideally in notepad++ set to YAML language) and find the Alien Retaliation mission which has done it. Somewhere in there it will have some flag which tells it that the x-com base has been located. You might then be able to copy that mission into your save file, but I'm not sure if it'll all work without a hitch. If your save file already has a retaliation mission ongoing, then you can simply find the flag which says it hasn't found the base and change its state.
Title: Re: How to trigger a base defense mission?
Post by: pipanni on September 13, 2021, 03:13:11 pm
Thanks Reaver, I'll try this as soon as possible :)
Title: Re: How to trigger a base defense mission?
Post by: pipanni on February 14, 2023, 01:36:43 am
Ok, so if I edit the save game and insert this code:

- type: STR_ALIEN_RETALIATION
    region: STR_SOUTH_EAST_ASIA
    race: STR_SECTOID
    nextWave: 2
    nextUfoCounter: 0
    spawnCountdown: 10
    liveUfos: 1
    uniqueID: 710
    missionSiteZone: -1

I'll get an alien retaliation mission (I do have a base in southeast Asia, of course), and the first time I tried it a battleship appeared and attacked my base, exactly what I wanted!... except that it never worked again. Now everytime I try to trigger a base defense mission with this code (or similar, with a different location / alien species) some small ships appear looking pissed, roaming around and then just leaving. So how can I make sure the aliens willl send a battleship to attack my base instead of just flying around and then buzzing off?

By the way is the 'uniqueID' field important? Can I just put a random number?
Title: Re: How to trigger a base defense mission?
Post by: fortuner12a on March 31, 2023, 01:22:27 pm
Well, aliens can assault your base multiple times in LW. There's no special action that triggers that (like you assault their base, which happens in vanilla). They can assault whenever they want, or when they think you are a threat to them, which means, at any moment. I had base defense before I did the alien base assault. So, if you see a large UFO heading to your base, prepare your ass. Anyway, I read some comments around to avoid Ironman when playing LW, cause it may contain bugs that break the game.

Title: Re: How to trigger a base defense mission?
Post by: The Reaver of Darkness on April 05, 2023, 05:25:52 am
I wanted to toss this in on my previous post but I couldn't find it. Well, I eventually did find it!

Retaliation heat map (https://openxcom.org/forum/index.php/topic,7403.0.html)