Loading...
  OR  Zero-K Name:    Password:   

Question about factory UI and unit tweaks

4 posts, 298 views
Post comment
Filter:    Player:  
sort
2 years ago
Ive been trying to add in a lot of the units from the campaign to regular matches to test how that would go, i managed to add in the nebula, eclipse, and kestrel, however when ive tried to add in other units the factories simply don't get the units ive set them to build. Have I done anything wrong or is it just an issue with the UI of the factories and the limitations of unit tweaks?

This is the base code im trying to use in unit tweaks and the encoded code:

{
factoryamph = {
buildoptions = {
[[amphcon]],
[[amphraid]],
[[amphimpulse]],
[[amphfloater]],
[[amphriot]],
[[amphsupport]],
[[amphassault]],
[[amphlaunch]],
[[amphaa]],
[[amphbomb]],
[[amphtele]],
[[grebe]],
},
},
factoryhover = {
buildoptions = {
[[hovercon]],
[[hoverraid]],
[[hoverheavyraid]],
[[hoverskirm]],
[[hoverassault]],
[[hoverdepthcharge]],
[[hoverriot]],
[[hoverarty]],
[[hoveraa]],
[[hoverskirm2]],
[[hoversonic]],
[[hovershotgun]],
[[hoverminer]],
},
},
factoryplane = {
buildoptions = {
[[planecon]],
[[planefighter]],
[[planeheavyfighter]],
[[bomberprec]],
[[bomberriot]],
[[bomberdisarm]],
[[bomberheavy]],
[[planescout]],
[[planelightscout]],
[[bomberstrike]],
},
},
striderhub = {
buildoptions = {
[[athena]],
[[striderantiheavy]],
[[striderscorpion]],
[[striderdante]],
[[striderarty]],
[[striderfunnelweb]],
[[striderbantha]],
[[striderdetriment]],
[[shipheavyarty]],
[[shipcarrier]],
[[subtacmissile]],
[[nebula]],
[[bomberassault]],
},
},
}

ewpmYWN0b3J5YW1waCA9IHsKYnVpbGRvcHRpb25zID0gewpbW2FtcGhjb25dXSwKW1thbXBocmFpZF1dLApbW2FtcGhpbXB1bHNlXV0sCltbYW1waGZsb2F0ZXJdXSwKW1thbXBocmlvdF1dLApbW2FtcGhzdXBwb3J0XV0sCltbYW1waGFzc2F1bHRdXSwKW1thbXBobGF1bmNoXV0sCltbYW1waGFhXV0sCltbYW1waGJvbWJdXSwKW1thbXBodGVsZV1dLApbW2dyZWJlXV0sCn0sCn0sCmZhY3Rvcnlob3ZlciA9IHsKYnVpbGRvcHRpb25zID0gewpbW2hvdmVyY29uXV0sCltbaG92ZXJyYWlkXV0sCltbaG92ZXJoZWF2eXJhaWRdXSwKW1tob3ZlcnNraXJtXV0sCltbaG92ZXJhc3NhdWx0XV0sCltbaG92ZXJkZXB0aGNoYXJnZV1dLApbW2hvdmVycmlvdF1dLApbW2hvdmVyYXJ0eV1dLApbW2hvdmVyYWFdXSwKW1tob3ZlcnNraXJtMl1dLApbW2hvdmVyc29uaWNdXSwKW1tob3ZlcnNob3RndW5dXSwKW1tob3Zlcm1pbmVyXV0sCn0sCn0sCmZhY3RvcnlwbGFuZSA9IHsKYnVpbGRvcHRpb25zID0gewpbW3BsYW5lY29uXV0sCltbcGxhbmVmaWdodGVyXV0sCltbcGxhbmVoZWF2eWZpZ2h0ZXJdXSwKW1tib21iZXJwcmVjXV0sCltbYm9tYmVycmlvdF1dLApbW2JvbWJlcmRpc2FybV1dLApbW2JvbWJlcmhlYXZ5XV0sCltbcGxhbmVzY291dF1dLApbW3BsYW5lbGlnaHRzY291dF1dLApbW2JvbWJlcnN0cmlrZV1dLAp9LAp9LApzdHJpZGVyaHViID0gewpidWlsZG9wdGlvbnMgPSB7CltbYXRoZW5hXV0sCltbc3RyaWRlcmFudGloZWF2eV1dLApbW3N0cmlkZXJzY29ycGlvbl1dLApbW3N0cmlkZXJkYW50ZV1dLApbW3N0cmlkZXJhcnR5XV0sCltbc3RyaWRlcmZ1bm5lbHdlYl1dLApbW3N0cmlkZXJiYW50aGFdXSwKW1tzdHJpZGVyZGV0cmltZW50XV0sCltbc2hpcGhlYXZ5YXJ0eV1dLApbW3NoaXBjYXJyaWVyXV0sCltbc3VidGFjbWlzc2lsZV1dLApbW25lYnVsYV1dLApbW2JvbWJlcmFzc2F1bHRdXSwKfSwKfSwKfQ==
+0 / -0


2 years ago
Strider Hub build options work because it is just a constructor with unsorted build options. Build options without a specific tab (Economy/Defense/Factory/Special) overflow to the Units tab. So adding simple unit tweaks is easy.

Factories don't have the overflow Units tab, instead they have a tab called Units that implements a special build queue at the bottom. I suppose factories could have an overflow tab for modding, but it would be an untested codepath so I'm not too keen on it. Full mods can override the file that specifies the tab and position of a build option. This doesn't work for tweakunits, so a while ago I added an extra way to specify position.

Tweakunits only touches UnitDefs so I added a customParam for position. It is read here: https://github.com/ZeroK-RTS/Zero-K/blob/master/LuaUI/Configs/integral_menu_commands_processed.lua#L30

Basically, you need to put 'pos_<position name> = <unitdefname>' in custom params. Here is the example from the file.

{factorytank = {
buildoptions = {
[[cloakcon]],
[[spiderscout]],
[[vehraid]],
[[hoverskirm]],
[[jumpblackhole]],
[[gunshipaa]],
[[cloaksnipe]],
[[gunshipheavyskirm]],
[[spidercrabe]],
[[bomberdisarm]],
[[planefighter]],
},
customParams = {
pos_constructor=[[cloakcon]],
pos_raider=[[vehraid]],
pos_weird_raider=[[spiderscout]],
pos_skirmisher=[[hoverskirm]],
pos_riot=[[jumpblackhole]],
pos_anti_air=[[gunshipaa]],
pos_assault=[[cloaksnipe]],
pos_artillery=[[gunshipheavyskirm]],
pos_heavy_something=[[spidercrabe]],
pos_special=[[bomberdisarm]],
pos_utility=[[planefighter]],
}},}


Your next issue will be that the UI only has eleven spots for factory build options. Factories with more twelve or more units is beyond the current capabilities of tweak units.
+1 / -0
2 years ago
Ah thats very nice thank you, additionally could you use that to allow a unit to morph into another type of unit (IE to have one unit with the options to morph into two or more units) or is that not possible?
+0 / -0


2 years ago
As far as I'm aware units can morph into more than one type of unit. Also I think morphs are configurable with customParams.
+0 / -0