Search the Community
Showing results for tags 'walkabout'.
-
The WalkAbout mod allows you to take an available kerbal from the Astronaut Complex and have him/her placed outside any door at the KSC (see Placement, see note 6). It also allows you to move your kerbal around without having to hold down the W-A-S-D keys (see Perpetual Motion below). Download from SpaceDock Placement: You can activate WalkAbout from the Space Centre scene by pressing ctrl-W. The WalkAbout seclections screen will appear. 1 - List of available kerbals. any kerbal currently not assigned to a craft or on EVA will appear in this list. Simply click on a kerbal to select that one. 2 - Facilities a list of the KSC facilities with locations for placing kerbals. Click on one of these to restrict the list of Locations (see below) to only those locations associated with the facility. 3 - Locations - list of all locations where a kerbal may be placed. Or, if a facility has been selected, a list of all locations associated with that facility. See notes 1, 2, 3 and 4. 4 - Action Button - when the button text is green, click it to send your kerbal on WalkAbout. 5 - Top 5 Button - Restricts the locations shown to only the top 5 most commonly selected locations. See notes 3, 4 and 5. For players who use the Kerbal Inventory System mod: 6 - Toggle Inventory Button (only appears if the Kerbal Inventory System mod is installed) - turns the inventory display on or off 7 - Kerbal's Inventory - lists all items in the selected kerbal's inventory. 8 - Available Items - list all items that can be added to the kerbal's inventory. Perpetual Motion: When a kerbal is on EVA, it is now possible to walk/swim or run without having to hold down the movement keys. To do this enter Perpetual Motion mode by pressing the activation key (single quote ['] - see note 1). Your kerbal should now start walking forward (see note 2). The movement keys (W-A-S-D) will now change your kerbal's direction of movement. See note 2. The run key (left-shift) will act as a toggle, switching your kerbal's movement between walking and running. Time acceleration is limited to physics time-warp only (1x, 2x, 3x, 4x). Pressing the activation key again will take you out of Perpetual Motion mode. Many thanks to Diazo, Crzyrndm, IgorZ, and LabRats for helping me out in the forums. And thanks too to mod creators KospY (KIS), MSK (EVA-Follower), MrHappyFace (Better Time Warp), The kOS Team (kOS), and Qberticus (Haystack Continued) for creating the code that helped me figure out how to do most of this. This software is licenced under the GNU General Public License
- 95 replies
-
- 21
-
I am trying to add new functionality to my WalkAbout mod so that it will spawn kerbals with selected items already in their inventory. Currently, I am still in the proof-of-concept stage. The problem I am having is that I can't seem to get KIS to add an item to an inventory. Below is a snippet of the code I am using to test things out (the Debug() method is my extension method to write messages to the log file): if (inventory != null) { var items = WalkAboutPendingItems.InventoryItems[kerbal.name]; "performing getinfo on inventory".Debug(); var info = ModuleKISInventoryType.InvokeMember("GetInfo", System.Reflection.BindingFlags.InvokeMethod, null, inventory, new object[0]); $"obtained info from inventory [{info}]".Debug(); foreach (var itemName in items) { $"{kerbal.name} has a {itemName} to be added".Debug(); var defPart = PartLoader.getPartInfoByName(itemName); $"obtained part [{defPart}] for item [{itemName}]".Debug(); if (defPart != null) { $"invoking AddItem member using defPart [{defPart.GetType()}]".Debug(); ModuleKISInventoryType.InvokeMember("AddItem", System.Reflection.BindingFlags.InvokeMethod, null, inventory, new object[] { defPart }); $"If you can read this then ... hurray! It worked! {itemName} is in the inventory".Debug(); } else { "Cannot add item to inventory".Debug(); } } } And the resulting entries from the log file: [LOG 07:36:21.281] WalkAbout: performing getinfo on inventory [LOG 07:36:21.282] WalkAbout: obtained info from inventory [<b>Max Volume</b>: 300.00 L <b>Internal access</b>: ALLOWED <b>External access</b>: ALLOWED ] [LOG 07:36:21.283] WalkAbout: Jebediah Kerman has a KIS.wrench to be added [LOG 07:36:21.283] WalkAbout: obtained part [AvailablePart] for item [KIS.wrench] [LOG 07:36:21.284] WalkAbout: invoking AddItem member using defPart [AvailablePart] [EXC 07:36:21.287] MissingMethodException: The best match for method AddItem has some invalid parameter. System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParameters) System.Type.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[] args) KspWalkAbout.WalkAboutEva.Start () As you can see, I have properly obtained the kerbal's ModuleKISInventory object and can query it for info by invoking "GetInfo". The call to invoke "AddItem" uses the same object and the only difference is that I am passing an AvailablePart object (just as is shown here). I just can't figure out where I've gone wrong. Any help would be appreciated.