Jump to content

[1.8 1.9 1.10] LadderWarp


DarthPointer

Recommended Posts

I'm working on a new reliability mod and the next step is adding (un)planned repairs via EVA. I'd like them to take time thus having a way to warp with an EVA kerbal on a ladder would be nice. The idea is to add a module that lets you "take a seat" to Pegasus I. I have already written a LadderSeat PartModule. It is a modified KerbalSeat that gives no control.

The problem is that I can't board my ladder. Something causes a NRE. Replacing KerbalSeat with LadderSeat for the EAS-1 seat works fine. I guess something wrong is with Pegasus I's model.mu. Has anyone made custom EVA seats by chance? Adding CrewCapacity = 1 field does not do the job. Can you explain how to make it or give an example?

The source code is here.

Download form GitHub or via CKAN

Dependency - Module Manager

Source Code

License - MIT

What is this?

Welcome to LadderWarp forum thread. This is a small mod to let you use railwarp with kerbals on ladders. As of now it only adds LadderSeat module to the stock's Pegasus I Mobility Enhancer. This module is a slightly modified KerbalSeat module. The difference is that it provides no control and boarding radius is really small (you should grab the ladder you are going to board to get within the radius). The mod also contains a small KSPAddon that lets you use seated kerbal's buttons with no control (otherwise you could board a ladder of an uncontrolled vessel and have no "Leave Seat" button). @atomontage's PAWRangeBuff mod sources have helped me with this button enabling addon.

You have been warned!

I don't really understand how do the config numbers for ejectionDirection and ejectionForceDirection work. When you leave the ladder's seat your kerbal is spawned not exactly at the ladder he/she occupied. Make sure you use these virtual seats only on ladders with some free space around. It is possible that you won't be able to grab a ladder after detaching, please take some EVA fuel. And the last thing. Warranty void if ejection force is not zero. Use ejection force slider at your own risk.

Needa some help

If you know how to make detaching and ejection more reliable, share the config please :)

Edited by DarthPointer
Arghhh forgot the license!
Link to comment
Share on other sites

  • 2 months later...

I was trying to board a kerbal into an airlock with the Easyboard mod which lets you press "B" prior to reaching a hatch, then they board when they reach the hatch.  I'd forgotten I'd installed LadderWarp.  So he drifts past a ladder, ends up in the ladder seat.  Now he can't get out.  The "leave seat" in the PAW is there, but when clicked nothing happens but exceptions.  The log says no one is in the seat, and that is probably the root of the issue.  Good thing this asteroid miner isn't destined for re-entry.  Dondred Kermin will just have to live on the ladder I guess and be a useless crew member lost in his reverie as he ponders the vastness of space while everyone else works their butts off, lol.  A fix would be great

Link to comment
Share on other sites

@DarthPointer idk if this helps, but from the wiki on how to make laders/hatches, theres this little detail, that I notice some mod devs seem to miss.
 

Quote

Remember: airlock and ladder pivots (origins) must have same coordinates!

I've done enuff ladder/hatch combos to know there seems to be *some* leeway in how close together the ladder/hatch (spawn) origins are.

But if they are far enuff, that does lead to weird kerbal ejections, and trickiness in grabbing/hanging onto ladders, and inability to properly use hatches to board.

I'm just wondering if this could be part of the problem, on ladders/hatches that arent properly positioned relative to each other? vOv

Mebbe you could check, using various ladder/capsule/what-ever parts, and check their collider origins in a 3d modelling program, and if it looks like mebbe something to it, add in somekind of position offset key for the seatPivotTransform? configurable/adjustable in the .cfg of course. vOv
So cfgs/MM patches could "correct" for unique parts vOv

 

Edited by Stone Blue
Link to comment
Share on other sites

15 hours ago, darthgently said:

I was trying to board a kerbal into an airlock with the Easyboard mod which lets you press "B" prior to reaching a hatch, then they board when they reach the hatch.  I'd forgotten I'd installed LadderWarp.  So he drifts past a ladder, ends up in the ladder seat.  Now he can't get out.  The "leave seat" in the PAW is there, but when clicked nothing happens but exceptions.  The log says no one is in the seat, and that is probably the root of the issue.  Good thing this asteroid miner isn't destined for re-entry.  Dondred Kermin will just have to live on the ladder I guess and be a useless crew member lost in his reverie as he ponders the vastness of space while everyone else works their butts off, lol.  A fix would be great

So has EasyBoard executed boarding? Any issues with "manual" boarding (via PAW of a seat/ladder you approach)? I'll try it with EB and see if it causes the problem.

Have you tried reloading scene? I guess it should help you before I release a fix.

12 hours ago, Stone Blue said:

how to make laders/hatches

But... LW is about making ladder to work as an EVA seat. Does this stuff apply to them?

Gonna see it anyway. Thanks.

Link to comment
Share on other sites

2 hours ago, darthgently said:

Maybe reloading the scene has helped in similar situations, but not this one.

Sounds weird. A have quickly made an F5-F9 maneuver after boarding a ladder (boarding causes an NRE and clicking "leave seat" too). I have checked EB code, hintbox of one of the custom methods called for seat boarding says "This is temporary method and will be removed ASAP" (intention.cs, line 114).

I'm pinging @Dizor now, I hope he is the one who can tell what happens what is going on when a kerbal is seated in a KerbalSeat module. And there is a question I'd like to have an answer for. Should kerbals be auto-seated in ladders? May be we don't need to fix the current issue, just making EB ignore LadderSeat modules. May be something via reflections, attributes or simply a strict check for KerbalSeat, ignoring its derivatives.

If he does not response within 2 weeks, I will try to see what can I do to EB on my own.

 

Edited by DarthPointer
Link to comment
Share on other sites

5 hours ago, DarthPointer said:

Sounds weird. A have quickly made an F5-F9 maneuver after boarding a ladder (boarding causes an NRE and clicking "leave seat" too). I have checked EB code, hintbox of one of the custom methods called for seat boarding says "This is temporary method and will be removed ASAP" (intention.cs, line 114).

I'm pinging @Dizor now, I hope he is the one who can tell what happens what is going on when a kerbal is seated in a KerbalSeat module. And there is a question I'd like to have an answer for. Should kerbals be auto-seated in ladders? May be we don't need to fix the current issue, just making EB ignore LadderSeat modules. May be something via reflections, attributes or simply a strict check for KerbalSeat, ignoring its derivatives.

If he does not response within 2 weeks, I will try to see what can I do to EB on my own.

 

After multiple reloads without it having an effect (this has been going on for a few days), I just tried "leave seat" again and it worked.  Just another Kerbal struggle.  

Link to comment
Share on other sites

On 10/10/2020 at 2:41 PM, DarthPointer said:

Sounds weird. A have quickly made an F5-F9 maneuver after boarding a ladder (boarding causes an NRE and clicking "leave seat" too). I have checked EB code, hintbox of one of the custom methods called for seat boarding says "This is temporary method and will be removed ASAP" (intention.cs, line 114).

I'm pinging @Dizor now, I hope he is the one who can tell what happens what is going on when a kerbal is seated in a KerbalSeat module. And there is a question I'd like to have an answer for. Should kerbals be auto-seated in ladders? May be we don't need to fix the current issue, just making EB ignore LadderSeat modules. May be something via reflections, attributes or simply a strict check for KerbalSeat, ignoring its derivatives.

If he does not response within 2 weeks, I will try to see what can I do to EB on my own.

 

I had to use reflections to operate with command seats. I still don't know the public method or property to set occupant for the seat. By some reason allowed method Kerbal.BoardSeat(seat) does not set the occupant. When i find some public functionality to board seat correctly i will remove reflections approach. It looks like i'm doing something wrong even with reflections. Any suggestions?

Link to comment
Share on other sites

23 minutes ago, Dizor said:

I had to use reflections to operate with command seats. I still don't know the public method or property to set occupant for the seat. By some reason allowed method Kerbal.BoardSeat(seat) does not set the occupant. When i find some public functionality to board seat correctly i will remove reflections approach. It looks like i'm doing something wrong even with reflections. Any suggestions?

The first workaround I have tested is adding a check for typename to be KerbalSeat so LadderSeats are fully ignored.

If we want to keep autoboarding ladders, we need a lot of investigation then. TBH, a button to board ladder without opening a PAW would be really nice, if it was separate from the one for boarding seats and hatches. I can't even tell what is wrong here. Have you tried using

Invoke

method for a PAW button (PartInstance.Events["BoardingButtonStringID"].Invoke())?

Upd: I guess you must have the needed Kerbal being the active vessel when invoking.

Edited by DarthPointer
Link to comment
Share on other sites

5 minutes ago, DarthPointer said:

The first workaround I have tested is adding a check for typename to be KerbalSeat so LadderSeats are fully ignored.

If we want to keep autoboarding ladders, we need a lot of investigation then. TBH, a button to board ladder without opening a PAW would be really nice, if it was separate from the one for boarding seats and hatches. I can't even tell what is wrong here. Have you tried using


Invoke

method for a PAW button (PartInstance.Events["BoardingButtonStringID"].Invoke())?

It was so long ago. As far as i remember i did not tried to invoke board event, or there was some another problem appeared with this. Will check.

And i think a cannot provide separate button for boarding unknown parts))

Link to comment
Share on other sites

Just now, Dizor said:

for boarding unknown parts))

You can. You can use reflection to know class name as a string. KerbalSeat - stock module, LadderSeat - a module from LadderWarp. LadderSeat inherits KerbalSeat, thus it should work fine, at least via invoking a button from PartInstance.Events.

Link to comment
Share on other sites

2 hours ago, Dizor said:

I had to use reflections to operate with command seats. I still don't know the public method or property to set occupant for the seat. By some reason allowed method Kerbal.BoardSeat(seat) does not set the occupant. When i find some public functionality to board seat correctly i will remove reflections approach. It looks like i'm doing something wrong even with reflections. Any suggestions?

I have zero understanding of that dev environment.  Well, maybe not zero, but might as well be.  If the API provides a call for Kerbal.BoardSeat(seat) and it doesn't work, then any other solution is probably no where near as good as someone somewhere fixing that API call, lol.  Hello Squad?

a quick additional thought:  no matter what method you use to set the occupant, it is surely a good idea to continue calling BoardSeat for whatever else it may do right.  Additionally, you might want to code with someone fixing that down the road in mind and not do the reflection unless an occupant doesn't get set.  That way you don't have another problem emerging when the reflection technique ends up tangling with some future solution.  That is all shotgun in the dark though.  You clearly know a lot more about the context than I do.  I'm just throwing out what I see as "rules of thumb" type stuff

Edited by darthgently
Link to comment
Share on other sites

On 10/10/2020 at 7:41 AM, DarthPointer said:

Sounds weird. A have quickly made an F5-F9 maneuver after boarding a ladder (boarding causes an NRE and clicking "leave seat" too). I have checked EB code, hintbox of one of the custom methods called for seat boarding says "This is temporary method and will be removed ASAP" (intention.cs, line 114).

I'm pinging @Dizor now, I hope he is the one who can tell what happens what is going on when a kerbal is seated in a KerbalSeat module. And there is a question I'd like to have an answer for. Should kerbals be auto-seated in ladders? May be we don't need to fix the current issue, just making EB ignore LadderSeat modules. May be something via reflections, attributes or simply a strict check for KerbalSeat, ignoring its derivatives.

If he does not response within 2 weeks, I will try to see what can I do to EB on my own.

 

Autoboarding a ladder doesn't make much sense because there are too many ladders and rails near hatches and airlocks.  Having EB ignore the ladders makes a lot of sense.  Personally, for game play, I'd rather have a separate button in the PAW for ladders with the option to "Clip in", just like rock climbers, sailors, and real astronauts do.  So you grab the ladder, then clip in, at which point warp is safe.  It would be frosting if, when clipped in, the kerbal is bumped off the ladder, he is restricted by a tether from going far.  In fact, the lack of tethers is really a big deal for realism. ( I keep trying to remember to try to use a KIS/KAS winch cable for a tether and if the kerb gets in trouble he can use the remote control for the winch to pull himself in )

Link to comment
Share on other sites

41 minutes ago, Dizor said:

Just changed the boarding approach for seats with invoking part event, thank you  @DarthPointer. Can someone please check if the original issue gone before releasing new EB version?
https://drive.google.com/file/d/1_7V8u6jh84zSjH2b9MN_TQ99kJm2D7z3/view?usp=sharing

The issue is gone. But now we have 2 more.

1) It boards a ladder from a distance relevant for stock EAS seat while LadderWarp lets you press the boarding button only being really close to the part center (float unfocusedRange in KSPEventAttribute)

2) Could you make a separate searchlist for LadderSeat modules and set  different keys to toggle will to board hatces&seats/ladders?

Link to comment
Share on other sites

Just now, Dizor said:

Hi @DarthPointer

I am going to release this EB version: https://drive.google.com/file/d/1IYmjYnKRqZYwsh-ujIw5ir1Fh0A1fE0E/view?usp=sharing

Please check how it works with your ladder. The board distance is decreased dramatically for all KerbalSeat derived parts. I tested this, i think it is perfect now.

Hi, nice to see things being fixed. Quick check has shown I could only autoboard while the ladder is grabbed.

You should really release it. But still I suggest you making separate modes for boarding seats&lhatches and ladders. This is not critical though as ladder boarding range is very limited and accidential ladder-boardings now are only possible when moving on a ladder patched to be seatable.

Link to comment
Share on other sites

4 minutes ago, DarthPointer said:

Hi, nice to see things being fixed. Quick check has shown I could only autoboard while the ladder is grabbed.

You should really release it. But still I suggest you making separate modes for boarding seats&lhatches and ladders. This is not critical though as ladder boarding range is very limited and accidential ladder-boardings now are only possible when moving on a ladder patched to be seatable.

I am trying to be consistent with key binding provided by the game. F - grab, B - board. I don't want to use other keys that can be set by Squad for new commands in future, or conflict with some other mods. Sorry.

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