Padwan Posted March 12, 2018 Share Posted March 12, 2018 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 More sharing options...
Hammelpilaw Posted March 12, 2018 Share Posted March 12, 2018 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 More sharing options...
Padwan Posted March 13, 2018 Author Share Posted March 13, 2018 I found a solution.. Sector():getEntitiesByComponent(ComponentType.TurretLoot) gets all Turret Loot. Works pretty well.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now