Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Loaded Unit? Ask for it? (Return)

Discussion in 'World Editor Help Zone' started by CaptainHero, Jan 10, 2015.

  1. CaptainHero

    CaptainHero

    Joined:
    Sep 30, 2012
    Messages:
    197
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Similar to asking which item does this hero have in that certain inventory slot..
    I would like to how if it is possible to ask if, and which unit this certain unit has in its cargo? At which position it is, isn't really important to me..

    I guess you could save the units name in a hash table, when loaded, and store it in the loadings transporter-unit's row, and removing them again when unloaded. So you just have to look at the hash table when asking: which units are in this certain transport.

    However is there a direct way of asking this?

    _________

    Although i think it might get a bit tricky with cargo's that could hold multiple units... Wouldn't know how to do that right away..
    ... maybe with an intreger that goes up or down if unit is loaded/unloaded and then read number of integer rows or some sort, while saving this integer in yet another row
     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
  3. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,035
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    Well there is

    constant native IsUnitInTransport   takes unit whichUnit, unit whichTransport returns boolean


    so you could iterate over all units and check if they are carried by given transporter.
     
  4. CaptainHero

    CaptainHero

    Joined:
    Sep 30, 2012
    Messages:
    197
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thats Kick-Ass! Thanks for the info!