Jump to content

Welcome to the Forum!

The best place to exchange builds and ideas! Vote for the best ideas and suggestions here.

Join the Avorion Discord!

Connect with other passionate players and talk about the latest news.
Discord

DLC Avorion Into the Rift Out Now!

Now available on Steam!
Steam

How to determine Loot type of an Entity


Padwan
 Share

Recommended Posts

Hi All,

 

i'm trying to improve the salvage script or even better make a dedicated loot collection script but i can't quite figure out if there is any way to determine the loot type of a loot Entity (returned by Sector():getEntitiesByType(EntityType.Loot)).

I would like to prioritize collecting Turrets and System upgrades over colors and minerals. Entity.type seems to be always 8 and typename always says "Beute" so there seems to be no way of determining the exact loot type. Am i missing something here?

 

Link to comment
Share on other sites

EntityType.Loot is a constant, it will never change. Watch Enums section in Scripting API docs for more information.

This will get all entities of type loot in the current sector:

Sector():getEntitiesByType(EntityType.Loot)

 

Then you could do a for loop to find out wich kind of loot it is. Watch Entity section in docs. I never scripted with loot entities, so I don't know what exactly you could do with it, sorry.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...