Closed TheMasterCreed closed 3 years ago
The unit specialisations that are set are scripts, they run in sequential order - if you set a specific boost and then run allstat, the allstat will overwrite the specific boost. So if you want to change the stats set, do it like following
However, I'm sure there are mistakes in here so I'll make sure to check them over.
This is what I have set, still no defense value. However I will use the unit specific script and see if that fixes my issue. Thanks!
Still no luck, here is what is in my script. Even checked the actual battle forecast. No extra defense.
Technically speaking, I could set StatAll to Eagle's value's, and then go through every other unit in the game and set their appropriate stats using the unit specific script.
Example: setCOD2DAllStat coeagle,15,10,0,0 setCOD2DUnitStat coeagle,Unit_Infantry,0,0,0,0 setCOD2DUnitStat coeagle,Unit_Mech,0,0,0,0
But do I feel like doing unit by unit? No, I still might though xD.
Oh no please don't do that. I'll have a look through and see what's wrong.
You are amazing, thank you!
Okay so something I discovered.
When using SetCOAllUnitStat, it works fine on it's own. All stats get set as they should be.
However when anything else that changes stats comes after that command, the defense gets "overlooked".
Example: SetCOD2DAllUnitStat coeagle,10,10,1,1 This works perfectly fine.
Example2: SetCOD2DAllUnitStat coeagle10,10,1,1 SetCOD2DUnitStat coeagle,Unit_Infantry,0,0,0,0 This sets defense to 0 for all units.
Hope this helped!
Confirmed reproduction of the issue, doesn't appear to be a simple fix.
Only affects defence attribute - Firepower, movement and range work correctly Affects scripts for D2D, Power and Super
Bug in the defence value function - value is written correctly but is not being used
Confirmed source of issue: Defence collection function does not grab from Unit ID, is grabbing solely from Unit 1 in the list (Infantry). Reproduce by giving infantry a defence boost and all units will have defence boosts
This should fix the issue, now defence should be grabbed correctly. If you come across incorrect CO numbers, etc, please place another issue
Certain CO's, like Eagle, do not have the appropriate defense boosts to their specialty units.
Tried editing the CO's in the editor and no matter what you change the defense to, after compiling, their defense still remains at 0.
For example, changed Eagle's air defense to 50 just for giggles and when entering a match, his air units still remain at 0 defense. Tried it with the other slots just to make sure but those slots are for Attack, Movement, and Range respectively. This seems to only be an issue with unit specializations, because when setting the function SetCOD2DAllStat, all units are effected appropriately.