How to save player's worldOrientation?

As title says, I have tried to crunch this nut for a while today.
How could I convert orientation information to more manageable format for saving?
I can already load the data, but I need to convert the current player orientation to floats.

The information on this thread can help you out: Thread

That will work if u want to make checkpoints… but if you really want to save the position for something different, you will need some scripting

Orientation is basically three Vectors, and a Vector is three floats, so orientation is nine floats.

I think you can just save Orientation[0][0],Orientation[0][1],Orientation[0][2],
Orientation[1][0],Orientation[1][1],Orientation[1][2],
Orientation[2][0],Orientation[2][1],Orientation[2][2]
in a list.

SolarLune helped me out with saving / loading a character’s position; the thread is here.

Please stop using ADFLY, it’s incredibly annoying for users and it won’t persist in the future.

You can access the vectors from a matrix using “.col”

Beware of eval(), there is often a better solution.

I’m not suggesting using eval() is recommended. Actually I’m avoiding it because more experienced people recommend to avoid it at all times. However, with library storage eval() to me seems to be the easiest solution, when you’re not using the pickle module. Formatting a library of libraries, lists, floats, … will definitely require some functions. And if only computing time is the issue with eval() I don’t think it makes a big difference. But I’m guessing there are some other significant reasons behind disapproving of it. (I’m curious which, so maybe you could tell me).

From what I know:

  1. eval invokes another Python interpreter -> slow/inefficient
  2. eval can be difficult to debug
  3. eval is inherently insecure.

Although eval is most vulnerable when exposed to outside code, networking, etc.

Once I almost used it, but I ended up going another route using getattr, setattr, etc. It was related to RPC.

I guess a nice analogy (if you’re familiar with Linux), would be running in root all the time. I think some people view it as “an accident waiting to happen”.

Thanks Mahalin, for this valuable information.
Edit: one question though, I don’t know what you mean with: ‘invokes another Python interpreter’.