[REQ] Commander Regen

Discussion in 'Mod Discussions' started by wondible, November 3, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Someone PM'ed me about adding commander regen. I've still got a few items in my WIP List, so if anybody has the itch to try and solve this, leave a comment and go for it. I've got a few ideas how it might be done:

    Server Script

    The only units the server knows about are the commanders it spawned, and it monitors the commander state in order to handle game over. Unfortunately it seems to be a 'dead' flag rather than HP, but it could be interesting to see if the HP value is available to to the server and if it's a two-way link, or just read-only.

    The Invisible Hand

    Using either server script or create-unit containment,create an invisible, invulnerable unit that can only repair with assist-only-build flag, and order it follow the commander around. See Murder Party for most of the details. Caveat: this costs the player metal, because that's the only way the game does repair. You can decrease the commander metal cost (or increase wreckage_health_frac) to improve the metal/health ratio, but that also makes him easier to reclaim.

    These are all kind of long-shots; any other ideas?
  2. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    Another long shot: Bomb the commander with weapons that do negative damage.
    wondible likes this.
  3. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Strike one: the only (enumerable) keys on a sim.units object are id, dead, spec, and army.
  4. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Negative damage is a thing. (Also: I have a pair of dox playing ping-pong ;^) ) But you can't target your own units for direct fire.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    A secondary fire weapon with splash_damage_allies can target the ground near a unit. Secondary fire is a 2D command.

    Create Zero-Health Unit: can occur at either the pointer position, or a 3d coordinate. The pointer won't work. There is the hidden PIP hack to issue a 2D command, but it would take a ping to turn that into a 3D coordinate.

    Order Unit: if we could create a truly hidden unit, we could use the hidden PIP hack and track-commander to order it to fire at the commander's 2D location.
  6. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Damage volumes do reject negative damage.
  7. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    There are probably more (actual) getters and setters, not just those read-only attributes, but they are not enumerated since they are handled by a wrapper via a catch-all and router system.
    wondible likes this.
  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Only things I've gotten to work so far:

    - direct fire weapons, which can only damage enemies
    - modified uber cannon with splash_damages_allies
    - modified nuke without a damage volume

    Anything I've tried as a death weapon either does nothing (I think those were the damage volumes) or crashes the server.
  9. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Somewhere internally the code uses 'health', but that property doesn't work.
  10. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    What do you mean by "doesn't work"? Are you invoking it as a property or as a method? If it's a native method, then you won't be able to get the method as an object, you can only invoke the method.
  11. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Was property; I would expect something like [native code] instead of undefined if it was a method. Tried calling it anyway and got the expected no-method error message.
  12. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Damage volumes can't be negative, but armor_damage_map can, and at least one form (nuke ammo) works as a death weapon.
  13. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    I guess it's time to summon @chargrove to help then. Let's hope he isn't in one of that "absent from the forums for 3 months" phases again.

    Bu I can't help to think that this mod would have horrible side-effects given the current control mechanisms. What I'm talking about? Reclaiming, of course, a self regenerating commander is a decent source of metal, even more so that his metal value is rather high compared to his health thanks to those sneaky orbital reclaim snipes. So unless you can disable metal gain on reclaim, regeneration doesn't sound like a smart thing to do either.
  14. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Server script is actually less ideal because of the custom server requirement. Negative damage currently has promise. I'll worry about reclaim if actually becomes an issue.
  15. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    He hasn't been online for 2 months.
  16. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    In that case summon @jables to check the pulse?
  17. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Is there a precedent for commander regeneration rate?

Share This Page