adaneslavo / More-Unique-Components-for-VP

Adds 3rd and 4th unique component to each civilization.
1 stars 6 forks source link

Cacadores scouting promotions #114

Closed pineappledan closed 6 years ago

pineappledan commented 6 years ago

Cacadores is supposed to get 1 random promotion from the scouting line every time it gains a level. This is not currently working

pineappledan commented 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?

theazuresoul commented 6 years ago

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.

pineappledan commented 6 years ago

I attempted a new version of the lua code. It isn't working either though :(

pineappledan commented 6 years ago

Still not working, according to Hinin

Infixo commented 6 years ago

I could fix this if you describe exactly how this feature is supposed to work.

pineappledan commented 6 years ago

"Whenever this unit levels up, it gets a promotion from either the Survivalism or Trailblazer lines along with its normal promotion"

adaneslavo commented 6 years ago

Randomly choosen between Survivalism/Trailblaizer?

pineappledan commented 6 years ago

Unit levels up, you choose promotion, random number generated between 1-2

Infixo commented 6 years ago

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:

  1. Get promotions available to use. 1a. Iterate through the set and select those that player doesn’t have and has a prerequisite if one exists.
  2. Select randomly a promotion.

Simple, right? And can work for any set of promotions, even if somebody messes up with recon promos.

pineappledan commented 6 years ago

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

Infixo commented 6 years ago

Updated. Gives a random promo from a predefined set.

adaneslavo commented 6 years ago

So anyone tested this? Can we close this issue "once and for all" :P.

Infixo commented 6 years ago

Idk, it was re-opened without any explanation.

pineappledan commented 6 years ago

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

Infixo commented 6 years ago

"Doesn't working" doesn't say anything. Details, pls.

pineappledan commented 6 years ago

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

Infixo commented 6 years ago

[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.

Infixo commented 6 years ago

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.

Infixo commented 6 years ago

20180420185243_1

20180420185630_1