Jump to content

Recommended Posts

Posted (edited)

Has anyone figured out an easy way, or any way to do this? Such as by changing the CharacterBaseStats in GameData_CharacterStats?

Edited by lamaros
Posted

I'm quite sure there is no easy way to do this.

 

If a new unit is created its stats will get initialized by XComGameState_Unit.OnCreation. This function will copy the stats over from its template.

Posted (edited)

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

Edited by Guest
Posted
  On 2/24/2016 at 2:17 PM, Eladdv202 said:

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

Posted
  On 2/24/2016 at 10:32 PM, lamaros said:

 

  On 2/24/2016 at 2:17 PM, Eladdv202 said:

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

 

Not Really, using point system it's quite easy to get stuff like a sectoid with tons of psi offense but little health or a more agile berserker but with less HP.

my problem is a system to allocate the points since a +2 to hp is a considerable number for an advent trooper it's not that consequential for a gatekeeper

Posted
  On 2/24/2016 at 10:42 PM, Eladdv202 said:

 

  On 2/24/2016 at 10:32 PM, lamaros said:

 

  On 2/24/2016 at 2:17 PM, Eladdv202 said:

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

 

Not Really, using point system it's quite easy to get stuff like a sectoid with tons of psi offense but little health or a more agile berserker but with less HP.

my problem is a system to allocate the points since a +2 to hp is a considerable number for an advent trooper it's not that consequential for a gatekeeper

 

 

Yeah that's what I meant, if you want to allow Sectiods to vary in health by 2 health, but Troopers only by 1, and have gatekeepers vary in armor by 2 but mutons not to vary at all in armor, etc...

Posted
  On 2/24/2016 at 10:45 PM, lamaros said:

 

  On 2/24/2016 at 10:42 PM, Eladdv202 said:

 

  On 2/24/2016 at 10:32 PM, lamaros said:

 

  On 2/24/2016 at 2:17 PM, Eladdv202 said:

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

 

Not Really, using point system it's quite easy to get stuff like a sectoid with tons of psi offense but little health or a more agile berserker but with less HP.

my problem is a system to allocate the points since a +2 to hp is a considerable number for an advent trooper it's not that consequential for a gatekeeper

 

 

Yeah that's what I meant, if you want to allow Sectiods to vary in health by 2 health, but Troopers only by 1, and have gatekeepers vary in armor by 2 but mutons not to vary at all in armor, etc...

 

i should get it working over the weekend, along with improvements to NCE and hopefully finally implement UI (and learn how GameState works) watch out for that on my mod on steam (Second Wave Reborn) i should hopefully come back on sunday with some enlightenments

Posted (edited)

My thinking now on the best way to do this is to have the enemy you want modified, the stat you want modified, and how you want it modified, in three arrays.

 

EnemyRandom[0]=AdvTrooperM1

EnemyStatRandom[0]=eStat_HP

StatRandomAmount[0]=1

EnemyRandom[1]=AdvTrooperM2

EnemyStatRandom[1]=eStat_HP

StatRandomAmount[1]=2

 

...

 

2. Then update those values in the XComGameState_Unit?

 

So your final output is

 

currentStat=(Rand(StatRandomAmount[n]+1));

RandomStats.addItem(EnemyRandom[n].getBaseMaxStat(EnemyStatRandom[n])+currentStat)

 

EnemyRandom[n].setBaseMaxStat(EnemyStatRandom[n],RandomStats[n]);

EnemyRandom[n].setCurrentMaxStat(EnemyStatRandom[n],RandomStats[n]);

 

until the end of the array? Does that make sense logically? Obviosuly the code itself would be.. not this.

Edited by lamaros
Posted

In situations like this, I would advice to use only one single array which then contains a struct. That way:

  • if you want to pass the information around you dont need to pass multiple values
  • if need for an aditional value arises, its very easy to edit it in

 

I'm thinking about something like this

struct RandomChange
{
  var name Target;
  var ECharStatType StatType;
  var float Amount;
}
var array<RandomChange> RandomChanges;
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...