Jump to content

LUA get XP value


NoHero

Recommended Posts

I was originally asked to modify a autolevel lua script seen the same script in slight different forms around the internet. Thing is both in the original scrip and my modified one i get the same problem:

 

return et.gentity_get(pID, "ps.persistant", 0)

 

returns 0 when the players XP is not 0.

 

Is ps.persistant the right fieldname for XP? I bypassed this section of code and everything else in my script works last nail to be done before implementing it.

Link to comment
Share on other sites

  • Management

Here is our documentation of Lua http://mygamingtalk.com/wiki/index.php/Silent_Lua#gentity_get. If following it doesn't result correct output, there is a bug. The index 0 is indeed correct index for the score within the ps.persistant.

 

Please provide a full test case script that is able to reproduce the issue as a bug report. Include only what is relevant to the issue.

Link to comment
Share on other sites

If I remember correctly xp will show as 0 until at least one xp is gained in the round/map. (Bugged the hell out of me when testing) This was a long time ago though when I was testing on etpub, so I am unsure if this is still the case in silent mod.

Thanks, that was messing me up everything was working i just didn't realise ^^

Edited by NoHero
Link to comment
Share on other sites

  • Management

Additionally, the "ps.persistant" is probably not a good way to get the score. The better way to get the XP should be to calculate "sess.skillpoints" array values together. This way it won't be necessary to check if the player is in a team, dead or if he is speccing and the returned result will be correct. The ps (playerstate) values depend a lot on what the player is doing.

Link to comment
Share on other sites

Additionally, the "ps.persistant" is probably not a good way to get the score. The better way to get the XP should be to calculate "sess.skill" array values together. This way it won't be necessary to check if the player is in a team, dead or if he is speccing and the returned result will be correct. The ps (playerstate) values depend a lot on what the player is doing.

Thanks for the tip, i will definitely use it since my next project will need to get XP again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...