| Mirage Source http://web.miragesource.net/forums/ |
|
| single player. http://web.miragesource.net/forums/viewtopic.php?f=201&t=4701 |
Page 1 of 2 |
| Author: | genusis [ Thu Nov 06, 2008 1:11 pm ] |
| Post subject: | single player. |
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. |
|
| Author: | Matt [ Thu Nov 06, 2008 1:35 pm ] |
| Post subject: | Re: single player. |
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. |
|
| Author: | William [ Thu Nov 06, 2008 6:04 pm ] |
| Post subject: | Re: single player. |
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. |
|
| Author: | genusis [ Thu Nov 06, 2008 6:08 pm ] |
| Post subject: | Re: single player. |
thank you William that will work good too =] better than redoing it all. |
|
| Author: | William [ Thu Nov 06, 2008 6:29 pm ] |
| Post subject: | Re: single player. |
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. |
|
| Author: | genusis [ Fri Nov 07, 2008 4:51 am ] |
| Post subject: | Re: single player. |
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 |
|
| Author: | carloso [ Sat Nov 08, 2008 1:20 am ] |
| Post subject: | Re: single player. |
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. |
|
| Author: | genusis [ Sat Nov 08, 2008 1:53 am ] |
| Post subject: | Re: single player. |
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. |
|
| Author: | carloso [ Sat Nov 08, 2008 1:58 am ] |
| Post subject: | Re: single player. |
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 |
|
| Author: | genusis [ Sat Nov 08, 2008 2:03 am ] |
| Post subject: | Re: single player. |
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. |
|
| Author: | Dragoons Master [ Sat Nov 08, 2008 2:10 am ] |
| Post subject: | Re: single player. |
subject /\ ? |
|
| Author: | genusis [ Sat Nov 08, 2008 2:13 am ] |
| Post subject: | Re: single player. |
i was just answering his question. |
|
| Author: | carloso [ Sat Nov 08, 2008 2:41 am ] |
| Post subject: | Re: single player. |
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 >_>; |
|
| Author: | genusis [ Sat Nov 08, 2008 3:02 am ] |
| Post subject: | Re: single player. |
its multi player with single character. |
|
| Author: | Dragoons Master [ Sat Nov 08, 2008 3:04 am ] |
| Post subject: | Re: single player. |
genusis wrote: its multi player with single character. OHHHHHHHHHHHHHHHHHHHH, that explains a lot xD LOL |
|
| Author: | carloso [ Sat Nov 08, 2008 3:47 am ] |
| Post subject: | Re: single player. |
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? |
|
| Author: | genusis [ Sat Nov 08, 2008 6:11 am ] |
| Post subject: | Re: single player. |
NVM i figured it out here i made a tutorial for it as well =]. http://web.miragesource.com/forums/viewtopic.php?f=128&t=4710 |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|