Jump to content

PurePassive and Salvo


ClaytonCross

Recommended Posts

It didn't fail. The build won't fail on warnings, only errors. That's why it still said "success."

 

An ability tree is indexed 0 to length-1, and tree[0] lists the skills they get at squaddie (since it will never apply to rookies).

 

Are you running the game with the mod enabled, and then checking Launch.log? Because that's where the log statement will be.

Link to comment
Share on other sites

  • Replies 44
  • Created
  • Last Reply

Top Posters In This Topic

I found the Launch.log and the only line I found that seemed related was:

[0005.97] ScriptWarning: Accessed None 'AbilityTemplate'

 

I tried debugger and starting a game through the normal interface and even did a couple battles. I still can't find a log that relate.

Link to comment
Share on other sites

1) Do you even have a variable called AbilityTemplate?

2) Did you Ctrl+F the log statements you specifically added?

 

Also OnPostTemplatesCreated(), in X2DownloadableContentInfo, gets called once, as the game starts up, before you even reach the main menu.

Link to comment
Share on other sites

I tried Ctrl + F searches for "Log" and another of other variables. I was not able to find any logs relating to it.

 

I did find a log from Lucubration's mod that seems to be showing up:

[0006.72] ScriptLog: Lucubration Infantry Class: Applied Light 'Em Up to ability template StandardShot .

 

His log line was;

`LOG("Lucubration Infantry Class: Applied Light 'Em Up to ability template " @ string(abilityName) @ ".");

 

So I searched for "ScriptLog:'

 

Then I deleted everything in the log that was not related a piece at a time looking for it until there was nothing left. (Though as you said I might have been Finding the wrong variables)

 

So... here is the code again: (I tried moving it to its own file in hopes that I could search for the file name.

 

class EverVigilant_LOG extends X2AmbientNarrativeCriteria; <-- Betting this is part of my problem.


//Test Hook EverVigilant use primary weapon
static event OnPostTemplatesCreated()
{

local X2SoldierClassTemplate ClassManager;
local X2SoldierClassTemplate Template;
local array<SoldierClassAbilityType> AbilityTree;
local int i;

Template = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager().FindSoldierClassTemplate('StormGuard');
AbilityTree = Template.GetAbilityTree(1);
for(i = 0; i < AbilityTree.length; ++i)
{
`log("AbilityName"@AbilityTree.abilityName);
`log("Applied to: eInvSlot_PrimaryWeapon"@AbilityTree.ApplyToWeaponSlot);
}
}

Link to comment
Share on other sites

The ScriptLog tag will show up for log statements from any mod. That's why you should specifically search for a phrase from your logs.

 

Extending X2AmbientNarrativeCriteria (which doesn't use OnPostTemplatesCreated) was a workaround to do basically the same thing as the OnPostTemplatesCreated() hook added by the May 12th patch. OnPostTemplatesCreated has to be called from your mod's X2DownloadableContentInfo.

Link to comment
Share on other sites

The ScriptLog tag will show up for log statements from any mod. That's why you should specifically search for a phrase from your logs.

 

Extending X2AmbientNarrativeCriteria (which doesn't use OnPostTemplatesCreated) was a workaround to do basically the same thing as the OnPostTemplatesCreated() hook added by the May 12th patch. OnPostTemplatesCreated has to be called from your mod's X2DownloadableContentInfo.

Movied it to X2DownloadableContentInfo

Rebuilt and started the game. I get to the screen with mods selected (only the one I am working on is selected). search and nothing. Hit play wait for the next menu. search and nothing. I am looking at every entry with ScriptLog because ANY should include this one and I am not finding it. There are not that many so it should be easy to find but surly I am doing something stupid and wrong. Sorry. After multiple attempts I still don't see it.

 

I did also search for:

AbilityTree

PrimaryWeapon

ApplyToWeaponSlot

eInvSlot

Applied to

Template

Link to comment
Share on other sites

Whole file:

 

//---------------------------------------------------------------------------------------
// FILE: XComDownloadableContentInfo_StormGuard.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_StormGuard extends X2DownloadableContentInfo;

/// <summary>
/// This method is run if the player loads a saved game that was created prior to this DLC / Mod being installed, and allows the
/// DLC / Mod to perform custom processing in response. This will only be called once the first time a player loads a save that was
/// create without the content installed. Subsequent saves will record that the content was installed.
/// </summary>
static event OnLoadedSavedGame()
{}

/// <summary>
/// Called when the player starts a new campaign while this DLC / Mod is installed
/// </summary>
static event InstallNewCampaign(XComGameState StartState)
{}

//Test Hook EverVigilant use primary weapon
static event OnPostTemplatesCreated()
{

local X2SoldierClassTemplate ClassManager;
local X2SoldierClassTemplate Template;
local array<SoldierClassAbilityType> AbilityTree;
local int i;

Template = class'X2SoldierClassTemplateManager'.static.GetSoldierClassTemplateManager().FindSoldierClassTemplate('StormGuard');
AbilityTree = Template.GetAbilityTree(1);
for(i = 0; i < AbilityTree.length; ++i)
{
`log("AbilityName"@AbilityTree.abilityName);
`log("Applied to: eInvSlot_PrimaryWeapon"@AbilityTree.ApplyToWeaponSlot);
}
}

Link to comment
Share on other sites

Now that it is in the XComDownloadableContentInfo I marked out the line:

 

// local X2SoldierClassTemplate ClassManager;

 

and Success!!

 

[0009.70] ScriptLog: AbilityName EverVigilant
[0009.70] ScriptLog: Applied to: eInvSlot_PrimaryWeapon eInvSlot_PrimaryWeapon
[0009.70] ScriptLog: AbilityName Salvo
[0009.70] ScriptLog: Applied to: eInvSlot_PrimaryWeapon eInvSlot_Unknown

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...