Life RPG Maker 2.0
Bem vindo a LRM, forum de ajuda Maker
Registre-se em nosso forum e aproveite Very Happy
esperamos que você seja ajudado e esperamos que nos ajude Very Happy

Participe do fórum, é rápido e fácil

Life RPG Maker 2.0
Bem vindo a LRM, forum de ajuda Maker
Registre-se em nosso forum e aproveite Very Happy
esperamos que você seja ajudado e esperamos que nos ajude Very Happy
Life RPG Maker 2.0
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Life RPG Maker 2.0

2ª versão do forum life rpg maker

Os membros mais ativos do mês
Nenhum usuário

Últimos assuntos
» Kingdon 1.6
Sistema de Checkpoint EmptyTer Jun 09, 2015 3:02 pm por MasterKill

» Tempo dinâmico e Hora do Sistema
Sistema de Checkpoint EmptySeg Dez 09, 2013 5:42 pm por jonathas

» Sistema de Natação
Sistema de Checkpoint EmptySáb Dez 07, 2013 5:14 pm por jonathas

» Classificar Inventario
Sistema de Checkpoint EmptySáb Dez 07, 2013 12:07 pm por Samuka_Adm

» VOLTEI ALELUIA :D
Sistema de Checkpoint EmptySáb Dez 07, 2013 10:35 am por Samuka_Adm

» Netplay Master v4.0.7
Sistema de Checkpoint EmptyQua Jun 26, 2013 1:32 pm por xdario

» The League Of War [Season 1]
Sistema de Checkpoint EmptySex Jan 18, 2013 6:02 pm por Warrior

» Meu primeiro desenho que posto :D
Sistema de Checkpoint EmptyQua Jan 09, 2013 1:37 pm por PedroMatoso

» Window Configurações
Sistema de Checkpoint EmptyQua Jan 09, 2013 1:36 pm por PedroMatoso

Parceiros
Fórum grátis

Fórum grátis


Mundo RPG Maker
MMORPG BRASIL

Você não está conectado. Conecte-se ou registre-se

Sistema de Checkpoint

Ir para baixo  Mensagem [Página 1 de 1]

1Sistema de Checkpoint Empty Sistema de Checkpoint Seg Nov 19, 2012 1:07 pm

Samuka_Adm

Samuka_Adm
Admin
Admin

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.
Sistema de Checkpoint XBFBU

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

https://liferpgmakerv2.forumeiros.com

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos