I'm in the process of making a Multiplayer game, but I've hit a roadblock. Does anyone know how to save information like what you have in your inventory, what your level, skills, and friend, etc?
Printable View
I'm in the process of making a Multiplayer game, but I've hit a roadblock. Does anyone know how to save information like what you have in your inventory, what your level, skills, and friend, etc?
I have a server of my own, so it's fine if it stores some files on my computer.
Ini files. If you need any more help than that just ask.
umm, yeah. How would you save all of this? If my friend is on his computer, how would he save all these files so they end up on my computer with my server? Also, how would I have the program read it when it opens it up?
He would send all of the data at once, separated by delimiters.
Str$(value("Health"))+","+string$("Name")+","+Str$ (value("Attack Power"))+","+Str$(X("Player"))+","+Str$(Y("Player" ))
Then you would use the string parser to separate all of that on your computer and save it as a ini. Next time they sign on, load it into a string and send it back to them.
how do you use the string parser? Also, what form would the health and stuff be in? Can it be in counters? Also, can you make a full code? I'm kinda bad at filling in the blanks. And for an inventory, where the things I'm sending aren't numbers, how would I save the objects he has in his inventory?
Ok I'm going to make a full example for you. Here it goes:
+Person is done playing
-Here is where you send the data to the server using mooclick or moosock. You have to turn everything into text. If it is a number, like a counter, put Str$() around it, that makes it into text. Between every piece of data add +","+ except the end one. My previous post demonstrates this pretty well.
Ok that was the client app, now these events go under your server.
+Start of Frame
-Add delimiter "," (String Parser)
+On message
-Set Source String to "Equation for retrieving message from mooclick or moosock" (String Parser)
Now you separate each of the parts sent from the client using the Get Element expression of the String Parser. If it is a number, wrap the Val() around the GetElement.
I know this might be confusing, because it is. If you need, I'll make an example, but it would help if you could send me the client and the server.
Right now all my client has is a chat feature. I haven't started on the actual gameplay. For your first action (player is done playing), if the data you're sending isn't a number, do you not put anything around it? For example, if it's your pet's name. What would you have the pet name's code be? Also, I'm not sure how I should store the things he has in his inventory. Should I have a list, or counters for every object and if they have it the value is 1 and if they don't the value is 0? an example file would be very helpful, but if it's too much work, don't worry about it. Thanks for responding!
Ok, instead of answering all of your questions, I'll make an example. But instead of sending it over a server, I'll just put it into an ini file in the same app. The example will be up in 10 to 20 minutes.
I think i know how to send it over a server.. I think. You just send the messege Str$(value("Health"))+","+string$("Name")+","+Str$ (value("Attack Power"))+","+Str$(X("Player"))+","+Str$(Y("Player" )) to the server, then have the server recieve it, break it up, and save it in an ini, right? Can you include having the app send and recieve the messege. thanks!