Player XP
#2
Hello, welcome, and good luck.

The players should start with zero XP. Whatever XP level they get to, it should be stored once they leave the server, so when they come again, their XP is restored - just like regular vanilla server.
In order to test this, you'll probably need some way of setting and getting the player XP to verify, so you'll need to write cPlayer::SetExperience() and cPlayer::GetExperience(); note that vanilla splits the experience into several different variables (XpLevel, XpP, XpTotal), consider duplicating that behavior and having a separate get / set function for each variable, as well as a function to add experience (that will be called later when exp orbs are collected; it will do the calculation of the exp orb value against current level)
http://minecraft.gamepedia.com/Player.dat_format should be helpful with the Xp* variables, http://minecraft.gamepedia.com/XP has the level calculations.

Once you add the Get / Set functions, I can help you make them Lua-exported, and you can write a testing command in the Debuggers plugin, so that you can call those functions in-game, for testing.
Reply
Thanks given by: marmot21


Messages In This Thread
Player XP - by marmot21 - 11-12-2013, 04:54 PM
RE: Player XP - by xoft - 11-12-2013, 05:09 PM
RE: Player XP - by xoft - 11-13-2013, 08:11 PM
RE: Player XP - by marmot21 - 11-14-2013, 04:57 AM
RE: Player XP - by xoft - 11-14-2013, 07:57 AM



Users browsing this thread: 2 Guest(s)