FAForever / fa

Lua code for FAF
221 stars 228 forks source link

Add entity + dummy Unit in between ExFac and ExFacUnit #6093

Closed clyfordv closed 2 months ago

clyfordv commented 3 months ago
  1. Re-adds the entity attached to the external factory base unit. This prevents "deploy" on the fatboy from detaching the external factory.
  2. Adds another (newly defined) dummy unit in between the entity and the external factory. The dummy unit has the "CARRIER" category which prevents the external factory from being highlighted or selected in the worldview with the cursor, but still allows it to be selected with the exFac button.
apollodeathstar commented 3 months ago

@clyfordv mild request : can make it so the assist command from the external factory when selected to assist the fatboy unit itself causes units produced by the external factory to surround/guard the fatboy like they do when a unit is selected and told to assist the fatboy body normally? right now the fatboy external factory can only have a set rally point that stays statically behind the fatboy and units get produced and left behind. This way you can have units produced by the factory stay with the fatboy as it advances/fights.

Currently when you use the assist command from the external factory to the main body it simply cancels all its production queue.

clyfordv commented 2 months ago

Currently the exFacs, like normal factories, can only assist other factories and can't have assist orders on units (you see it yourself, you can give assist commands to units but the engine eats it after a beat). The canceling the production queue is likely because the exFac thinks on some level that it's being given an assist order to another factory (even though the base unit has no production capability), which has the same result.

But, but, if there was another unit sitting around somewhere, related to the exFac, like a dummy unit, we could task that unit with tracking the assist target (or rally point entirely, which would probably be cleaner).

Garanas commented 2 months ago

Let's first finalize these changes however to fix the bug 😃 !

clyfordv commented 2 months ago

We're good to go. I was experimenting with trimming down the dummy units bp to the absolute minimum viable but that can happen later.

Garanas commented 2 months ago

It is still possible to detach the unit that you're building:

image

Garanas commented 2 months ago

but I'll take this pull request, it fixes the problem that matters the most

clyfordv commented 2 months ago

Is it known if detaching the unit was possible with the original original version, with just the entity? And do you reckon adding the carrier category to the exFac would mess anything else up? (because I think that would solve the problem)

Garanas commented 2 months ago

No idea - we'd need to try and see what happens