KnuckleCracker / CW4-bug-tracker

The gathering point for bugs and supporting information, or suggestions about additional features.
Creative Commons Attribution Share Alike 4.0 International
13 stars 1 forks source link

[4RPL Addition] #1054

Closed VertuTheMapMaker closed 1 year ago

VertuTheMapMaker commented 2 years ago

Summary: We have the ability to change if a unit can be damaged by Creeper and or Anti-Creeper yet we don't have a way to change if a unit can or can not be damaged by other units to our liking/context.

I have made many CPACKs of varying complexity and since I have had "the exosphere is the limit" attitude with modding (while ensuring I don't over do it and lag the game) there are many units of mine that damage other units regularly. It would be very helpful to have the ability to SetUnitImpeviousState to true at a specific instance so the masses of units I have created which attack other units can ignore the newly set unit. This can be very helpful in creating wreckages and disabled buildings rather than creating a buffer health pool or creating a new unit entirely (something many games actually do) which is a separate unit entirely.

It will also help players if I where to use this as an instance is: my Lancer in the VPAC Vertu Expansion CPACK can be damaged by TCMLs in my VertusCreeperBldgs CPACK while it is a "disabled wreck", bypassing the reclaim mechanic it has when disabled and even possibly skipping it by destroying the Lancer before it gains its health buffer. If this API was present I could just set it to impervious and even better, the TCML places indicators for what units are impervious as it uses the GetUnits API to search for impervious units to mark! So the wreck would be labeled as impervious to the player so they don't waste time firing at it and also communicate this to other units.

Now of course this is just one unit but now I am making numerous units that can befit from this API, mainly towers that when damaged to a certain point, become disabled and need to repair/heal until they can be used again. This is currently impossible without some cloning magic where when destroyed, a clone is created with a table to give it different initParams which say it is disabled or a large amount of buffer health will be needed to minimize a premature destruction,

Furthermore, such an API gives us an additional state to distinguish between what can and can not be damaged and in what contexts as currently, impervious states are unchangeable so we must stick with a single decision at a single moment. This AIP can be immensely helpful to broaden how units can interact with each other in a combat context. Even going as far to give movements of weakness just like any typical video game boss fight. Yes, this can be worked around using the ScriptVar API's but rather than constantly searching for a variable that has to be babysit in case context changes, a quick SetUnitImperviousState(self true) is much simpler and less complex. (As much as I make massive logic sequences in my CPACKs and complex combinations of code, I do understand that more moving parts means more things can break and how it takes little to break the whole thing). This will also remove the need to search through returned lists from API's like GetUnits as the impervious state parameter can be used instead, reducing lines and what goes on in a single frame (never underestimate the performance impact of a very large Do Loop).

Sorry if this was a bit mundane and a bit of a ramble but the impervious state of a unit is a great source of information when unit-unit interaction is a heavily implemented feature in a level.