Jump to content

[0.15]EVA v0.1


Recommended Posts

EVA for 0.15! Now you can fly kerbonaut in space!

For detaching press U, and for returning.

You can fly only once, but if I\'ll find a way to spawn kerbonaut near the ship, you\'ll can fly unlimited times.

Controls: like default ship RCS control.

In part CFG you can change torque and force of EVA-suit\'s engines.

Screens:

f0b39439f45e14a1ae44102790bb2d84.jpeg

bbfe820c46072747b5eaf96eca228217.jpeg

Thanks Alchemist for giving me code base! He gave me decouple and control code, but control was uncomfortable. I fixed it and added returning to the ship.

Download:

http://www./?th0itvgv4a4slfn

Source:

using UnityEngine;

namespace EVA
{

public class Kerbonaut : Part
{
protected bool onEVA = false;
protected bool stateChanging = false;
public float maxtorque = 0.1f;
public float maxthrust = 0.1f;
Vessel prvessel;

protected override void onPartUpdate()
{
base.onPartUpdate();

if ((!(onEVA)) && (stateChanging))
{
if (this.vessel != FlightGlobals.ActiveVessel) //vessel switch for EVA
{
print('vesselswitch ' + this.vessel.name); FlightGlobals.SetActiveVessel(this.vessel);
}
onEVA = true; stateChanging = false;
print('EVA start');
}


if ((onEVA) && (this.vessel.isActiveVessel))
{//control
if (Input.GetKey(KeyCode.L))
{
this.rigidbody.AddRelativeForce(Vector3.forward * maxthrust);
}
if (Input.GetKey(KeyCode.J))
{
this.rigidbody.AddRelativeForce(Vector3.forward * maxthrust * -1);
}
if (Input.GetKey(KeyCode.I))
{
this.rigidbody.AddRelativeForce(Vector3.right * maxthrust * -1);
}
if (Input.GetKey(KeyCode.K))
{
this.rigidbody.AddRelativeForce(Vector3.right * maxthrust);
}
if (Input.GetKey(KeyCode.H))
{
this.rigidbody.AddRelativeForce(Vector3.up * maxthrust);
}
if (Input.GetKey(KeyCode.N))
{
this.rigidbody.AddRelativeForce(Vector3.up * maxthrust * -1);
}
if (Input.GetKey(KeyCode.Q))
{
this.rigidbody.AddRelativeTorque(Vector3.up * maxtorque);
}
if (Input.GetKey(KeyCode.E))
{
this.rigidbody.AddRelativeTorque(Vector3.up * maxtorque * -1);
}
if (Input.GetKey(KeyCode.S))
{
this.rigidbody.AddRelativeTorque(Vector3.forward * maxtorque * -1);
}
if (Input.GetKey(KeyCode.W))
{
this.rigidbody.AddRelativeTorque(Vector3.forward * maxtorque);
}
if (Input.GetKey(KeyCode.D))
{
this.rigidbody.AddRelativeTorque(Vector3.right * maxtorque);
}
if (Input.GetKey(KeyCode.A))
{
this.rigidbody.AddRelativeTorque(Vector3.right * maxtorque * -1);
}
}

//start EVA
if (Input.GetKeyDown(KeyCode.U))
{ // do something
if (!(onEVA))
{//start EVA
prvessel = FlightGlobals.ActiveVessel;
this.decouple(0);
stateChanging = true;
}
else
{//return
this.onPartDestroy();
this.Die(); //Returning kerbonaut
onEVA = false;
stateChanging = false;
print('EVA end');
FlightGlobals.SetActiveVessel(prvessel); //Switch to mother ship
}



}

}


}
}

Some questions:

I\'m new in C#, so, I want to get more knowledge.

1. How to make particle system in plugin? It would be great if EVA-suit will look like real.2

2. How to spawn parts?

Link to comment
Share on other sites

It not scares me that it become pointless when 0.16 will be released. I made KAPAS docking mod during 0.15 developing. Then, EVA during 0.16. And, if Squad won\'t add new planets in 0.16, and will release them in 0.17, I\'ll play with Part Gravity code ;D

Link to comment
Share on other sites

That\'s cool !

Good way to wait 0.16 :)

I have a little suggestion : lighter green for the Kerbal, since now it looks like a cucumber with eyes in a spacesuit :P

Also, I\'ve found something that could be interessing :

1. Take your model

2. Remove space suit, keep only EVA thruster

3. Cut EVA thruster in half

4. Make one half that is RCS tank, the other half that is RCS block

5. You have now a demo-compatible EVA pack !

About spawning parts, there\'s a plugin called orbital construction. Check the source files, it should help since it spawns a ship in orbit.

Or you could check the Wormhole\'s plugin source.

Also, you should maybe include a little built-in SAS, since that little guy looks like instable ;)

@Subcidal : What do you mean ? You didn\'t knew that EVA will be implemented in 0.16 ?

Link to comment
Share on other sites

About spawning parts, there\'s a plugin called orbital construction. Check the source files, it should help since it spawns a ship in orbit.

Or you could check the Wormhole\'s plugin source.

They both just move the ship instead of spawning parts. It hasn\'t been done for now, I think.

Link to comment
Share on other sites

Nice timing lol, I\'ll give this mod a try. Let\'s see how this EVA handles the mun surface :P

EDIT:

I just tried this out, really cool! The RCS works fine with keyboard, but is there a way you can make it work with the bindings from a joystick? Great work so far though!

Link to comment
Share on other sites

I dont get what you mean eva\'s will be out in about 2 maybe 3 days, I dont get this though: How did you get the part under 1 meter to not go haywire, that takes some skill.

Show me where HarvesteR said, outright, that 0.16 will be released in two or three days. (even ignoring that post was three or four days old)

If not, kindly hold your tongue, and not spread unfounded rumours.

Link to comment
Share on other sites

Lol good point im about to kill my self over waiting :\'( I mean no ofence but it does kinda seem pointless and what are you ganna do in 0.16 with this anyways

aparently parts will be able to take damage soon and lose efficiency like the airbreathing engines, imagine a fuel tank leaking, what do you do? send a kerbonaut into the vacuum and have him fix it...

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