Author Topic: minimod: Elerium and Alloys Listed on Top  (Read 12506 times)

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
minimod: Elerium and Alloys Listed on Top
« on: January 25, 2015, 09:52:40 am »
Code: [Select]
items:
  - type: STR_ELERIUM_115
    listOrder: 1
  - type: STR_ALIEN_ALLOYS
    listOrder: 2

Am I the only one around who wishes checking how well supplied all bases are in Elerium and Alloys, for fuel and manufacturing purposes, was more convenient? Depending on how much other stuff is on each base, finding the entries in the Stores or Sales lists gets a bit annoying, especially if you use multiple bases and need to check them fairly often. I've often wished that the amount of Elerium was displayed under the amount of Money in the main base screen.

Well, with the above, Elerium and Alloys are always on top of the list in Stores, easy to find.

I'm almost embarassed to post something so minimal and trivial-looking, but the change in convenience has been enough for me that I wanna share. In fact, I think this would be a nice addition to the pre-installed mods or Advanced Options (and most of those are pretty small too). So putting this up in case I'm not crazy the only one to think so.
« Last Edit: March 02, 2021, 10:15:43 am by Markus Ramikin »

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: minimod: Elerium and Alloys Listed on Top
« Reply #1 on: January 25, 2015, 11:23:34 am »
May conflict with the 80 Item Limit? (There are player who use it.)

But otherwise a good Idea.

We also could be haveing a drop down category menue like in the manufacture screen.
« Last Edit: January 25, 2015, 11:26:07 am by hellrazor »

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #2 on: January 25, 2015, 12:39:27 pm »
You mean, because it would cause elerium pods to spawn instead of weapons on base defense?

Hm, I'll have to test that. But if so, putting them at the bottom of the list instead of top would be about just as convenient (one extra click gets you there) and avoid that problem.

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: minimod: Elerium and Alloys Listed on Top
« Reply #3 on: January 25, 2015, 01:22:35 pm »
You mean, because it would cause elerium pods to spawn instead of weapons on base defense?

Hm, I'll have to test that. But if so, putting them at the bottom of the list instead of top would be about just as convenient (one extra click gets you there) and avoid that problem.
Exactly :>

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #4 on: January 25, 2015, 10:24:42 pm »
Tested, and this didn't happen for me in my latest base defense. Listing them on top seems safe.

Which makes sense, since the 80-limit mod only applies that limit to craft, and has nothing in it about bases.
« Last Edit: January 25, 2015, 10:29:16 pm by Markus Ramikin »

Offline CryptoCactus

  • Sergeant
  • **
  • Posts: 34
  • oh god how did this get here
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #5 on: January 26, 2015, 09:20:29 pm »
The original game had a 170-item hardcoded max for spawned items (source). I don't believe that's an issue anymore with OXC though.

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #6 on: January 27, 2015, 12:05:07 am »
Just tried your idea as I agree with your point about hunting to find the elerium and alien alloys in your stores but the following happened. After a mission ends the game crashes to the desktop. I used oxc ruleset editor to implement "list order" 1 & 2 respectively, I also made UFO power sources as 3 and 4 for UFO navigation. Have I done something silly? See the attachments. The only way it seems to stop the crashing is to reinstall an unedited Xcom 1 ruleset. It doesn't seem to help if u just delete the above changes.

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #7 on: January 27, 2015, 12:20:39 pm »
Beats me! I've never used the ocx editor, so I don't know how well that works. And I don't mess with Xcom1ruleset. I just wrote it as a separate mod.

I now attached it to my original post, so if you like, try using that file, enable it in mods, and see if that works better for you? (Hopefully you won't need to go back to a savegame from before you made your change).

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #8 on: January 27, 2015, 02:30:31 pm »
Thanks for the .rul file, that seems to work ok, was also able to add on ufo ps and ufo nav as 3 & 4 in the list order. If I've time and can be bothered I might redo the whole list order as some of the items are a bit out of place in stores. Also with the 170 limit not applying to OPXC u might as well do something completely right instead of piece meal. This will take quite a bit of time as atm I've got 56 different items in my stores @ base 1 but I'll need to plan out the order carefully as it'll be a case of how many items could I have @ any base.

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #9 on: January 27, 2015, 02:43:11 pm »
Further point I forgot to add is wud it not be possible to do what I'm suggesting but split the stores up into different sections like manufacturing?

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #10 on: January 28, 2015, 01:19:03 am »
Here's what I've got so far and a brief test on my current game seems to have it working ok. However the way I wud imagine it in completion wud be the equivalent of 14 sections worth of items in one long list as I'm not sure how u wud implement having it in sections like manufacturing. Atm my knowledge of editing .rul files is very limited and on a trial by error basis. But thanks 4 putting me onto this idea and feel free to tweak with this urself. I'm trying to put everything in alphabetical order so that's why "Aegis Fuel" from XOP'S great mod is last @ the minute as it's called XCF_FUEL, go figure but I'm not going to change every mention of Aegis Fuel in Xeno Ops to XCF_FUEL just to fit one line in a highly experimental mod.

Offline Dooh

  • Squaddie
  • *
  • Posts: 5
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #11 on: January 30, 2015, 03:31:20 pm »
Hi there,
The idea to show amount of Elerium and Alloys in main base screen is very good. Actually there is no need to know how much money you have from the main base view. This information is almost at every submenu - manufacture, purchase, sell, even on geoscape after enabling Show Funds in game options.
I did some digging in the code and changed funds info to Elerium and Alloy info. Unfortunately there is no place for two lines and adding also funds to the same line might be too long.

To apply this modification you need to edit BasescapeState.cpp file with below code and recompile.

Code: [Select]
ADD AT TOP OF FILE:
#include "../Savegame/ItemContainer.h"

REMOVE THIS:
        _txtFunds->setText(tr("STR_FUNDS").arg(Text::formatFunding(_game->getSavedGame()->getFunds())));


ADD THIS:
        const std::vector<std::string> &items = _game->getRuleset()->getItemsList();
        for (std::vector<std::string>::const_iterator i = items.begin(); i != items.end(); ++i)
        {
                int e115;
                int alloy;
                std::wostringstream ss, ss2;
                if (*i=="STR_ELERIUM_115")
                {
                        e115 = _base->getItems()->getItem(*i);
                }
                if (*i=="STR_ALIEN_ALLOYS")
                {
                        alloy = _base->getItems()->getItem(*i);
                }

                ss << e115;
                ss2 << alloy;
                        _txtFunds->setText(tr("E>{0}, A>{1}").arg(ss.str()).arg(ss2.str()));
        }

Result is like below.
PS. As I am not a C++ programer the code might be a little clumsy. Also sorry for my English, it's not my first language.

Offline Markus Ramikin

  • Captain
  • ***
  • Posts: 83
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #12 on: January 30, 2015, 03:39:52 pm »
Wow, C++ got a lot uglier since I last bothered with it (which admittadly is a loong time ago).

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #13 on: February 22, 2015, 02:42:53 pm »
Based on ur original idea I expanded this to cover all items in my current game. ITEM LIST ORDER.rul is now complete so I throw this .rul file to the community for thoughts, comments or suggestions. I wud have liked to divide the rul file in different sections rather than one long list but ran into problems so settled for this. Any one can use this if they want to but it is based on having all these mods on in this order:

rulesets:
  - Xcom1Ruleset
  - 2012DeathSounds
  - Acid_Weaponry
  - AlienInventory
  - Batman
  - CUSTOM STATSTRINGS
  - CivArmorRich
  - CraftMissleSound
  - DartPistol
  - DartRifle
  - EleriumFlare
  - Enforcer
  - ExtraPockets
  - Extra_Explosions
  - FireStormGfx
  - FlashBangGrenades
  - GaussWeaponry
  - GenderDetail
  - GuidedMissile
  - HWP_Mortar
  - Improved_HandOb
  - Improved_Recruit_Start_Stat
  - Ironman Super Suit
  - Laser_Sniper_Rifle
  - MassAccelerator
  - PSX_Static_Cydonia_Map
  - Predator
  - SECTOPOD_HWP
  - SPACEMARINES
  - SniperRifle_custom
  - SniperRifle_u2s
  - TacticalNuke
  - UFOextender_Gun_Melee
  - ViperAssaultCannon
  - WeaponNaymore
  - WeaponTranquilizer
  - XcomUtil_Fighter_Transports
  - XcomUtil_High_Explosive_Damage
  - XcomUtil_Improved_Ground_Tanks
  - XcomUtil_Pistol_Auto_Shot
  - XcomUtil_Skyranger_Weapon_Slot
  - XcomUtil_Starting_Defensive_Improved_Base
  - YetMoreUFOTypes
  - small_rocket_small
  - Research_Alive_Aliens
  - Alternate_Lightning_Thunder
  - Commendations
  - CommendationsUFOpedia
  - Terrain_Pack_Nightly
  - ITEM LIST ORDER

Offline SIMON BAILIE

  • Commander
  • *****
  • Posts: 676
    • View Profile
Re: minimod: Elerium and Alloys Listed on Top
« Reply #14 on: February 22, 2015, 05:26:28 pm »
Tried to improve on my earlier rul file by putting different sections in and it seemed ok when I checked it on https://yaml-online-parser.appspot.com/?url=http%3A%2F%2F but when I used the attached version it wudn't load and gave me the attached error message. Any one know what's wrong?