Cannot get parachute state after loading a save
Rhahi opened this issue ยท 0 comments
What happened?
- Server start
- Start flying a craft and create a save file.
- Connect to KRPC
- Get a parachute part
- Get parachute's state. It should work.
- Load the save. I used KRPC to load it.
- Connect to KRPC.
- Get the parachute part and get its state.
- Error!
---------------------------------------------------------------------------
RPCError Traceback (most recent call last)
Cell In[3], line 1
----> 1 chute.parachute.state
File [~/.julia/dev/SpaceLib/python/venv/lib64/python3.11/site-packages/krpc/services/spacecenter.py:15454](https://vscode-remote+ssh-002dremote-002bbuilder.vscode-resource.vscode-cdn.net/home/rhahi/.julia/dev/SpaceLib/python/~/.julia/dev/SpaceLib/python/venv/lib64/python3.11/site-packages/krpc/services/spacecenter.py:15454), in Parachute.state(self)
15449 @property
15450 def state(self) -> ParachuteState:
15451 """
15452 The current state of the parachute.
15453 """
> 15454 return self._client._invoke(
15455 "SpaceCenter",
15456 "Parachute_get_State",
15457 [self],
15458 ["self"],
15459 [self._client._types.class_type("SpaceCenter", "Parachute")],
15460 self._client._types.enumeration_type("SpaceCenter", "ParachuteState")
15461 )
File [~/.julia/dev/SpaceLib/python/venv/lib64/python3.11/site-packages/krpc/client.py:208](https://vscode-remote+ssh-002dremote-002bbuilder.vscode-resource.vscode-cdn.net/home/rhahi/.julia/dev/SpaceLib/python/~/.julia/dev/SpaceLib/python/venv/lib64/python3.11/site-packages/krpc/client.py:208), in Client._invoke(self, service, procedure, args, param_names, param_types, return_type)
206 # Check for an error in the procedure results
207 if response.results[0].HasField('error'):
--> 208 raise self._build_error(response.results[0].error)
210 # Decode the response and return the (optional) result
211 result = None
RPCError: Object reference not set to an instance of an object
Server stack trace:
at KRPC.SpaceCenter.Services.Parts.Parachute.get_Deployed () [0x00022] in <7ed7d61af49940fa8a93b5df435e46bc>:0
at KRPC.SpaceCenter.Services.Parts.Parachute.get_State () [0x0002e] in <7ed7d61af49940fa8a93b5df435e46bc>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <9577ac7a62ef43179789031239ba8798>:0
How can someone else reproduce it?
User specific configuration:
- Hostname
- A vessel with a part tag "chute" on parachute of Kerbal X.
- A save file called "kerbalx_chute" which situates the upper stage of Kerbal X at 20 km altitude, about to fall.
import krpc
conn = krpc.connect("Test", "10.0.0.51")
sc = conn.space_center
sc.load("kerbalx_chute")
ves = sc.active_vessel
chute = ves.parts.with_tag("chute")[0]
chute.parachute.state # works well
sc.load("kerbalx_chute")
sc = conn.space_center
ves = sc.active_vessel
chute = ves.parts.with_tag("chute")[0]
chute.parachute.state # does not work.
What is your environment?
- KSP 1.12.3
- Mods: KRPC 0.5.3, KOS, LaserDist
- Python: 3.11.2
Anything else we need to know?
- Might be a similar issue with this #210