Some gadget updates

Some gadget updates

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
Deadnight Warrior
Posts: 183
Joined: 08 Jun 2009, 17:59

Some gadget updates

Post by Deadnight Warrior »

Being Advent season and time of giving, I've decided to give something to other devs.

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)
  • "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_morph.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_cobbutton.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.
unit_dynamic_collision_volume.lua (gadget)
  • 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.
cmd_state_reverse_toggle.lua (widget)
  • Allows reverse toggling of Move and Fire Orders by right clicking it's button.
  • update: Works with any type of multi-state button.
Attachments
Updated_Gadgets.7z
(17.12 KiB) Downloaded 37 times
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Some gadget updates

Post by Beherith »

Awesome stuff, Deadnight! Thanks for this, ill stick it for a while so mod devs dont lose it.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Some gadget updates

Post by zwzsg »

Can you merge my changes into your morph gadget?
User avatar
Deadnight Warrior
Posts: 183
Joined: 08 Jun 2009, 17:59

Re: Some gadget updates

Post by Deadnight Warrior »

That is going to be difficult as you did a lot of changes, and I'm still struggling with LUA. If Spring used VBA instead, it wouldn't be a problem at all. I might give it a try, but I would have to do a detailed cross reference but kinda lack proper tools.
Nevertheless, thank you for the information. I should browse around the forum more often.
User avatar
Deadnight Warrior
Posts: 183
Joined: 08 Jun 2009, 17:59

Re: Some gadget updates

Post by Deadnight Warrior »

It's been some time since I've started this topic, so in the same mannor as initiated, I'll continue with giving away gadgets/widgets/updates for this advent season.

For Dynamic Collision Volume keep an eye on XTA SVN, it uses a config file, so don't forget that one.

A simplistic mission triggers and actions gadget I wrote for XTA (missions still pending, though some sample missions are available, gadget it not game specific). To ease setting up the playfield for missions I made a small editor mutator, details in the readme file.

For an experimental unit script that uses Cyclic Coordinate Descent Inverse Kinematics, look for BAR's AK script. It's not the best work, and might not look as nice as a predefined animation cycle, but looks better on rough land as kbot's feet tend to dig into ground a lot less.

A lot more stuff is in those repos from various authors, both are public, just give credit where credit is due.

And finaly the big unveiling:
  • Modular units
  • Buildmenu templates
  • Local metal storage for construction units
  • Weapon damage upgrades
All can be tried out in my WIP proof-of-concept game YAAG. Note that these gadgets/widgets are game specific and need some reworking for other use. Some also require proper models and unit script interaction (modular factory).


Merry Christmas everyone!
Post Reply

Return to “Game Development”