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

seeking help to pull certain values from component

Question

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)]

 

 

 

 

 

 

 

 

 

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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