Jump to content

ActionScript (aka Flash) directions


amaciel81

Recommended Posts

OK, guys, I'm still far from understand how to mod X-Com, but now I grasping better some basic concepts.

 

So... I want to ask your help again. I successfully increased the number of alien species in hyperwave relay display to 8:

 

 

http://static-2.nexusmods.com/15/mods/151/images/619-0-1438992952.png

 

 

 

This display is created by the following call:

AS_SetHyperwaveData(m_strHyperwavePanelTitle, Caps(kAlert.arrLabeledText[3].strLabel), kAlert.arrLabeledText[3].StrValue, Caps(kAlert.arrLabeledText[4].strLabel), kAlert.arrLabeledText[4].StrValue, Caps(kAlert.arrLabeledText[5].strLabel), formattedSpecies1, formattedSpecies2);

As far as I understand AS_ means this is a ActionScript call; formattedSpecies1 and formattedSpecies2 are string arguments used to fill species detected column 1 and 2, which are limited to 4 lines

 

My question is: there is a way I can "see" this ActionScript asset? There is a way I can change it, make it bigger or something? Is this a different kind of problem than lab slots UI glitch fixed by XMarksTheSpot?

 

Thank you very much,

Link to comment
Share on other sites

You'll need to extract the SWF files from the UPK files which you can do with Toolboks. You can view and edit these files with JPEXS. Once you've updated the SWF (which is a major pain in the ass) you can create a PatcherGUI patch file to get your changes back into the game.

 

XMarksTheSpot provided me with a lot of useful info about how to do this a while ago. See my original question thread here:

http://forums.nexusmods.com/index.php?/topic/2768619-how-to-resize-andor-move-ui-elements/

Edited by SpazmoJones
Link to comment
Share on other sites

And -- that SWF asset is located inside the UICollection_Strategy_SF.UPK & driven by the gfxMissionControl.swfmovie pseudo-file which you can obtain by using Gildor's UE toolset (( http://www.gildor.org/downloads )).

 

You can extract (and even edit.. but that's a bit risky & somehow complex) these kind of code resources with a decompiler program called JPEXS (( https://www.free-decompiler.com/flash/ )).

 

Then, firstly -- the essential Hyperwave-Data scripting is being handled by the UFOAlert Class in the following function;

  function SetHyperwaveData(title, objectiveLabel, objectiveData, crewLabel, crewData, speciesLabel, speciesData1, speciesData2)
   {
      var _loc2_ = this.hyperwavePanel;
      _loc2_.titleField.text = title;
      _loc2_.objectiveLabel.text = objectiveLabel;
      _loc2_.objectiveData.text = objectiveData;
      _loc2_.crewLabel.text = crewLabel;
      _loc2_.crewData.text = crewData;
      _loc2_.speciesLabel.text = speciesLabel;
      _loc2_.species_0.text = speciesData1;
      _loc2_.species_1.text = speciesData2;
      _loc2_._visible = true;
      this.bgLeft.gotoAndPlay("hyperwave");
      this.bgRight.gotoAndPlay("hyperwave");
      this.reticle.gotoAndPlay("hyperwave");
   }

Secondly, two DefineEditText components are involved to display the speciesData1 & speciesData2 "columns"... #195 & #196 which offer various settings like XY-min-max, Fonts+Height, Multiline (( i guess that's what you're after to *ADD* detected species, right? )), wordwrap, align, color, etc.

The DefineSprite (#197) is used to dispatch various HUD elements for two specific core-sprites -- UFOCrashAlert (#215) & UFOLandingAlert (#206). But, you'll see all of these facts when you inspect the gfx yourself with JPEXS suggested earlier.

 

Thirdly, there might also be some specific code elsewhere (XComGame.UPK, etc) that could indirectly perform extra "HUD" related stuff... for the Hyperwave framework found in the SWF processing above. Worth looking into with UEExplorer (again, as you seem to have figured out some of that ActionScript stuff already) just in case the basic control of that data needs some important pre-parsing details from other sources and/or functions.

Edited by Zyxpsilon
Link to comment
Share on other sites

First, thank you both; now I understand better of what I need to do. I extracted the SWF and I saw how it's composed. It is bit complex, but I have an idea how of what I need to do.

 

However, I'm unable so far to put code back in UPK. JPEXS doesn't allow me to save directly over the file, and all my saves they are completely different of the original (in my understanding, only some bytes should change, right?). So, how can I patch the UPK to change SWF?

 

Thanks!

 

Nevermind, I still have a lot to learn, but I did it. So, like Zyx said, there are actually two parallel text boxes, to show species. But the problem is not the multiline setting (because the boxes are multiline already, the problem is the text box height fits exactly 4 lines. So, the solution was to reduce the font size until make each text box fits 7 lines, making up to 14 displayed species. It's not the ideal solution, but it's good enough for now.

 

The next step should be try resize the text boxes. However, resizing the text boxes would require to resize the dialog, and resizing the dialog would require to move the reticule (the stuff pointing to the UFO crash site) and the dialog with commands.

 

Perhaps, a different solution could be "create" additional columns using tabs instead newlines after every specie. This require some work on code side, but it's not impossible.

 

What do you think?

 

Thank you all!

Edited by amaciel81
Link to comment
Share on other sites

One composite word; Scroll-Container!

:smile:

 

OR -- what if.... you'd just move the sub-title header overthere?

 

http://s30.postimg.org/611t3nloh/Hyperwave_More_Lines_For_Detected.png

 

I also have to wonder if that Framing "Container" could be expanded (to the right) with the re-sizing method already supplied by a Flash option.

:D

Edited by Zyxpsilon
Link to comment
Share on other sites

I like Zyx's idea of moving the "Species detected" label, but you could also simply hide it. That would give you more room to increase the existing 2 columns. Combined with the smaller font size (which looks fine to me), you should have enough space for at least 16 species.

 

Alternatively, you could separate the species with plain old commas. Just widen the one text box and make sure word wrap is enabled.

Link to comment
Share on other sites

Ya know... two columns of 7 (( or 8 )) each might well be just enough.

15 Aliens + 1 Exalt... you get to keep some mystery if 14 is the new maximum while 16 won't leave any rocks unturned -- except for Outsiders, of course!!

:ninja:

Edited by Zyxpsilon
Link to comment
Share on other sites

If you have a campaign with a lot of exalt clues, open up the covert ops screen in the situation room and notice how the list of clues scrolls when there are more clues than space in the very similar layout there - a short double column list.

 

This is done with a vertical scroller utility class firaxis provides and it might be possible to hook this up to the existing flash. Modding the flash directly is kind of tedious, though.

 

For the campaign summary timeline, I am doing something similar, except I'm using my own textbox that I overlay on top of the situation room ui and i draw the text in there instead of in the continent info textbox in the vanilla ui.

 

I wonder if it'd be useful to split that component out into a separate upk that you could load on demand (eg with a mutator) to place a scrollable text box anywhere on the screen with whatever data you want to display? Anyone think of any other places where we would want a scrolling textbox where there wasn't one before?

Link to comment
Share on other sites

@Zyz, @Spazmo and @TrackTwo; first, thanks for all support.

Scroll-container would be perfect, but I have no idea how edit the SWF model to make a change that big. Moving the header or make it go would work too, this didn't occurred me.

Reducing the font size work - I tried it - but I found the size required to make 14 aliens fit (the limit as far as I can tell) is too small. However, I might be able to make the first text box bigger, and them simulate two columns using tabs.

 

Regards,

Link to comment
Share on other sites

Anyone think of any other places where we would want a scrolling textbox where there wasn't one before?

 

Certainly... LW-Pedia will most probably require something of that sort! :wink:

 

But speaking of that auto-scrolling function, IIRC someone on Reddit was asking for a way to speed it up when we look into Research & Foundry projects details which are always underneath their corresponding costs or requirements list(s). The runtime engine even appends Credits info lines to some of those which might explain why it all slows down, right? Any chance a swift patcherGUI file could be devised to modify that process?!?

 

(( PS; TrackTwo, remember that "Quiet-Bradford" mod you made to deny pre-Exalt mission comments from proceeding? Would it be possible to do something similar to shut-up DR-Shen's bomb-nodes series of instructions from these particular CNH file maps? ))

 

Amaciel, some kind of ""1.75 + 1"" total width where one wider column should provide enough space for two lists while the other should be pushed to the right? The trick is, these strings are (currently) flushed to the left-side of the container *and* there are somehow large words combo (Exalt Operatives, Sectoid Commander, etc). Is there a "centered" option in that font declaration?

Edited by Zyxpsilon
Link to comment
Share on other sites

  • Recently Browsing   0 members

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