Jump to content

GlobalPersistentCookerData


Neonin

Recommended Posts

Has anyone had any luck getting at the Actionscripts contained in this? I'm pretty sure what I'm after is in there but as UExplorer won't show anything in it and Johnnylump's method of stripping all the bytes before GFX doesn't work on this file I'm a little stuck. Specifically I'm after the script AS_AddAbilityItem and the only references I've found so far are once in XComGame where it's called and 11 times in GPCD.

 

To be more specific in case anyone is curious, at the moment I'm looking at the function PopulateFlash in the UITacticalHUD_AbilityContainer part of XComGame.upk. This bit was interesting:

 

 

               if(kAbility.HasProperty(2))
                {
                    strBgLabel = "purple";
                }
                // End:0x45B
                else
                {
                    // End:0x44B
                    if(kAbility.HasDisplayProperty(9))
                    {
                        strBgLabel = "yellow";
                    }
                    // End:0x45B
                    else
                    {
                        strBgLabel = "cyan";
                    }
                }
                AS_AddAbilityItem(I, class'UIUtilities'.static.GetAbilityIconLabel(kAbility.GetType()), bAvailable, strCoolDown, strCharge, strBgLabel, Caps(kAbility.strName), ((bHideConfirmButton) ? "" : m_strAbilityHoverConfirm), kTargettedAbility.CanFreeAim(), controllerRef.m_Pres.m_kKeybindingData.GetPrimaryOrSecondaryKeyStringForAction(controllerRef.PlayerInput, 26 + I));

 

Having done a little testing with simple hex edits, changing "yellow" to "purple" modifies all the ability icons gained from normal perks to have the psi-purple background colour instead of the normal yellow one. If you remove the string or leave gibberish in its place it defaults back to the cyan colour normally used, regardless of whether you've changed "cyan" to something else, so I'm guessing there's a default value stored somewhere I haven't found yet.

 

The bit that I'm definitely struggling with is the AS_AddAbilityItem call. I can read code well enough to know that when called this function is being passed the strBgLabel and bAvailable, which I'm guessing it uses to parse the colour string and if the ability is unavailable drop the opacity of the icon. Unfortunately without being able to get at that function changing things is proving difficult. It gets called just below PopulateFlash as the following:

 

 

simulated function AS_AddAbilityItem(int Id, string Icon, bool isActive, string CoolDown, string charge, string bgLabel, string antennaDesc, string antennaOK, bool canBeFreeAimed, string hotkeyLabel)
{
    manager.ActionScriptVoid(string(GetMCPath()) $ ".AddAbilityItem");
    //return;    
}

 

From Johnnylump's investigations I assume this is calling an external Actionscript, which as I said I can only find another reference to (so far) in GPCD.upk.

 

Sorry if this doesn't make a lot of sense, I'm still new at this!

Edited by Neonin
Link to comment
Share on other sites

The actionscript throughout the tactical game seems to be handled a bit differently than the actionscript in the shell (game launch) and strategy game. I haven't yet figured out where the tactical game actionscript is stored.

 

It seems that every unreal game has a globalpersistantcookerdata file, so I don't think that it's something that contains any game developer-written code, but is something more like a big cross-linking reference file between the various upks and texture files.

 

I think the references you found there are maybe the reference to where the actionscript is actually stored?

Link to comment
Share on other sites

I've just looked through a mission-specific upk file picked at random (LSmallScout_River.upk) and it contains extensive flash data, the AddAbilityItem() method is implemented in the AbilityContainer class of a flash section titled TacticalHUD.

I've attached a zipped version of an excised swf file here:

 

There's 15 more flash files contained in that upk totaling about 1MB of data, interesting stuff like MissionSummary or UnitGermanMode.

I suspect that instead of using a single upk containing all necessary flash stuff for the tactical game each level (i.e. mission) features its own copy of those embedded flash files, possibly featuring additional content for specific level types, e.g. council missions.

Modifying the common tactical UI would probably require applying changes to all level files :confused: On the other hand, this does open up the opportunity to implement some mission-specific UI things, if anyone can think of something cool :sweat:

Link to comment
Share on other sites

Well, that would explain why it's so hard to find the tactical actioscript, why there is no release map editor, and why the map upk files are so big.

 

I'm sure that there are some common UI libraries that get compiled into each map, but this massively explains why it is that Firaxis doesn't release a bunch of extra map packs, since the maps are ever-so-much more than just data.

 

In case you are interesting "GermanMode" refers to the detailed breakdown view that appears when selecting a target to use an ability on. I have no idea why it was called German mode, but I'm sure there's an interesting story there.

 

Has anyone tried decompressing one of the maps and running it through UE Explorer to see if there's any upk hex code in a map?

Link to comment
Share on other sites

Has anyone tried decompressing one of the maps and running it through UE Explorer to see if there's any upk hex code in a map?

Nope, doesn't look like there's any UnrealScript, at least not in LSmallScout_River.upk. It's all art assets in there as far as I can tell.

 

The 'German mode' reference is probably some kind of in-joke poking fun at the German's fondness for boring simulation/management games that are basically glorified spreadsheet editors, e.g. the countless incarnations of Fußball Manager and such :)

Edited by XMarksTheSpot
Link to comment
Share on other sites

Hoooooo boy... I did manage to find some new SWF files in Startup.upk, and I thought I'd hit the jackpot when I spotted this in the 22nd (and last, sods law) one I extracted:

     if(!active)
      {
            this.isActive = false;
            this.iconMC._alpha = 40;
      }
      else
      {
            this.isActive = true;
            this.iconMC._alpha = 100;
      }

Changing the 40 to anything else just caused the game to crash, unless I'm just modding it wrong.

 

(Edit: Thinking about it, I'm sure they were the values for icons on the perk tree in the Abilities window... Perhaps because I'd already modded that elsewhere the change here was clashing and causing the crash?)

 

There's a similar section in that TacticalHUD under AbilityItem with the values 30 and 60. That sounds more plausible because the icons aren't bright enough to be at 100 alpha, so I guess I'm going to have to pick a map and load up the old DevShell menus to keep testing it.

 

As always, you guys rock :D

Edited by Neonin
Link to comment
Share on other sites

Ok, I can confirm that changing the value in the actual map file changed the alpha value of the icons for that specific map only. Sheesh, the don't like making things easy on me do they? :tongue:

 

Now all I have to do is figure out how to get rid of the overlay, which I think might be related to the ShowGlow thing.

 

EDIT AGAIN: Looks like the glow thingy was actually related to the alpha level. Like the Abilities screen, once the alpha was shoved up to 100 the icon displayed perfectly with no icky overlay, which I know now is actually an underlay! You guys have led me to the promised land! All I need to do is go through each map... urgh... and change the alpha values, stick them all into a Toolboks mod, and that section of my mod will work as intended :D

Edited by Neonin
Link to comment
Share on other sites

Question: Did bokauk go through and change the soldier info display on every map to show the XP values for that mod, or are we missing some default/overall place this stuff could be edited? Hmm...

Link to comment
Share on other sites

AFAIK, the solution for displaying XP has never been made public (although I guess you could try to find it by comparing upks), but I strongly doubt she changed every map. I'm not aware that anyone in the modding community has done anything to map files before.

Link to comment
Share on other sites

I thought as much, but I could have missed it being posted as I only recently started reading/learning how to do this sort of thing. At the moment I'm about 2/3rds of the way through making the changes to the map files I need to but I'm thinking towards EW, as if the maps are changed/updated the way some of the Devs seem to indicate it's entirely possible it will break my changes and I'll have to do them all again. While easy, it's extremely tedious! Also if there's a single place these changes could be made it would make life easier on Toolboks, as I've crashed it three times with the size of the mod (it hits around 1.2 gig memory usage then has a panic attack) so I've had to split it into three sections so far :P

Edited by Neonin
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...