Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Multiple Characters per Account


Slasheree
 Share

Recommended Posts

can someone give me the logic (which functions/handledata i'll need) for making this possible (not a tutorial, just the basic lines)

I tried adding accountname_1.ini accountname_2.ini and accountname_3.ini, but then it messes up the saveplayer() loadplayer() and bank and more stuff, is there an easier way of doing it that I'm not seeing ? O.o

[Edit]

I'm using CS:DE btw
Link to comment
Share on other sites

I tried this but failed ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png)

But this was the logic I had in mind.

Use a rec that holds the main player files. Then a Player rec that holds the characters data. The Player rec can be only accessed from the main rec. The player files are saved in their own folders in \accounts\ Within the player folder is a Main file. It holds the players name and stuff. Then along with the main. 1….# files that holds the characters data. (# being the character number, like 1 for chara 1 etc)
Link to comment
Share on other sites

I have added this to my engine and once you get the understanding down its relatively easy.

I'm not going to spell it out completely for you as that would defeat the point of learning the engine and coding it your own way (plus I have no idea how efficient mine is.)

You will need:

A Character Rec - Holds all the Character details

An edited Player Rec - Which only holds the account details (It will also use the Character rec)

An edited TempPlayer Rec - You need a way to store the current character a player is using.

You need to alter nearly every single line of code involving a player on the server.

The client does not really need to change much.
Link to comment
Share on other sites

TorenRenne, could you give me your Sub ClearPlayer() to check something ? ._.

When I try to register an account it give a runtime error 9 subscript out of range and highlights:

Function GetPlayerMap(ByVal Index As Long) As Long

If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function

GetPlayerMap = Player(Index).Char(TempPlayer(Index).CurChar).Map

End Function
Link to comment
Share on other sites

Ok, fixed it, needed a check:

Function GetPlayerMap(ByVal Index As Long) As Long

If TempPlayer(Index).CurChar <= 0 Then Exit Function

If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function

GetPlayerMap = Player(Index).Char(TempPlayer(Index).CurChar).Map

End Function

Some minor tweaks to the code and done ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) (ToDo: Gonna add a confimation thingy for Char Delete)
Link to comment
Share on other sites

That should never be hit.

If your "Getting a Player map", the player has to be in game as checked by:

"If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function"

The problem your experiencing is down to the fact you are trying to use an account that probably existed BEFORE you added multiple chars?

You have to wipe all accounts to implement this.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...