Jump to content

KSPEvent on unfocused, uncontrolled vessel


Recommended Posts

I have the following event in a part module:

 [KSPEvent(name = "Add", guiActive = true, guiActiveEditor = false, guiName = "Add to current collection", guiActiveUncommand = true, requireFullControl = false, guiActiveUnfocused = true, unfocusedRange=100)]
 public void AddToCollection()

I'm trying to make it available while focused on another vessel.  This can be a stand-alone part, it has a command module, but no ec, etc.  Just a basic part.

This works when I focus onto it, but when focused on another vessel, it isn't showing up.  I have to switch to the part/vessel in order to see it in the PAW

Any ideas what I'm doing wrong?

Link to comment
Share on other sites

Does "PAW" refer to Part Action Window Sorter-Outer ?

While i tinkered with my code, i used following flags (this was done with stock part menus) :
 

guiActive = true

guiActiveEditor = true

externalToEVAOnly = false

guiActiveUnfocused = true //this one ?

unfocusedRange = 1 //not directly relevant, though it wouldn't surprise me if KSP freaks out on large values

 

Though i tested this by launching two probe cores separated with docking  ports and batteries, then cheating them into orbit and then decoupling them. As distance grew, beyond 1m range,  menu item for other vessel vanished. Note that distance is measured from part's stack attachment node (most likely first one in part.cfg, part i work with has only one).

Edited by fatcargo
better explanation
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...