I've expanded the functionality of some gadgets and a widget and included a gadget of my own.
For Dynamic Collision Volume gadget I highly recomend you get the Boxxy hitbox helper (by Knorke and Google_Frog), it will save you a few gray hair.
The included readme.txt describes all changes in detail. Feedback wellcome.
Readme.txt wrote:These are all the gadgets and widgets I've made or upgraded.
unit_mex_upgrader.lua (gadget)unit_morph.lua (gadget)
- "Upgrade mex" command to all construction units that can build a metal extractor more powerfull than the weakest one in mod. There is also a UpgMex ON/OFF button that make the construction unit roam the land from metal extractor to metal extractor in your team and replaces it with a better one if possible. If a metal extractor has any weapons it will not be on the upgrade list (there is a variable that disables this behaviour).
- update: Gadget doesn't treat metal extractors with shields as armed metal extractors, the only condition is that a metal extractor has <=1 weapons and that the only weapon it has is a shield. Gadget's ID number changed so it doesn't conflict with unit_morph.lua
unit_cobbutton.lua (gadget)
- Adds the "Upgrade" command that allows upgrading a unit/structure into any other unit/structure. The gadget works in a way that it paralyzes the unit/structure under upgrade and when the time is over, it simply removes the unit from battlefield and creates a new unit at the same place and copies the order queue of old unit. This gadget is taken from "The Cursed" mod and it was updated there as well, compared to CA one.
- update: Added several new parameters to morph definitions, see morph_defs.lua in /LuaRules/Configs for details. The default command is now called "Upgrade" instead of "Morph", but it can be changed to anything either by replacing the default name in gadget code, or by using the cmdname = 'Something' parameter in morph definitions.
unit_dynamic_collision_volume.lua (gadget)
- Adds a command button defined in cob_buttons.lua to a unit. Button can have several properties (see cob_buttons.lua in /LuaRules/Configs for details), but in the end all it does is call a specified function in BOS/COB of that unit, without any parameters.
- update: It's now possible to make togglable and multi-buttons (many states) by specifying the params and type parameters in cob_buttons.lua. In case of a togglable and multi-button, the current value of the button is passed to BOS/COB function as parameter, which can be then analysed for apropriate unit action.
- Example: Toggle unit weapon/ammo type, unit has several weapons, but can use only one at a time, adjust unit max speed, etc.
cmd_state_reverse_toggle.lua (widget)
- Adjusts collision volume for pop-up style units and reduces the diameter of default sphere collision volume for 3DO models. The collision volumes of open/closed unit state must be manually defined in /LuaRules/Configs/CollisionVolumes.lua. Details about definitions are in the same file. The gadget works by inspecting the ARMORED variable of each unit form the list and sets the collision volume to 'On' if ARMORED = 0 or to 'Off' otherwise. Gadget can also inspect ACTIVATION variable if the proper code segment is uncommented. In that case unit is 'On' if ACTIVATION = 1 or 'Off' otherwise.
- Allows reverse toggling of Move and Fire Orders by right clicking it's button.
- update: Works with any type of multi-state button.