Jump to content

Screenstack, kscreen, Flash, and UIMissions -At Wit's End


TeamDragonpunk

Recommended Posts

Hi,

Has anyone posted a good tutorial on understanding and manipulating the Screenstack, yet? I'm at my wit's end with all of this. Initially, I just wanted to add the intel options panel to every mission, similar to the existing intelligenceSpending mod. It looks like that author ran into the same problems I did with trying to modify the existing Flash widgets. Eventually, I may just spend the $250 for a license of ScaleForm.

 

I moved on to creating a second Black Market and populating it with the hacker rewards. It's great, and even better than the intel options panel actually. The only problem is that I can't get it to show anytime after you select a mission

 

Initial Mission Screen: 1 of 7 UIMission screens with 2 Flash widgets (BuildMissionPanel and BuildOptionsPanel)

-Tried calling the Black Market screen anywhere in here and nothing happens, even when you push to the front of the stack. I assume 2 Flash screens can't overlap, but since there is no documentation, that's only an assumption.

 

Squad Select: I may have to cram it in here as a button on the bottom, but with all the mods already using this, I'm trying to keep the UI clean.

 

Pre-Skyranger Screen: Also has 2 Flash widgets and will not allow the Black Market screen to be overlayed. Again, assuming that somehow 2 Flash based screens are incompatible for some reason.

 

 

Link to comment
Share on other sites

I too would be much interested to find out what the Screenstack'ing principles truly are.. but maybe not for the same reasons as you do.

 

To me, these all are HUD Layers guided by similar Flash-Assets and yet completely isolated in terms of "accessing" various components. A bit like the Strategy+Tactical+Geoscape+Avenger_AntFarm structures but with some tricky embedding elements archived in different (or in rare cases, common) UPK files.

 

My latest attempt at creating a "TexMod" style tool (SwappImg) doesn't perform entirely as expected mostly because of the above dispatch system where Paths & referencing are both defined in either Flash scripting or conventional UC-IDE flow.

 

https://forums.nexusmods.com/index.php?/topic/4077190-texmod-swapimg-code-breakthrough/?p=37800545

 

For example, the Spoiler from the above post has a custom image for the Xcom_default file that occupies the pending save box.

This screen is attached to a formal click-on "ARROW" context like many others.. indicative that another layer is currently in focus.

 

When such interactive Calls are done or prepared by the Engine, a series of code widgets participate into a "scrambling" of components.. Some of which hardly hidden in obscure code acrobatics --and this is where it hurst the most-- only Natively declared.

 

Thus.. the mystery goes on. Until somebody can clarify these to both of us & many more modders, i'm sure.

 

Crossing fingers. :smile:

Edited by Zyxpsilon
Link to comment
Share on other sites

Scaleform is not likely to help you too much, I don't think. That would be useful if you want to create your own custom flash, but that'd completely bifurcate the UI. In order to make a custom screen or panel from the flash level you need to tie into the ActionScript framework exposed by the game's ui - you need to inherit from the right classes and call the right functions in the actionscript to make that work, and none of that source code is part of the SDK.

 

I did hack together a custom screen with some custom flash, importing the .swf to unreal and that did load (at least I could draw some basic sprites). But since it's not really a proper Screen at the flash level I can't attach any vanilla panels to it, so I can't really build anything useful from this unless I want to reimplement all the widgets and everything.

 

I don't think I understand your original problem, though. Are you trying to create a new screen and display some existing panels in it? As. I understand it, that should work, but there might be something specific about the intel panel that I'm not familiar with.

Link to comment
Share on other sites

Ok I've been doing some little experiments as Daniel (TeamDragonpunk) is aware of and i will continue to work on it but i am here to say that i have made a little breakthrough in that i was able to overlay the current GP Intel option screen on the regular one, next i'll duplicate the code in it's entirety and start messing around with the different parts and tearing it apart, should have something working withing a week or so. The code i used to show the GP intel options screen (super simple)

class UI_Listener_MissionUI extends UIScreenListener;

event OnInit(UIScreen Screen)
{
    local UIMission_GPIntelOptions kScreen;
    if(Screen.IsA('UIMission'))
    {

        // Show the Golden Path mission with intel options
        if (!`ScreenStack.GetCurrentScreen().IsA('UIMission_GPIntelOptions'))
        {
            kScreen = Screen.Spawn(class'UIMission_GPIntelOptions', Screen);
            kScreen.bInstantInterp = true;
            kScreen.GPMissionSource =XComGameState_MissionSite(`XCOMHISTORY.GetGameStateForObjectID(UIMission(Screen).MissionRef.ObjectID)).Source;
            `ScreenStack.Push(kScreen);
        }

        `log("-------------DOING MY MISSION SCREEN-----------------",true,'Team Dragonpunk Goblin Market');
    }
}

defaultproperties
{
    // Leaving this assigned to none will cause every screen to trigger its signals on this class
    ScreenClass = none;
}
Link to comment
Share on other sites

Eladdy202, just tested your code, and it does work... to some extent. What is interesting, is that it pulls in the BuildMissionPanel() data from the actual mission. I'm not even sure why or how it does that lol. While this will probably solve our current issue, we'll still have to deal with limited UI and Widget control at some point. Of all the power we have over the source code, it would be unfortunate if the UI was a deal breaker.

Link to comment
Share on other sites

Speaking of the action script code in Flash, is that where the internal game logic is that takes us from the mission launch button to the Squad Select screen?

simulated function BuildOptionsPanel()
{
	LibraryPanel.MC.BeginFunctionOp("UpdateCouncilButtonBlade");
	LibraryPanel.MC.QueueString(m_strCouncilMission);
	LibraryPanel.MC.QueueString(m_strLaunchMission);
	LibraryPanel.MC.QueueString(m_strIgnore);
	LibraryPanel.MC.EndOp();
}

We're sending a string to populate the launch mission button with LibraryPanel.MC.QueueString(m_strLaunchMission); but I don't seem to find any code taking us to Squad Select screen. So while I can use an OnLaunchClicked event handler, I can't take us back to the Squad Select screen when finished.

 

https://www.dropbox.com/s/im8zm86not903yq/RanDPScript.PNG?dl=0

 

If you look at that image, you'll see in the logs that our script DID run once I pressed the launch button, but the Black Market UI never came up. It just went straight to squad select.

 

I did try to see if I could stop it with a bInstantInterup but apparently you can't do that with any UIScreen based class.

 

UPDATE: Ok, it looks like the parent class has a CloseScreen function that may be responsible. No documentation, so I can tell if by closing the geoscape, you go straight to Squad Select screen (still can't find that logic anywhere). I did comment out super.OnLaunchClicked(button); and the Black Market UI does run now. Of course, now I can't get to the Squad Select screen. If it's not one thing, it's another lol.

Link to comment
Share on other sites

Ok, so thanks to Eladdy202 we have the Black Market screen coming up once you press "Launch" on a mission. We're getting the same problem with the intel options code as far as strings not populating though.

 

The following is the Flash code in UIBlackMarket that will randomly call 1 of the 7 black market "welcome" phrases. The phrases are in the localization file.

LibraryPanel.MC.FunctionString("SetMenuQuote", m_strWelcome[Rand(NUM_WELCOMES)]);

I'm making no modifications to the UIBlackMarket class, and yet this still does not work. It's called in the BuildScreen function, and we ARE calling it because the buttons and everything else are created.

 

So... is anyone else having issues getting their strings to populate in Flash based panels/screens? (Perhaps I'm doing something wrong with the localization file). Do we need to include the flash utilities function in our mods? @tracktwo Do you have any insight, sir?

Link to comment
Share on other sites

So here is where we are at right now...

 

https://www.dropbox.com/s/8an1u50z5urhex0/GoblinMarket.png?dl=0

 

While we are getting results, the Flash functions are still not pulling from the XComeGame.int localization file. I'm having to hard code strings in, which is of course, very inelegant and defeats the point of localization.

//	LibraryPanel.MC.QueueString(class'UIAlert'.default.m_strBlackMarketLogoString);
    LibraryPanel.MC.QueueString("Goblin Market");
Link to comment
Share on other sites

  • Recently Browsing   0 members

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