lamaros Posted February 24, 2016 Posted February 24, 2016 (edited) Has anyone figured out an easy way, or any way to do this? Such as by changing the CharacterBaseStats in GameData_CharacterStats? Edited February 24, 2016 by lamaros
eXecator Posted February 24, 2016 Posted February 24, 2016 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.
Deleted32045420User Posted February 24, 2016 Posted February 24, 2016 (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 February 24, 2016 by Guest
lamaros Posted February 24, 2016 Author Posted February 24, 2016 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?
Deleted32045420User Posted February 24, 2016 Posted February 24, 2016 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
lamaros Posted February 24, 2016 Author Posted February 24, 2016 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...
Deleted32045420User Posted February 24, 2016 Posted February 24, 2016 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
lamaros Posted February 25, 2016 Author Posted February 25, 2016 (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]=AdvTrooperM1EnemyStatRandom[0]=eStat_HPStatRandomAmount[0]=1EnemyRandom[1]=AdvTrooperM2EnemyStatRandom[1]=eStat_HPStatRandomAmount[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 February 25, 2016 by lamaros
eXecator Posted February 25, 2016 Posted February 25, 2016 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 valuesif need for an aditional value arises, its very easy to edit it in I'm thinking about something like thisstruct RandomChange { var name Target; var ECharStatType StatType; var float Amount; }var array<RandomChange> RandomChanges;
Deleted32045420User Posted February 25, 2016 Posted February 25, 2016 I was thinking of going to have a simpler ini file it'd also procedurally support further new enemies, having a base like the muton and constructing a formula to extract the rest of the stat changes for the rest of the enemies
Recommended Posts