Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Firedan1176 · Jul 07, 2014 at 04:06 PM · stringdatabasestoresplitstring.split

What do you say the best way to store a string be?

Let your inner imagination show: I'm not wanting answers such as, "look up PlayerPrefs." or "look at this tutorial." I'm asking if any of you guys would be willing to provide me with any magically delicious method that comes to your special little minds to store a user's data as a string.

The user can have a primary, secondary, grenades, equipment slot 1, equipment slot 2, money, then level.

It has to be a string. Anyone have an amazingly radical method to store this data into a string? String.Split() would be preferred too. Something like 2.3.74.4.6.8.2.673568356.6753 where each blank means something.

Thanks, and stay special!

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image roojerry · Jul 07, 2014 at 04:10 PM 0
Share

JSON, X$$anonymous$$L ?

avatar image Firedan1176 · Jul 07, 2014 at 04:11 PM 0
Share

Okay, with X$$anonymous$$L, how would I be able to format that?

avatar image roojerry · Jul 07, 2014 at 04:13 PM 0
Share

You could serialize and save an entire "player" or "player data" class, and read that back in at load.

avatar image roojerry · Jul 07, 2014 at 04:17 PM 0
Share

I don't fully understand your needs. If you need your string in a specific format, you may just want to write your own parser

avatar image Firedan1176 · Jul 07, 2014 at 07:39 PM 0
Share

I'm not asking for something that you would give an anwer, I'm asking you guys to let your inner imagination prosper. Give me a format that you would suggest similar to what I put.

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by drudiverse · Jul 07, 2014 at 04:16 PM

primary, secondary, grenades, equipment slot 1, equipment slot 2, money, then level.

all code is a string.

You can do like the method that you suggested, but it's more difficult than using an int array.

if you store savegames like

    var saveints [2,3,74,4,6,8,2,673568356,6753]

the only difference is a comma instead of a dot

then access it alot easier than with string parse.

when load, grenated = saveints[1] level = savints[2] etc... so easy. play prefs arrays using the wiki playprefs extension.

there are other ways of saving data than playprefs but it is pretty simple.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Kiwasi · Jul 07, 2014 at 07:45 PM

If you want a obfuscated string then you can serialise a class, convert it to a byte[], then convert it to a string. That string can be saved anywhere you like.

You can even chain several classes together, as long as you insert some defined term in between that you can use to split on.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

String.Split With Backslash 2 Answers

how can i split a word to individual letters..?? 2 Answers

Extract number from string? 3 Answers

Split String into groups of characters without using delimiters 1 Answer

How do I connect to an Oracle Database? 6 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges