Still having the issue.
Here is my current setup, per you recommendation.
Code: Select all
marker.mobileEnemy = gameObject.GetComponent<DaggerfallEnemy>();
if (marker.mobileEnemy.MobileUnit.Summary.Enemy.Gender == MobileGender.Male || marker.mobileEnemy.MobileUnit.Summary.Enemy.Gender == MobileGender.Unspecified)
npcTempTexture = ImageReader.GetTexture(string.Concat("TEXTURE.", marker.mobileEnemy.MobileUnit.Summary.Enemy.MaleTexture), 0, 0, true, 0);
else
npcTempTexture = ImageReader.GetTexture(string.Concat("TEXTURE.", marker.mobileEnemy.MobileUnit.Summary.Enemy.FemaleTexture), 0, 0, true, 0);
Works in 13.5 source editor, but in a stand alone 13.5 build, I get this token error.
Code: Select all
TypeLoadException: Could not resolve type with token 0100008b (from typeref, class/assembly MobileUnitSummary, )
(Filename: Line: -1)
If you want to try it yourself, this script should work if you compile it into a mod and run it on game load. On launch, it figures out the location type, grabs all the enemies in that area, drops them into a list, then loops through the list and grabs the texture using the mobile unit summary.
Code: Select all
private void Start()
{
//location check logic ladder. Grabs the enemy array using proper location object.
if (!GameManager.Instance.IsPlayerInside)
{
location = GameManager.Instance.PlayerEnterExit.ExteriorParent;
mobileEnemyArray = location.GetComponentsInChildren<DaggerfallEnemy>().ToList();
}
//set inside building interior indicator size and material and grab npc objects for assigning below.
else if (GameManager.Instance.IsPlayerInside && !GameManager.Instance.IsPlayerInsideDungeon)
{
interiorInstance = GameManager.Instance.InteriorParent;
mobileEnemyArray = interiorInstance.GetComponentsInChildren<DaggerfallEnemy>().ToList();
}
//set dungeon interior indicator size and material and grab npc objects for assigning below.
else if (GameManager.Instance.IsPlayerInside && GameManager.Instance.IsPlayerInsideDungeon)
{
dungeonInstance = GameManager.Instance.DungeonParent;
mobileEnemyArray = dungeonInstance.GetComponentsInChildren<DaggerfallEnemy>().ToList();
}
//loop through location enemies, grab their mobile unity object, and use it to check gender and setup marker texture into empty texture object.
foreach (DaggerfallEnemy mobileEnemy in mobileEnemyArray)
{
Texture2D npcTempTexture = null;
if (mobileEnemy.MobileUnit.Summary.Enemy.Gender == MobileGender.Male || mobileEnemy.MobileUnit.Summary.Enemy.Gender == MobileGender.Unspecified)
npcTempTexture = ImageReader.GetTexture(string.Concat("TEXTURE.", mobileEnemy.MobileUnit.Summary.Enemy.MaleTexture), 0, 0, true, 0);
else
npcTempTexture = ImageReader.GetTexture(string.Concat("TEXTURE.", mobileEnemy.MobileUnit.Summary.Enemy.FemaleTexture), 0, 0, true, 0);
}
}