Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify reform time based on food usage have conflict #483

Open
jzy-chitong56 opened this issue Dec 21, 2024 · 4 comments
Open

Modify reform time based on food usage have conflict #483

jzy-chitong56 opened this issue Dec 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jzy-chitong56
Copy link
Contributor

When peon_assignment in UD, it will call FormGroupAM.
Does this conflict occur???

so I give some change

  if race_has_ghouls then
    call HarvestWood(0, Max(harvesting_ghouls,0))
    if GetWood() < 400 then
      call HarvestWood(0, Min(TownCountDone(racial_ghoul), 5))
    elseif take_all_ghouls_along then // no need harvest wood
      call AddAssault(attacking_ghouls,old_id[racial_ghoul])
    elseif peons_assigned and ghouls_in_attack then
      call HarvestWood(0, Max(TownCountDone(racial_ghoul) - attacking_ghouls - harvesting_ghouls,0)) // spare ghouls not doing anything and not assigned to attack yet
      call AddAssault(attacking_ghouls,old_id[racial_ghoul])
      //call FormGroupAM(0) // in an attack so don't let harvest AI override attack
    else
      call HarvestWood(0, Max(TownCountDone(racial_ghoul) - harvesting_ghouls,0)) // spare ghouls not doing anything
    endif
    set peons_assigned = true
@SMUnlimited
Copy link
Owner

True, it could also trigger the same pause to wait for units. I'll have to think about this case if there another way to do it, or perhaps I can test if it isn't needed anymore since I fixed the calculations on the attack side it might keep things in sync.

@SMUnlimited
Copy link
Owner

Above code is fine with take_all_ghouls_along as it pulls every ghoul off, but doesn't work when its not.

@SMUnlimited SMUnlimited added the bug Something isn't working label Dec 21, 2024
@SMUnlimited
Copy link
Owner

Either no or hardly any ghouls go, or all the ghouls go. Can't have the right number without formgroup running every time.

SMUnlimited added a commit that referenced this issue Dec 21, 2024
Not perfect but at least won't form group unless there is ghouls now.
@SMUnlimited
Copy link
Owner

Got it to not form when no ghouls attacking, but nothing reliable in other approaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants