ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Selling Gives Free Unit Bug

From ModEnc
(Redirected from Selling Gives Free Unit)
Jump to navigation Jump to search

While this bug does present an interesting quirk, no useful exploitations for it have been discovered.


The original text regarding this bug:
 
 
I have yet to confirm the circumstances of this bug:

[NAREFN]
FreeUnit=HARV
DeploysInto=HARV
UndeploysInto=CMIN
(Forgive me, the above flags may not be exactly how I had them set up to cause the following effect, they need confirming.)

Sell the Refinery, a HARV appears.
Didn't test undeploy.

If this effect were replicatable without side-effects, then one could use it on the Mobile War Factory (rally-point instead of undeploy, sell to undeploy with soylent=0).
 


This assumption is somewhat flawed. In actuality, any structure that can be sold (does not have Unsellable=yes) and undeploys into any unit (has UndeploysInto=unit) will make the unit that it undeploys into appear when it is sold. This means that selling that structure produces virtually the same effect as undeploying it normally, except the structure will expell infantry crew (unless the structure has Crewed=no). The structure will not, however, give a Soylent refund.

To see this in effect, comment out the Unsellable=yes tag on the Deployed Slave Miner (YAREFN) and notice what happens when you sell it. It should simply appear to undeploy. The Deployed Slave Miner does not have Crewed=yes, so no infantry men are expelled when it is sold.

Despite all of this, for a structure that does have Crewed=yes and expells infantry when sold, there is a small chance that the UndeploysInto unit will not appear when the structure is sold. When this happens, the Soylent for the structure also seems to be refunded. It rarely does this and the reason for it is not known, but it appears that it might happen if the expelled infantry fails to move out of the way.

It seems that Construction Yards are not affected by this bug, probably by a special hardcoded statement, which is why an MCV does not appear when the Construction Yard is sold.

This bug cannot be exploited to create a workaround for the Mobile War Factory Rally Point Bug as the original author theorized, because the structure will still undeploy as it normally does, when it is selected and clicked to a destination.