[Pedido] Win HUD error dividide by 0

    Compartilhe

    イアゴル
    Membro Ativo
    Membro Ativo

    Mensagens : 351
    Créditos : 27

    [Pedido] Win HUD error dividide by 0

    Mensagem por イアゴル em Ter Maio 07, 2013 10:44 am

    Então, tava testando o projeto aqui e eu peguei level 99 pra testar tudinho, só que, ao chegar no level 99 da erro na HUD de divisão por 0 que com certeza é da EXP. a minha HUD usa % na EXP, alguem ai sabe como posso concertar esse erro?!


    _________________




    Haters? Haters gonna Hate!

    Gauthier99
    Iniciante
    Iniciante

    Mensagens : 33
    Créditos : 24

    Re: [Pedido] Win HUD error dividide by 0

    Mensagem por Gauthier99 em Ter Maio 07, 2013 11:36 am

    I haven't got this problem.



    May be this is work in NPM 4.0.7.

    Else, you can do something like that in your script :

    while
    ---if level = 99
    -----exp = 0
    -----maxexp = 0
    end while

    (this is not a real script, of course)


    _________________
    "My script doesn't work, I don't know why :/
    My script works, I don't know why ._."

    - All great scripters


    My Scripts :

    イアゴル
    Membro Ativo
    Membro Ativo

    Mensagens : 351
    Créditos : 27

    Re: [Pedido] Win HUD error dividide by 0

    Mensagem por イアゴル em Ter Maio 07, 2013 2:17 pm

    I think it's because im using a percent module on experience, if you know how fix post please ! thanks .


    _________________




    Haters? Haters gonna Hate!

    Gauthier99
    Iniciante
    Iniciante

    Mensagens : 33
    Créditos : 24

    Re: [Pedido] Win HUD error dividide by 0

    Mensagem por Gauthier99 em Ter Maio 07, 2013 2:32 pm

    Can I see your % module please ?


    _________________
    "My script doesn't work, I don't know why :/
    My script works, I don't know why ._."

    - All great scripters


    My Scripts :

    イアゴル
    Membro Ativo
    Membro Ativo

    Mensagens : 351
    Créditos : 27

    Re: [Pedido] Win HUD error dividide by 0

    Mensagem por イアゴル em Ter Maio 07, 2013 3:04 pm

    Gauthier99 escreveu:Can I see your % module please ?


    Código:
        # Valor Exp
        self.bitmap.font.color = Color.new(0,0,0)
        bitmap.font.name = "Arial Black"
        bitmap.font.size = 16
        exprect = Rect.new(-123, 25, self.bitmap.width - 8, 32)
        @exp_percent = $game_party.actors[0].now_exp*100/$game_party.actors[0].next_exp
        self.bitmap.draw_text(Rect.new(50,75,32,32), @exp_percent.to_s, 1)
        self.bitmap.draw_text(71, 75, 32, 32, "%")
        self.bitmap.font.color = Color.new(255,255,255)
        exprect2 = Rect.new(-124, 76, self.bitmap.width - 8, 32)
        self.bitmap.draw_text(Rect.new(49,74,32,32), @exp_percent.to_s, 1)
        self.bitmap.draw_text(70, 74, 32, 32, "%")


    _________________




    Haters? Haters gonna Hate!

    Gauthier99
    Iniciante
    Iniciante

    Mensagens : 33
    Créditos : 24

    Re: [Pedido] Win HUD error dividide by 0

    Mensagem por Gauthier99 em Ter Maio 07, 2013 4:42 pm

    I have edit the module. I don't know if it works so I post 2 new module :

    Código:
    # Valor Exp
        self.bitmap.font.color = Color.new(0,0,0)
        bitmap.font.name = "Arial Black"
        bitmap.font.size = 16
        exprect = Rect.new(-123, 25, self.bitmap.width - 8, 32)
        if $game_party.actors[0].next_exp == 0
          @exp_percent = 0
        else
          @exp_percent = $game_party.actors[0].now_exp*100/$game_party.actors[0].next_exp
        end
        self.bitmap.draw_text(Rect.new(50,75,32,32), @exp_percent.to_s, 1)
        self.bitmap.draw_text(71, 75, 32, 32, "%")
        self.bitmap.font.color = Color.new(255,255,255)
        exprect2 = Rect.new(-124, 76, self.bitmap.width - 8, 32)
        self.bitmap.draw_text(Rect.new(49,74,32,32), @exp_percent.to_s, 1)
        self.bitmap.draw_text(70, 74, 32, 32, "%")

    or

    Código:
    # Valor Exp
        self.bitmap.font.color = Color.new(0,0,0)
        bitmap.font.name = "Arial Black"
        bitmap.font.size = 16
        exprect = Rect.new(-123, 25, self.bitmap.width - 8, 32)
        if $game_party.actors[0].level == 99
          @exp_percent = 0
        else
          @exp_percent = $game_party.actors[0].now_exp*100/$game_party.actors[0].next_exp
        end
        self.bitmap.draw_text(Rect.new(50,75,32,32), @exp_percent.to_s, 1)
        self.bitmap.draw_text(71, 75, 32, 32, "%")
        self.bitmap.font.color = Color.new(255,255,255)
        exprect2 = Rect.new(-124, 76, self.bitmap.width - 8, 32)
        self.bitmap.draw_text(Rect.new(49,74,32,32), @exp_percent.to_s, 1)
        self.bitmap.draw_text(70, 74, 32, 32, "%")

    May be you have to re-create a new player profile.


    _________________
    "My script doesn't work, I don't know why :/
    My script works, I don't know why ._."

    - All great scripters


    My Scripts :

    イアゴル
    Membro Ativo
    Membro Ativo

    Mensagens : 351
    Créditos : 27

    Re: [Pedido] Win HUD error dividide by 0

    Mensagem por イアゴル em Ter Maio 07, 2013 6:08 pm

    I tried the seconde one and works, thanks +1 credits Wink Pode Trancar o Topico!


    _________________




    Haters? Haters gonna Hate!

      Data/hora atual: Qua Dez 07, 2016 9:09 pm