[Help] Multi Character at login

character
multiple
help

#1

Iv’e got a request by some of my users to make it able to choose from 2 characters or more at login .

After a week of trying to manage that i broke it all so now i am here asking if some of you have maybe managed it to get it to work .


#2

I manage it.
But you have to know that you would need to edit all the scripts you’re using which used the identifier to target an user.
Because you would have more than 1 user with the same identifier now, so I created a column named id which is a PK in my database.
Change all the queries which contains WHERE identifier = @ identifier by WHERE id = @id
And if you’re using essentialmode, edit it in the player.lua (the class)
add self.id = myDataReturnedByUsersFetcherQuerie.id
now you would be able to do a user.get('id') to identify a player
Good luck


#3

Omg that is way easier than i had have to stop thinking the hard way.
So nice of you telling me this .

Now the hard part setting up the client side part that they actually can choose which character they want .


#4

You can use MenuBuilder to do this or create your own Html/css/js app


#5

Do you use es_extended as well? I’m having problems with trying to load the second character… Gives me errors with es_extended…