Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-07-2009, 03:59 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
Resetting player stats

Ive been using that add on for the control npc to reset stuff, have .txt to join, add weapons, ect ect on player start up. I was wondering, how do you completely reset the players spar rating?

PHP Code:
  this.resetVars = { 
                     { 
"kills", 0 }, 
                     { 
"deaths", 0 },
                     { 
"rating", 1500 },
                     { 
"client.frozen", false } 
                   }; 
} 
Thats what I use, and ive tried putting in 1500/350, but it doesnt work. Need to reset the right side back to 350 as well.
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #2  
Old 11-07-2009, 05:16 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Not quite sure what these do, but they look promising, especially the second.

PHP Code:
updateratingdeviation(float, float) - returns float - old deviation, time of last spar, returns new deviation
updateratings
(obj) - returns object - updates an array of {rating1,ratingdeviation1, rating2,ratingdeviation2, ...}, init them at 1500 and 350 
__________________
Reply With Quote
  #3  
Old 11-07-2009, 05:33 AM
sssssssssss sssssssssss is offline
Cyril Rain
sssssssssss's Avatar
Join Date: May 2003
Location: Texas, USA
Posts: 1,134
sssssssssss will become famous soon enough
woa, what is a rating deviation?
__________________
Cyril Rain
Creator and leader of SLX
Admin of Elysium
Elysium's Facebook Page: http://facebook.com/GraalOnlineElysium
Graal Forum Thread: http://forums.graalonline.com...
Graalians Thread: http://www.graalians.com...


Reply With Quote
  #4  
Old 11-07-2009, 06:25 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
You'll need to study statistics a bit to fully grasp the concept (see http://en.wikipedia.org/wiki/Standard_deviation).

Basically, spar ratings in Graal work like this:
NPC Code:
(recent wins VS recent loss)
over
(recent # of spars)


Except, each is weighed a bit.



updateratings and updateratingdevation don't work on a player object, they only provide a means to "emulate" a spar win or spar loss on a player, and return the values which you then set on the player.

The cool thing is that you can even simulate a 3-person-spar or a 4-person spar with that.



To simply set the rating / rating deviation on a player:
PHP Code:
player.rating = 1500;
player.ratingd = 350; 
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.