Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Knoman Knoman is offline
Developer Last Online: Jun 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 10-29-2001 Last Update: Never Installs: 237
 
No support by the author.

After my rantings in the other thread about people posting my codes, I've decided to forget everything that happen and post my version of the EXP/HP/MP hack. Most people will not need this hack because it will only apply to gaming forums; specifically RPG forums.

This hack works in such a way that:

HP drops and rises according to the members activeness.
MP determins how long a user has been with the forums, and how active they are.
EXP determins how close a user is to reaching the next level.

EDIT: To prevent non-legit vb owners from installing this hack, I have removed it from this post. Instead, just scroll down to Neo's post in this thread and download the file.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 11-23-2001, 09:44 PM
Logtenberg Logtenberg is offline
 
Join Date: Nov 2001
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What line(s) do I modify so that members require more posts to increase to a new level.

Some of my members have made 300+ posts and they are at level 16 with the current hack.

I would prefer if they would only be at say... level 8.

Once the levels start getting in the double digits, it looses it's appeal for me. So I would like it to be harder (require more posts) for members to get a new level.

Thanks!!

PS - I am also interested in having the stats (level specifically) on the members profile. Any idea what needs to be done there?
Reply With Quote
  #73  
Old 11-24-2001, 12:20 AM
winston winston is offline
 
Join Date: Oct 2001
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It worked finein the 2.20 but now in 2.21 it displays all wierd like no exp on a 1100 post user
and the userlevel is like 1.112332243243
I copied andpasted it perfectly in admin/ functions.php
Reply With Quote
  #74  
Old 11-24-2001, 03:21 AM
|DarkManX|'s Avatar
|DarkManX| |DarkManX| is offline
 
Join Date: Oct 2001
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i think a breakdown of what HP, MP, and EXP are would be very good....


i have members wondering how it works exactly also
Reply With Quote
  #75  
Old 11-24-2001, 10:18 AM
fonzerelli_79's Avatar
fonzerelli_79 fonzerelli_79 is offline
 
Join Date: Nov 2001
Posts: 259
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have removed this hack but when i did you it i had a link to my faq3 and i put

<p>You have probably noticed the coloured bars at the side of each post, just below the member's avatar. This is our graphical system which lets you see how active and experienced a member is.</p>
<p>The bars represent :
<ul><li><font color="red">The Red Bar </font>: Drops and rises according to the members activeness.</li>
<li><font color="green">The Green Bar </font>: Determines how long a user has been with the forums, and how active they are. </li>
<li><font color="blue">The Blue Bar</font> : Determines how close a user is to reaching the next level.</li></ul>
</p>

I hope this helps you out winston
Reply With Quote
  #76  
Old 11-24-2001, 10:29 AM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just look at the code for an explanation of how it's worked out. All the maths is in there and is reasonably easy to work out most of it, even if you are not a coder.

Code:
$level = pow (log10 ($post[posts]), 3);
$ep = floor (100 * ($level - floor ($level)));
$showlevel = floor ($level + 1);
$hpmulti =round ($postsperday / 6, 1);
if ($hpmulti > 1.5) {
$hpmulti = 1.5;
}
if ($hpmulti < 1) {
$hpmulti = 1;
}

$maxhp = $level * 25 * $hpmulti;
$hp= $postsperday / 10;
if ($hp >= 1) {
$hp= $maxhp;
} else {
$hp= floor ($hp * $maxhp);
}

etc...........................
Though I would appreciate an "english" explanation of it myself, as I can't follow all the maths in the code and don't understand why some of the variables have been set at the numbers they are at.
Reply With Quote
  #77  
Old 11-24-2001, 03:38 PM
|DarkManX|'s Avatar
|DarkManX| |DarkManX| is offline
 
Join Date: Oct 2001
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yea, i don't really get that either.....

plain english would be good
Reply With Quote
  #78  
Old 11-30-2001, 02:50 AM
Knoman's Avatar
Knoman Knoman is offline
 
Join Date: Oct 2001
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let's break it down to simple English, shall we?

$level = pow (log10 ($post[posts]), 3);
This is a simple logarithm that will calculate the how much post a member needs in order to get to the next level. This is the engine that will control all other calculations. Now, I've cubed it so leveling resembles Final Fantasy; where the max level is 99. If you are into D&D, squaring the formula would be best, requiring a lot of post before a user can reach level 20. In short, the higher the exponent, the quicker it is to level up.

$ep = floor (100 * ($level - floor ($level)));
This is the basis for the Experience system. What i did here, was take the remainder (or mod) from the Level logarithm and converted it to a percentage. I wasnt sure if PHP had a MOD function, so I did it the hard way.

$showlevel = floor ($level + 1);
I cant have a user with level zero, but i didnt want to affect the engine with a false number either. So, I created another variable $showlevel and added 1, which will only be used to show users, and wont affect the calculations.

$hpmulti =round ($postsperday / 6, 1);
if ($hpmulti > 1.5) {
$hpmulti = 1.5;
}
if ($hpmulti < 1) {
$hpmulti = 1;
}
This code here was to add to the randomness. This is my HP bonus multiplier. I took the post per day and divided by six and rounded it to the tenths decimal. I use a few IF functions to prevent it from being too high and too low.

$maxhp = $level * 25 * $hpmulti;
Determins the Max HP. Not much to be said here, 25 just seem to be a nice number.

$hp= $postsperday / 10;
If a person couldnt perform a ten post per day average, HP will drop.

if ($hp >= 1) {
$hp= $maxhp;
} else {
$hp= floor ($hp * $maxhp);
}
Sets the limit on how high your HP will go. Keeps it at or under the Max HP

$hp= floor ($hp);
$maxhp= floor ($maxhp);
HP calcualations are down. Rounding down for viewing sake.

if ($maxhp <= 0) {
$zhp = 1;
} else {
$zhp = $maxhp;
}
Debugs the Divide by Zero error.

$hpf= floor (100 * ($hp / $zhp)) - 1;
Is used in the templates.

$maxmp= ($jointime * $level) / 5;
Determins Max MP. Again, the 5 just seems right.

$mp= $post[posts] / 3;
Determins MP, not sure why I chose to do what I did, but it works. This is the reason why MP is still a mystery to my members and even to me.

if ($mp >= $maxmp) {
$mp = $maxmp;
}
Keeps MP from going above its max.

$maxmp = floor ($maxmp);
$mp = floor ($mp);
MP calculations done. Rounding down.

if ($maxmp <= 0) {
$zmp = 1;
} else {
$zmp = $maxmp;
}
Debugs the divide by zero error.

$mpf= floor (100 * ($mp / $zmp)) - 1;
Is used in the templates.
Reply With Quote
  #79  
Old 11-30-2001, 09:34 AM
Meta's Avatar
Meta Meta is offline
 
Join Date: Nov 2001
Location: Germany (north)
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, Knoman ... lovely hack!


Afterlab ... i found a way to get it into the members profile. See how i did it in the member.php:

PHP Code:
  $userinfo[avatarurl]=getavatarurl($userinfo[userid]);
  if (
$userinfo[avatarurl]=="") {
    
$userinfo[avatarurl]="images/clear.gif";
  }

// start levelhack
$level pow (log10 ($userinfo[posts]), 3); 
But it also needs a little finetuning ... e.g. change variable-names like

PHP Code:
 $posts[posts
in

PHP Code:
 $userinfo[posts
and so on.


Maybe this helps you. If not and you encounter problems feel free to ask. But the hardest thing (for me) was to find the right place in member.php ... the finetuning isn't hard.


Nice hack, Knoman, did i mention it? Thank you!
Reply With Quote
  #80  
Old 12-01-2001, 07:37 AM
afterlab's Avatar
afterlab afterlab is offline
 
Join Date: Oct 2001
Location: Dallas, TX
Posts: 327
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks meta, that worked. I mixed it up a bit too in my profile. Cya around.
Reply With Quote
  #81  
Old 12-01-2001, 08:22 PM
sctsnipe's Avatar
sctsnipe sctsnipe is offline
 
Join Date: Nov 2001
Location: Coral Springs
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have 2.2.1, and i cant find that first line we need, the 'if ($post' thingy, any help? I looked in showthread.php!
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. The time now is 09:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04876 seconds
  • Memory Usage 2,321KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete