Jump to content

Open Resource System (ORS) - Mod Resource API - version 1.4.2


Fractal_UK

Recommended Posts

That's why you'd use the gradient bit, they'd look like this. So effectively you would be able to define either a set group of discrete colours (say row 38 in that link) or a nice linear single colour gradient (row 1) or even a rainbow type map (row 39).

Link to comment
Share on other sites

Nice. Thats what im talking about.

Also. Having an option to be able to show all the different resource deposits at the same time is something im missing in the kethane overlay.

EDIT:

another question for Fractal_UK. Are you planning to impliment some unified converter module using the new resourcerequest method? the stock one is just aweful. Kethaneconverter is better but the negative "behind the scenes "draw screws up fuel lines and it could be more flexible with animations etc. Same goes for the kethaneextractor module.

Powercurve support would be awesome.(scale with availabe resource. Perfect for greenhouses etc. Where more plants mean more oxygen/seeds and require more co2/water) also isalwaysActive = value support is definitely a must

The current ors resource extractor dont support particle(gas/smoke/emissions) effects and deploy/retract animations at all right? Also the resource scanners dont support animations eather. I patched them to work with animations but im getting some nullref exceptions in the log so it probably needs more work.

Another bonus would be to have a limited background resource flow (not active vessel) amounts would probably need to be updated very seldom and be integrated in a unified gui for easy viewing/monitoring while doing other stuff. But thats one for the future

EDIT 2: typo. Meant kethaneconverter not kethanegenerator

Edited by landeTLS
Link to comment
Share on other sites

I understand that ORSModuleResourceExtraction can be used to extract crust or ocean resources. Does this plugin come with a built-in module for extracting atmospheric resources?

Yep. The module name is ORSAtmosphericExtractor and the config is the same as for the generic extractor discribed on the first page. Fractal has made a very good foundation here for a unified and open resource extraction system. Cant wait to see what he pulls out of his sleeve next.

Link to comment
Share on other sites

Fractal's resource mechanism is pretty cool, and I think could be modified to allow mining to reduce resources in an area. Given that mining is never going to be enormous as you have to actually play through (and assuming it takes a considerable amount of time to do in game) every mining instance, you could have the standard map, then overlay a circular 'reduction' centered on where it has been mined. At the center it reduces a lot, proportional to how long it has been mined, and around it this reduces depends on distance. The available resource at any given point on the map is the standard, based on the resource map, minus the circular overlay map. To simplify you could also make the circles fairly large (say a few kilometers diameter) and if you mine again within a percentage of that radius (say 25%) it just increases the amplitude of the circular reduction's effect rather than adding a new circle.

How to show this on the map would vary. Given Fractal's current display system a similar 'hotspot' system in reverse (with a different color) to show low spots due to mining would be valid. If there is any way to overlay the overall map onto a planet/moon with something similar to Majiir's overlay but with a continuous map it would be interesting. I'm not sure how easy it would be though to map over. Is it possible to simply copy the surface map, scale it by something like 1.01% radius, make it transparent and use a different texture, updated with the mining resource?

Link to comment
Share on other sites

Yep. The module name is ORSAtmosphericExtractor and the config is the same as for the generic extractor discribed on the first page. Fractal has made a very good foundation here for a unified and open resource extraction system. Cant wait to see what he pulls out of his sleeve next.

Presumably I also need to replace "extractionRateLandPerTon" and "extractionRateOceanPerTon" with a field appropriate for the atmosphere. I've tried "extractionRateAtmospherePerTon" and simply "extractionRatePerTon", neither of which seem to work. Also, is there an easy way to activate a part animation when extracting?

Link to comment
Share on other sites

These are the supported cfg fields:

powerConsumption =

extractionRatePerTon =

resourceName =

unitName =

extractActionName =

stopActionName =

resourceToUse =

resourceManaged = true/false

Not all of these are required but some are. Im not using this module so i wouldnt know. Best to just experiment.

Part animations are not yet supported

Link to comment
Share on other sites

  • 2 weeks later...

ORS Version 1.1 Released

Changelog


-Atmospheric Extractor now takes into account atmospheric density
-New ORSHelper.fixedRequestResource() method

The ORSHelper.fixedRequestResource(Part part, string resourcename, double resource_amount) method is the ORS analogue of KSP's part.requestResource(string resourcename, double resource_amount) method. It differs from KSP's function in two major ways:

1) If you don't have enough of a resource (either stored resource if you're trying to consume, or spare capacity if you're trying to supply) instead of simply doing nothing and returning 0, it will make the maximum change it can manage and return the value the resource was changed by.

2) If you use it with a resource that has ALL_VESSEL flow, it will not do nothing and return zero if the requested quantity is < 1e-5. It will instead consume/supply the resource correctly as the stock function used to.

Find the updated download on the first page.

Link to comment
Share on other sites

Excellent system, I wish I would have discovered this upon first release. I'm an looking forward to playing around with this, though I do have a couple of questions:

1) My understanding is that ORS allows an easy way to add additional resources to the game and mining/extract them. Does the mining/extracting part work during time warp?

2) Is there an integrated "ORSModuleResourceConverter" for taking already extracted resources and processing them? If not, is this a feature that might be added at a later time?

ORS looks to me to be a very powerful system that could be a common back-end for many mods already out there if it is capable of working during time warp and processing resources. Personally, this would help me get my own modding ideas out of my head and into reality :P.

This is a definite +1 for the Community and a ++1 for Fractal. Thanks for taking the time to set this up!

Link to comment
Share on other sites

One thing that would be good if there are modellers out there with some free time - add generic models + parts. So the pack could include

short/long range generic scanner - find stuff

small/large generic miner (drill or digger?) - extract it

small/large generic cracking column - break A down into B (and possibly C)

small/large generic reactor vessel - join A and B into C

With stretchy tanks, spherical/toroidal tanks and Modular fuels it should be possible to cover the storage side pretty easily. Or would that require something in modular fuels?

I know this isn't in what you have currently but it's the logical place for such things to live and wouldn't be much effort (once the initial release changes settle down I'll look at it).

Another thing for modders to think about it to provide the parts with different coloured trim (think the green trim on kethane parts) so have a tank with red trim and the same tank with green trim etc etc. Then when you create a resource you can then pick and choose which colour best suits it (blue for water, purple for fuel, silver for ore etc)

Link to comment
Share on other sites

It seems that I'm having some kind of conflict with resources between TAC life suport and Interstellar how do I solve this?, the debug says that resources are trying to overwrite but the file is unknown but I know that those resources are oxygen, carbon dioxide and water.

Link to comment
Share on other sites

I've not installed this, nor even looked a the source code, but I'm somewhat curious as to consumption. With Kethane, you can bleed a planet dry. Depending on the planet size, a single pixel on the PNG map could turn out to be a few KM on the planet surface. So if I land at a particular spot, start mining stuff up, do the resources count down, or stay static? If they count down, is this information stored in the persistence/quicksave file? Does the PNG map get copied somewhere and modifications are done to the PNG on a per-save basis?

And who's made a PNG for Kerbin that puts massive amounts of fuel right around the flight center? ;)

Link to comment
Share on other sites

  • 2 weeks later...
It seems that I'm having some kind of conflict with resources between TAC life suport and Interstellar how do I solve this?, the debug says that resources are trying to overwrite but the file is unknown but I know that those resources are oxygen, carbon dioxide and water.

I am using TAC life suport and Interstellar. No conflct. Try reinstall both addons

I've not installed this, nor even looked a the source code, but I'm somewhat curious as to consumption. With Kethane, you can bleed a planet dry. Depending on the planet size, a single pixel on the PNG map could turn out to be a few KM on the planet surface. So if I land at a particular spot, start mining stuff up, do the resources count down, or stay static? If they count down, is this information stored in the persistence/quicksave file? Does the PNG map get copied somewhere and modifications are done to the PNG on a per-save basis?

And who's made a PNG for Kerbin that puts massive amounts of fuel right around the flight center? ;)

You can not bleed a planet dry in ORS. It operates with concentrations (extraction/mining rates) rather than amount of resources

Link to comment
Share on other sites

Is there any way to scan for atmospheric/oceanic resources? Interstellar has this capability but I can't see it anywhere in ORS (which really needs better documentation!).

Also, is ORSAtmosphericExtractor the only module available to pull resources from the atmosphere? I was hoping to create an intake which pulls in the atmosphere regardless of its composition but ORSAtmosphericExtractor only seems capable of pulling in one per module meaning I would have to attach multiple ORSAtmosphericExtractor's to my part, with each one being seperately toggleable. Again, Interstellar seems to have a part that does this.

Link to comment
Share on other sites

Is there any way to scan for atmospheric/oceanic resources? Interstellar has this capability but I can't see it anywhere in ORS (which really needs better documentation!).

Also, is ORSAtmosphericExtractor the only module available to pull resources from the atmosphere? I was hoping to create an intake which pulls in the atmosphere regardless of its composition but ORSAtmosphericExtractor only seems capable of pulling in one per module meaning I would have to attach multiple ORSAtmosphericExtractor's to my part, with each one being seperately toggleable. Again, Interstellar seems to have a part that does this.

You can consider Interstellar to be "example code" for ORS because it demonstrates referencing a version specific ORS install as well as how to make certain useful parts.

The idea is to keep the part modules contained in ORS fairly simple because it's tough to code for every resource extraction system someone might imagine. I think it's better to simply provide API functions to let people make the part they actually want via an easy process.

If you look at the interstellar ISRU scoop source you'll see there's only a few lines relating to the ORS API, it's really easy to get the resource quantities, the majority of the code is density calculations and similar.

Link to comment
Share on other sites

I'm curious. Would there be a way to map a small graphical template over the png resource map during game play? Specifically a small pattern, dense in the center and bleeding off to nothing over a short distance (a few kilometers? Depends on the pixel size on map I guess), which could be applied after mining a spot for a given time, reducing the mine rate at the center, less so in the vicinity around. It would make a slow, but appreciable 'limited resource' function, but mean a planet as a whole is very unlikely to run out of resources.

Link to comment
Share on other sites

  • 2 months later...

Has ORS been configured for asteroid resource values? And if it hasn't, is it in planning? I've been creating a private tech tree and resource system that utilizes TAC, KSPI, and EPL with extreme limits for a more challenging gameplay experience (KSP is to easy as it is...) and I am planning to add Iridium, ferromagnetic minerals, and Platinum-Group metals (the last one for catalytic and electrical purposes, the first two for active and passive radiation shielding)

Link to comment
Share on other sites

Not sure if this has been posted yet - but is anyone aware of any samples that leverage SCANSat along with ORS to provide visual resource mapping?

Same question.

Also, is there a way to define some atmospheric or ocean resources with a map?

For example - ocean/lake.

Link to comment
Share on other sites

  • 2 weeks later...

Small problem (hopefully someone can help).

Detection is working fine, but my extractor is not. It just sits there saying it is offline, and I have no button/option to bring it online.

Resource (works, shows 67% or so where I am trying to dig):



PLANETARY_RESOURCE_DEFINITION
{
name = Substrate
celestialBodyName = Kerbin
resourceName = Minerals
mapUrl = UmbraSpaceIndustries/MKS/ORS/png/Mun_Substrate_1440x720
resourceScale = LINEAR_SCALE
scaleMultiplier = 1
displayTexture = UmbraSpaceIndustries/MKS/ORS/resource_point
displayThreshold = 1
}

Detector (also works, see above):


MODULE
{
name = ORSResourceScanner
resourceName = Substrate
mapViewAvailable = true
}

Extractor (NOT WORKING)


MODULE
{
name = ORSModuleResourceExtraction
powerConsumptionLand = 100
powerConsumptionOcean = 0.001
extractionRateLandPerTon = 0.00009259259259
extractionRateOceanPerTon = 0.0001
resourceName = Substrate
unitName = Substrate Extractor
extractActionName = Extract Substrate
stopActionName = Stop Substrate Extraction
resourceManaged = False
resourceToUse = ElectricCharge
}

Link to comment
Share on other sites

I don't suppose anyone has a master list somewhere with all of the resources that use ORS. I'm looking for planetary resources specifically, but anything would do.

I need to explicitly add support for each resource type in order for it to work with SCANsat and to avoid any mix up between different resources. All I have so far are the four KSPI resources.

The same goes for Kethane resources if anyone should have a list of those.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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
Reply to this topic...

×   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.

×
×
  • Create New...