zingfharn Posted March 17, 2016 Share Posted March 17, 2016 (edited) I thought I was getting there. Things were saying they were updating, but Tygan wasn't changing. So I dug a little deeper. Ended up with this. local XComGameState_Unit Tygan, UnitState; local XComGameState UpdatedState; local int idx; local array<StateObjectReference> Crew; `Log("Attempting to dress Tygan"); UpdatedState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Change Tygan"); Crew = `XCOMHQ.Crew; for(idx = 0; idx < Crew.Length; idx++) { UnitState = XComGameState_Unit(`XCOMHistory.GetGameStateForObjectID(Crew[idx].ObjectID)); if(UnitState != none && UnitState.GetMyTemplateName() == 'HeadScientist') { Tygan = UnitState; } } `Log("HELMET IS " @ Tygan.kAppearance.nmHelmet); Tygan.kAppearance.nmHelmet = 'Hat_A_Ballcap_M'; Tygan.kAppearance.nmFacePropUpper = 'Monacle_M'; Tygan.SetTAppearance(Tygan.kAppearance); `Log("HELMET IS " @ Tygan.kAppearance.nmHelmet); Tygan.StoreAppearance(); UpdatedState.AddStateObject(Tygan); `XCOMHISTORY.AddGameStateToHistory(UpdatedState); But it just crashes to desktop. Clearly I'm doing something critically wrong, but after spending a couple of hours trying to unpick how to put a damn hat on Tygan, I'm at a loss. Can anyone point me in the right direction, please? Edited March 17, 2016 by zingfharn Link to comment Share on other sites More sharing options...
zingfharn Posted March 18, 2016 Author Share Posted March 18, 2016 So, I haven't gotten much further with this. But, it turns out Tygan is a lady. `Log("iGender is" @ UnitState.kAppearance.iGender); if(UnitState.kAppearance.iGender == eGender_Female) { `Log("Tygan is a lady"); } Link to comment Share on other sites More sharing options...
Atrocityasylum Posted June 23, 2016 Share Posted June 23, 2016 (edited) Haha! Edited June 23, 2016 by Atrocityasylum Link to comment Share on other sites More sharing options...
kexx456 Posted June 23, 2016 Share Posted June 23, 2016 I found this discussion on reddit some time ago. Deals with Tygan and Shen's appearance. Hope it helps or at least points you in the right direction! https://www.reddit.com/r/xcom2mods/comments/4azgl5/changing_shen_tygans_appearance/ Link to comment Share on other sites More sharing options...
prowler83 Posted June 23, 2016 Share Posted June 23, 2016 Tygan = UnitState; should be Tygan = XComGameState_Unit(UpdatedState.CreateStateObject(class'XComGameState_Unit',UnitState.ObjectID); Link to comment Share on other sites More sharing options...
Recommended Posts