Is there an easy way to get a soldier's ObjectID?

Post Reply
Antifringe
Posts: 226
Joined: Tue Jan 24, 2017 9:52 pm

Is there an easy way to get a soldier's ObjectID?

Post by Antifringe »

I've recently discovered the SelectSoldierProgressionAbility console command. It's pretty neat. It lets you add arbitrary perks to a soldier, great if you want to do a little bit of "soft modding." The format of the command is

SelectSoldierProgressionAbility [Object ID] [Rank of Perk] [Column of Perk]

The problem is the ObjectID part. You can get a dump of all of the IDs of every creature ever spawned in your game by using the DisplaySoldierClass -1 command. But the problem is that it dumps EVERYTHING, and you can only scroll up one line at a time. Even getting the IDs for your starting soldiers on a fresh game is hard. Getting them for new soldiers in a mature game would be an all day job.

So, my question is, is there an easier way to fetch a soldier's ObjectID?

P.S. I know about Grimy's Console Commands mod, but that adds perks as AWC perks, which is a slightly different effect. I'd prefer the ability to manipulate "real" perks if at all possible.
Smee
Posts: 1
Joined: Sun Feb 26, 2017 9:21 pm

Re: Is there an easy way to get a soldier's ObjectID?

Post by Smee »

there is a command I found on this site:
http://www.mmo-game.eu/xcom-2-cheat-console/
DisplaySoldierClass -1
however it gives too much outputs as it lists all of the soldiers and all of the resistance personnel and it goes off the top of the console window.
Do you know how to output the console commands and responses to a log file somewhere
zronko
Posts: 3
Joined: Sat Mar 04, 2017 3:31 am

Re: Is there an easy way to get a soldier's ObjectID?

Post by zronko »

Smee wrote:there is a command I found on this site:
http://www.mmo-game.eu/xcom-2-cheat-console/
DisplaySoldierClass -1
however it gives too much outputs as it lists all of the soldiers and all of the resistance personnel and it goes off the top of the console window.
Do you know how to output the console commands and responses to a log file somewhere
I am also looking for a way to send the output of this command to a file. I tried the appending | or > with a filename with no luck.

If anyone has experience successfully sending output from a console command to a text file, any feedback is appreciated. :D
Antifringe
Posts: 226
Joined: Tue Jan 24, 2017 9:52 pm

Re: Is there an easy way to get a soldier's ObjectID?

Post by Antifringe »

I forgot that I made this post. I figured it out, if anyone wants to know how to do it.

The commands you want are
GetAll XComGameState_Unit strNickName
GetAll XComGameState_Unit strFirstName
GetAll XComGameState_Unit strLastName
GetAll XComGameState_Unit ObjectID

typing one of the first three commands will give you a list of all units and their names (fist, last, or nick, depending on which command you used). The list doesn't contain the ObectID, but it does give you something called XComGAmeStateUnit, which is a temporary number given to the unit by the game.

Next, you use the GetAll XComGameState_Unit ObjectID command, which lists everyone b their ObjectID. This list will also contain the XComGameStateUnit number from before,, so you can match the two lists and get everyone's permanent ObjectID. Write those down, and you can add extra perks. Unfortunately, you can't REMOVE perks, which was something I really wanted.

BTW, the exact syntax for the perk command is

SelectSoldierProgressionAbility [Object ID] [Rank of Perk] [Column of Perk]

LCPL counts as Rank 1 and it scales up from there. The left column is 0, the middle is 1, and the right column is 2.

as an example, if your soldier has ObjectID 781, and you want to add the leftmost perk from the LCPL level, you would type

SelectSoldierProgressionAbility 781 1 0
Last edited by Antifringe on Sat Mar 11, 2017 11:20 am, edited 1 time in total.
zronko
Posts: 3
Joined: Sat Mar 04, 2017 3:31 am

Re: Is there an easy way to get a soldier's ObjectID?

Post by zronko »

This is great! Thanks so much for sharing.

Yea, I'm surprised that they never built a way to remove skills and perks for testing and debugging. Maybe they have a tool with direct access to the database.
hermescostell
Posts: 21
Joined: Tue Apr 11, 2017 4:22 pm

Re: Is there an easy way to get a soldier's ObjectID?

Post by hermescostell »

For anyone arriving here who wants to change an existing Soldier Ability using this command - unless I'm mistaken - it's not actually possible. The solution is fairly easy though: Use the MakeSoldierAClass command and it will respec all their Soldier Abilities and you then just need to click through their abilities, choosing as desired, as though this were a soldier you just bought at the Black Market.

Example:
Joe "Kickass" Schmoe, the Tech Sergeant level Shinobi has "Coup De Grace" chosen, but due to your hatred of all things french, you decide you'd like to change that to "Conceal". Here are the steps:

In the command console run:
MakeSoldierAClass "Joe Schmoe" Shinobi

Then go to their Soldier Abilities screen, click through their various levels choosing the abilities as desired. Note - Only the info in quotation markes ("Joe Schmoe") is case-sensitive. All other commands can be all nutso caps/lowercase/whatever - but the content in quotes needs to be only First Last - capitalized, with no nickname in between.
hermescostell
Posts: 21
Joined: Tue Apr 11, 2017 4:22 pm

Re: Is there an easy way to get a soldier's ObjectID?

Post by hermescostell »

Addendum to my post above:

I wrote the class above wrong. It's not supposed to be "Shinobi" but rather "LWS_Shinobi" as per http://ufopaedia.org/index.php/Console_Commands_(LW2)

Code: Select all

LWS_Assault
LWS_Shinobi
LWS_Grenadier
LWS_Sharpshooter
LWS_Ranger
LWS_Specialist
LWS_Technical
LWS_Gunner
LWS_PsiOperative
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Is there an easy way to get a soldier's ObjectID?

Post by Zyxpsilon »

I accidentally came across every ObjectID tags neatly listed in a recent "Launch.log" file..
Not sure if this is what you're after, but if they are hooked somehow by something, the entire Barracks (plus Haven/Rebels!!) was assembled there in consecutive GarbageCollection--ValidationChecks!

Code: Select all

[0632.62] ScriptLog: +++ Destroying all icons
[0632.62] LW_Toolbox: ToolboxOptions: Starting Garbage Collection and Validation.
[0632.62] LW_Toolbox: GCandValidationChecks: Found RandomizedState, OwningObjectID=773, Deleted=False
[0632.62] LW_Toolbox: GCandValidationChecks: Found Owning Unit=Jack O'Neill, Deleted=False
[0632.62] LW_Toolbox: GCandValidationChecks: Found RandomizedState, OwningObjectID=781, Deleted=False
[0632.62] LW_Toolbox: GCandValidationChecks: Found Owning Unit=Tealc Jaffa, Deleted=False
[0632.62] LW_Toolbox: GCandValidationChecks: Found RandomizedState, OwningObjectID=789, Deleted=False
[0632.62] LW_Toolbox: GCandValidationChecks: Found Owning Unit=Sam Carter, Deleted=False
[0632.62] LW_Toolbox: GCandValidationChecks: Found RandomizedState, OwningObjectID=797, Deleted=False
--- * Plenty..
[0632.63] LW_Toolbox: GCandValidationChecks: Found RandomizedState, OwningObjectID=65645, Deleted=False
[0632.63] LW_Toolbox: GCandValidationChecks: Found Owning Unit=Resistance MEC, Deleted=False
So Jack O'Neill=773

... (( and so on! ))

Sooooo... if someone were to do a quick/find of the GCandValidationChecks strings they'd be able to gather up the whole text block in a single sweep to copy/paste results in external TXT content.
Not sure *WHAT* wrote such stuff in the log process though apart from the LW_Toolbox references.

Maybe this...

Code: Select all

[0426.02] ScriptWarning: Accessed None 'Personnel'
	UIPersonel_listener ShowMeThePersonel.Default__UIPersonel_listener
	Function ShowMeThePersonel.UIPersonel_listener:Maketh:01A0
[0426.02] ScriptLog: +++ Refreshing icons
[0434.48] ScriptLog: +++ Destroying all icons
No wonder my "Barracks List" is slow'er when accessed! :lol:

As a result.. some genius out there (RoboJumper??) has got to try fixing that old "ShowMeThePersonel" mod for us all, pleazzzze!! :? ;)
Post Reply