Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

krat.davaham

Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by krat.davaham

  1. Long story short i have no idea how to properly pull values from components

    component:

    component.stargate.getEnergyRequiredToDial(address)

    This component is from another mod, but i just need to learn the principle to pull certain values.

    Im trying to pull the boolean value (canOpen) and the value open from the return energyMap

    When running the component command in lua i get in return:

    {canOpen=true, keepAlive=11886, open=27386566}

    As you can see it returns 3 values.

     

    Now i want to run this same component command but only get the canOpen boolean in return

    And another command that only gets the open value in return, nothing else.

     

     

    I also run 

    print(component.stargate.getEnergyRequiredToDial(address))

    in my current program to see what would get printed (not in the native program lua) and it returned this:

    d7a0b79f4faf1fa3f19a4ad24a4ee716.png.b0828f17726c69c42e5f6331271e812e.png

     

    The following is stated from the mod wiki on this specific command:

    • getEnergyRequiredToDial(symbols... or symbols:array) Gets the energy required to dial specified gate. From Aunis 1.9.6.
      Parameters:
      symbols... Symbols as subsequent parameters,
      symbols:array Symbols as an array.
      Point of Origin is added automatically if not present
      Returns:
      not_merged Gate's not merged (duh), or
      address_malformed (No such gate, address contains less than 7 symbols), or
      energyMap Map (aka array in Lua) with 3 indexes: [open(open cost, in RF), keepAlive(sustain cost, in RF/t), canOpen(if the stored power is enough to open the wormhole, boolean)]

     

     

     

     

     

     

     

     

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.