aliens

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - hellrazor

Pages: [1] 2 3 ... 5
1
Hi,

I wanted to let alien bases, be also able to directly call in the construction of another alien base.

The following setup I have tried so far:

Code: [Select]
alienMissions:
#BEGIN ALIEN BASE BASE MISSION
  - type: STR_ALIEN_BASE_BASE_MISSION
    points: 250
    objective: 2 #Built a alien base
    siteType: STR_ALIEN_BASE_ASSAULT
    spawnZone: 4 #Mission zone for alien bases
    operationType: 5
    operationSpawnZone: 4 #Mission zone for alien bases
    operationBaseType: STR_ALIEN_BASE_ASSAULT
    raceWeights: *BASE_TERROR_INFILTRATION
    waves:
      - ufo: STR_EXCAVATOR
        count: 1
        trajectory: P4
        timer: 25501
      - ufo: STR_SUPPLY_SHIP
        count: 1
        trajectory: P5
        timer: 60
      - ufo: STR_LAB_SHIP
        count: 1
        trajectory: P5
        timer: 60
      - ufo: STR_BATTLESHIP
        count: 1
        trajectory: P6
        timer: 60
        objectiveOnTheLandingSite: true
        interruptPercentage: 33
#END ALIEN BASE BASE MISSION

Code: [Select]
alienDeployments:
#BEGIN ALIEN BASE ASSAULT
  - type: STR_ALIEN_BASE_ASSAULT
    data:
      - alienRank: 6
        lowQty: 1
        highQty: 2
        dQty: 2
        percentageOutsideUfo: 50
        itemSets: *EMPTY
      - alienRank: 7
        lowQty: 1
        highQty: 2
        dQty: 2
        percentageOutsideUfo: 50
        itemSets: *EMPTY
      - alienRank: 8
        lowQty: 1
        highQty: 2
        dQty: 2
        percentageOutsideUfo: 50
        itemSets: *EMPTY
      - alienRank: 9
        lowQty: 1
        highQty: 3
        dQty: 0
        percentageOutsideUfo: 50
        itemSets: *EMPTY
      - alienRank: 11
        lowQty: 1
        highQty: 3
        dQty: 0
        percentageOutsideUfo: 60
        itemSets: *RANK_11_LARGE
      - alienRank: 10
        lowQty: 1
        highQty: 3
        dQty: 0
        percentageOutsideUfo: 60
        itemSets: *RANK_10_LARGE
      - alienRank: 5
        lowQty: 5
        highQty: 8
        dQty: 4
        percentageOutsideUfo: 0
        itemSets: *RANK_5_LARGE
      - alienRank: 4
        lowQty: 1
        highQty: 2
        dQty: 0
        percentageOutsideUfo: 0
        itemSets: *RANK_4_LARGE
      - alienRank: 3
        lowQty: 1
        highQty: 2
        dQty: 0
        percentageOutsideUfo: 0
        itemSets: &RANK_3_LARGE_HE
          -
            - STR_PLASMA_RIFLE
            - STR_PLASMA_RIFLE_CLIP
            - STR_PLASMA_RIFLE_CLIP
            - STR_ALIEN_GRENADE
          -
            - STR_SMALL_LAUNCHER
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_FIRE_BOMB
          -
            - STR_PLASMA_SHOTGUN
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
          -
            - STR_SMALL_LAUNCHER
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_FIRE_BOMB
          -
            - STR_HEAVY_PLASMA
            - STR_HEAVY_PLASMA_ELERIUM_CLIP
            - STR_HEAVY_PLASMA_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
          -
            - STR_SMALL_LAUNCHER
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_FIRE_BOMB
          -
            - STR_PLASMA_SHOTGUN
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
      - alienRank: 2
        lowQty: 1
        highQty: 4
        dQty: 0
        percentageOutsideUfo: 0
        itemSets: &RANK_2_BASE
          -
            - STR_PLASMA_SHOTGUN
            - STR_PLASMA_SHOTGUN_CLIP
            - STR_PLASMA_SHOTGUN_CLIP
            - STR_ALIEN_GRENADE
          -
            - STR_SMALL_LAUNCHER
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_FIRE_BOMB
          -
            - STR_PLASMA_SHOTGUN
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
          -
            - STR_SMALL_LAUNCHER
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_ELERIUM_BOMB
            - STR_FIRE_BOMB
          -
            - STR_HEAVY_PLASMA
            - STR_HEAVY_PLASMA_ELERIUM_CLIP
            - STR_HEAVY_PLASMA_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
          -
            - STR_BLASTER_LAUNCHER
            - STR_BLASTER_BOMB
            - STR_BLASTER_BOMB
            - STR_BLASTER_BOMB
            - STR_BLASTER_BOMB
            - STR_PLASMA_SWORD
          -
            - STR_BLASTER_LAUNCHER
            - STR_BLASTER_BOMB
            - STR_BLASTER_BOMB
            - STR_BLASTER_BOMB
            - STR_BLASTER_BOMB
            - STR_PLASMA_SWORD
      - alienRank: 1
        lowQty: 2
        highQty: 4
        dQty: 0
        percentageOutsideUfo: 0
        itemSets: *RANK_1_LARGE
      - alienRank: 0
        lowQty: 1
        highQty: 1
        dQty: 0
        percentageOutsideUfo: 0
        itemSets:
          -
            - STR_PLASMA_RIFLE
            - STR_PLASMA_RIFLE_CLIP
            - STR_PLASMA_RIFLE_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
          -
            - STR_HEAVY_PLASMA
            - STR_HEAVY_PLASMA_CLIP
            - STR_HEAVY_PLASMA_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
          -
            - STR_PLASMA_RIFLE
            - STR_PLASMA_RIFLE_ELERIUM_CLIP
            - STR_PLASMA_RIFLE_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
          -
            - STR_PLASMA_SHOTGUN
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
          -
            - STR_PLASMA_SNIPER_RIFLE
            - STR_PLASMA_SNIPER_RIFLE_ELERIUM_CLIP
            - STR_PLASMA_SNIPER_RIFLE_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
          -
            - STR_HEAVY_PLASMA
            - STR_HEAVY_PLASMA_ELERIUM_CLIP
            - STR_HEAVY_PLASMA_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
          -
            - STR_PLASMA_SHOTGUN
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_PLASMA_SHOTGUN_ELERIUM_CLIP
            - STR_ALIEN_GRENADE
            - STR_ALIEN_DATA_SLATE
    width: 60
    length: 60
    height: 2
    terrains:
      - UBASE
    shade: 10
    script: ALIENBASE
    briefing:
      textOffset: -16
      background: BACK01.SCR
      showTarget: false
    objectiveType: 3
    markerName: STR_ALIEN_BASE
    markerIcon: 7
    genMission:
      STR_ALIEN_BASE_BASE_MISSION: 100
      #STR_ALIEN_BASE_ABDUCTION_MISSION: 10
      #STR_ALIEN_BASE_HARVEST_MISSION: 10
      #STR_ALIEN_BASE_TERROR_MISSION: 20
      #STR_ALIEN_SUPPLY: 70
    genMissionFreq: 10 #60% chance to generate a mission each time the trigger is called, usually daily
    genMissionRaceFromAlienBase: false #Supply is still alien base race, all others pick from mission raceweights
    alienBase: true # this is only to tell new battle mode what to do with this deployment
    objectivesRequired: 16 #MCD defined specialtype
    objectiveComplete: [STR_ALIEN_BASE_CONTROL_DESTROYED, 500]
    objectivePopup: STR_CONTROL_CENTER_DESTROYED
    points: 34 #points aliens get for a base each day
    cheatTurn: 7 #Force Attack Mode
    winCutscene: winMiss
    loseCutscene: loseMiss
    abortCutscene: abortMiss
#END ALIEN BASE ASSAULT

The other commented out genMissions do work as expected and i was able to test them successfully.
But when the game tries to generate this STR_ALIEN_BASE_BASE_MISSION, it just crashes.

Maybe i did oversee something, but I am at a loss here. Any Ideas?

2
Playthroughs / Hardmode Expansion Attempts from Streamer The_Voice
« on: May 13, 2022, 06:04:42 pm »
Hello all and Good News Everyone!

I recently discovered that some streamer from the US is doing a attempt to beat Hardmode Expansion in Ironman Mode.

He is streaming on Twitch under The_Voice

Feel free to join in onto his endavor. I am enjoying myself greatly, watching him get mauled ;) Well he is learning and adapeting.

I wish you all a nice weekend, good health and so ;)


3
Hello there alltogether,

i was recently setting up OXC and OXCE in a Windows VM, which does not have a Sound device.
The Installation was good, and OXC loads normally and runs fine.
OXCE seems to not load the Sound files of the game if no Sound Device is detected.

See attached Logfiles for detailed messages. Not Mods exept xcom1 have been active.

4
Troubleshooting / Having issues compiling on Linux
« on: January 27, 2022, 12:26:29 am »
Maybe my YAML Version is out of date?


Code: [Select]
[ 73%] Building CXX object src/CMakeFiles/openxcom.dir/Mod/Polyline.cpp.o
/home/patrick/games/openxcom/OpenXcom/src/Mod/Mod.cpp: In member function ‘void OpenXcom::Mod::loadOffsetNode(const string&,

int&, const YAML::Node&, int, const string&, size_t, size_t) const’:
/home/patrick/games/openxcom/OpenXcom/src/Mod/Mod.cpp:730:128: error: ‘const class YAML::Node’ has no member named ‘Mark’
   err << "Error for '" << parent << "': offset '" << offset << "' has incorrect value in set '" << set << "' at line " << node.Mark().line;
                                                                                                                                ^
[ 74%] Building CXX object src/CMakeFiles/openxcom.dir/Mod/RuleAlienMission.cpp.o
[ 74%] Building CXX object src/CMakeFiles/openxcom.dir/Mod/RuleBaseFacility.cpp.o
[ 74%] Building CXX object src/CMakeFiles/openxcom.dir/Mod/RuleCommendations.cpp.o
make[2]: *** [src/CMakeFiles/openxcom.dir/Mod/Mod.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/CMakeFiles/openxcom.dir/all] Error 2
make: *** [all] Error 2


5
Help / spriteFaceColor spriteHairColor spriteRankColor
« on: January 19, 2020, 02:12:22 am »
Hi all,

would someone please be so kind to enlighten me on how palettes and the bitmask for
spriteFaceColor spriteHairColor spriteRankColor are mapped?

How do i know which value represents which color?

6
Dear Meridian and Yanks,

i would like to make a suggestion, it is something which has been bothering me a while. Base management, especially restocking bases, transfering items, redistributing new armor or weapon in the vanilla OXC is kinda of a big hassle. Its very tedious.

OXCE has brought some overviews already, like for research and production, which is a very handy QOL feature, which i really really like.

Can we have something like that for base storages and maybe also personel management? Is there a finance overview already?

That would be really helpful ;)

7
OXCE Builds & Ports / [Solved] Problems when attempting to compile
« on: November 30, 2019, 09:44:21 am »
I am having issues configuring the repo under linux for self compilation:

Code: [Select]
:~/games/openxcom/OpenXcomExtended/build$ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_SUPPORTS_CXX17
-- Performing Test COMPILER_SUPPORTS_CXX17 - Failed
-- Performing Test COMPILER_SUPPORTS_CXX1Z
-- Performing Test COMPILER_SUPPORTS_CXX1Z - Failed
CMake Error at CMakeLists.txt:56 (message):
  The compiler /usr/bin/c++ has no C++17 support.  Please use a different C++
  compiler.


-- Configuring incomplete, errors occurred!
See also "~/games/openxcom/OpenXcomExtended/build/CMakeFiles/CMakeOutput.log".
See also "~/games/openxcom/OpenXcomExtended/build/CMakeFiles/CMakeError.log".

gcc Version is:_gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4

Is my GCC Version too old?

8
OXCE Suggestions DONE / [DONE] Weapon reload cost
« on: November 25, 2019, 12:15:51 am »
Hello there, i was testing out OpenXcom Extended and noticed then when reloading a weapon, the movement cost of the item in the inventory is applied additionally to the 15 TU cost of reloading the weapon.

Would someone mind explaining this behaviour? Since it makes the game nearly implayable with single shot weapons like Grenade launchers, Rocket Launchers and Blaster Launchers.

Vanilla behaviour is reloading a weapon does cost 15 TU, doesn't matter were the ammo is located in the soldiers inventory.

Guess someone was trying to fix a bug, which was never one.

I also researched if this behaviour is somewhat configurable in OpenXcom Extended, but this doesn't seem to be the case.
Nice way of changing a core game mechanic under the nose of players.....

9
Released Mods / FloorObs for Vanilla Plasmaweapon Clips
« on: January 26, 2019, 10:04:39 pm »
Hello guys i was just wondering, if anyone ever made some proper FloorObs for the Vanilla Plasma Weapon Clips:
- Plasma Pisol Clip
- Plasma Rifle Clip
- Heavy Plasma Clip

I searched though a couple of bigger mods and some older ones, but have not found any.

If anyone has some information to offer if anyone already made these would be nice.
Thanks.

10
Offtopic / Putting together a new PC - Advice needed.
« on: October 18, 2017, 08:10:15 pm »
Hello all of you out there in the forum.

I am just searching together new hardware to create my new desktop PC System.
I haven't bother looking at the hardware PC market for a long time and was astonished by the fact that you actually can by 128 core CPU's... who would have been imagining this 20 years ago.

Maybe you guys can give me a hand here or have some recommendations or general advice.
Thanks to the currently high bitcoin value, i am working on a budget of 1500 EUR | ~ 1750 USD

So far my initial research has led me to the following possible configuration:

AMD:

Motherboard:  Asus Prime X370-A AMD X370 So.AM4 Dual Channel DDR ATX Retail 
CPU:          AMD Ryzen 7 1700X 8x 3.40GHz So.AM4 WOF                                     
Cooler:       Thermalright HR-02 Macho Rev. B Tower Cooler                                   
RAM:          16GB (2x 8192MB) Corsair Vengeance LPX black DDR4-3600 DIMM CL18-19-19-39 Dual Kit
Graphic Card: 6GB Gigabyte GeForce GTX 1060 Windforce OC Aktiv PCIe 3.0 x16 1xDisplayPort / 1xHDMI 2.0 / 2xDVI (Retail)
Case:         be quiet! Silent Base 800 insulated Midi Tower (without Power Supply) black
Power Supply: 650 Watt be quiet! Dark Power Pro 11 Modular 80+ Platinum
SSD:          480GB SanDisk Ultra II 2.5" (6.4cm) SATA 6Gb/s TLC Toggle (SDSSDHII-480G-G25)
HDD:          1000GB Seagate Desktop HDD ST1000DM003 32MB 3.5" (8.9cm) SATA 6Gb/s
DVDRW:        LiteOn iHAS324 DVD-RW SATA intern black Retail

I already have 3x 1000GB Seagate Desktop HDD ST1000DM003 32MB 3.5" (8.9cm) SATA 6Gb/s currently running as a raid 5 which needs expansion.

Would this configuration be ok? Or maybe go for a Intel System with the same specs/price.


11
Support Drones Mod

Download: mod.io

This file is also attached towards this post.

#Support Drones Mod v 1.1 by hellrazor

This mod requires at least: openxcom_git_master_2019_02_10_0214 or newer

README for Version 1.1:

About this mod:
This mod adds a army of small drones towards the xcom arsenal.
The drones are small 1x1 sized tanks, which are mainly used for scouting and in support roles.
They do have a weak smoke launcher, with limited range and shots, to break enemy line of sight
or hide exposed soldiers.

The mod should now also work correctly in OpenXcomExtended (Drones are now immun against Stun and Zombification).

There are also models equipped with motion scanners, medikits and tasers for stunning.
The Drones are:

   - Drone/Scout (More Armor, buyable)
   - Drone/Scanner (Less Armor, Motion Scanner)
   - Drone/Medikit (Less Armor, Medikit)
   - Drone/Taser (Less Armor, Taser for range limited stun)
   - Alloy Drone/Scout (More Armor)
   - Alloy Drone/Scanner (Less Armor, Motion Scanner)
   - Alloy Drone/Medikit (Less Armor, Medikit)
   - Alloy Drone/Taser (Less Armor, Taser for range limited stun)

All Drones are repairable, if the corpse of the unit is recovered (at the end of a successful mission).
Drones can also be upgraded and they can switch around the equipment.
For convinience reasons, the Drones have their own three categories in the manufacture menu:
   - Support Drones (Produce Drones and Drone Ammo)
   - Repair Drones (Guess what, repait them)
   - Upgrade Drones (Make then fancier ;-))
Each drone does use one of the HWP spots in your craft, allowing you, to bring a bigger team of soldiers
and still have a sacrifical/expandable unit nearby. Of course you can also mix them with normal tanks.
For example a vanilla Avenger could carry, two normal tanks, two drones and also 16 soldiers, which is a decent sized fighting force.

Feel free to experiment with the usage of drones, their main strong point is the small hitbox they have.
They are usually optimal for scout and sniper tactics.


Credits:
hellrazor - ruleset, sprite recolors
IvenDogovich - sprites for additional drones (BIG THANKS DUDE!!!)
Ryskeliini - original spritework

Based upon the original Scout Drone mod from Arpia ( https://openxcom.org/forum/index.php/topic,1768.0.html  )
A big thanks to Warboy to answer alot of my questions (weapons for tanks in OpenXcom are sometimes weird).
Also thanks to Supsuper to fix the bugs i reported.

Some pictures attached for your enjoyment.

12
Programming / volutars door patch
« on: June 05, 2017, 08:28:39 pm »
Our dear volutar made a patch to fix the timeunit preview for 2x2 tanks and optimize its handling.

I implemented the patch from: http://volutar.myds.me/05_doors.patch

I merged it into my branch here: https://github.com/hellrazor4223/OpenXcom/commit/9b488f02828f22ab5e619054d2734872ca772747
Took some work, but it works, even thou i already found a case were there is some issue.
See screenshots attached.

screen014 and screen015 show that the preview now work correctly.
on screen016 and screen017 there is a slight bug, the preview shows that 4 TU more are consumed then there actually are used. Maybe volutar could take a look at this again.

13
Programming / Reworked Research Code
« on: June 03, 2017, 09:21:10 pm »
My Dear SupSuper and all others,

it took me a while, but i managed to rewrite the essential parts of the research code
Respective functions are:
 - getAvailableResearchProjects
 - isResearchAvailable

They are located in "SavedGame.cpp"

Changes:
 - Checking for a alive Alien and "getOneFree" have been unified
 - Checking also if their "unlocks" are in the discovered list
 - As long as not all "getOneFree" and "unlocks" are in the discovered list, the research topic stays available
 - When both are in discovered the research gets removed from list
 - Code has been made more readable and understandable, also commented

Differences:
 - All alive Aliens will stay around for research, as long as their "getOneFree" and "unlocks" are not discovered

Testing:
 - using the attached testscenario i was able to confirm that all code behaves like it should
   meaning i could research all research topics and achieve to fly to mars

If someone would, please test the code, to verify it is working 100%, i already did but more people can not hurt - THANKS.

Changed getAvailableResearchProjects:
Code: [Select]
/**
 * Get the list of RuleResearch which can be researched in a Base.
 * @param projects the list of ResearchProject which are available.
 * @param mod the game Mod
 * @param base a pointer to a Base
 */
void SavedGame::getAvailableResearchProjects (std::vector<RuleResearch *> & projects, const Mod * mod, Base * base) const
{
        const std::vector<const RuleResearch *> & discovered(getDiscoveredResearch());
        std::vector<std::string> researchProjects = mod->getResearchList();
        const std::vector<ResearchProject *> & baseResearchProjects = base->getResearch();
        std::vector<const RuleResearch *> unlocked;
        for (std::vector<const RuleResearch *>::const_iterator it = discovered.begin(); it != discovered.end(); ++it)
        {
                for (std::vector<std::string>::const_iterator itUnlocked = (*it)->getUnlocked().begin(); itUnlocked != (*it)->getUnlocked().end(); ++itUnlocked)
                {
                        unlocked.push_back(mod->getResearch(*itUnlocked, true));
                }
        }
        for (std::vector<std::string>::const_iterator iter = researchProjects.begin(); iter != researchProjects.end(); ++iter)
        {
                RuleResearch *research = mod->getResearch(*iter);

                // Check if a research is available,
                // when this is not the case remove from list
                if (!isResearchAvailable(research, unlocked, mod))
                {
                        continue;
                }

                // Check if the research has "requires" which need to be satisfied,
                // if so count them and check if all of them are in "discovered",
                // if not remove from list.
                // Check is performed here in case a modder thinks giving a "requires" to alive aliens or item with getOneFree is somehow approriate.
                // We also do not call all the rest of the function, hopefully saving some performance.
                if (!research->getRequirements().empty())
                {
                        size_t countRequirements(0);
                        for (size_t itReqs = 0; itReqs != research->getRequirements().size(); ++itReqs)
                        {
                                std::vector<const RuleResearch *>::const_iterator itDiscovered = std::find(discovered.begin(), discovered.end(), mod->getResearch(research->getRequirements().at(itReqs)));
                                if (itDiscovered != discovered.end())
                                {
                                        countRequirements++;
                                }
                        }
                        if (countRequirements != research->getRequirements().size())
                        {
                                continue;
                        }
                }

                // Lets check the list of already discovered researches and take care of cleaning up
                // the research menu list when needed, but keep alive aliens and items with getOneFree around
                // as long as they have something to discover by the player.
                std::vector<const RuleResearch *>::const_iterator itDiscovered = std::find(discovered.begin(), discovered.end(), research);
                bool liveAlien = mod->getUnit(research->getName()) != 0;
                if (itDiscovered != discovered.end())
                {
                        bool remove = true;

                        // Check if research is a item with getOneFree,
                        // which is still available,
                        // if so do not remove from list
                        if (!liveAlien && !research->getGetOneFree().empty())
                        {
                                if (isResearchAvailable(research, unlocked, mod))
                                {
                                        remove = false;
                                }
                        }
                        if (!liveAlien && remove)
                        {
                                continue;
                        }

                        // Check if alive alien still is available for research,
                        // if so do not remove from list
                        else if (liveAlien)
                        {
                                if (isResearchAvailable(research, unlocked, mod))
                                {
                                        remove = false;
                                }
                                if (remove)
                                {
                                        continue;
                                }
                        }
                }
                if (std::find_if (baseResearchProjects.begin(), baseResearchProjects.end(), findRuleResearch(research)) != baseResearchProjects.end())
                {
                        continue;
                }
                if (research->needItem() && base->getStorageItems()->getItem(research->getName()) == 0)
                {
                        continue;
                }
                projects.push_back (research);
        }
}

Changed isResearchAvailable:
Code: [Select]
/**
 * Check whether a ResearchProject can be researched.
 * @param r the RuleResearch to test.
 * @param unlocked the list of currently unlocked RuleResearch
 * @param mod the current Mod
 * @return true if the RuleResearch can be researched
 */
bool SavedGame::isResearchAvailable (RuleResearch * r, const std::vector<const RuleResearch *> & unlocked, const Mod * mod) const
{
        if (r == 0)
        {
                return false;
        }
        const std::vector<const RuleResearch *> & discovered(getDiscoveredResearch());
        bool liveAlien = mod->getUnit(r->getName()) != 0;
        if (_debug  || std::find(unlocked.begin(), unlocked.end(), r) != unlocked.end())
        {
                return true;
        }

        // Checks if research has "dependencies",
        // if so count how many of them are in discovered,
        // if all are in discovered make research available.
        // Check is performed here in case a modder thinks giving a "requires" to alive aliens or item with getOneFree is somehow approriate.
        // We also do not call all the rest of the function, hopefully saving some performance.
        if (!r->getDependencies().empty())
        {
                size_t countDependencies(0);
                for (size_t itDeps = 0; itDeps != r->getDependencies().size(); ++itDeps)
                {
                        std::vector<const RuleResearch *>::const_iterator itDiscovered = std::find(discovered.begin(), discovered.end(), mod->getResearch(r->getDependencies().at(itDeps)));
                        if (itDiscovered != discovered.end())
                        {
                                countDependencies++;
                        }
                }
                if (countDependencies != r->getDependencies().size())
                {
                        return false;
                }
        }

        // Check if research is either a alive alien or has "getOneFree",
        // if so count how many of the researches "getOneFree" and "unlocks" are in discovered,
        // if at least one of each are not in discovered keep research available.
        else if (liveAlien || !r->getGetOneFree().empty())
        {
                size_t countUnlocks(0);
                size_t countGetOneFree(0);

                if (!r->getGetOneFree().empty())
                {
                        for (size_t itGetOneFree = 0; itGetOneFree != r->getGetOneFree().size(); ++itGetOneFree)
                        {
                                std::vector<const RuleResearch *>::const_iterator itDiscovered = std::find(discovered.begin(), discovered.end(), mod->getResearch(r->getGetOneFree().at(itGetOneFree)));
                                if (itDiscovered != discovered.end())
                                {
                                        countGetOneFree++;
                                }
                        }
                }

                if (!r->getUnlocked().empty())
                {
                        for (size_t itUnlocks = 0; itUnlocks != r->getUnlocked().size(); ++itUnlocks)
                        {
                                std::vector<const RuleResearch *>::const_iterator itDiscovered = std::find(discovered.begin(), discovered.end(), mod->getResearch(r->getUnlocked().at(itUnlocks)));
                                if (itDiscovered != discovered.end())
                                {
                                        countUnlocks++;
                                }
                        }
                }

                // When counters of "getOneFree" and "unlocks" are
                // equal to the respective size of the research,
                // remove topic, since nothing more can be discovered by the player.
                if (countUnlocks == r->getUnlocked().size() && countGetOneFree == r->getGetOneFree().size())
                {
                        return false;
                }
        }
        return true;
}

EDIT: This is the final Version of the code. I did spent the last 8 hours to test it with the attached savefile for vanilla.
I also tested it against my Hardmode Expansion Mod.

EDIT2: Updated the post with the code which is on github. Main change was the comments, for a better explanation.

14
Skystriker - Improved Skyranger Mod

Download: mod.io

The file is also attached towards this post.

#Skystriker - Improved Skyranger Mod v1.0 by hellrazor

The SKYSTRIKER is a modifikation of the Skyranger Craft.
Refitted with a alien alloy airframe. It is faster bigger
and also has a slidedoor on the back, to deploy your troops faster.

Possible Loadouts:

- 16 Soldiers
- 12 Soldiers + 1 Tank
- 8 Soldiers + 2 Tanks
- 4 Soldiers + 3 Tanks

Some pictures added as attachments.

15
Hardmode Expansion / Youtube Videos
« on: January 02, 2017, 10:30:53 am »
Collection of Youtube Video links i made:

I disabled comment on Youtube, please feel free to comment here in this thread.

Feel free to comment again.

OpenXcom Groundbattle - How I Fight! : https://youtu.be/Ybbmzqz0UVU

Pages: [1] 2 3 ... 5