Jump to content

Model Swapping - Is it possible?


Krazyguy75

Recommended Posts

Hello,

 

I was wondering if it was possible to swap the model and animations of an actor. From my experience with putting skeletal meshes in Unreal, there should be code used to reference them. I was thinking it might be possible to swap the references to both the model and the animation with something else, to essentially allow swapping of a model. I don't know how much this would break the games coding, I just wanted to investigate the possibility.

 

Is this plausible, or is it not yet possible for us to do something of this magnitude?

Link to comment
Share on other sites

It is possible to do some mesh / animation swapping. So far I haven't been able to divorce the mesh / animation completely from the game mechanics of the item, but it's very possible that I haven't tried everything yet.

 

First off, I'm not actually very knowledgable about Unreal Engine stuff -- this is the only Unreal game I've ever modded.

 

The mesh / animation assets appear to be packaged in separate files. For example, the ballistic shotgun is in the Weapon_Shotgun_SF.upk file. Examining this (after decompressing) with umodel should show the shotgun.

 

There appears to be some pairing of item ID with mesh / animation object asset in the DefaultConfig.ini config file. For the Shotgun the line is :

WeaponPackageInfo=(ItemType=eItem_Shotgun,ArchetypeName="Weapon_Shotgun.GD_Shotgun")

I haven't explored this aspect to swapping mesh / animation assets for items.

 

-----------------

 

Where I have messed with the items is in the XGItemLibrary class. The critical part of this class is a default m_arrItems array that provides mapping from item ID to particular weapon classes. The shotgun's entry here is :

m_arrItems(eItem_Shotgun)=class'XGWeapon_Shotgun'

The class XGWeapon_Shotgun is a very thin child class of XGWeapon. It only adds the item ID as the default.

 

This is how I was able to get the First Aid Kit item working (which was much more a pain that it was probably worth, tbh). The First Aid Kit item uses item ID 83 to represent it in the strategy game. The Medikit is item ID 76.

 

So, in XGItemLibrary I added the default value :

    m_arrItems(83)=class'XGWeapon_Medikit'

This makes the First Aid Kit loadout into the tactical game working exactly like a Medikit, including mesh and animation info. To make the First Aid Kit function differently I had to create a helper function to search the unit's 'primitive' TInventory structure for the original item IDs that were transferred from the strategy game.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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