How To Change Enemy Skeletal Mesh?

For technical discussions and help
Post Reply
bduhbob1
Posts: 1
Joined: Sat Jan 19, 2019 12:42 pm

How To Change Enemy Skeletal Mesh?

Post by bduhbob1 » Sat Jan 19, 2019 12:54 pm

I'm just dipping my toes into XCOM2 modding, and to say the very least, I'm frustrated.
A lot of the documentation is super vague and cheesy, and most tutorials are from 2016 and don't really answer my questions.

I'm simply attempting to start with what I thought was easy (changing the enemy appearance to something custom), but I'm at a dead end.

I've gotten to the point where I've rigged my custom model with the XCOM2 skeleton, and he works with all the ANIMS.
I went through the XCOM_Alien documentation that comes with the editor and it says to simply replace the skeletal mesh field in your desired units ARC (archetype).
Obviously I can do this, but its not going to save when I close the editor right? So my assumption is I have to have a bit of code to go in and change it.
(From my minimal C# coding knowledge, I assume it would be something like this:)

XAdventTrooper.Archetypes.GameUnit_AdvSoldier_M.SkeletalMesh = (Insert Custom Skeletal Mesh Path Here);


I've searched high and low on the internet and the only promising thing I could find was an old forum post on here from 2016 about someone asking the same question. The admin pointed him to the AlienPack script and config, which I have dug through and don't really see how anything about the appearance is called or changed.

(Old Forum Post I Found: https://pavonisinteractive.com/phpBB3/v ... hp?t=23302)

Any help or advice would be awesome.

User avatar
szmind
Long War EU Crew
Posts: 102
Joined: Tue Dec 29, 2015 9:56 pm
Location: Poland

Re: How To Change Enemy Skeletal Mesh?

Post by szmind » Tue Jan 22, 2019 8:19 am

Why does it not save? It should. Have you checked this thread? It is from UE3 documentation but might point you to solution.

https://api.unrealengine.com/udk/Three/ ... types.html

Also - if updating the archetype does not work, you can create your own archetype of the mesh in a separate file: e.g. MyMeshPackage_SF. Then you should have sth like this in your code of the unit's class. I am coding blind (have no idea of actual code in XCOM2)

Code: Select all

simulated event PostBeginPlay()
{
    local SkeletalMesh kMyTemplate;
    
    kMyTemplate = SkeletalMesh(DynamicLoadObject("MyMeshPackage_SF.MyMeshName", class'SkeletalMesh')); 
    Mesh.SetSkeletalMesh(new (self) (kMyTemplate) );
    super.PostBeginPlay();   
}

Post Reply