Jump to content

KoS Sending a Runpath Message to another local Vessel


Ktrooper15

Recommended Posts

The overall aim is to code a rocket to send 4 satellites into a geostationary orbit. I have all the code set just stuck on the last bit. 

Until the 'Sats" leave the main vessel they are apart of that vessel so the only way I believe would work is to start each Sat running it's own script as soon as it decouples by sending a 'runpath' Command to run a path from 0:/ .

Can anyone help with this code ??? 

I can connect to Sat 1 and send it a message but can not send a run path command to save my life. 

Any help would be greatly appreciated. 

Thank you. 

Edited by Ktrooper15
Link to comment
Share on other sites

A simple way I've done this before is have the deployable script count the KOSProcessors on boot, identify the S2 processor, and

    FOR eachModule IN SHIP:MODULESNAMED("kOSProcessor")    {
        LOCAL eachPart IS eachModule:PART.
        LOCAL tag IS eachPart:TAG.
        IF tag:STARTSWITH("mission/s2") {
            SET processorS2 TO eachModule.
        }

}

IF processorS2 <> 0 {

WAIT UNTIL processorS2:PART:SHIP <> CORE:PART:SHIP.

}

The way that you have described involves CORE:MESSAGES - being a message queue and commands around that.  Useful if you want to invest in understanding everything around it, but more complex for your simple use case.

Link to comment
Share on other sites

On 7/30/2020 at 10:43 PM, Devoblue said:

A simple way I've done this before is have the deployable script count the KOSProcessors on boot, identify the S2 processor, and

    FOR eachModule IN SHIP:MODULESNAMED("kOSProcessor")    {
        LOCAL eachPart IS eachModule:PART.
        LOCAL tag IS eachPart:TAG.
        IF tag:STARTSWITH("mission/s2") {
            SET processorS2 TO eachModule.
        }

}

IF processorS2 <> 0 {

WAIT UNTIL processorS2:PART:SHIP <> CORE:PART:SHIP.

}

The way that you have described involves CORE:MESSAGES - being a message queue and commands around that.  Useful if you want to invest in understanding everything around it, but more complex for your simple use case.

Thank you, I will give it a try, although with the issue of KSP and its load distance I have come to the conclusion that this problem is no longer necessary.

I have instead choosen to code an AG to run the sats 2mins before AP and decouple 120 before to give time for the script to kick in and complete the circ burn. 

This is my first coding experince,  I am enjoying the learning curves. 

 

 

Edited by Ktrooper15
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...