Jump to content

Noob projects: Physics hiding and Resource Restriction


Recommended Posts

Hello!

I'm a complete noob at plugin development. I believe I know about 80% of the things you can do with a .cfg file, so that is the perfect amount of knowledge for starting the 100 times more difficult process of creating a plugin.

First project:

-I know that the stock game, and FAR, can recognize whether a part is inside a cargobay/fairing and is shielded from the airflow. Is it possible to add another property to those parts?: Physics significance 0

I'm not sure I'm using the correct vocabulary, but I want shielded parts to be ignored for physics calculations. No more oscillating fuel tanks inside cargobays, but a rigid physicsless part.

Second project:

-For a career mod, I want to restrict the amount of LiquidFuel (or any other resource for that matter) that you can 'buy' from the KSC.

My first idea was to create a resource pool for the Kerbal Space Center that the player draws from with each launch. When it hits zero, the player simply cannot launch a rocket with that resource onboard.

My second, was to force all rockets to start on the launchpad with zero resources. The player would then have to transfer resources through a launch clamp. The clamp has a persistent resource pool that it can draw from, much like Science or Reputation points.

My third idea would be convert Resources into something from the Scenario {Funding} in Save files, so you'd have to basically 'buy' LiquidFuel by spending 300 'LiquidFuel' points. Dropping extraplanetary resources on the KSC for recovery could replenish these points.

My final, and most cherished idea, is to create a 'Resource' cost for all resources. This could be a very simple step of converting the 'cost = x' line in the resources.cfg file into 'cost = x resource points'.

So, my dear experienced C# wizards, how do I go about writing plugins for these mods?

Please do not simply direct me to the various outdated tutorials lying around. I currently have zero C# knowledge, have yet to install Visual Basic and learning an entire language just for a small project somehow doesn't sound right.

Link to comment
Share on other sites

For your first idea, this is not how physicsless part work. They won't behave as a rigid object. They're just skipped when it comes down to coriolis, gravitational, etc forces to be applied. They'll still wobble.

And really, if you want to write a plugin, you *will* have to learn C#. You certainly won't be able to understand any help anyone could provide you if you do not understand C# well and do not understand how to correctly program that. Writing a plugin is not an easy task, and the ideas you are proposing are far more complex than what you think they are. You're gonna have to take the long road as everyone else unfortunately.

Link to comment
Share on other sites

For your first idea, this is not how physicsless part work. They won't behave as a rigid object. They're just skipped when it comes down to coriolis, gravitational, etc forces to be applied. They'll still wobble.

And really, if you want to write a plugin, you *will* have to learn C#. You certainly won't be able to understand any help anyone could provide you if you do not understand C# well and do not understand how to correctly program that. Writing a plugin is not an easy task, and the ideas you are proposing are far more complex than what you think they are. You're gonna have to take the long road as everyone else unfortunately.

Yes, I was wrong. I was supposed to search for something that unloads the vessels contained, making the vessels essentially dissapear from the physics calculations.

I found one mod which does this: http://forum.kerbalspaceprogram.com/threads/88933-0-90-0-Hangar-v2-3-1

However, it hasn't been updated for 1.0.2, won't do so for a long time, and contains lots of 'peripheral' accessories in addition to the code that allows the Hangars to unload vessels.

It might be possible to apply that code to regular cargo bays.

Link to comment
Share on other sites

  • 3 weeks later...

I've been thinking about starting a project similar to your #1. Hanger would be nice for reducing the part count, but I'm thinking about creating a mod to auto-strut cargo inside fairings. It might be possible to utilize what's been done for quantum struts. I've used the method detailed in this

in the past for payloads that just wouldn't launch, but it was a massive pain (I haven't tried the quantum struts yet, so maybe those will be easier to use).
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...