ID:164830
 
today I was wondering about passwords the long long incredibly long text strings used for save files on the NES i wanted to know how they work and how they could be used on byond
Uhh..Do they just generate a random sequence of letters and numbers?
In response to Revojake
Not really, otherwise how do they work? :)



The NES password system takes all of the required variables and jumbles them into a code (or just placed in order with 'code names' if you don't want to be confusing) in which can be read and built on.

Say like, if you have 10/10 Health and at a waterfall, it could be...
MAL MMH WTR

If you move to the town, you could change 'WTR' to 'TON' or something. Thats just a crude idea of what it could be.
You might as well just write a var dump then encode it in a way, decoding it when its inputted again later. Same thing really.
Mblal6 wrote:
today I was wondering about passwords the long long incredibly long text strings used for save files on the NES i wanted to know how they work and how they could be used on byond

They could very easily be used on BYOND, simply created areas that when Entered() it will show a password to the client. That is just one of the many ways it could be done. As for how they get it you could easily make up a password for a certain area by just smacking the keyboard, "iksdf ouoier 034 090qe" could be the code to the last level! But really, if you need anything else to do with creating areas that display the client a message I could assist you, if what I just stated doesnt make sence.
In response to Revojake
It's not really random.. after all, if it was, how does it know where you exactly saved off last time?

An example of a very crude system of this:
mob/proc
password() //gives the encoded password
var/a //Used to show you a step-by-step process, you could return it as a single string instead of keep adding strings to a if you know what to do
a+="[(99-level)<10?"0[99-level]" :(99-level)]"]" //Two digits stating the indirect level of maximum 99 (eg: level of 4 would have the value 95 here and level of 94 would be the value 05
a+="[x+10][y+20][z+30]" //These are in strings because we are adding a, which is a string. If you added a number to a string, you get a mistype error.. Let's say that the map has a maximum value of: 89, 79, 69 for x,y,z respectively
return a

Relocate(pass) //The password is decrypted
level = text2num(copytext(pass,1,3)) //turns the 1st two digits in the string to a num for the level
x = text2num(copytext(pass,3,5))//The 3rd-4th digits, it stops just before the 5th
y = text2num(copytext(pass,5,7))
z = text2num(copytext(pass,7))//Since the rest is for z, no stopping digit was placed


As I said, that's a crude system but the idea is the same, it's a basic encode/decode system and not a random system

EDIT: Redline's crude example is more related to it than this crude example is :P

- GhostAnime