Este sistema é pra tipo, quando o cara passar por cima do local, ele "salvar jogo", e ao morrer nascerá ali, já que salvou lá, isso é tipo um "memory card", as vezes é útil, quando se quer que um cara entre para um esconderijo, salve o jogo e depois quando morrer sair lá dentro, tanto faz, usem como quiserem !
Client ~ Side
1.0 - Abram o frmEditor_Map, e adicione um Option com o name: optCheckpoint, qualquer dúvida siga a imagem.
1.1 - Abra o Server.vbp ( Server ~ Side )
1.2 - Em modConstants, procure por:
Abaixo do procedimento acima, adicionar:
1.3 - Em modDatabase, procure por:
Abaixo adicione:
1.4 - Em modPlayer, procure por:
Abaixo adicione:
1.5 - Ainda na mesma modPlayer, em Sub OnDeath, procure por:
Substituia o codico acima por:
1.6 - Desça até o final da modPlayer, e adicione isso no final:
Nosso trabalho no Server.vbp está completo ! Agora vamos para o Client.vbp ( Client - Side )
1.7 - no Client ~ Side, na modConstants, procure por:
Abaixo adicione:
1.8 - Em ModGameEditors, procure por:
Abaixo adicione:
1.9 - Em modText, procure por:
Abaixo adicione:
FIM ! Agora você tem um sistema de checkpoint no seu jogo, siga todos os procedimentos corretamente, para evitar "burrice" de erros ! Pois o sistema é testado e 100% funcional..
Créditos:
- Alatar - Por fazer o sistema e postar na TouchofDeath
- Sakuray - Por organizar, adicionar foto para melhor entendimento, traduzir e postar na mmorpg !
- Samuka_Maker - Por postar na life rpg maker
Client ~ Side
1.0 - Abram o frmEditor_Map, e adicione um Option com o name: optCheckpoint, qualquer dúvida siga a imagem.
1.1 - Abra o Server.vbp ( Server ~ Side )
1.2 - Em modConstants, procure por:
- Código:
Public Const TILE_TYPE_SLIDE As Byte = 14
Abaixo do procedimento acima, adicionar:
- Código:
Public Const TILE_TYPE_CHECKPOINT As Byte = 15
1.3 - Em modDatabase, procure por:
- Código:
Player(Index).Class = ClassNum
Abaixo adicione:
- Código:
Call PutVar(App.Path & "\Data\accounts\checkpoints.ini", "*SERVEROPTIONS*", "" & GetPlayerName(Index), "" & 0)
1.4 - Em modPlayer, procure por:
- Código:
' Check if it's a trap tile
If .Type = TILE_TYPE_TRAP Then
amount = .Data1
SendActionMsg GetPlayerMap(Index), "-" & amount, BrightRed, ACTIONMSG_SCROLL, GetPlayerX(Index) * 32, GetPlayerY(Index) * 32, 1
If GetPlayerVital(Index, HP) - amount <= 0 Then
KillPlayer Index
PlayerMsg Index, "You're killed by a trap.", BrightRed
Else
SetPlayerVital Index, HP, GetPlayerVital(Index, HP) - amount
PlayerMsg Index, "You're injured by a trap.", BrightRed
Call SendVital(Index, HP)
End If
Moved = YES
End If
Abaixo adicione:
- Código:
If .Type = TILE_TYPE_CHECKPOINT Then
SetCheckpoint Index, .Data1, .Data2, .Data3
End If
1.5 - Ainda na mesma modPlayer, em Sub OnDeath, procure por:
- Código:
With Map(GetPlayerMap(Index))
' to the bootmap if it is set
If .BootMap > 0 Then
PlayerWarp Index, .BootMap, .BootX, .BootY
Else
Call PlayerWarp(Index, START_MAP, START_X, START_Y)
End If
End With
Substituia o codico acima por:
- Código:
With Map(GetPlayerMap(Index))
'Checkpoint
If ValCheckPoint(Index) = True Then
WarpToCheckpoint Index
' to the bootmap if it is set
ElseIf .BootMap > 0 Then
PlayerWarp Index, .BootMap, .BootX, .BootY
Else
Call PlayerWarp(Index, START_MAP, START_X, START_Y)
End If
End With
1.6 - Desça até o final da modPlayer, e adicione isso no final:
- Código:
'Checkpoint
Public Sub SetCheckpoint(ByVal Index As Long, ByVal MapNum As Long, ByVal x As Long, ByVal y As Long)
PlayerMsg Index, "Checkpoint activated!", BrightGreen
Call PutVar(App.Path & "\Data\accounts\checkpoints.ini", "*SERVEROPTIONS*", "" & GetPlayerName(Index), "" & 1)
Call PutVar(App.Path & "\Data\accounts\checkpoints.ini", "" & GetPlayerName(Index), "MAPNUM", "" & MapNum)
Call PutVar(App.Path & "\Data\accounts\checkpoints.ini", "" & GetPlayerName(Index), "X", "" & x)
Call PutVar(App.Path & "\Data\accounts\checkpoints.ini", "" & GetPlayerName(Index), "Y", "" & y)
End Sub
Public Sub WarpToCheckpoint(ByVal Index As Long)
Dim MapNum As Integer
Dim x As Integer
Dim y As Integer
MapNum = GetVar(App.Path & "\Data\accounts\checkpoints.ini", "" & GetPlayerName(Index), "MAPNUM")
x = GetVar(App.Path & "\Data\accounts\checkpoints.ini", "" & GetPlayerName(Index), "X")
y = GetVar(App.Path & "\Data\accounts\checkpoints.ini", "" & GetPlayerName(Index), "Y")
Call PlayerWarp(Index, MapNum, x, y)
End Sub
Public Function ValCheckPoint(ByVal Index As Long) As Boolean
If GetVar(App.Path & "\Data\accounts\checkpoints.ini", "*SERVEROPTIONS*", "" & GetPlayerName(Index)) = 1 Then
ValCheckPoint = True
Else
ValCheckPoint = False
End If
End Function
Nosso trabalho no Server.vbp está completo ! Agora vamos para o Client.vbp ( Client - Side )
1.7 - no Client ~ Side, na modConstants, procure por:
- Código:
Public Const TILE_TYPE_SLIDE As Byte = 14
Abaixo adicione:
- Código:
Public Const TILE_TYPE_CHECKPOINT As Byte = 15
1.8 - Em ModGameEditors, procure por:
- Código:
' slide
If frmEditor_Map.optSlide.Value Then
.Type = TILE_TYPE_SLIDE
.Data1 = MapEditorSlideDir
.Data2 = 0
.Data3 = 0
End If
Abaixo adicione:
- Código:
'Checkpoint
If frmEditor_Map.optCheckpoint.Value Then
If movedMouse Then Exit Sub
X = X - (CurX * 32)
Y = Y - (CurY * 32)
.Type = TILE_TYPE_CHECKPOINT
.Data1 = GetPlayerMap(MyIndex)
.Data2 = CurX
.Data3 = CurY
End If
1.9 - Em modText, procure por:
- Código:
Case TILE_TYPE_SLIDE
DrawText TexthDC, tX, tY, "S", QBColor(BrightCyan)
Abaixo adicione:
- Código:
Case TILE_TYPE_CHECKPOINT
DrawText TexthDC, tX, tY, "CP", QBColor(BrightGreen)
FIM ! Agora você tem um sistema de checkpoint no seu jogo, siga todos os procedimentos corretamente, para evitar "burrice" de erros ! Pois o sistema é testado e 100% funcional..
Créditos:
- Alatar - Por fazer o sistema e postar na TouchofDeath
- Sakuray - Por organizar, adicionar foto para melhor entendimento, traduzir e postar na mmorpg !
- Samuka_Maker - Por postar na life rpg maker