Jump to content

eggroll666

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by eggroll666

  1. I looked into Eteam but I've only found lines that look for what it is set to and nothing that actually hard sets it in place. Is there a way to set it in the character template or assign it with gamestate_unit functions?
  2. I've recently created a custom character based off the 'Soldier' template in defaultcharacters. I've also managed to spawn him in with appearances using functions from gamestate_unit and everything seems to function identically to a typical soldier. Except he can't trigger civilian rescues. Nothing happens when he runs into the rescue ring but he can trigger faceless procs just fine. The game creates proximity events and trigger certain reactions based off what team the unit belongs to. This makes me think the game isn't recognizing my soldier as an XCOM member. Is there a team flag or something of the sort that gets set in place after a soldier created with the in-game maker?
  3. I noticed that super soldiers get a lot of their customizations locked in place. I'm looking to do the same and I can find code relating to their initial looks but nothing that seems to lock it.
  4. i've recently made a custom character and i've got him in the game, however the game keeps adding more on each subsequential save+load. i'm trying to make it so it adds only one per game but i can't seem to figure out how to go about doing so static event OnLoadedSavedGame() { local XComGameStateHistory History; local XComGameState NewGameState; local XComGameState_HeadquartersXCom OldXComHQState; local XComGameState_HeadquartersXCom NewXComHQState; local XComGameState_Unit ItemState; local X2CharacterTemplateManager ItemMgr; local X2CharacterTemplate ItemTemplate; //local CharacterPoolManager CharMgr; //In this method, we demonstrate functionality that will add ExampleWeapon to the player's inventory when loading a saved //game. This allows players to enjoy the content of the mod in campaigns that were started without the mod installed. ItemMgr = class'X2CharacterTemplateManager'.static.GetCharacterTemplateManager(); History = `XCOMHISTORY; //Create a pending game state change NewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Adding MonkeyBiscuits"); //Get the previous XCom HQ state - we'll need it's ID to create a new state for it OldXComHQState = XComGameState_HeadquartersXCom(History.GetSingleGameStateObjectForClass(class'XComGameState_HeadquartersXCom')); //Make the new XCom HQ state. This starts out as just a copy of the previous state. NewXComHQState = XComGameState_HeadquartersXCom(NewGameState.CreateStateObject(class'XComGameState_HeadquartersXCom', OldXComHQState.ObjectID)); //Make the changes to the HQ state. Here we add items to the HQ's inventory ItemTemplate = ItemMgr.FindCharacterTemplate('MonkeyBiscuits'); //Instantiate a new item state object using the template. ItemState = ItemTemplate.CreateInstanceFromTemplate(NewGameState); NewGameState.AddStateObject(ItemState); //Add the newly created item to the HQ inventory ItemState.RankUpSoldier(NewGameState); ItemState.SetSoldierClassTemplate('Ranger'); ItemState.SetVoice('MaleVoice1_English_UK'); ItemState.SetCharacterName("Jordan", "Bananas", "Monkey Biscuits"); ItemState.SetCountry('Country_Canada'); NewGameState.AddStateObject(ItemState); NewXComHQState.AddToCrew(NewGameState, ItemState); ItemState.SetHQLocation(eSoldierLoc_Barracks); NewXComHQState.HandlePowerOrStaffingChange(NewGameState); //Commit the new HQ state object to the state change that we built NewGameState.AddStateObject(NewXComHQState); //Commit the state change into the history. History.AddGameStateToHistory(NewGameState); }
  5. i'm trying to name my character as he's spawning into the world but i can't figure out how to use this function function SetCharacterName(string First, string Last, string Nick) { strFirstName = First; strLastName = Last; strNickName = Nick; } i'm trying to use it like this but i'm getting errors when compiling SetCharacterName(First("Joe"), Last("Schmo"), Nick,("Person"));
  6. so i created a custom character but i'm having difficulties adding him into the game whether it be a fresh game or pre-existing save. this is what i'm using to try to load him in. //---------------------------------------------------------------------------------------// FILE: XComDownloadableContentInfo_MyXCOM2Mod.uc // // Use the X2DownloadableContentInfo class to specify unique mod behavior when the // player creates a new campaign or loads a saved game.// //---------------------------------------------------------------------------------------// Copyright © 2016 Firaxis Games, Inc. All rights reserved.//--------------------------------------------------------------------------------------- class X2DownloadableContentInfo_MyXCOM2Mod extends X2DownloadableContentInfo;static event OnLoadedSavedGame(){local XComGameStateHistory History;local XComGameState NewGameState;local XComGameState_HeadquartersXCom OldXComHQState; local XComGameState_HeadquartersXCom NewXComHQState;local XComGameState_Unit ItemState;local X2CharacterTemplateManager ItemMgr;local X2CharacterTemplate ItemTemplate;local CharacterPoolManager CharMgr; //In this method, we demonstrate functionality that will add ExampleWeapon to the player's inventory when loading a saved//game. This allows players to enjoy the content of the mod in campaigns that were started without the mod installed.ItemMgr = class'X2CharacterTemplateManager'.static.GetCharacterTemplateManager();History = `XCOMHISTORY; //Create a pending game state changeNewGameState = class'XComGameStateContext_ChangeContainer'.static.CreateChangeState("Adding CoconutMonkey"); //Get the previous XCom HQ state - we'll need it's ID to create a new state for itOldXComHQState = XComGameState_HeadquartersXCom(History.GetSingleGameStateObjectForClass(class'XComGameState_HeadquartersXCom')); //Make the new XCom HQ state. This starts out as just a copy of the previous state.NewXComHQState = XComGameState_HeadquartersXCom(NewGameState.CreateStateObject(class'XComGameState_HeadquartersXCom', OldXComHQState.ObjectID)); //Make the changes to the HQ state. Here we add items to the HQ's inventoryItemTemplate = ItemMgr.FindCharacterTemplate('CoconutMonkey'); //Instantiate a new item state object using the template.ItemState = ItemTemplate.CreateInstanceFromTemplate(NewGameState);NewGameState.AddStateObject(ItemState); //Add the newly created item to the HQ inventoryItemState.SetSkillLevel(5);NewGameState.AddStateObject(ItemState);NewXComHQState.AddToCrew(NewGameState, ItemState);ItemState.SetHQLocation(eSoldierLoc_Barracks);NewXComHQState.HandlePowerOrStaffingChange(NewGameState); //Commit the new HQ state object to the state change that we builtNewGameState.AddStateObject(NewXComHQState); //Commit the state change into the history.History.AddGameStateToHistory(NewGameState);} /// <summary>/// Called when the player starts a new campaign while this DLC / Mod is installed/// </summary>static event InstallNewCampaign(XComGameState StartState){//Don't need to do anything - the weapon should be picked up and placed into the HQ inventory when starting a new campaign.}
×
×
  • Create New...