vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   RPG Integration Hack (https://vborg.vbsupport.ru/forumdisplay.php?f=102)
-   -   RPG Integration Hack - Old Support Thread (https://vborg.vbsupport.ru/showthread.php?t=73868)

rinkrat 09-30-2004 07:47 PM

My site has been going slow since I added this hack and I'm not real sharp on queries but one of my tech guys sent me a list from the logs saying there are a ton of queries in showthread.php, including a lot of RPG stuff. Any way I can clear out some of this stuff and speed things up a bit because I'm getting server busy with only 50 people online? (He says the LEFT JOIN's at the bottom are killing me)

Code:

From showthread.php:
SELECT
post.*, post.username AS postusername, post.ipaddress AS ip,
user.*, userfield.*, usertextfield.*,
user.ma AS uma,user.hp AS uhp,user.pp AS upp,user.ap AS uap,".TABLE_PREFIX."rpg_battle_options.namefield,".TABLE_PREFIX."rpg_battle_options.exprate,".TABLE_PREFIX."rpg_battle_options.privacy AS battleprivacy,".TABLE_PREFIX."rpg_items_user.*,".TABLE_PREFIX."rpg_battle_stats.*,".TABLE_PREFIX."rpg_rpg_race.name AS rpgracename,".TABLE_PREFIX."rpg_rpg_race.alignment AS rpgalignmentname,".TABLE_PREFIX."rpg_rpg_classf.name AS fclassname,
".TABLE_PREFIX."rpg_rpg_classf.folder AS fclassfolder,".TABLE_PREFIX."rpg_rpg_classm.name AS mclassname,".TABLE_PREFIX."rpg_rpg_classm.folder AS mclassfolder,".TABLE_PREFIX."rpg_rpg_element.name AS elename,
" . iif($forum['allowicons'], 'icon.title as icontitle, icon.iconpath,') . "
" . iif($vboptions['avatarenabled'], 'avatar.avatarpath, NOT ISNULL(customavatar.avatardata) AS hascustomavatar, customavatar.dateline AS avatardateline,') . "
" . iif($vboptions['reputationenable'], 'level,') . "
" . iif(!$deljoin, 'NOT ISNULL(deletionlog.primaryid) AS isdeleted, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,') . "
editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason,
post_parsed.pagetext_html, post_parsed.hasimages,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
" . iif(!can_moderate(), $datastore['hidprofilecache']) . "
FROM " . TABLE_PREFIX . "post AS post, ".TABLE_PREFIX."rpg_battle_options, ".TABLE_PREFIX."rpg_items_options
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN ".TABLE_PREFIX."rpg_items_user ON ".TABLE_PREFIX."rpg_items_user.userid=user.userid
LEFT JOIN ".TABLE_PREFIX."rpg_battle_stats ON ".TABLE_PREFIX."rpg_battle_stats.userid=user.userid
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_classf ON ".TABLE_PREFIX."rpg_rpg_classf.id=user.rpgclass
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_classm ON ".TABLE_PREFIX."rpg_rpg_classm.id=user.rpgclass
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_element ON ".TABLE_PREFIX."rpg_rpg_element.elementid=user.element
LEFT JOIN ".TABLE_PREFIX."rpg_rpg_race ON ".TABLE_PREFIX."rpg_rpg_race.raceid=user.rpgrace AND ".TABLE_PREFIX."rpg_rpg_race.alignmentid=user.alignment
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
" . iif($forum['allowicons'], "LEFT JOIN " . TABLE_PREFIX . "icon AS icon ON(icon.iconid = post.iconid)") . "
" . iif($vboptions['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") .
iif($vboptions['reputationenable'], " LEFT JOIN " . TABLE_PREFIX . "reputationlevel AS reputationlevel ON(user.reputationlevelid = reputationlevel.reputationlevelid)") . "
" . iif(!$deljoin, "LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND deletionlog.type = 'post')") . "
LEFT JOIN " . TABLE_PREFIX . "editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN " . TABLE_PREFIX . "post_parsed AS post_parsed ON(post_parsed.postid = post.postid)
WHERE $postids
ORDER BY dateline $postorder


Blam Forumz 09-30-2004 08:03 PM

Quote:

Originally Posted by Revan
Just alter the SQL to have Dropdown as default, and then remove the Choose stuff from the template AND the php

And how would i go about doing that ? :|

Revan 10-01-2004 02:12 PM

Quote:

Originally Posted by RMS
Ah, this isn't a big deal but what I meant was is there a way to get a link to display stats in the profile that anyone can see of a certain person? I have the link in the usercp but currently the only way to see another person's character is to find a thread he posted in and then look it up there.

No theres no such mod available atm. :)

Quote:

Originally Posted by RMS
Sorry if this has been asked before but is there a reason that classes are based upon gender? Maybe I'm just not clear on it but it seems that this isn't very useful. Races are based on alignment so in turn it would be nice to have classes that are exclusive to certain races. Is this possible?

What I would like to do is for example do something like make a race of dwarves where if you choose them you can then only choose a class that is proficient in melee and not magic. The way I see it now is that no matter your alignment or race, you can be pretty much any class that is availalable. This way I can't even divide it so that only the default race of orcs can only be black mages. Personally I find it a bit contradictory to allow good people to be a black mage.

At the very least is there any real purpose to creating more class types other than to organize things better?

Is this just the way it is, am I mistaken or is there a way to fix this?

The main reason to have Class Types is that you can limit the ITEMS each class can use.

Theres currently no way of seperating races by alignment. It would also be impossible to both seperate by alignment AND gender (afaik).
Redesigning this would mean having to mess about with JavaScript, which I dont know ANYTHING about, so no can do :(

Quote:

Originally Posted by RMS
Also I seem to have a problem. After battles (and maybe something else) it seems that some or all characters have their max MP and PP calculated incorrectly, making it become some huge number. When I was level one I could go to my character edit screen and update it which would fix it. Now even when I do that nothing happens. :surprised:

Weird. You could try lowering the MA and PP modifiers in the acp, then update stats.
Recommended values for versions < 2.5.3 is 0.003
:)


Quote:

Originally Posted by rinkrat
My site has been going slow since I added this hack and I'm not real sharp on queries but one of my tech guys sent me a list from the logs saying there are a ton of queries in showthread.php, including a lot of RPG stuff. Any way I can clear out some of this stuff and speed things up a bit because I'm getting server busy with only 50 people online? (He says the LEFT JOIN's at the bottom are killing me)

If you know any other way of merging all those different tables that uses less query time, do let me know ;)


Quote:

Originally Posted by Blam Forumz
And how would i go about doing that ? :|

1. Open profile.php and pick out all that has anything to do with rpgpostbit, namely:
PHP Code:

        if ($bbuserinfo['rpgstats'] == 1)
        {
            
$rpg_postbit1 '<input type="radio" name="rpgpostbit" value="1" CHECKED /> Display RPG stats in postbit';
            
$rpg_postbit2 '<input type="radio" name="rpgpostbit" value="0" /> Display RPG stats in dropdown';
        } 
        else if (
$bbuserinfo['rpgstats'] == 0
        {
            
$rpg_postbit1 '<input type="radio" name="rpgpostbit" value="1" /> Display RPG stats in postbit';
            
$rpg_postbit2 '<input type="radio" name="rpgpostbit" value="0" CHECKED /> Display RPG stats in dropdown';
        } 

and
PHP Code:

rpgstats='$rpgpostbit' 

Then pick out the stuff that shows the $rpg_postbit variables, the entire table preferrably :P

Then run this:
[sql]
ALTER TABLE `user` CHANGE `rpgstats` `rpgstats` CHAR( 1 ) DEFAULT '0' NOT NULL ;
UPDATE `user` SET `rpgstats`='0';
[/SQL]
Remember to add a prefix if you use it.

TJFweb 10-01-2004 02:35 PM

Revan: Any ETA on v3?

I check this thread every day in anticipation ;-)

RMS 10-01-2004 04:51 PM

Ah thanks. Indeed if the MA and PP modifiers should be something around .003 then my values were a bit off. I think they were default but I had 2 and 3. So far it seems to be fixed :)

Revan 10-01-2004 04:55 PM

Quote:

Originally Posted by TJFweb
Revan: Any ETA on v3?

I check this thread every day in anticipation ;-)

About 3-4 months would probs not be too far off the mark.

rinkrat 10-01-2004 07:42 PM

I removed the RPG stats in postbit and it seems to have speeded up things dramatically.

starfantazy 10-02-2004 03:37 AM

could you let me know when you get the female part of the hack fixed..... i really want to use it and im one of the few that cant, its such a tease :nervous: haha

Revan 10-02-2004 07:56 AM

I would send you the alpha build of the "new feature-less" v3 once I get the acp done redesigned, but I dont want to upload it anywhere and link to it in PM, and I most def dont want to attach it here cos I dont want everyone grabbin it
lol
:p

Blam Forumz 10-02-2004 09:38 AM

Wanna send it to me? my board is so small it almost doesnt exist :P

Blam Forumz 10-02-2004 09:50 AM

Anyway of making it so in the itemshop everything is always expanded?

thanks again

Revan. you own!

Revan 10-02-2004 01:49 PM

Quote:

Originally Posted by Blam Forumz
Anyway of making it so in the itemshop everything is always expanded?

thanks again

Revan. you own!

To make it expand by default:
PHP Code:

//Find:
OR $expandall == 1)

//change to:
OR $expandall == 0

(note that this code comes from v3 so if you dont get a perfect match, search manually. Its under the "get cats" section.)

Note that you should, in the template, remove the Expand All Generic Items link, because this will now contract the cats instead.
:)

Blam Forumz 10-02-2004 02:24 PM

Thank you :D

Also, just need to know something about v3, will the admincp stuff be easier to navigate?

as in you dont have to manually type in what image for a weapon etc, so its a drop down instead :d

thanks

Blam Forumz 10-02-2004 03:16 PM

Also, is it possible to make it so the rpg pages are actually inside tables (like on the uStore hack)

thanks

again

Blam Forumz 10-02-2004 03:26 PM

Omg another post by me, can you make it so only certain elements can have items?

Revan 10-02-2004 07:44 PM

Quote:

Originally Posted by Blam Forumz
Thank you :D

Also, just need to know something about v3, will the admincp stuff be easier to navigate?

as in you dont have to manually type in what image for a weapon etc, so its a drop down instead :d

thanks

The admincp wont be any in particular EASIER to navigate, it will just look heaps better and the Edit Items will be much less SQL intensive for large item stocks ;)
Theres no way in unholy feck to have a dropdown, dya mind explaining how you would add new weapon images and actually USE them without altering hardcoded dropdown? ;)
I rest my case :p


Quote:

Originally Posted by Blam Forumz
Also, is it possible to make it so the rpg pages are actually inside tables (like on the uStore hack)

thanks

again

If that is possible then I wouldnt know, as Im no HTML person.
If it doesnt have $ infont of it, then I dont know it ;)


Quote:

Originally Posted by Blam Forumz
Omg another post by me, can you make it so only certain elements can have items?

Nope and I dont think Ill be adding that either, at least not for the imminent version lol :lick:

RMS 10-02-2004 07:58 PM

I could be mistaken on this but from a bunch of battles I've watched, it seems that when people try to use weapons they actually manage to hit less often than when they simply try to punch. Is it supposed to be like this or am I just wrong?

I figure since weapons just increase the amount of damage done it shouldn't really have any affect.

Revan 10-02-2004 08:46 PM

Quote:

Originally Posted by RMS
I could be mistaken on this but from a bunch of battles I've watched, it seems that when people try to use weapons they actually manage to hit less often than when they simply try to punch. Is it supposed to be like this or am I just wrong?

I figure since weapons just increase the amount of damage done it shouldn't really have any affect.

Im unsure of the level of randomness in the hit chance of weapons and fists, but as long as the opponent got an armor, then theres a risk of getting your fist hurt :p
Besides its easier to jump away if someone runs after you with a broadsword than it is to dodge if someone whacks you in the head with their fists ;)

Warlord 10-03-2004 07:22 PM

My edit/update RPG Info isn't working anymore.. just loads forever and brings up a blank screen. Any ideas?

Revan 10-03-2004 08:04 PM

The infamous "Female Class" bug....
On some servers where PHP is compiled wrong, selecing Female class will feck up yer edit rpg info page...

Not much I can do about that sadly.
However for unknown reasons, this bug is gone in the current v3 build... :ermm:

Warlord 10-03-2004 08:04 PM

And I checked to see if the RPG templates somehow got wiped, and they're still there. Just to make sure I didn't miss any I re-uploaded the templates.xml.. but still no luck

Warlord 10-03-2004 08:45 PM

When will the v3 upgrade be ready? My RPG has kind of come to a grinding halt until I get this option fixed... as it's pretty important to define your character to battle people.

Revan 10-04-2004 09:19 AM

As Ive said the FINAL will not be out until long, but if so many are having problems I might just release a "v3 Lite" that has no new features (cos they arent coded yet :p)...
Ill just get the rest of the ACP phrased and secured.
:)

TJFweb 10-04-2004 12:33 PM

Quote:

Originally Posted by Revan
As Ive said the FINAL will not be out until long, but if so many are having problems I might just release a "v3 Lite" that has no new features (cos they arent coded yet :p)...
Ill just get the rest of the ACP phrased and secured.
:)

Will the v3 Lite have new templates? If so I think it will be a good idea because people can test it out and give you feedback on it before you release a final. Like a BETA version (but better :) ).

What are the new features which will be missing from the lite version which we can expect in the final version?

Revan 10-04-2004 01:02 PM

As it appears now, the lite will not have new templates, as all my sources for template redoing has dried out :(

And features that can be expected, Id like as few people as possible to know. I like to surprise y'all ;)

Tri@de 10-04-2004 01:24 PM

There's a way to block changing class, race etc after the char reached a certain level?

Blam Forumz 10-04-2004 02:39 PM

Quote:

Originally Posted by Revan
As it appears now, the lite will not have new templates, as all my sources for template redoing has dried out :(

And features that can be expected, Id like as few people as possible to know. I like to surprise y'all ;)

hope you've included most of my ideas :D

TheElf 10-04-2004 04:26 PM

If you installed this hack, go to profile PHP, look for:

PHP Code:

$DB_site->query("UPDATE ".TABLE_PREFIX."userfield SET $rpgfield=' $_POST[rpgname]' WHERE userid='$bbuserinfo[userid]'"); 

And replace with:

PHP Code:

$DB_site->query("UPDATE ".TABLE_PREFIX."userfield SET $rpgfield='".addslashes$_POST[rpgname])."' WHERE userid='$bbuserinfo[userid]'"); 

Why? if the RPG name contains ' that creates an error, but if you also add ; to end the current SQL query after it, start a new query and after that another one just to have a good place for rest of the string... Now that can be real bad. Hope no typos in the code here. (check all other rpg hack specific variables for the same problem)

Revan 10-04-2004 05:22 PM

...or maybe I DONT have to post a fix in the thread
XD

what I can do is recompile the zip and post an addon with this fix :p

Dyntheos 10-05-2004 11:24 AM

Well I've finally reached the point where I am completely done on every aspect of the hack apart from items.

I can't edit any of them, as at this stage it crushes the site, I am just waiting on that portion of the admin cp where I can edit items outside the main table, as currently I am looking at over 400 or so items that have been made for the rpg, and all those on one table would be suicide for the site, currently I only have about 20 and that drops things pretty badly even when changing a stock number on one item.

So.. Revan i eagerly await your admin cp update so I can start playing this thing :p

Revan 10-05-2004 03:10 PM

Hopefully you dont have hundreds of items under one specific category, cos all this does is seperate each category :p
I tried to do a break operation countermeasure in case you do have hundreds in one category, but I couldnt find a way to make a "second page" so you could actually edit the others... meh

Ill put this problem up in the dev board, maybe someone in team knows howto :)

Dyntheos 10-05-2004 10:12 PM

thanks revan. I think the most in one cat will be a hundred and thats the weapons cat

Rahzel_hx 10-06-2004 01:36 AM

When does the next major update come out ^.^ btw hack wroks fine for me still XD no errors

Revan 10-06-2004 01:42 PM

Next version wont be out till long time, but anyways:

Ive sent out an email with an update to everyone who has problems with the profile.php timing out, and Im gonna go post it in the addons post for these cheap mofos that wouldnt click install.
;)

TheRealFragger 10-06-2004 04:32 PM

how much xp for each lvl?

Blam Forumz 10-06-2004 04:55 PM

Hey Revan!11!

I dare you to make many a items with stats for boards with lazy owners such as me :D

High stats preferable :P

also

Moar ideas!!!

Character / Spell / Item animations?
Drop down for item image select in admincp (you dont have to hardcode it, Petz has it :P (I dont use petz so :P))
Pre-Made Spells
Easier Control in admincp kinda like this

Item Create Section

Item Name : [Box for item name]
Other stuff : [Box for other stuff]
Other stuff : [Box for other stuff]
Other stuff : [Box for other stuff]

:d

korny 10-07-2004 03:33 AM

Sorry, this question may have been asked and anwser once before, but I have my weapons set to be in battle mode and not in non-battle. For some reason, everytime we use a weapon....we miss. We have not been able to hit with weapons at all, just punching. Am I missing something in the RPG settings? I can't seem to find it if I am.

Thanks again

korny 10-07-2004 03:44 AM

Quote:

Originally Posted by Revan
I edited my sig, so perhaps you see your answer more clearly now ;)


Which addon/hotfix is it?

If its the [vB 3.0.3] - User select RPG postbit.txt, how do I do the first thing "ALTER TABLE `user` ADD `rpgstats` CHAR(1) NOT NULL DEFAULT '1';" I'm not a SQL guy, so let me know what I need to do.

Thanks again.. ;)

Blam Forumz 10-07-2004 06:09 AM

In the admincp, weapons are set to be non-battle items, change them like i did :D

Revan 10-07-2004 10:16 AM

Quote:

Originally Posted by korny
Which addon/hotfix is it?

If its the [vB 3.0.3] - User select RPG postbit.txt, how do I do the first thing "ALTER TABLE `user` ADD `rpgstats` CHAR(1) NOT NULL DEFAULT '1';" I'm not a SQL guy, so let me know what I need to do.

Thanks again.. ;)

You can run it through "execute SQL query" in your acp, provided you have the neccesary permissions in config.php :)


Quote:

Originally Posted by Blam Forumz
Hey Revan!11!

I dare you to make many a items with stats for boards with lazy owners such as me :D

High stats preferable :P

also

Moar ideas!!!

Character / Spell / Item animations?
Drop down for item image select in admincp (you dont have to hardcode it, Petz has it :P (I dont use petz so :P))
Pre-Made Spells
Easier Control in admincp kinda like this

Item Create Section

Item Name : [Box for item name]
Other stuff : [Box for other stuff]
Other stuff : [Box for other stuff]
Other stuff : [Box for other stuff]

:d

Nah I wont make an items list, but I will make a way to import/export items lists, so others can make for you (you lazy bastard) ;)
I been told that dropdown for the image selecting adds high loading times cos its much html, so I prefer to write an extensive Admin Help section that covers all the pre-made items.
Pre-made spells, same answer as item list lol
And that easier control in acp... not sure I know what you mean but that setup looks like the way it will be.
:)


Quote:

Originally Posted by korny
Sorry, this question may have been asked and anwser once before, but I have my weapons set to be in battle mode and not in non-battle. For some reason, everytime we use a weapon....we miss. We have not been able to hit with weapons at all, just punching. Am I missing something in the RPG settings? I can't seem to find it if I am.

Thanks again

Well, that is a rare problem... hit chances are calculated based on Speed and Evade, but I will take a look at the calculations before v3 is out :)


All times are GMT. The time now is 02:28 AM.

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.02288 seconds
  • Memory Usage 1,872KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (5)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete