View Issue Details

IDProjectCategoryLast Update
0019981AI War 2Bug - OtherAug 26, 2018 12:34 pm
ReporterRocketAssistedPuffin Assigned ToBadgerBadger  
Status resolvedResolutionfixed 
Product Version0.759-0.760 Only The Start of Discovery 
Fixed in Version0.761 A Badger And A Puffin 
Summary0019981: My notes on the Arks being un-upgradeable (Fix details inside, tested)
DescriptionDon't think I can do anything further, so putting this mess here so it isn't clogging up Discord. Keep worrying about that.

So Arks don't show up in the tech menus. From Chris' documentation of how the new XML stuff works, build menus and tech menus are together, so the Arks have to be in a build menu of some kind, using "built_by" line. For this purpose I made a new menu called "ArkUpgrades", that no builder unit has access to, and shows up in the tech menu.

It works, the Ark I was using is now upgradeable, and not buildable by anything. Problem is, it shows up all the time. I could have ArkOne, yet have the option to upgrade Thanatos, which obviously isn't good. Each attempt to fix this, by having the Ark itself grant you the tech to upgrade it, has failed. So far, I can't find any method of doing that.

I've tried to make the Ark act like an ARS, but it isn't claimed at game start, so does not trigger it, and gets an ugly addition to the tooltip. This'd also require new "drawbags", one for each Ark, containing just itself so it doesn't grab the wrong Ark for the one you picked. Don't want to do that.

I've tried to have it only show up when the Ark itself is present, like the Zenith Trader but that only works so far on the build part, which is already hidden; tech still shows.

Attempted for it to be unlocked by "LineMustBeGrantedByStructure" with no success either - the only structure that unlocks anything is the ARS. Couldn't find anything else that worked similarly to work off.

Looked in the C# but it doesn't seem to mention anything tech wise for Arks.

There's probably more I've tried...mind is frazzled right now, so can't recall every single one. I have looked at numerous other units and tried about all of them, though.

I am completely stalled, so am leaving it for now. I imagine if/when Fabricators exist, their code would work. Fabricator being held unlocks the ship line - except in this case, the Ark being held unlocks itself as a ship line, which grants the player the tech choice to upgrade it, while still not being buildable by anything. This'd also mean the player can't upgrade a wrecked Ark, which might be good?

That's all I have.




TagsNo tags attached.

Activities

BadgerBadger

Aug 26, 2018 10:13 am

manager   ~0048335

Having one Tech upgrade that affects all Arks is very hard. When I did this before the era of discovery, I instead created Techs for each ark upgrade. Then in the UI C# code said "Only display the tech for the Ark that's currently enabled".

Chris redid all of how the Tech stuff worked, and I haven't looked at it since.

RocketAssistedPuffin

Aug 26, 2018 10:57 am

reporter   ~0048338

Was intending for the Tech upgrades to be for each Ark separately, and be available to you simply by having the Ark held. This didn't really work out.

I'll try to look at the UI C#, didn't occur to me.

RocketAssistedPuffin

Aug 26, 2018 11:17 am

reporter   ~0048341

"{
                        item = items[j];
                        if ( !localPlayerFaction.CanSeeTechOnMenu( item ) )
                        {
                            //if ( item.ShipLineMustBeUnlocked == ShipTypeUnlockStyle.LineUnlockedFromStart )
                            //{
                            // UnityEngine.Debug.Log( item.InternalName + ": " + localPlayerFaction.MarkLevelsByShipLine_PlayerOnly[item.RowIndex] +
                            // " current, " + item.StartingMarkLevel.Ordinal + " starting, max: " + item.MaxMarkLevel );
                            //}
                            continue;
                        }
                        if ( item.TechCost.ArkUpgradePointCostsByOrdinal[0] > 0 )
                        {
                            //Only show ark tech that the player has enabled
                            Faction faction = World_AIW2.Instance.GetLocalPlayerFaction();
                            string ark = faction.Ex_MinorFactionCommon_GetPrimitives().ark; //reset the things that can be set during the game lobby each time
                            if(!ArcenStrings.Equals(ark, item.InternalName))
                                continue;
                        }
                        btnScienceItem itemButton = btnScienceItemPool.GetOrAddEntry();
                        itemButton.ShipLineToUnlockOrUpgrade = item;
                        itemButton.ShipLineToUnlockOrUpgrade_ForMarkStats = item.ForMark[localPlayerFaction.GetEffectiveTechScienceCostMarkLevel( item )];
                        this.ItemsAvailableInCategory++;
                    }"

Would this happen to be it? It's still in there.

RocketAssistedPuffin

Aug 26, 2018 11:56 am

reporter   ~0048343

That was it. This line here:

 if ( item.TechCost.ArkUpgradePointCostsByOrdinal[0] > 0 )

was the culprit. Becaaaaaaause, in TechCosts.XML:

ark_upgrade_point_costs_by_ordinal="0,1000,3000,9000,18000,30000,60000,140000"/>

That 0 at the start meant the UI code you put in was hiding it, because the first upgrade cost no Ark points. Removing it causes the Arks to appear in my Tech menu, Ark Upgrades. No Ark, nothing shows up under it. Tested it with all five, they all show up correctly. So, great success.

The build menu XML:

"<build_menu name="ArkUpgrades"
              display_name="Ark Upgrades" show_in_tech_menu="true"
              description="Ark Upgrades"
  />

For each Ark, add this: built_by="ArkUpgrades"

In KDLTechCosts.XML, simply change

ark_upgrade_point_costs_by_ordinal="0,1000,3000,9000,18000,30000,60000,140000"/>

To:

ark_upgrade_point_costs_by_ordinal="1000,3000,9000,18000,30000,60000,140000"/>

or any other value you wish, as long as the first number isn't 0.

Finally glad that's done...I hope. Thanks for the UI mention again.

BadgerBadger

Aug 26, 2018 12:34 pm

manager   ~0048344

Fixed!

Issue History

Date Modified Username Field Change
Aug 26, 2018 9:45 am RocketAssistedPuffin New Issue
Aug 26, 2018 9:48 am RocketAssistedPuffin Description Updated
Aug 26, 2018 9:50 am RocketAssistedPuffin Description Updated
Aug 26, 2018 10:13 am BadgerBadger Note Added: 0048335
Aug 26, 2018 10:57 am RocketAssistedPuffin Note Added: 0048338
Aug 26, 2018 11:17 am RocketAssistedPuffin Note Added: 0048341
Aug 26, 2018 11:56 am RocketAssistedPuffin Note Added: 0048343
Aug 26, 2018 12:32 pm RocketAssistedPuffin Summary My notes on the Arks being un-upgradeable => My notes on the Arks being un-upgradeable (Fix details inside, tested)
Aug 26, 2018 12:34 pm BadgerBadger Assigned To => BadgerBadger
Aug 26, 2018 12:34 pm BadgerBadger Status new => resolved
Aug 26, 2018 12:34 pm BadgerBadger Resolution open => fixed
Aug 26, 2018 12:34 pm BadgerBadger Fixed in Version => 0.761 A Badger And A Puffin
Aug 26, 2018 12:34 pm BadgerBadger Note Added: 0048344