[Question] How do commanders work in-game at the moment?

Discussion in 'Mod Discussions' started by thetrophysystem, August 25, 2014.

  1. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    I notice that some mods change commanders, some mods change commander icons in the commander select, but I believe I remember the limitation of what commanders show up for you is based by your account access, and I know if you remove all commanders from unit_list.json or all units at all from unit_list.json that a commander still spawns like magic (seriously, the game doesn't even have a commander loaded to give you but it gives one).

    So, what is hardcoded and what can be changed? I ask this because I want to make about 8 commanders all have different tech and tbh I don't think there are more than 7 free ones.

    So what is all possible?

    -Can you make it so a commander doesn't spawn?
    -Can you make it so a commander is chooseable by someone who doesn't have it?
    -Can you make it so a commander completely replaces another commander, including in lobby select?
    -Can you make it so another unit is spawned instead of a commander?
    -Can you make it so the "initial starting unit" doesn't endgame on death?
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I haven't poked into all the corners here.

    - Not that I know of; you could make the 'commander' invisible and neigh-invulnerable - but of course then you could never lose.
    - The models are all there; it's technically feasible, but Uber may step in if people start breaking their armory model.
    - See above
    - Somebody (trialq?) made a mod where the commander was a factory
    - Not that I know of
  3. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    What wondible suggests is the best bodge solution imo. You could hack you own end game condition into the game as the usual end game is not possible. Something like checking periodically that the total metal cost on field for player x is more than y after time z; if it's not the player (well, the players client mod) automatically commits sodoku, as they are effectively wiped out.

    You can replace assets to for example replace the theta with an armalisk, bypassing the need to pay for it. This wouldn't be allowed on PAMM (there's a precedent if you look hard enough), but is fair game as a client-side 'only I will ever know' mod.

    I think you're really asking if everyone can have access to 8+ free commander slots given <8 free vanilla slots. My gut says no unless you're willing to go hacking. At the least every player would need a client portion of the mod to give them the choice of more commanders, with the host also having the server mod itself. The extra slots could be filled with new commander units, it sounds much cleaner than trying to activate restricted comms. It's still tentative whether the game will load properly with a modded selection; who knows it might just 'work'.

    The other solution that comes to mind is forget about comm selection in the lobby and hack it into the game. Make the real comander untargetable and pretty much invulnerable, with the power to build all of your custom commanders. Then make the built unit the lose condition. I think each player would need a client-side mod to ensure they don't create more than one custom commander, or possibly the allow mod data updates cheat to disable the invulnerable commanders ability to build commanders after a short time.

    Yes, but it will be restricted in the same way as what is being replaced (in all likelihood). As above, lobby select would require everyone to have a client mod afaik.

    No. Wondible is right in saying that I turned the commander into a factory with a mod. You can make the commander whatever you like but it will still be a commander to the game.

    See the first point. I think a hack is the only way until it's added properly by Uber.
  4. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Here's hoping to endgame conditions addition to the files available to mod.

    Also, what is needed is a few starting commanders, I think if I search hard enough I can find a solution, but I may just multi-use models. Matter of fact, I could make extreme textures like Able is to Progenitor except for the Invictus or something.
  5. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Just a guess, but might
    Code:
    "si_name": "commander",
    have something to do with the victory condition?

    Turning all existing commanders into factories which can produce the actual commander (or a selection of commanders) would probably work. Turning these factories off / disabling the construction of additional commanders however probably wouldn't. Not even auto-self-destruction would be possible for now.

    Uhm wait, I think I've got an idea...
    Setting factory_cooldown_time to some ridiculously high value, shouldn't that deactivate the factory for good?

    Now there is only the question left, what happens if the originally spawned unit does not have the "commander" property (whatever is used to evaluate that). Does it still need to be destroyed? Is the test for remaining commanders performed constantly or just whenever a commander dies? If a new commander is built, is it actually registered as a commander?
  6. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    We discovered during Puppetmaster that pasting commanders doesn't affect victory conditions, so I doubt there is any extra code when building them.
  7. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    You mean the second commander was just worth as much as the first? I think I remember that match...

    And now for the question what happens if the first unit spawned doesn't have the "commander" property. Guess that means neither
    Code:
    "si_name": "commander",
    nor
    Code:
    "unit_types":["UNITTYPE_Commander"],
  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Hadn't noticed that one before. I'm guess Strategic Icon Name, because unlike other unit the icon name isn't the same as the last path component, due to all the variations.
  9. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Good point.

    So it has to be "UNITTYPE_Commander", because that's the only special property left.

    Unless of course that
    Code:
    "record_index": -1
    on the commanders death weapon means anything special. Could be hard coded index which triggers additional tests on death, like causing the engine to count all commanders for each team.

    Either that, or that refers to the player id, meaning that the commander explosion is not owned by a certain player. That attribute isn't listed in the docs yet: https://forums.uberent.com/threads/reference-unit-blueprints.47378/
  10. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    I think that is to keep it from being counted as a regular weapon. I can only imagine early tests where the commander decided blowing up would be a really effective way to kill that pesky dox ;^) A recent PTE actually pulled death weapon into a top level property to remove that particular hack.
  11. masterdigital

    masterdigital Uber Alumni

    Messages:
    438
    Likes Received:
    833
    si_name: strategic icon name.

    Commanders are spawned (and monitored) by server side JS code... which is not currently mod-able but is expected to be mode-able sometime after release. Currently an army will be defeated if the server side JS detects that all spawned Commanders (flags and specs don't matter, only the unit id matters) for that army have been destroyed.
    kjotak109, SXX, liquius and 1 other person like this.
  12. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Oh. Might I make a short term suggestion just for that then? Make it so if the game needs to detect a commander in order to end game without a commander.

    Then at least we could modify to remove the commander unit id from all the units.

    I can't believe nobody noticed that yet. I didn't because the commanders we copy-paste still die if original commander lives (copypaste doesn't count to server or something), and other units we added as commanders all had commander tag and were unbuildable, so it never was noticed.
  13. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    I am necroing this, because I would like to quickly know how to make a client mod to add commanders to the lobby selection. Like, in my instance, I want to add to spawn with a factory, and would like to simply add "vehicle factory" in the lobby commander selection. How would I add a vehicle factory picture to the commander selection, and make it select and then spawn in as a factory? Would that be serverside as well?
  14. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    As before I doubt new commanders would be easy to add, but replacing an existing one is doable:
    • Server mod to change one of the existing commanders to a 'vehicle factory commander'
    • Client mod to change the lobby image of the commander to a vehicle factory image
  15. thetrophysystem

    thetrophysystem Post Master General

    Messages:
    7,050
    Likes Received:
    2,874
    Then let's be honest. The other options are:

    1) Merge 2 factions, or really remove 2 diverse factions and simplify some to fit elsewhere.

    2) For the most situational and unused factions, make them Theta, Delta, Shadowdemon, Spiderofmean, Gamma, and Calyx, as well of course as formatting other commanders to be skins of existing factions of the 7 main commanders. This would mean to use 2 factions, be them situational anyway, you would need some preorder/nordic/store commanders. I think this is still liveable anyway, besides, to complain about it would challenge you to furnish a better solution, which I would honestly use if the better solution was provided.
  16. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917
    Anything you make can be incremental. If making 7 factions is easily moddable but 8 requires painful hacks, make 7 first. Worry about 8 later, by that time you may have tinkered with the api some more and figured out an easy way to do what you want.

Share This Page