Closed pineappledan closed 6 years ago
I was just looking at the lua for cacadores.
It seems overly complicated. Is there a reason to separate survivalism and trailblazer promos into their own tables if they are going to be called all at once?
This is so the function can randomly select one of the promotion lines to grant. If Survivalism is selected, it will go through the Survivalism table and pick the first one that the unit doesn't already have, and if the unit has all of them, it falls through to Trailblazer. If Trailblazer is selected, it'll go through the Trailblazer table first.
I attempted a new version of the lua code. It isn't working either though :(
Still not working, according to Hinin
I could fix this if you describe exactly how this feature is supposed to work.
"Whenever this unit levels up, it gets a promotion from either the Survivalism or Trailblazer lines along with its normal promotion"
Randomly choosen between Survivalism/Trailblaizer?
Unit levels up, you choose promotion, random number generated between 1-2
I see more changes in the code. Seems even more complicated. I suppose that this feature is „name based”, i.e. it will only work for promos with specific names. Or is there any other way to designate a set of promotions to use? Because the code should be:
Simple, right? And can work for any set of promotions, even if somebody messes up with recon promos.
I have commented out Blue Ghost's version of this feature below my attempt (which is the one you fixed previously)
Blue Ghost's version does something similar to what you are describing, but it didn't work. My approach was to try to simplify things by simply making it a series of IF THEN statements. obviously that didn't work so well either though
Updated. Gives a random promo from a predefined set.
So anyone tested this? Can we close this issue "once and for all" :P.
Idk, it was re-opened without any explanation.
Hinin reported that Cacadores was not working when he tested it. He doesn't post his own bugs so I was just doing it for him. I didn't corroborate his bug
"Doesn't working" doesn't say anything. Details, pls.
Not much to say. I just tried it myself and can confirm that the cacadores is not getting a free scouting promotion when it get a level or chooses a promotion. Lua.log
[762856.937] Runtime Error: Assets\DLC\Expansion2\UI\InGame\InGame.lua:1262: attempt to index local 'addinFile' (a nil value) [762856.937] Runtime Error: Error loading Assets\DLC\Expansion2\UI\InGame\InGame.lua.
Plus a ton of errors from EUI that should not be there.
The problem is that Cacador receives a promotion that is not intended for it. Only UNITCOMBAT_RECON are eligible for recon promos. I used CanPromote because it checks for prereq promos but unfortunately it also checks if it is eligible for a given unit combat. In this case it is not, thus all recon promos are deemed invalid and none is granted.
Cacadores is supposed to get 1 random promotion from the scouting line every time it gains a level. This is not currently working