Jump to content

[0.25] ResourceRecovery for KSPI, EL and Kethan DevThread [alpha download]


Recommended Posts

It doesn't seem to save the resources for me so far, any tips?

edit: and which git version? What are the PluginVersion and PluginDate in ResourceRecovery.cfg?

edit 2: it seem unaware of what save game I'm using

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

ResourceRecovery Awake currentGame=

(Filename: C:/BuildAgent/work/d63dfc6385190b60/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 49)

edit 3: The above line is apparently a non-issue, happens with the plugin working in 0.23.5 as well. Here's my 0.25 output_log in case it helps https://www.dropbox.com/s/pl01bi1zhepholn/output_log5.txt?dl=0

I'm on it - stand by..

(the mod was not installled on my KSP, I onl have my dev version, nothing else..)

See the edit below..

To answer the questions:

1) that one:

https://github.com/philotical/ResourceRecovery/tree/master/ResourceRecovery/DEV/version-0.1.11

2) Versions: The download is identical with the latest git version..

(but it was built with the 0.23.5-DLLs from KSP and unity.. - that might be an issue, we will see)

3) the version numbers in that config are just for (my own) internal reference but have no effect what so ever..

When I have some infos, a solution or a new download I'll let you know..

Edit:

Well, I have downloaded the plugin from first post, installed it on 0.25 and it worked from start up, out of the box..

So I might have to ask some debug questions..

Are you aware of those limitations mentioned in the download-post?:

*********

It has some issues with not saving changes in the following instances:

- If you end the game by closing the game window, the changes are not saved!

SOLUTION: change scenes first or use the "Quit" button in Spacecenter

- If you revert a flight, the pre-launch changes made to the store are lost - in essence if you fill your ship with antimatter, start, revert => the antimatter is no longer in the ship but it's gone from the store too!

Solution: hit F5 before you start - than the revert point is fixed after the refueling and all is good.

*********

If yes, and you followed those, read on..

Please confirm that the SCENARIO is written into the save file..

Open the save file .sfs and search for this term:

"ResourceRecoveryData"

That is probbably the ,main cause for your problems..

I assume that KSP never installed that scenario properly..

KSP scenarios seem to have a problem wich I don't know how to circumvent.

AFAIK you have to load your game, leave it right away to main menu, and load it again from the load menu.

afaik, this is the only way to install a scenario properly..

if you didn't follow these steps, it might cause the issues..

Please report back - even if I'm wrong lol - then we can dig deeper to solve your issue..

So far I was no able to recreate your issue and the current RR download is working as advertized in 0.25

Edited by philotical
Link to post
Share on other sites

I have the scenario in the file,

	SCENARIO
{
name = ResourceRecoveryData
scene = 7, 8, 5
dll_version = 0.1.11.0
filesystem_version = 0.1.11.0
created = 11/9/2014 6:48:46 PM
updated = 11/9/2014 11:44:55 PM
SaveGameKredits = 0
loadcount = 16
PLANETS
{
PLANET
{
name = Kerbin
total_locations = 1
total_number_recource_tanks = 38
total_capacity = 0
total_capacity_used = 0
STORAGE
{
storagecapacity = unlimited (0)
modulecount = 1
RESOURCES
{
RESOURCE
{
name = LiquidFuel
resourceID = 00
storagecapacity = ToDo
storedamount = 0.00
density = 0.005
supply_mode = 1
value_factor = 0.8
total_sold = 0
total_bought = 0
display_order = 00
hide = 0
group = fuel
}
RESOURCE
{
name = XenonGas
resourceID = 01
storagecapacity = ToDo
storedamount = 0.00
density = 0.0001
supply_mode = 1
value_factor = 4
total_sold = 0
total_bought = 0
display_order = 01
hide = 0
group = gas
}
RESOURCE
{
name = SolidFuel
resourceID = 02
storagecapacity = ToDo
storedamount = 0.00
density = 0.0075
supply_mode = 0
value_factor = 0.6
total_sold = 0
total_bought = 0
display_order = 02
hide = 0
group = fuel
}
RESOURCE
{
name = ElectricCharge
resourceID = 03
storagecapacity = ToDo
storedamount = 0.00
density = 0
supply_mode = 0
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 03
hide = 0
group = electric
}
RESOURCE
{
name = Oxidizer
resourceID = 04
storagecapacity = ToDo
storedamount = 0.00
density = 0.005
supply_mode = 1
value_factor = 0.18
total_sold = 0
total_bought = 0
display_order = 04
hide = 0
group = fuel
}
RESOURCE
{
name = MonoPropellant
resourceID = 05
storagecapacity = ToDo
storedamount = 0.00
density = 0.004
supply_mode = 1
value_factor = 1.2
total_sold = 0
total_bought = 0
display_order = 05
hide = 0
group = other
}
RESOURCE
{
name = Kethane
resourceID = 06
storagecapacity = ToDo
storedamount = 0.00
density = 0.002
supply_mode = 1
value_factor = 0.16
total_sold = 0
total_bought = 0
display_order = 06
hide = 0
group = other
}
RESOURCE
{
name = RocketParts
resourceID = 07
storagecapacity = ToDo
storedamount = 0.00
density = 0.0025
supply_mode = 1
value_factor = 5
total_sold = 0
total_bought = 0
display_order = 07
hide = 0
group = other
}
RESOURCE
{
name = Metal
resourceID = 08
storagecapacity = ToDo
storedamount = 0.00
density = 0.039
supply_mode = 1
value_factor = 71.2
total_sold = 0
total_bought = 0
display_order = 08
hide = 0
group = other
}
RESOURCE
{
name = Ore
resourceID = 09
storagecapacity = ToDo
storedamount = 0.00
density = 0.0275
supply_mode = 1
value_factor = 3.52
total_sold = 0
total_bought = 0
display_order = 09
hide = 0
group = other
}
RESOURCE
{
name = ScrapMetal
resourceID = 10
storagecapacity = ToDo
storedamount = 0.00
density = 0.004
supply_mode = 1
value_factor = 1.28
total_sold = 0
total_bought = 0
display_order = 10
hide = 0
group = other
}
RESOURCE
{
name = Megajoules
resourceID = 11
storagecapacity = ToDo
storedamount = 0.00
density = 0
supply_mode = 0
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 11
hide = 0
group = electric
}
RESOURCE
{
name = ChargedParticles
resourceID = 12
storagecapacity = ToDo
storedamount = 0.00
density = 0
supply_mode = 0
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 12
hide = 0
group = electric
}
RESOURCE
{
name = Antimatter
resourceID = 13
storagecapacity = ToDo
storedamount = 0.00
density = 0.000000001
supply_mode = 1
value_factor = 4819.22
total_sold = 0
total_bought = 0
display_order = 13
hide = 0
group = electric
}
RESOURCE
{
name = UF4
resourceID = 14
storagecapacity = ToDo
storedamount = 0.00
density = 0.005
supply_mode = 1
value_factor = 0.26
total_sold = 0
total_bought = 0
display_order = 14
hide = 0
group = electric
}
RESOURCE
{
name = ThF4
resourceID = 15
storagecapacity = ToDo
storedamount = 0.00
density = 0.0042
supply_mode = 1
value_factor = 0.63
total_sold = 0
total_bought = 0
display_order = 15
hide = 0
group = electric
}
RESOURCE
{
name = UraniumNitride
resourceID = 16
storagecapacity = ToDo
storedamount = 0.00
density = 0.0143
supply_mode = 1
value_factor = 0.7436
total_sold = 0
total_bought = 0
display_order = 16
hide = 0
group = electric
}
RESOURCE
{
name = Actinides
resourceID = 17
storagecapacity = ToDo
storedamount = 0.00
density = 0.005
supply_mode = 2
value_factor = 0.2
total_sold = 0
total_bought = 0
display_order = 17
hide = 0
group = waste
}
RESOURCE
{
name = DepletedFuel
resourceID = 18
storagecapacity = ToDo
storedamount = 0.00
density = 0.005
supply_mode = 2
value_factor = 0.2
total_sold = 0
total_bought = 0
display_order = 18
hide = 0
group = waste
}
RESOURCE
{
name = Argon
resourceID = 19
storagecapacity = ToDo
storedamount = 0.00
density = 0.005
supply_mode = 1
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 19
hide = 0
group = gas
}
RESOURCE
{
name = Aluminium
resourceID = 20
storagecapacity = ToDo
storedamount = 0.00
density = 0.0135
supply_mode = 1
value_factor = 0.027
total_sold = 0
total_bought = 0
display_order = 20
hide = 0
group = fuel
}
RESOURCE
{
name = ExoticMatter
resourceID = 21
storagecapacity = ToDo
storedamount = 0.00
density = 0
supply_mode = 1
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 21
hide = 0
group = fuel
}
RESOURCE
{
name = LqdDeuterium
resourceID = 22
storagecapacity = ToDo
storedamount = 0.00
density = 0.0001624
supply_mode = 1
value_factor = 2
total_sold = 0
total_bought = 0
display_order = 22
hide = 0
group = fuel
}
RESOURCE
{
name = Lithium
resourceID = 23
storagecapacity = ToDo
storedamount = 0.00
density = 0.000534
supply_mode = 1
value_factor = 0.0032
total_sold = 0
total_bought = 0
display_order = 23
hide = 0
group = fuel
}
RESOURCE
{
name = LqdTritium
resourceID = 24
storagecapacity = ToDo
storedamount = 0.00
density = 0.0002436
supply_mode = 1
value_factor = 2304
total_sold = 0
total_bought = 0
display_order = 24
hide = 0
group = fuel
}
RESOURCE
{
name = LqdMethane
resourceID = 25
storagecapacity = ToDo
storedamount = 0.00
density = 0.00186456
supply_mode = 1
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 25
hide = 0
group = fuel
}
RESOURCE
{
name = Plutonium-238
resourceID = 26
storagecapacity = ToDo
storedamount = 0.00
density = 0.001
supply_mode = 1
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 26
hide = 0
group = fuel
}
RESOURCE
{
name = LqdHelium3
resourceID = 27
storagecapacity = ToDo
storedamount = 0.00
density = 0.000059
supply_mode = 1
value_factor = 525.2
total_sold = 0
total_bought = 0
display_order = 27
hide = 0
group = gas
}
RESOURCE
{
name = LqdWater
resourceID = 28
storagecapacity = ToDo
storedamount = 0.00
density = 0.001
supply_mode = 1
value_factor = 0.000001
total_sold = 0
total_bought = 0
display_order = 28
hide = 0
group = fuel
}
RESOURCE
{
name = Alumina
resourceID = 29
storagecapacity = ToDo
storedamount = 0.00
density = 0.00399
supply_mode = 1
value_factor = 0
total_sold = 0
total_bought = 0
display_order = 29
hide = 0
group = fuel
}
RESOURCE
{
name = H2Peroxide
resourceID = 30
storagecapacity = ToDo
storedamount = 0.00
density = 0.00145
supply_mode = 1
value_factor = 0.000517
total_sold = 0
total_bought = 0
display_order = 30
hide = 0
group = fuel
}
RESOURCE
{
name = Ammonia
resourceID = 31
storagecapacity = ToDo
storedamount = 0.00
density = 0.000681
supply_mode = 1
value_factor = 0.00044
total_sold = 0
total_bought = 0
display_order = 31
hide = 0
group = fuel
}
RESOURCE
{
name = LqdHelium
resourceID = 32
storagecapacity = ToDo
storedamount = 0.00
density = 0.000135
supply_mode = 1
value_factor = 0.022
total_sold = 0
total_bought = 0
display_order = 32
hide = 0
group = fuel
}
RESOURCE
{
name = GNparticle
resourceID = 33
storagecapacity = ToDo
storedamount = 0.00
density = 0
supply_mode = 1
value_factor = 1
total_sold = 0
total_bought = 0
display_order = 33
hide = 0
group = fuel
}
RESOURCE
{
name = Karbonite
resourceID = 34
storagecapacity = ToDo
storedamount = 0.00
density = 0.0125
supply_mode = 1
value_factor = 1.6
total_sold = 0
total_bought = 0
display_order = 34
hide = 0
group = fuel
}
RESOURCE
{
name = Karborundum
resourceID = 35
storagecapacity = ToDo
storedamount = 0.00
density = 0.02256
supply_mode = 1
value_factor = 2000
total_sold = 0
total_bought = 0
display_order = 35
hide = 0
group = fuel
}
RESOURCE
{
name = ArgonGas
resourceID = 36
storagecapacity = ToDo
storedamount = 0.00
density = 0.00005
supply_mode = 1
value_factor = 0.25
total_sold = 0
total_bought = 0
display_order = 36
hide = 0
group = fuel
}
RESOURCE
{
name = LiquidHydrogen
resourceID = 37
storagecapacity = ToDo
storedamount = 0.00
density = 0.0004
supply_mode = 1
value_factor = 0.5
total_sold = 0
total_bought = 0
display_order = 37
hide = 0
group = fuel
}
}
LOCATIONS
{
LOCATION
{
lon_lat = KSC: 285.442330134503/-0.0972077848128505
capacity = unlimited
}
}
}
}
}
}

I just tried the following steps

1) build vessel with full antimatter tank on Launchpad

2) press F5

3) empty the antimatter tank with RR

4) recover vessel

5) check RR stocks

Anything else I can do to narrow this down aside from removing mods 1 or 2 at a time?

edit: thank you for making this mod in the first place

edit 2: trying with steps 2 and 3 reversed

edit 3: no difference, and here is the antimatter section from the quicksave

						RESOURCE
{
name = Antimatter
resourceID = 13
storagecapacity = ToDo
storedamount = 0.00
density = 0.000000001
supply_mode = 1
value_factor = 4819.22
total_sold = 0
total_bought = 0
display_order = 13
hide = 0
group = electric
}

Edited by Ogamaga
Link to post
Share on other sites
I have the scenario in the file,

..snip..

I just tried the following steps

1) build vessel with full antimatter tank on Launchpad

2) press F5

3) empty the antimatter tank with RR

4) recover vessel

5) check RR stocks

Anything else I can do to narrow this down aside from removing mods 1 or 2 at a time?

edit: thank you for making this mod in the first place

edit 2: trying with steps 2 and 3 reversed

Thanks, I see..

Hmm - can we test something else?

1) open sfs, change the value of

SaveGameKredits = 0

to

SaveGameKredits = 2000000

2) then open RR at space center and go to buy some stuff at "Marketplace"

3) change scene to tracking station and back to space center..

4) see if what you bought is still there

5) go to flight (runway or so) and see if what you bought is still there..

6) close the game and verify that the bought stuff is in scenario

=> why?

because the "revert flight" thing is the only thing I "know" it won't work as expected..

there are 20 different issues related to "revert" but I can't remember them all in detail..

to test if RR saves, we need to follow those steps first..

if that works, we know it's related to reverting issues

As mentioned in last post, reverting is a problem for the current RR version..

It seems you found a new bug in that section..

It is indeed planned to rewrite the hole thing from scratch.. (at some point)

because the code is a monster bore out of nooby errors and idiocy..

A new version will hopefully have clean and organized code..

I'm sure, at this point I will also be able to fix all those issues right from start up..

When I wrote this, I didn't know of these problems and ran into them without warning lol..

In short that means - if the only problem we find is related to "reverting" - it won't be solved in this version

Link to post
Share on other sites
I had been testing my mods, and 1 or more are interfering with the steps I listed, and your steps worked with all of them present.

Ok, so (if I understand it right)

- RR does save but on revert it still does not.

- you suspect the cause somewhere else now?

did I deduce this right?

If yes, I'll be happy to hear all you find out - keep me informed..

If no, please elaborate where I got it wrong..

Link to post
Share on other sites

The only misunderstanding is that I have been recovering the vessels, not reverting. Otherwise you are correct it that post.

edit: I need to get some sleep, but I'll post the culprit once I identify it.

Edit 2: It was Kerbal Construction Time, but only if it was disabled for that save. Yes, I said DISabled. I don't understand it, but oh well. That just means its less useful in my testing worlds.

Edited by Ogamaga
Link to post
Share on other sites

Edit 2: It was Kerbal Construction Time, but only if it was disabled for that save. Yes, I said DISabled. I don't understand it, but oh well. That just means its less useful in my testing worlds.

That's a log I'd like to see. I've seen something on my side regarding an NRE with KCT when it's disabled for a save which I'm thinking might be related. You could try disabling build times instead of fully disabling it, but it's possible that will have the same error. It's actually surprisingly hard to disable functionality when much of what you do is event based.

I popped in here to see how similar some of the functionality of the ScrapYard will be to this (if and when that ever gets worked on and finished) and while it looks like the two will likely be incompatible I think there's enough different that it won't be treading too much on existing territory (for what it's worth, it wasn't my idea to have the ScrapYard include resource storage in the first place).

I saw there was some talk of including support for StageRecovery. It's pretty easy to do. You just need to include this wrapper in your mod and create a function that will be called when a stage is recovered. The Vessel is passed to the function (along with some other stuff that you likely won't care about) which you can parse for the resource data like you would normally.

The API example in the StageRecovery thread is pretty straightforward (toward the bottom in a spoiler called "API") and provides an example function based on what KCT does.

Link to post
Share on other sites
That's a log I'd like to see. I've seen something on my side regarding an NRE with KCT when it's disabled for a save which I'm thinking might be related. You could try disabling build times instead of fully disabling it, but it's possible that will have the same error. It's actually surprisingly hard to disable functionality when much of what you do is event based.

log is up

https://www.dropbox.com/s/88f9z2wyqo7cpft/output_log6.txt?dl=0

edit: and it has the issue both with KCT disabled and with just build times disabled

Link to post
Share on other sites
That's a log I'd like to see. I've seen something on my side regarding an NRE with KCT when it's disabled for a save which I'm thinking might be related. You could try disabling build times instead of fully disabling it, but it's possible that will have the same error. It's actually surprisingly hard to disable functionality when much of what you do is event based.

I popped in here to see how similar some of the functionality of the ScrapYard will be to this (if and when that ever gets worked on and finished) and while it looks like the two will likely be incompatible I think there's enough different that it won't be treading too much on existing territory (for what it's worth, it wasn't my idea to have the ScrapYard include resource storage in the first place).

I saw there was some talk of including support for StageRecovery. It's pretty easy to do. You just need to include this wrapper in your mod and create a function that will be called when a stage is recovered. The Vessel is passed to the function (along with some other stuff that you likely won't care about) which you can parse for the resource data like you would normally.

The API example in the StageRecovery thread is pretty straightforward (toward the bottom in a spoiler called "API") and provides an example function based on what KCT does.

Hey magico13 - just go ahead - replicate the hole functionality if it fits your plans...

It's not as if I had a patent on this.. :-)

If there are dozens of plugins who do the same, the user has a choice..

That's how I view it, for what it's worth..

About stage recovery..

Thanks for the info - I'll keep that in mind for when I re-write the hole thing (if that happens)..

Right now to finish NCI and LCARS is much more important to me actually..

@Ogamaga:

I'm glad your issue is identified - thanks for the effort my friend..

Link to post
Share on other sites
  • 4 months later...
Has anyone bothered to test this in 0.90 I'm very interested in this mod as it might solve the problems with AntiMatter after returning to Kerbin for KSPI Extended

I use it. It works, as far as I can tell (I only use the storage/retrieval function, and then only for antimatter). I haven't used it recently, I have been playing a hard-mode career with Kopernicus, still a looooooooong way from antimatter.

Link to post
Share on other sites
I use it. It works, as far as I can tell (I only use the storage/retrieval function, and then only for antimatter). I haven't used it recently, I have been playing a hard-mode career with Kopernicus, still a looooooooong way from antimatter.

Thanks for that report..

I actually haven't tested it in a while - however - there is good news ahead..

It seems as if FreeThinker is intrested in implementing RR into KSPI-E directly..

He asked me if I would give him permission and I said of course.

Now let's see what the future brings for RR.

Link to post
Share on other sites
  • 1 month later...
Has anyone tested this mod yet for KSP 1.0? With the new resource system we could create a real resource stock exchange. Resource minig for profit might become realy intresting.

I didn't even install 1.0 so far - had no time..

The idea is great though..

Link to post
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...