Jump to content
ℹ️ Intermittent Download History issues ×

XCOM Modding: Need of a centralized source of information?


anUser

Recommended Posts

Great! I've never used the developer shell, I may give it a try

 

Regarding the wiki I think now priorities are #1 finishing tutorials for the 3 steps mentioned by johnnylump (dgc.ini, changing 1 hex value and hexscripting) plus a tutorial for contributing to the wiki

#2 create some sample Modding Subject using something that has been long researched, including functions and classes involved, everything documented, with code snippets , etc. It seems to me that ufo combat or skills are good candidates. This should tell how effective the wiki can prove

#3 if #2 is proven useful then we could conduct some little experiment by conducting the research of some 'hot' modding subject (as it could be weapon damage since Amineri is around, but it could be any topic), just posting everything we learn about it at the moment we learn it, so to see how solid and/or useful it results

 

I mean to do what I've just said above, but I won't rush for it, moreover it takes me some time to write in english, so if there's something here from what I've mentioned that some of you guys would really want to see on the wiki, then please consider writting some stuff yourselves.

 

Any other thought as for how to handle info entries? I mean functions and such... do they make any sense out of context?

 

One thought I don't want to leave behind, I think a wiki should be as useful for those who start modding as for the most veteran modders, begginners will follow step by step tutorials but advanced modders should be able to rescript whatever they want because everything it's documented, so the limit is no longer lack of knowledge or time, just your skill to go as big as yiu can. And honestly I think begginners will have their stuff, in time, but any idea helping to make the wiki more attractive/useful for experienced modders is much appreciated.

Link to comment
Share on other sites

  • Replies 121
  • Created
  • Last Reply

Top Posters In This Topic

In terms of formatting, I followed the recommended template http://wiki.tesnexus.com/index.php/Posting_guidelines_and_template

 

One thing I might tackle early on, that I think would be more aimed at the upper 2/3 experienced modders, is a set of lists of all of the enums used in the game. Most useful would be an app of some sort in which I could enter a value I've come across, and it would check each enum list and tell me what the possible text_strings and sources are. A bit beyond a wiki, but even just having the enum lists more easily available would be nice. Within XcomGame.upk there are 248 enums defined. Many of them are related to graphics / UI settings, but presumably, eventually, maybe ... those will be accessible.

 

My $0.02

Link to comment
Share on other sites

They look like this:

 

 

enum EAbility
{
eAbility_NONE,
eAbility_Move,
eAbility_Fly,
eAbility_FlyUp,
eAbility_FlyDown,
...
And not being the world's greatest programmer doesn't mean you aren't a great modder ! Making a good mod is a lot more then just hacking code ... have the artistic eye and ability to balance the factors matters a lot too ... and that's an area that I'm not very good at and don't have much interest in, to be honest!
Here's the entire Ability list

 

 

 

 

enum EAbility
{
eAbility_NONE,
eAbility_Move,
eAbility_Fly,
eAbility_FlyUp,
eAbility_FlyDown,
eAbility_Launch,
eAbility_Grapple,
eAbility_ShotStandard,
eAbility_RapidFire,
eAbility_ShotStun,
eAbility_ShotDroneHack,
eAbility_ShotOverload,
eAbility_ShotFlush,
eAbility_ShotPaintTarget,
eAbility_ShotPaintDefense,
eAbility_MotionDetector,
eAbility_ShotSniper_DEPRECATED,
eAbility_ShotSuppress,
eAbility_ShotSuppressII_DEPRECATED,
eAbility_ShotSuppressArea_DEPRECATED,
eAbility_ShotDamageCover,
eAbility_TeslaHammer,
eAbility_FragGrenade,
eAbility_SmokeGrenade,
eAbility_AlienGrenade,
eAbility_RocketLauncher,
eAbility_Aim,
eAbility_Intimidate,
eAbility_Mark,
eAbility_HotPotato_DEPRECATED,
eAbility_PFG,
eAbility_PFGDropped,
eAbility_PFGCookedOff,
eAbility_Overwatch,
eAbility_Torch,
eAbility_Plague,
eAbility_Stabilize,
eAbility_Revive,
eAbility_TakeCover,
eAbility_Command,
eAbility_Ghost,
eAbility_MedikitHeal,
eAbility_RepairSHIV,
eAbility_CombatStim,
eAbility_EquipWeapon,
eAbility_Reload,
eAbility_FlashBang_DEPRECATED,
eAbility_MindMerge,
eAbility_PsiLance,
eAbility_PsiBoltII,
eAbility_PsiBomb,
eAbility_GreaterMindMerge,
eAbility_PsiControl,
eAbility_PsiPanic,
eAbility_WarCry,
eAbility_Berserk,
eAbility_ReanimateAlly,
eAbility_ReanimateEnemy,
eAbility_PsiDrain,
eAbility_PsiBless,
eAbility_DoubleTap,
eAbility_PrecisionShot,
eAbility_DisablingShot,
eAbility_FlareShot_DEPRECATED,
eAbility_SquadSight,
eAbility_TooCloseForComfort,
eAbility_ShredderRocket,
eAbility_ShotMayhem,
eAbility_RunAndGun,
eAbility_RifleSuppression_DEPRECATED,
eAbility_BullRush,
eAbility_BattleScanner,
eAbility_Mindfray,
eAbility_Rift,
eAbility_TelekineticField,
eAbility_MindControl,
eAbility_PsiInspiration,
eAbility_CloseCyberdisc,
eAbility_DeathBlossom,
eAbility_CannonFire,
eAbility_ClusterBomb,
eAbility_DestroyTerrain,
eAbility_PsiInspired,
eAbility_Repair,
eAbility_ForceEndTurn_DEPRECATED,
eAbility_HeatWave,
eAbility_CivilianCover,
eAbility_Bloodlust,
eAbility_BloodCall,
eAbility_MAX
};

Link to comment
Share on other sites

This one in particular I've posted it under Abilities Modding Subject, I'm gonna create now the category for enum values and post a few examples I've got here.

 

It would be great if those enum entries could be automatized somehow, although I strongly suspect that would go against the forum rules. Meanwhile, and if that's not possible, we could just post them manually, just instead of copy-pasting to your notepad when editing some function paste it on the wiki!

Link to comment
Share on other sites

What we could really makes use of, is an application that given an enum (in text), printed the line number both in decimal and hex, for easy locating a value inside long enums, and so to have a quick reference either in the script and in the hex.

 

edit: maybe that wasn't clear. Here's an example of what I meant: http://wiki.tesnexus.com/index.php/XGTacticalGameCoreData.EAbility

A small application that would process a text file containing one of this enums (I know there's a package extractor there, so I assume it could be possible to get them all automatically), and that would output that in a format ready for the wiki, and also showing option number, in decimal and hex... that would definitively be awesome. I know I could do the text processing in javascript but I assume it shouldn't be hard for an experienced programmer to make a batch file to do that, would it? :p hey, it was just a thought... :p

Edited by anUser
Link to comment
Share on other sites

Most useful would be an app of some sort in which I could enter a value I've come across, and it would check each enum list and tell me what the possible text_strings and sources are. A bit beyond a wiki, but even just having the enum lists more easily available would be nice.

I totally missunderstood that when I first read it... well here you are! I've made a crappy standalone web app in javascript, it's crappy, it uses html5 local storage and globals as well, but it should work, just input the decompiled XGTacticalGameCoreData or all the files you want and type in a number. When focus is out (just click anywhere) it should perform a search for every element with that index within enums. only enums now.

 

copy-paste this into a text file, rename it as an .html file.

 

<!DOCTYPE html>
<head></head>
<body>
    <p>Insert file (can select multiple files): </p>
    <input type="file" id="files" name="files[]" multiple />
    <p>Insert value to check: </p>
    <input type="text" name="numToCheck" id="numToCheck" ></input>
    <br />
    <output id="list"></output>
    <span id="possibleValues"></span>
<script>

    enumKeys = [];
    
    // Check for the various File API support.
    if (window.File && window.FileReader && window.FileList && window.Blob) {
      // Great success! All the File APIs are supported.
    } else {
      alert('The File APIs are not fully supported in this browser.');
    }

    function handleFileSelect(evt) {
        var files = evt.target.files; // FileList object
        // files is a FileList of File objects. List some properties.
        localStorage.clear();
        var output=[];
        for (var i = 0, f; f = files[i]; i++) {
            // list files.
            
            output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ') - ',
                f.size, ' bytes, last modified: ',
                f.lastModifiedDate.toLocaleDateString(), '</li>');
                
            // process files
            var reader = new FileReader();
            reader.onload = (function(theFile) {
                return function(e) {
                    var text = e.target.result;
                    // search if contains enum declaration
                    var i=text.indexOf("enum");
                    while (i > -1) {
                        var j=i+5;
                        var k=text.indexOf("{", j);
                        var enumName = text.substring(j, k).trim();
                        var l=text.indexOf("};", k);
                        var values = text.substring(k+1, l);//.split(",");
                        localStorage.setItem(enumName, values);
                        enumKeys.push(enumName);
                        i=text.indexOf("enum", l);
                    }
                    localStorage.setItem("enumKeys", enumKeys.join(", "));
                };
            })(f);

            // Read in the image file as a data URL.
            reader.readAsText(f);
        }
        document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';
    }
    
    function checkNumber(evt) {
        var numToCheck = evt.target.value;
        var strOut = [];
        var items = [];
        
        var keys = localStorage.getItem("enumKeys").split(", ").sort();
        for (var i=0; i<enumKeys.length; i++) {
            var list = localStorage.getItem(keys[i]).split(",");
            if (list.length >= numToCheck) {
                //items.push({keys[i]: list[numToCheck]});
                strOut.push('<li><strong>', escape(keys[i]), '</strong><br />', list[numToCheck], '</li>');
            }
        }
        document.getElementById('possibleValues').innerHTML = '<ul>' + strOut.join('') + '</ul>';
    }
    
    document.getElementById('files').addEventListener('change', handleFileSelect, false);
    document.getElementById('numToCheck').addEventListener('change', checkNumber, false);
</script>
</html>

 

 

 

let me know if it works as it should

 

edit: formatting

Edited by anUser
Link to comment
Share on other sites

Am I the only one who thinks it would be helpful to document what changes (from a modding perspective) each patch makes to the game? Primarily I am thinking in terms of changes to offsets, headers, function calls, and the things all the tool makers find necessary to alter after a patch to get their tool and mods to work again.

 

That way, if some mod or tool becomes abandoned (be sure to update your permissions on Nexus download page before you do) and someone gets desperate enough to attempt to take it over, they don't have to rediscover everything from scratch.

 

-Dubious-

Link to comment
Share on other sites

Am I the only one who thinks it would be helpful to document what changes (from a modding perspective) each patch makes to the game? Primarily I am thinking in terms of changes to offsets, headers, function calls, and the things all the tool makers find necessary to alter after a patch to get their tool and mods to work again.

 

That way, if some mod or tool becomes abandoned (be sure to update your permissions on Nexus download page before you do) and someone gets desperate enough to attempt to take it over, they don't have to rediscover everything from scratch.

 

-Dubious-

Well, so far I've been trying with little success to document current code, so documenting changes between versions seems to me far beyond comunity willingness, alhough in my experience I've found that most changes are related to deleted variables which change the ref value to other variables and functions, so you've gotta decrease those values in the same amount, so in theory, if keeping the original code it could be possible to extract a pattern by mere string comparisson, but that's alot of work I'm not taking now, though it seems perfectly doable, and it'd be pretty useful imo Edited by anUser
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...