Jump to content

[0.17] Electrical Energy Plugin | v1.5 (Oct 12)


Kreuzung

Ion engines...  

1 member has voted

  1. 1. Ion engines...

    • ...should stay infinite (only using energy)
      111
    • ...should use a bit of normal fuel too
      33
    • ...should use a bit of RCS fuel
      10
    • ...should have their own fuel type
      45
    • ... are for idiots (do not vote for this option!)
      8


Recommended Posts

I could do it in the next 30 minutes, but I think something is missing, but I don\'t know what.

Anyway, changelog:

+Added airfilters, they consume energy and produce ZO2 if the ZO2 plugin is installed and used on the ship

+Added a new solar panel type derived FromMuMechSolarPanel for part creators

+Added experimental 1m to 2m reactor, 2m battery and 2m plasma engine by Yorik, they are not really balanced and the reactor Krakens away from whatever it is attached to (will be separate download)

*Fixed battery icon color

*Did some tweaks with the parts I can\'t remember

*Going to divide download into plugin, DSM parts and VB parts

*Fixed EL_API class to also look for MuMechVariableTanks with fueltype = Energy, not only batteries

-Removed that crappy 1m-1.5m decoupler, if you really need that use the ones from CardBoardBoxProcessors Space Penetration Co instead

-Forgot what else I did

I will test this awesome things tomorrow!

Link to comment
Share on other sites

Still no word on .15, frustration. I took a look at that problem you we were having with the gauges instead.


public static float Consume(float Amount, Vessel vessel)
MuMechVariableTank b = (MuMechVariableTank)p;
b.getFuel('Energy', Amount);
elsewhere
public class Battery : MuMechVariableTank

You\'re not getting calls to getFuel() in Battery because 'b' is of type MuMechVariableTank. Even if you cast it\'s value to (Battery), it still won\'t work, as 'new' method resolution is done by the compiler based on variable type (from examples I\'ve read online); virtual override is run time, and does not have this problem.

Since you can\'t use an override, you will have to test '(p is Battery)' somewhere after 'foreach (Part p in vessel.parts)', but before you test '(p is MuMechVariableTank)'. The problem with testing for MuMechVariableTank is that Battery is derived from it, and will return true; since 'is' includes ancestor classes in testing.

Something like this may work.


public static float Consume(float Amount, Vessel vessel)
{
foreach (Part p in vessel.parts)//Check each part
{
if (p is Battery && (p.State == PartStates.ACTIVE || p.State == PartStates.IDLE))
{
Battery b = (Battery)p;
if (b.type != 'Energy') continue;
if (b.fuel >= Amount)//Battery contains more energy than amount, take amount and return 0
{
b.getFuel('Energy', Amount);
return 0;
}
else//Battery contains less than amount, take it and search for next battery
{
if (b.fuel == 0)
continue;
Amount -= b.fuel;
b.getFuel('Energy', Amount);
}
}
else if (p is MuMechVariableTank && (p.State == PartStates.ACTIVE || p.State == PartStates.IDLE))
{
MuMechVariableTank b = (MuMechVariableTank)p;
if (b.type != 'Energy') continue;
if (b.fuel >= Amount)//Battery contains more energy than amount, take amount and return 0
{
b.getFuel('Energy', Amount);
return 0;
}
else//Battery contains less than amount, take it and search for next battery
{
if (b.fuel == 0)
continue;
Amount -= b.fuel;
b.getFuel('Energy', Amount);
}
}
}
return Amount;
}

If you stick that in MSVS C#, and hover over b.getFuel in the top block, it will show the Battery.getFuel() signature, hover over b.getFuel on the bottom, it shows MuMechVariableTank.getFuel().

The problem is that if any other code calls getFuel() from a variable of type MuMechVariableTank, whether it\'s value is cast to (Battery) or not, will call MuMechVariableTank.getFuel(). It should at least fix your call to the member, however.

Link to comment
Share on other sites

Uhf. We really need to standardize certain plugins as \'must have\', because power mods are awesome, but useless when there\'s others like PowerSat and very little (read: no) support from other mod makers for them.

Imagine the possibilities if things like this mod and PowerSat were combined, and all solar panel mods out there supported them properly.

Link to comment
Share on other sites

Just wait for .15 & .16, modularization will end up with a master resource table, and you just tweak a part to say hold 100 units of fuel @ .002 density, or 10MW @ 0 density. There was talk of a standardized fuel/energy system at the start of .14, but modders just don\'t play well together, so Squad has to do it themselves.

Link to comment
Share on other sites

The problem is, that this whould discriminate users who don\'t use my plugin. The ZO2 plugin has a very good solution for that jin their main system, but adding that to my plugin whould not be possible without major changes and possibly bugs. I could of course be an egoist and release an energy-based version of each plugin that exist, but whouln\'t that be a bit... stupid, egoistic, redundant, etc?

Lol just had my mouse over 'average' in my Xenolith stats and ads for 'This Video is Awesome' came out. Average, hmm...

I want to bring things like the PowerTech or MultiJointPart panels in this, I did the beginnning with the MuMech-based panel type for now, but I\'ll stop development for now, .15 plugin dev crysis ;D

Link to comment
Share on other sites

Hello,

I\'m having plenty of fun thanks to your mod + zoxygene filter (it\'s even more realistic to use a filter instead of solar power -> zo2) and ion engines for munar transfers.

My problem is that the only solar panel that you have included (as far as i can see) it\'s not deployable and it gives me a lot of troubles ^^ any chance you could make a deployable version? maybe one of those nice 3 parts panel that become very small when packed.

thanks

Link to comment
Share on other sites

Yes, I want to make a panel like this, but I don\'t even know if the KRMuMechSolarPanel type allows this, I just added it because people wanted it. I wonder if the Kosmos pack includes unfolding solar panels, I\'m sure that whould help me a lot...

Edit: Yes, it does. Gonna try them using my plugin. Rest in peace acceptable load time, I\'ll miss you :\'(

Link to comment
Share on other sites

Yes, I want to make a panel like this, but I don\'t even know if the KRMuMechSolarPanel type allows this, I just added it because people wanted it. I wonder if the Kosmos pack includes unfolding solar panels, I\'m sure that whould help me a lot...

Edit: Yes, it does. Gonna try them using my plugin. Rest in peace acceptable load time, I\'ll miss you :\'(

Industrial flames one have an amazing 3 part flex solar panel, it fit about everywhere and has a cool look, usually i use a shuttle and i fit the panels inside the payload bay, the insustrial flames one fit very nice occupying few space and you can fold and unfold them pressing V, when folded i think they don\'t have drag or at least inside the payload bay they don\'t blow up ^^

Link to comment
Share on other sites

I\'ll have a look at them later. Just tried to use Kosmos panels, but since yesterday my game crashes almost everytime I hit launch. Renamed my saves/default folder to saves/stupid to break persistence, hope it helps.

Edit: What do you think of a space station module type that continuosly drains energy and ZO2? And if you want it, how should it behave exactly?

Edit2: Do you mean the Ultraflex Solar Array? It\'s module is strut, so how should it be able to unfold?

Anyway, change module = strut to module = SolarPanel, scroll to the end of the config file, add EnergyGain = and a number you want to get every second in energy units (see other parts for balancing).

Link to comment
Share on other sites

I\'ll have a look at them later. Just tried to use Kosmos panels, but since yesterday my game crashes almost everytime I hit launch. Renamed my saves/default folder to saves/stupid to break persistence, hope it helps.

Edit: What do you think of a space station module type that continuosly drains energy and ZO2? And if you want it, how should it behave exactly?

Edit2: Do you mean the Ultraflex Solar Array? It\'s module is strut, so how should it be able to unfold?

Anyway, change module = strut to module = SolarPanel, scroll to the end of the config file, add EnergyGain = and a number you want to get every second in energy units (see other parts for balancing).

- Regarding station part sincerely i\'m not very much into stations, since you can\'t add pieces to them or dock/transfer fuel or crew well, i find it a bit pointless and limited, anyway, one thing that is not covered is 'cooling' of the station:

Zoxygen Core use up Zo2 or the crew dies

Filters create Zo2 consuming energy and generate heat

Radiator consume energy and lower the temperature of parts (very big structures require multiple radiators)

Solar panel create Energy but the more they produce the more heat they generate

This would require some balancing, and you need to have a good mix up of sub-systems for keeping the crew alive, if the Zo2 end people dies, if the temeprature rise things blow up.

You may think about fuel cells too, one is the 'cell' with a higher energey density per mass then batteries, when it works like filters they create energy consuming the fuel

Another thing is Radioisotope generators, low energy output but very very long lifespan (years) but heavy and maybe they generate heat too.

This is just a bunch of toughts, nothing specific :)

- Regarding the ultraflex, i don\'t know how it unfold, but if you press V it does and looks pretty cool, i have tryed to modify the part config as you said (i checked the difference with your solar panel) but the 'yellow' bar with 'efficency' never appairs even if the module is active, folded or unfolded, maybe it\'s a problem with the plugin i\'m using i\'ll try to clean the folder.

Scratch that, my bad i confused parts, the one i was talking about is MJPPanel3_sml and it\'s of type PKSMultiJointPart by sarkun, i was confused by the name :)

Link to comment
Share on other sites

The radiators idea is cool, much packs have them, I\'m thinking about making the ZO2 filled station parts cook the crew if their temperature is too high, so you could also use radiators for other things like engines (night becomes more and more annoying right?).

Heating the panels up is a good idea too. The PowerTech ZO2 panels become more efficient if nearer to the sun, but they have a limit. I could do that for both heat and energy but only limit energy gain, not heat gain ;P

I\'m going to add fuel consuming devices, I need them for the reactor, and they whould allow a lot of new things, but they need the .15 individual part control, otherwise I pwn your keyboard.

Radioisotope generators are a good idea too, you can use the reactor for now, it never runs out of fuel :D (I don\'t know what hapens if it krakens away 2.5 km, though)

what did the module param say before you changed it?

Link to comment
Share on other sites

The radiators idea is cool, much packs have them, I\'m thinking about making the ZO2 filled station parts cook the crew if their temperature is too high, so you could also use radiators for other things like engines (night becomes more and more annoying right?).

Heating the panels up is a good idea too. The PowerTech ZO2 panels become more efficient if nearer to the sun, but they have a limit. I could do that for both heat and energy but only limit energy gain, not heat gain ;P

I\'m going to add fuel consuming devices, I need them for the reactor, and they whould allow a lot of new things, but they need the .15 individual part control, otherwise I pwn your keyboard.

Radioisotope generators are a good idea too, you can use the reactor for now, it never runs out of fuel :D (I don\'t know what hapens if it krakens away 2.5 km, though)

what did the module param say before you changed it?

As i said in last post edit (too late) i messed up with names, the solar panel i was talking about is MJPPanel3_sml and it\'s of type PKSMultiJointPart by sarkun, i was confused by the name, but i don\'t think i can change it to SolarPanel or the multi join would not work right?

With the radiators the energy cycle would be:

- Day

Solar Panel recharge battieries (a good idea could be that batteries gain heat when recharging like real ones) + Create heat

Radiators consume energy + reduce a little heat

Filters produce zo2 + create heat

- Night

Radiators consume batteries + reduce a LOT of heat

Filters produce zo2 + create heat

This would require a balance between day and night, during day you stockpile energy and you build up heat, during night you consume energy and lower the heat.

In this way both 'night and day' are useful and the night is not 'always' bad since you need it for cooling.

Link to comment
Share on other sites

No, it won\'t. Gonna ask sarkun if I can use it, I love these panels too. Forum ads are 90% about solar panels now ;P

Edit: Could also do it the easy way but my plugin whould require MJP to work then, however, that whould not be a problem, as I can include it to my pack.

Link to comment
Share on other sites

No, it won\'t. Gonna ask sarkun if I can use it, I love these panels too. Forum ads are 90% about solar panels now ;P

Edit: Could also do it the easy way but my plugin whould require MJP to work then, however, that whould not be a problem, as I can include it to my pack.

Added a few ideas on the previous post, as always too late you already answered :)

Edit: yea! include it, Multipart joint is amazing, you can do a lot of things i think like folding radiators that you open during night for heat sinking and close during day for not 'catching' too much heat or similar things.

Edit2: my 'test' craft is ready for the prototype, i always use this shuttle for testing stuff since i fill the cargobay with all the 'cool' modules, on a side note it can bring about 10 tonns to 150km orbit in a single stage :)

Link to comment
Share on other sites

That sounds interesting and whould make this plugin less simple. Do you mean radiator panels or radiators consuming energy?

I could do them both but I\'m already at the point where I have to learn blender or ask anyone if I can steal his parts...

So if you read this, and you made parts that could be useful for this, please give me permission to use them!

Link to comment
Share on other sites

That sounds interesting and whould make this plugin less simple. Do you mean radiator panels or radiators consuming energy?

I could do them both but I\'m already at the point where I have to learn blender or ask anyone if I can steal his parts...

So if you read this, and you made parts that could be useful for this, please give me permission to use them!

You could make 2 versions of the radiators:

- Passive ones (need folding) that when open during night reduce heat, but during day if you leave them open it increase heat.

- Active ones that works at any time but consume energy (a lot) for reducing heat

So if you have a big space station you could produce a lot of energy, so you have a lot of heat and during day you keep it 'in control' using active radiators, during night you unfold the passive radiators and drop all the heat left for the next day cycle.

At the same time everything mix up with Zoxygen so that you must manage it too.

Link to comment
Share on other sites

That sounds good so far. I can\'t start coding now, so anyone, continue suggesting for at least 24 hours.

Edit: What do you think of a space station module type that continuosly drains energy and ZO2? And if you want it, how should it behave exactly?

Two sentences completely repurposed my plugin, lol ;D

Link to comment
Share on other sites

That sounds good so far. I can\'t start coding now, so anyone, continue suggesting for at least 24 hours.

Two sentences completely repurposed my plugin, lol ;D

Nice 2 know :)

A question, there is a way i can modify the 'dsm_solarpanel' that was included in the deep space package for not 'sticking out' but 'laying' on the part i place it on? in this way i could place a pair of those on the side of the shuttle without making it stupid with solar panel that sticks out everywhere when launching.

Link to comment
Share on other sites

I can ask for that, but it might break crafts. You could also modify a Kosmos panel, they are very small if unfolded. Just do it in the same way I wrote above, but use KRMuMechSolarPanel as module to not break the unfolding possibility (don\'t do this with any other unfolding panel than the Kosmos ones, they will break into millions of sharp fragments!)

Link to comment
Share on other sites

I can ask for that, but it might break crafts. You could also modify a Kosmos panel, they are very small if unfolded. Just do it in the same way I wrote above, but use KRMuMechSolarPanel as module to not break the unfolding possibility (don\'t do this with any other unfolding panel than the Kosmos ones, they will break into millions of sharp fragments!)

Fianlly! it worked with the TKS Solar Panel, i lost a bit of cargo-bay but it\'s fine, now i can manage my Zox using batteries as i wanted, thanks!

Attached Screen, i modified a C7 RCS block with the stats of the 'main' Zoxigen core module, at least it fits a bit better.

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