Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
single player.
#1
Well i have changed everything in 3.60 from characters to account and i was wondering how would i set this.

Code:
Function GetPlayerX(ByVal Index As Long) As Long
    GetPlayerX = Player(Index).Char(TempPlayer(Index).CharNum).x
End Function

Code:
Sub SetPlayerX(ByVal Index As Long, ByVal x As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).x = x
End Sub

Code:
Function GetPlayerY(ByVal Index As Long) As Long
    GetPlayerY = Player(Index).Char(TempPlayer(Index).CharNum).y
End Function

Code:
Sub SetPlayerY(ByVal Index As Long, ByVal y As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).y = y
End Sub

Code:
Function GetPlayerDir(ByVal Index As Long) As Long
    GetPlayerDir = Player(Index).Char(TempPlayer(Index).CharNum).Dir
End Function

Code:
Sub SetPlayerDir(ByVal Index As Long, ByVal Dir As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).Dir = Dir
End Sub

Code:
Sub AddAccount(ByVal Index As Long, ByVal Name As String, ByVal Password As String, ByVal Sex As Byte, ByVal ClassNum As Byte)
Dim f As Long
Dim n As Long

'If LenB(Trim$(Player(Index).Name)) = 0 Then
        'TempPlayer(Index).CharNum = CharNum
        
    Player(Index).Login = Name
    Player(Index).Password = Password
    
        Player(Index).Sex = Sex
        Player(Index).Class = ClassNum
        
        If Player(Index).Sex = SEX_MALE Then
            Player(Index).Sprite = Class(ClassNum).Sprite
        Else
            Player(Index).Sprite = Class(ClassNum).Sprite
        End If
        
        Player(Index).Level = 1

        For n = 1 To Stats.Stat_Count - 1
            Player(Index).Stat(n) = Class(ClassNum).Stat(n)
        Next n
        
        Player(Index).Map = START_MAP
        Player(Index).x = START_X
        Player(Index).y = START_Y
            
        Player(Index).Vital(Vitals.HP) = GetPlayerMaxVital(Index, Vitals.HP)
        Player(Index).Vital(Vitals.MP) = GetPlayerMaxVital(Index, Vitals.MP)
        Player(Index).Vital(Vitals.SP) = GetPlayerMaxVital(Index, Vitals.SP)
  
    ' Append name to file
        f = FreeFile
        Open App.Path & "\accounts\playerlist.txt" For Append As #f
            Print #f, Name
        Close #f
        
    Call SavePlayer(Index)
End Sub
that's just some of them. but how would i change these to read from account instead of from character.
Thank you For your help.
Reply
#2
If you're gonna do that, just use the graphic engine in MS. The rest of it is tedious and you can do it sooo much faster from scratch.
Reply
#3
1. Make MAX_CHARS = 1

2. Have a create Account button.

3. When you login with the "account", check server side if it has a player in slot1. If it does send back a packet and log him in right away. If he dont have a char, send him to create char screen.
Reply
#4
thank you William that will work good too =] better than redoing it all.
Reply
#5
Or when you create a account, you can send him directly to the create char menu. That way your login button will only be for logging into the game. But both ways are pretty similar.
Reply
#6
i like that better than the first one because it makes it easier to code rather than making a new thing where it checks to see if you have a character and if not opens character create screen, so this way you just set it to use character slot 1. for direct login. ^^ thank you William Big Grin .
Reply
#7
Perfekt Wrote:If you're gonna do that, just use the graphic engine in MS. The rest of it is tedious and you can do it sooo much faster from scratch.

this.
Reply
#8
its much easier to do it William way. just have to add the create new character packet stuff to create account move that create frmnewchar stuff to Frmnewaccount then redo a bit of code to log them in directly using character slot 1 ^^

problem i only have is its been over 5months since i coded anything haha.
Reply
#9
genusis Wrote:its much easier to do it William way. just have to add the create new character packet stuff to create account move that create frmnewchar stuff to Frmnewaccount then redo a bit of code to log them in directly using character slot 1 ^^

problem i only have is its been over 5months since i coded anything haha.

Why use packets for singleplayer?

Why even use a server?

:S
Reply
#10
Lets see packets are for sending information back in for between something< which if you have a server you have to use something like a packet.>

you don't really have to use a server you could make the clients to be connected together but then you still need to send packets to other clients unless its an rpg. but if you are doing an online game i suggest using a server to help stop hacking and taking over your game.
Reply
#11
subject /\ ?
Reply
#12
i was just answering his question.
Reply
#13
genusis Wrote:Lets see packets are for sending information back in for between something< which if you have a server you have to use something like a packet.>

you don't really have to use a server you could make the clients to be connected together but then you still need to send packets to other clients unless its an rpg. but if you are doing an online game i suggest using a server to help stop hacking and taking over your game.

If you're making a single player game its better to not use a server.

The only reason MS has a server is so that it can be multiplayer >_>;
Reply
#14
its multi player with single character.
Reply
#15
genusis Wrote:its multi player with single character.
OHHHHHHHHHHHHHHHHHHHH, that explains a lot xD
LOL
Reply
#16
Dragoons Master Wrote:
genusis Wrote:its multi player with single character.
OHHHHHHHHHHHHHHHHHHHH, that explains a lot xD
LOL

yeah lol.

maybe elaborate more next time? Tongue
Reply
#17
NVM i figured it out here i made a tutorial for it as well =].

http://web.miragesource.com/forums/viewt...128&t=4710
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)