Thread: Max HP stops at 65535hp

Results 1 to 9 of 9
  1. #1 Max HP stops at 65535hp 
    Registered Member Versatile's Avatar
    Join Date
    Dec 2014
    Age
    26
    Posts
    433
    Thanks given
    247
    Thanks received
    9
    Rep Power
    9
    Where would I look to have my HP be more than 65535?
    I noticed this is the max for the byte. No idea where I would change the hp max though.

    if i try to make my hp to 65536, it'll instead be 0hp.
    same goes for if i put it to 65540, it'll instead be 4hp.
    Spoiler for Don't be a deadfool:
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Edit: 65535 is the maximum amount used in bytes. So you'll have to change the byte to something else.

    This might be usefull: https://docs.oracle.com/javase/tutor...datatypes.html
    Last edited by _Patrick_; 09-05-2018 at 03:25 PM.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2016
    Age
    27
    Posts
    392
    Thanks given
    19
    Thanks received
    61
    Rep Power
    68
    65535 is the maximum number in bytes, as patrick said.
    Thanks,
    Mikk
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Dec 2014
    Posts
    369
    Thanks given
    77
    Thanks received
    112
    Rep Power
    164
    What? 65535 is the maximum value of a short. Just change it to int
    Attached image
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Oct 2012
    Posts
    4,710
    Thanks given
    1,679
    Thanks received
    1,105
    Rep Power
    0
    Quote Originally Posted by Klem3n View Post
    What? 65535 is the maximum value of a short. Just change it to int
    A short has a maximum of 32768 bytes.
    Reply With Quote  
     

  6. #6  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by _Patrick_ View Post
    A short has a maximum of 32768 bytes.
    a signed short does, unsigned short is 65535 max, op use an int instead of short
    Reply With Quote  
     

  7. Thankful users:


  8. #7  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Oh my god I got autism from all of these comments jesus christ lol.
    A byte has a maximum value of 127/255(signed/unsigned). A byte carries 8 bits which is where the previously mentioned values derive from. 2^8-1.
    A short has a maximum value of 32767/65535(signed/unsigned). A short carries 16 bits which is where the previously mentioned values derive from. 2^16-1.

    My suggestion here is to use a medium rather than an int. There's no real reason to use an int, a medium can already carry values up to 16.777 million, that's more than enough.
    Attached image
    Reply With Quote  
     


  9. #8  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Just go through playerupdating and npcupdating masks and edit these:

    Code:
                    int hp = stream.readShort();
                    int maxHp = stream.readShort();
    To read an integer instead. You'll have to make the server send them as integers aswell.

    edit: yeah should use a medium-int instead as Kris suggested
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     

  10. Thankful user:


  11. #9  
    Registered Member Versatile's Avatar
    Join Date
    Dec 2014
    Age
    26
    Posts
    433
    Thanks given
    247
    Thanks received
    9
    Rep Power
    9
    Haha. Thanks guys.
    Spoiler for Don't be a deadfool:
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. error loading models stops at 81%
    By D-I-V-I-N-E in forum Help
    Replies: 2
    Last Post: 12-24-2009, 01:03 PM
  2. Replies: 10
    Last Post: 05-17-2009, 12:55 PM
  3. Client stops at "Connecting to Fileserver"
    By NICKname in forum Help
    Replies: 4
    Last Post: 04-22-2009, 08:24 PM
  4. STOP at lv 99?! HOW?!
    By ryannathans in forum Requests
    Replies: 16
    Last Post: 03-22-2009, 07:59 AM
  5. hp restores at 25%
    By Sway in forum Requests
    Replies: 6
    Last Post: 10-19-2008, 11:56 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •