Jump to content

Modding Meld


wghost81

Recommended Posts

Thanks. SplitString might do the trick and it is actually used in existing code, which means free bytecode example. :smile: But I don't know if I can fit it inside the last function to call 'Localizer', which seems to be UIBriefing.StartBriefing. Need to think about this. :smile:
Link to comment
Share on other sites

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Quick Q - what's the change required to turn meld canisters back on? (from false to true)

 

messing around with balance in marathon also....

 

would it be feasible, down the line, to have meld canister show up by mission type i.e. within saucer missions?

Link to comment
Share on other sites

If you want to turn canisters on, you will also need to disable meld collection from artifact.

 

First two changes with comments

{ in XGBattleDesc.ShouldSpawnMeldCanisters: true -> false }
turn off meld canisters on maps.

 

Change with this comment

{ XGBattle.GetRecoveredMeldAmount }
allows to collect meld from artifacts.

 

And these three

{ This is Meld amount per Alien Food. Change 01 to whatever value you like (hex-value). }
{ This is Meld amount per Alien Stasis Tank. Change 02 to whatever value you like (hex-value). }
{ This is Meld amount per Alien Surgery. Change 03 to whatever value you like (hex-value). }
are used to tweak constants in XGBattle.GetRecoveredMeldAmount.

 

So if you want canisters back, you need to remove all these changes and leave only XGSummaryUI.CollectArtifactsFromDeadAliens plus all its constants.

 

UPD:

UPK_FILE=XComGame.upk
OFFSET=10031542
[MODDED_HEX]
{ This is amount of Meld granted for Alien Base Assault. Change 32 (hex, 50 in dec) to whatever value you like (hex-value). }
32
This also needs to be removed, since offset is valid for modded version only.

END UPD

 

To change mission types for which Meld canisters are placed on maps, you need to re-write XGBattleDesc.ShouldSpawnMeldCanisters function:

event bool ShouldSpawnMeldCanisters()
{
    switch(m_iMissionType)
    {
        // End:0x18
        case 2:
        // End:0x1D
        case 3:
        // End:0x24
        case 4:
            return true;
        // End:0x3F
        case 11:
            // End:0x3F
            if(m_eCouncilType == 30)
            {
                return true;
        }
        // End:0xFFFF
        default:
            return false;
    }
    //return ReturnValue;    
}
Cases 2, 3 and 4 are abduction, crashed UFO and landed UFO missions and m_eCouncilType == 30 is Meld tutorial.

 

UPD:

Uploaded an alternative mod version, which keeps Meld canisters and in addition allows to collect Meld from alien corpses. See optional files.

Edited by wghost81
Link to comment
Share on other sites

Is it possible to turn off Fog of War on meld containers? I don't enjoy missing meld because I headed in the wrong direction/did not scrutinize FoW for meld container outlines.

 

This allows me to plan ahead more.

 

Edit: Alternatively, the orange meld signal should trigger always, which seems pretty random unmodded to me.

Edited by yeehaws
Link to comment
Share on other sites

Quick hack to show arrows with counters (copy/paste to text file, install with ToolBoks custom mod):

 

MOD_NAME=Meld Arrows Always Visible
AUTHOR=wghost81 aka Wasteland Ghost
DESCRIPTION=Meld Arrows Always Visible

Version: 1.0p1

Compatible with XCOM Enemy Within versions:
 - Patch 1 (Changelist: 398180)


UPK_FILE=XComGame.upk
OFFSET=6164411
[MODDED_HEX]
{ jump if -> goto }
06

 

This will show Meld Arrows from the beginning, but won't update interface until you actually see canisters and still attempt to give you visual cues on canisters location. Making it work better will require to set bVisibleToSquad to true, but there is simply no place to put this code into. And actual visibility is calculated through native function.

Link to comment
Share on other sites

Silly me :smile: I could replace native function call with explicit variable value definition. :smile:

 

MOD_NAME=Meld Arrows Always Visible
AUTHOR=wghost81 aka Wasteland Ghost
DESCRIPTION=Meld Arrows Always Visible

Version: 1.0p1

Compatible with XCOM Enemy Within versions:
 - Patch 1 (Changelist: 398180)


UPK_FILE=XComGame.upk
OFFSET=7760674
[MODDED_HEX]
86 61 00 00 76 5F 00 00 00 00 00 00 71 61 00 00
DA 4A 00 00 00 00 00 00 72 61 00 00 00 00 00 00
EC 00 00 00 44 1C 00 00 
{                       2B                    }
                        2F
                           00 00 00 1F 00 00 00
1C DA 4A 00 00 00 72 61 00 00 16 1C 20 FC FF FF
28 16
{     1B 15 7B 00 00 00 00 00 00 16           }
      0F 2D 01 42 61 00 00 27 0B 0B
                                    04 0B 53 00
00 00 02 09 02 00 8E 76 00 00 00 00 00 00

 

Works perfect so far. But if native function does something else, except for setting visibility variable, there might be some problems. Report here if you encounter any.

Link to comment
Share on other sites

Getting around native function calls can be done, but sometimes is a bit tricky.

 

The EU patch 4 mods to rework the ammo system and the damage randomization both had to replace native function calls. The tricky part (as you say) is figuring out exactly what it is that the native function does.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...