XCOM 2
SwappImg
Zyxpsilon  [developer] May 31, 2016 @ 2:53pm
Documentation
Not ready yet.. but as soon as i get a solid version, i'll come right back here to explain further!! :)
< >
Showing 1-9 of 9 comments
macelharen Sep 7, 2017 @ 2:40pm 
so from a complete n00b perspective, here's my stream of consciousness walkthrough. My mod skills so far is basically *.ini file tweaks, period.

I'm going to attempt to replace the rank [8] icon. I'm already using nTex rank icons.
I'll use this one[en.wikipedia.org] for the marines and that one[en.wikipedia.org] for the army. (both are dirt simple text replacement mods i created)

  • First off, i'm curious as to how Neonin made his mod standalone (without needing swappimg as requirement)...i'm going to assume it's not a requirement to play with - just to mod with.
  • Welp, i don't see any *.txt file in swappimg's config folder, so i'm assuming it'll be in quick_fix's folder. nope not there either. oh wait, it's in the base folder for swappimg, not a subfolder
  • okay, wait what? this isn't a 3rd party program...so the point of this mod is merely a placeholder for the SwappImg_UIScreenListener_Extension.uc file? buh? i'll roll with that assumption so far.
  • so you refer to other threads in the forums *goes looking* and copious swearing later i come up with nada
  • alright, so far i've assumed that Neonin totally ripped off your swappimg by just simply copying whole hog your src subfolder, adding that uc.txt file corrected for his mod. then built his mod?
  • so where did neonin get his 'content' subfolders from?
  • guess i fire up modbuddy and see how far the rabbit hole i can go
  • first off i'm going to try and open neonin's mod from inside modbuddy and start poking around
  • *opens one of my mods in modbuddy*
  • ? wait...my mod's SRC file - only one - is almost exactly like nTex's. ahhhh...okay, so the downloadable content file isn't part of this but the default one the SDK manufactures.
  • okay, so it looks like nTex copied the SwappImg_UIMCController_Base.uc file? or did he?
    i'll just assume he did for now (file contents are identical)
  • as for the actual *.uc.text file differences between yours and his:
// Instructions for paths of ------"img:/// Your *Target* Images ", "img:/// Your *Custom* Images "); // Picked from... *Any given SDK file resources--- *As archived in your own UPK file(s) // Helper.Path = Repl(Helper.Path, "img:/// UILibrary..etc ", "img:/// CUSTOMLibrary..etc "); // // Adding as many as needed here... make sure correct paths & valid files are declared! //
// OTHER // RANKS Helper.Path = Repl(Helper.Path, "img:///UILibrary_Common.rank_", "img:///nTexRanks.rank_"); Helper.Path = Repl(Helper.Path, "img:///UILibrary_Common.psirank_", "img:///nTexRanks.psirank_");
  • no idea what the hell that even means so far
  • right, into modbuddy and see what more i can discover in nTex's mod
  • oh great. his 'content' subfolder is hexadecimal gobbledeegook.
  • oh god, i hate modbuddy. how the heck does one even get an image of an example weapon template ffs? better start there
At this point i'll digress to some troubleshooting i had to do in order to actually open "xcom2 editor" which had previously given me "can't find file specified" errors (options file location needed \XcomGame\ at the ends)

getting close to work so i'll stop there. hey! at least i learned how to open the editor! yay
Last edited by macelharen; Sep 7, 2017 @ 3:55pm
Zyxpsilon  [developer] Sep 7, 2017 @ 7:37pm 
That was exactly my point with this empty pseudo "Documentation" thread.

--IF-- anyone is getting interested by such a complex coding duo of tricky features.. they should really have minimal understanding of UC script methods. Neonin just barely managed to apply the SwappIMG principles.

PS... (( Forged with blood & tears of InfectedM & I, btw ))

Neonin roughly mimicked the process by embedding the Extension & grafting the Base hooks within his own code -- elegant BUT very risky for reasons beyond the scope of this reply & frankly, just to spare the extra D/L of the authentic solid device from us?

TBH.. i no longer have any spare time to explain further... and i'm deeply sorry. Burried deep into real life & enjoying a few limited hours of WotC per week to shaft over the slightly buggy stuff Firaxis Devs managed to dump on us, Modders.

YET -- i do have one last precious advice for ya (my first subscriber that dared sharing his thoughts here!!)... get a hold of another mod of mine;
qUIck_FIX

It actually offers anything someone serious (and skilled) enough will ever need to create their own (easy or tougher) stuff!

Good luck.
Last edited by Zyxpsilon; Sep 7, 2017 @ 7:51pm
macelharen Sep 7, 2017 @ 10:49pm 
thx. =) i'll soldier on, documenting my stumbles. Most likely i'll simply mimic the mimicker. I am, after all, just after the [8] rank icon for LWPP.

my intent in documenting is to give you and idea of where a n00b's blind spots are...to walk a mile in his/her shoes so to speak. That'll make it easier to figure out how to start, how fast to go, and where you can skip the details (since i'm sure i'll find alot of tutorials on..."UC script methods")

once you actually have spare time for something like this *knocks on wood*

  • holy crap. "UnrealScript" is a programming language? wow. last time i did programming was grade 10 thirty years ago when floppy disks were actually floppy. lol
  • first thing i'll do is try out Quick_Fix
  • quick_fix's description says "The UC script that can produce these kind of results is fairly straight forward ... The method is quite simple, the Library Paths and Texture2d files must be valid
    Helper.Path = Repl(Helper.Path, "img:///UILibrary_Common.rank_", "img:///nTexRanks.rank_");
    Helper.Path = Repl(Helper.Path, "img:///UILibrary_Common.psirank_", "img:///nTexRanks.psirank_");
  • so just the description, plus Neonin's UC script, allows me to identify what a "library path" is and that a "texture2d file" is something i assume i'll create from the sergeant major icons i linked above
  • UILibrary_Common isn't among the files i can find in the directory so i assume that's something esoteric programmy language, neither is a handy dandy nTexRank.(psi)rank_ file found either. so poopy for ease of understanding.
  • So obviously things are more complex than what the layman can glean from basic directory exploration, and mod descriptions.
  • i'll be assuming "Base hooks" is exactly what i think they are: the above quotes from the "SwappImgFIX_UIScreenListener_Extension.uc"
  • so, basically,
    i'm imaging my base hooks will look something like this:
    {
    local WebApplication Helper;
    Helper = WebApplication(EventData);

    // OTHER

    // RANKS
    Helper.Path = Repl(Helper.Path, "img:///UILibrary_Common.rank8_", "img:///NAMilitaryRanks.rank8_");

    return ELR_NoInterrupt;}
    at least that's my theory. As to where to go from here i have the hope that Quick_Fix may have a few answers to start me off on the correct path
Last edited by macelharen; Sep 7, 2017 @ 11:35pm
Zyxpsilon  [developer] Sep 7, 2017 @ 11:43pm 
OH.. don't worry, i'll be right here watching with intense curiosity & probably intervene when the mindset boiler(s) implodes beyond irrational lack of "care" for the secrets seeker.

Let truth be said that i **DO** want to help out. Not sure how or when but as long as i breath oxygen -- i'll surely make some efforts.

No glory in "laziness" & "dependancy".. power to the daring Pioneers & Explorers.

PS; I'm 62 t'day -- so i certainly can understand your perception of time & reality.
macelharen Sep 7, 2017 @ 11:51pm 
  • right off the bat i'm convinced my earlier guess, about not needing swappimg being a requirement, is correct in that just copying the third file in Src\swappimg\Classes\ (SwappImg_UIMCController_Base.uc) allowed nTex rank icons mod to skip the requirement.
  • SwappImgFIX_UIScreenListener_Extension.uc has a completely different structure than Neonin's "own code" as you described it.
    {
    local WebApplication Helper;
    Helper = WebApplication(EventData);

    Helper.Path = Repl(Helper.Path, "img:///UILibrary_Common.Head_Shen", "img:///qUIck_FIX_UILibrary.Head_Shen");

    *** blah blah blah ***

    return ELR_NoInterrupt;}
    Seems cuite enough...i'm merely "Repl" the common library vanilla bit with a custom library bit. okay, that makes more sense. I'm definitely dealing with libraries here...but where does the image come in? the "texture2d" thingy. ah well, baby steps.
  • next up i leave the SRC subfolders and head into CONFIG folder and i assume
    [CentralOfficer X2SoldierClassTemplate]
    -IconImage="img:///UILibrary_Common.class_ranger"
    +IconImage="img:///qUIck_FIX_UILibrary.GOPS3_Bradford64"
    is super effing easy peasy and i wish EVERYTHING was like that, but nooooooooo, it's hidden within the code. boo
  • huh...XComEngine.ini lists the uiscreenlistener as a modclassoverride of doom. huh...so a listener is a less harmful classoverride, well according to the alterate mod launcher blather. curiouser and curiouser.
    Alright, not learning a whole hell of a lot from config folder. besides, all that stuff is mostly created for me by modbuddy anyways (at least the default stuff)
  • so i've got SCRIPT folder and CONTENT folder. my mods don't have those folders so into the deepend i go.
  • alright, so here's the thing: here i have modbuddy which shows me absolute hexidecimal hockus-pockus...i take it people literally can't use modbuddy alone to build complex stuff involving what makes up script and content files.
  • after opening up the editor, via TOOLS, i realized it might only be used to make maps. period. i could be wrong on that...*checks again*
  • while i'm waiting for the program to grudgingly open up i found the nexus forums sticky post on xcom2 modding[forums.nexusmods.com]. yay!
  • xcom2 editor definitely looks like a level creator...there's this utility inside its tool called game data editor but it's failing to load...so meh.
  • "adding graphics such as icons[imgur.com]" i'm sure is going to be helpful, but i'll bet i still need swappimg (or that it'll make it easier)
  • Army-USA-OR-09c.tga (32x32) yay! i hope it still has the transparencies. whatever.
  • hmph...it's asking me to go back into xcom2 editor. *sigh* fine!
  • saaaaayyyy....wait a effing minute. that image of the editor is alot different than mine. i really think i installed the SDK improperly, and that workaround i found (adding \xcomgame\ to the paths in OPTIONS) is a poor jury rig
  • no ...wait...effing all it needed was for me to minimize the left pane. jeeeuz, not to mention i thought this smaller popup in front of the level editor was just the annoying adjunct to the main map creator.
YAY FIRST IMPRESSIONS
  • right then, actually using the actual real unreal editor for real.
  • oh ♥♥♥♥. i hope rank [8] exists in vanilla. lol
  • ah ha! okay, so i found the "texture2d" files for "rank_" in the vanilla folders. nifty. TGA 64x64, eh? all i gotta do is match the transparency ratio to image size so my image isn't misproportioned. that seems to me the first step i should take to feel like i'm accomplishing anything. *opens PAINT.exe* oh crap! the rank image i got from google was an svg. yay me. hmmm...bitmap conversion here i come.
    lol
  • alright, from the looks of it i'm guessing the rank icon itself has to be 32*32 and the transparency 64*64?
  • okay, i need something better than paint. *glowers* should i rent creativecloud for a month? decisions decisions. Ahhhh photoshop it's been too long
TL;DR - all i've gotten so far is xcom2 editor opening, finally. plus knowing i need to use a 3rd party image editor to tweak the proportions of my icon...eventually turning it into a *.tga file ("texture2d" thingy)...i know my next steps are going to be creating the sergeant master tga file then importing it into the xcom2 editor.

Where swappimg fits in i have yet to hazard a guess at...i'm assuming it's the difference between editing the vanilla code yourself vs creating a mod that'll do it for you.

right. off to bed. and happy birthday, btw
Last edited by macelharen; Sep 8, 2017 @ 1:38am
macelharen Sep 8, 2017 @ 8:39am 
  • Where am i at right now: i have photoshop 2017 open with a realllly large SGM icon, in *.svg format, that i need to proportion. I also have modbuddy open so i could open the xcom2 editor *closes modbuddy* And i have the xcom2 editor open, but shrunk really small, and the 'content browser' front and center.
    i'm looking at the rank icons because i have "rank" in the search box.
  • i was actually curious about the left pane, now that i minimized the stupid "shared collections" panel, and started clicking on 'packages' subfolders trying to narrow down where exactly the rank icons were located.
    Turns out they're all in "GFx" subfolder and "UILibrary_Common"...huh. i'll be damned. from the above stream of consciousness yesterday i had the impression most everything had "library" somewhere in it's name when dealing with unreal stuff...definitely wrong on that count.
  • i tend to digress alot into trivial explorations. right, where was i? let me get this effing rank icon proportioned. ♥♥♥♥♥♥♥♥, i missed you photoshop. okay, so i have a 64x64 rank icon *.tga file with transparency around it to about the proportion the vanilla rank icons have.
  • tga file, according to unreal documentation needs to be 24bit and not 32bit. Also, according to Zyxpsilon on the nexus forums, i can't use "-" in my file names (i'll assume it's good habit to avoid that for all file names regardless of relevance to his point)
  • okay, let's rock and roll. obviously i'm going to run into a brick wall real fast here because the docs.unrealengine.com totally suck
  • alright, so back to that nexus link about "adding graphics such as icons". now that i have my image good to go i'll see how far i can follow that guy's blather...
  • okay, importing.
    here's a screenshot[imgur.com] of where i'm at with that...*stares at import options. wtf?*
    alright, so i figured out his instruction about "LODgroup" is one of the selections in that popup.
    done that. now, wtf is with all these other options and do i need to do something to make sure the transparency stays? i have no clue. "blend_opaque" sounds really fishy. okay, whatever,
    i'll just hit 'okay' for now. Right called it "UILibrary_Marines" that should do the trick i hope
  • alright, so right clicking and 'saving' my new project gives me a "UILibrary_Marines.upk" file that i'm going to shove into my marine name mod (creating a content folder here: C:\Games\steamapps\common\XCOM 2 SDK\Mods\USMarineRankNames\ )
  • okies. what next? guess i goof off in modbuddy and see what happens when i keep following that guy's advice. meh. he lost me on step 22.
Last edited by macelharen; Sep 8, 2017 @ 9:47am
Zyxpsilon  [developer] Sep 8, 2017 @ 9:35am 
That Zyxpsilon is *ME* & thank you for the wishes! ;)

If you want to inspect some content in a different enviro (than ModBuddy Editor).. i highly recommend getting familiar with EliotVU's UEExplorer ((http://eliotvu.com/portfolio/view/21/ue-explorer)).

This tool is extremely useful when trying to determine how various XC2 elements interact.

Secondly, once you gain minimal understanding of the SWF/Flash part of the engine (HUD/UI drivers & functions) .. another extraordinary tool can reveal HUGE details about any of the SwfMovie files where the Icons you are referring to are also embedded as resources or pulled straight from UI_Library--...... archives (UPK).=== JPEXS decompiler ((https://www.free-decompiler.com/flash/))

That one offers rapid p-Code scripting hints and a variety of text, sprites, morphshapes references to Adobe Flash facts.

Thirdly, Gildor's UModel toolset is also essential when we must extract or decompress some other files (well -- those that the other two above can't access directly) === (( http://www.gildor.org/downloads)) and, it also can "view" Unreal 3d Models, as a bonus. Check out his downloads section. Some stuff for ya.

That's the (minimal) arsenal of a true XCom2 modder -- get used to it -- master every secrets they have to offer. Knowledge is precious & the will to obtain it even more so.

Enjoy the ride!
Last edited by Zyxpsilon; Sep 8, 2017 @ 10:55am
macelharen Sep 8, 2017 @ 9:56am 
SWF/Flash part of the engine (HUD/UI drivers & functions)
this i assume ties into why the 'package' name holding the rank icons, in the UILibrary_Common, is called "GFx"

btw, your link to gildor's is incorrect. http://www.gildor.org/downloads


  • so i got stuck trying to add item to my modbuddy's content folder for usmarineranknames. huh. weird. see screenshot[imgur.com]. I'm sure that error isn't as important as the fact i have a upk file for my tga image. I'm sure it's a 'working' upk file and i'm just not using modbuddy properly. i hope my upk file isn't broken. that would suck...i doubt it tho.

    Anyways, at this point i'm going to take a brain break. come back with fresh eyes later

  • *shoves the upk into the mygames subfolder for the mod.* *doesn't see it when i open modbuddy* *adds existing item* success!
  • so the upk file in modbuddy view is the same kind of hexidecimal gobbledeegook. okay, great!
    so working tga inside upk inside content folder...i wonder what happens when i press 'build'?
  • took a loooong time...and 'failed' cool! alright, i understood clearly just shoving in an unrelated upk file was going to cause issues.
wanders off to play a game
Last edited by macelharen; Sep 8, 2017 @ 10:56am
Zyxpsilon  [developer] Sep 8, 2017 @ 7:23pm 
OH -- one more semi-important suggestion for ya.

Join the most active community of Xcom2 Modders on Discord/Apps by validating this Invite within the nest 24 hours... (( https://discord.gg/BzRc2Q )).

Once there.. glimpse around to familiarize with our own special "socialization" principles & slowly start asking solid questions.. you may get lucky when someone passing-by could be willing to provide hints or direct answers.
< >
Showing 1-9 of 9 comments
Per page: 1530 50