Author Topic: Mining E2 Functions  (Read 13744 times)

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Mining E2 Functions
« on: September 19, 2016, 12:52:53 am »
I've been working on some E2 functions tonight for the SB mining add-on, so far I have:

  entity:IsAsteroid() - Is the entity an asteroid?
  entity:ResourceAmount() - How many units of the asteroid are resources (not rock)
  entity:TotalResourceAmount() - How many total units (resource + rock) are in the asteroid

I have not really played the mining addon all that much, so any requests for additional functions will be considered.

I'm also open to suggestions for the function names themselves...


« Last Edit: September 25, 2016, 11:29:22 pm by kevinminion »

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Mining E2 Functions
« Reply #1 on: September 25, 2016, 11:08:20 pm »
Question: There are groups for the asteroid resources for the mining storage.  Does anyone know the order by rarity?
                 Currently I have them ranked as Abundant, Common, Uncommon, Precious, Rare, Very Rare

New or updated functions:

   entity:Resources() - Returns a table of resource names and amounts
   entity:Resource(string) - returns the amount of specified resource in an asteroid
   entity:ResourceDifficulty(string) - Difficulty (rating?) of a specified resource
« Last Edit: September 26, 2016, 12:08:16 am by kevinminion »

bloxgate

  • Supreme Forum Overlord
  • Administrator
  • Hero Member
  • ******
  • Posts: 546
  • Karma: +50/-4
    • View Profile
    • Bloxgate's Website
  • IGN: bloxgate
Re: Mining E2 Functions
« Reply #2 on: September 26, 2016, 07:56:50 am »
I think you have it right. I can check when I get home today.

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Mining E2 Functions
« Reply #3 on: October 02, 2016, 11:15:19 pm »
I created an E2 to display a "periodic table" of the mining elements.

Not sure how I'm going to use this in-game, but it was a project I wanted to do.

Lehr suggested that I attach it to the storage and display the amount in each box.

Any other feedback is welcomed.

Edit: Due to poor penmanship, I erroneously put in Indium (In) when it should have been Iridium (Ir)
« Last Edit: October 04, 2016, 08:28:36 pm by kevinminion »

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Mining E2 Functions
« Reply #4 on: October 02, 2016, 11:43:14 pm »
A satellite that mines precious resources, still a work in progress.

bloxgate

  • Supreme Forum Overlord
  • Administrator
  • Hero Member
  • ******
  • Posts: 546
  • Karma: +50/-4
    • View Profile
    • Bloxgate's Website
  • IGN: bloxgate
Re: Mining E2 Functions
« Reply #5 on: October 02, 2016, 11:45:33 pm »
Uh... what's Ob supposed to be on that periodic table?

Shifty

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +2/-34
    • View Profile
  • IGN: Shifty
Re: Mining E2 Functions
« Reply #6 on: October 03, 2016, 09:03:26 am »
@bloxgate Obsidian, maybe?  I can't remember if obsidian is a resource or not.

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Mining E2 Functions
« Reply #7 on: October 03, 2016, 04:06:51 pm »
It is Obsidian... not a real element, so I made up a symbol for it

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Mining E2 Functions
« Reply #8 on: October 04, 2016, 08:32:13 pm »
New or updated functions:

   entity:HasResource(string) - Returns true if the specified resource exists in an asteroid (Iron, Gold, Silver, etc.)
   entity:HasResourceGroup(string) - Returns true if the specified resource group exists in an asteroid (Common, Precious, Rare, etc.)


kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Re: Mining E2 Functions
« Reply #9 on: October 04, 2016, 11:51:26 pm »
My latest E2, it marks the location of each asteroid using the entity:hasResourceGroup(string) function to classify them

kevinminion

  • Global Moderator
  • Full Member
  • *****
  • Posts: 147
  • Karma: +15/-0
    • View Profile
  • IGN: Kevin Minion
Space Build Mining Addon e2 Functions
« Reply #10 on: October 14, 2016, 11:36:04 pm »
Sending Revision 2016-10-15 to @bloxgate tonight!

Code: [Select]
//======================================\\
|| Space Build Mining Addon e2 Functions ||
||           by Kevin Minion             ||
||---------------------------------------||
||  sbmaIsAsteroid()                     ||
||  sbmaMaxCapacity()                    ||
||  sbmaTotalResources()                 ||
||  sbmaHasResource(string)              ||
||  sbmaGetAllResources()                ||
||  sbmaGetResource(string)              ||
||  sbmaResourceDifficulty(string)       ||
||  sbmaHasResourceGroup(string)         ||
\\======================================//

Usage:

number = entity:sbmaIsAsteroid() - Returns 1 if entity is an asteroid
number = entity:sbmaMaxCapacity() - Returns how many total units (resource + rock) are in the asteroid
number = entity:sbmaTotalResources() - Returns how many units of the asteroid are resources (not rock)
number = entity:sbmaHasResource(string) - Returns 1 if the specified resource exists in an asteroid
table = entity:sbmaGetAllResources() - Returns a table of resource names and amounts
number = entity:sbmaGetResource(string) - Returns the amount of specified resource in an asteroid
number = entity:sbmaResourceDifficulty(string) - Returns the difficulty (rating?) of a specified resource
number = entity:sbmaHasResourceGroup(string) - Returns 1 if the specified resource group exists in an asteroid