Various Types of Persistent Player Variables
Right now you can only store number data as a player persistent variable. If we could store other forms of data, we could create far richer experiences for returning players:
- Number (Already Amazing)
- Boolean (Save a state)
- Vector (Save positions)
- Rotation (Save orientations)
- Color (Save player's color)
- String (Save messages and much more)
If it is an option, saving a list of a single data type would also be incredible, this could enable save points that could be resumed and so much more. Thank you for considering. šš
-
Matthew Warner commented
With the ability to now store floats and not just integers as PPV, we can break our vectors, rotations, and colors into three separate PPVs and then reassemble them in script. This isn't as good as just being able to store them straightaway, but it's a start. Bools can be stored as 1s or 0s. But I still think Horizon should add these other data types for PPV. It would help if we also could extract from rotations their X/Y/Z components as we can with vectors.
Being able to save a string as a PPV would really open things up considerably, not just in being able to store complex data as a human-readable string but possibly being able to store complex/associative arrays. That would then be even easier with the addition of explode and implode functions.
-
Paul Crabb commented
Additionally, "world persistent variables" that can be accessed by any script but aren't tied to certain players would also be incredibly useful. I know it's possible to do this using events but it feels like such a hack.
-
Matthew Warner commented
If priority were given to a mixed-type variable, we could create things like comma-separated lists. World instances could then read those lists and explode them into arrays. From the arrays, we could run for-each loops to recreate complex game states. This means giving players the option to save their individual game states in a more meaningful way.