Mys 1.3.4 Alchemy Mod

Forum
Last Post
Threads / Messages
Uhmm sorry but I have some troubles, I am still unable to install this alchemy thing. I have created the tables already and downloaded the file, and have not done any other Mods to the site as of yet, any help or reasons why it did not work?
 
I'm having a problem with this mod. After adding it, using an item on a pet just leads to a pure white /uses page.
 
Well I've had the idea of working on an alchemy system since the initial Mys v1.3.0 release, but did not carry out for numerous reasons. Now I finally decided to give it a try and it took me only about 4-5 hours.

The idea of Alchemy is to mix two or more old items(called ingredients) to create a new item, which is normally rarer and more valuable(otherwise it does not justify the economics lol). The Alchemy Mod allows you to achieve just that, you can create some items that are rare or even impossible to obtain without performing alchemy. This will make your site considerably more interesting to a good number of your users, it also offers incentives for the act of item collection.

Below is a screenshot of the basic alchemy page, which allows you to choose two items to produce a new one. Note at this time being only two items can be used to produce a new item, there is no way to mix more than two:
2lxckkg.jpg


This mod also comes with ACP integration, in which the admins can create alchemy practices that allow users to create new items from the old ones. Admins can also manipulate the settings for Alchemy System on their sites. The entire system can be turned on/off at will, while admins can specify whether alchemy success chance is 100% always or less. Other settings such as cost of action, recipe/license requirement for performing alchemy are also configurable.

To install the mod, simply run the installer script located at yoursite.com/install/alchemy.php. If your site is in a subdirectory, just change the example url accordingly. I assume you all know what I mean by this so I wont explain further.

If you have a brand new site or have never ever modified any part of the script, you may simply download the .rar file I provided and uploading them to your server through ftp. If the only changes you made are the mods I've offered lately(gender ratio and item drop), you may give a try just uploading the files as well as good chance my mods are compatible with each other.

However, for advanced users who have heavily modified sites, you will need to make some changes manually. I will post a brief description on how to do that in the next post.

At last, I hope you enjoy the new mod I've made for Mys v1.3.4, unlike the old ones like gender ratio which were simply revised to be compatible with the new version. You can edit the alchemy system to as you wish, maybe altering its user interface or adding more functionality(such as multiple item mix rather than just two), its all up to you.

Hall of Famer
I am having some trouble with the alchemy mod.
I unzipped the folder and put install/alchemy.php and its a blank screen
 
I ran the installer script and got:
Warning: require(../inc/config.php) [function.require]: failed to open stream: No such file or directory in /home2/luteus/public_html/imaginea.net/caveofcrystals/classes/class_initializer.php on line 97

Warning: require(../inc/config.php) [function.require]: failed to open stream: No such file or directory in /home2/luteus/public_html/imaginea.net/caveofcrystals/classes/class_initializer.php on line 97

Fatal error: require() [function.require]: Failed opening required '../inc/config.php' (include_path='.:/opt/php53/lib/php') in /home2/luteus/public_html/imaginea.net/caveofcrystals/classes/class_initializer.php on line 97

Any idea what's going on?
 
Have you attempted the fix already posted inside this thread? That is, manually installing? Read through the entire thread before proceeding and then if that doesn't work, come back. I don't use this mod myself but I can try to help but only if you've already tried the help already posted.
 
Okay, I did the whole super-manual thing, and it seemed to work. But then I went to the alchemy page, and got this:
Fatal error: Uncaught exception 'LanguageException' with message 'Language var alchemy_title does not exist.' in /home2/luteus/public_html/imaginea.net/caveofcrystals/classes/class_language.php:68 Stack trace: #0 /home2/luteus/public_html/imaginea.net/caveofcrystals/view/inventoryview.php(162): Language->__get('alchemy_title') #1 /home2/luteus/public_html/imaginea.net/caveofcrystals/classes/class_frontcontroller.php(100): InventoryView->alchemy() #2 /home2/luteus/public_html/imaginea.net/caveofcrystals/index.php(74): FrontController->render() #3 /home2/luteus/public_html/imaginea.net/caveofcrystals/index.php(78): IndexController::main() #4 {main} thrown in /home2/luteus/public_html/imaginea.net/caveofcrystals/classes/class_language.php on line 68

I then went in and added this to the bottom of /lang/lang_inventory.php:
Code:
$lang['alchemy_title'] = "Welcome to the Alchemy Service";
$lang['alchemy'] = "Here you can use the powerful alchemy system to merge two of your items to produce a new item, whether brand new or not. 
                    Fill in the form below to start using this service we offer, you may find plenty of surprises!";
$lang['alchemy_choose'] = "To begin with, select the first ingredient item from the list: ";
$lang['alchemy_choose2'] = "Now select the second ingredient item from the list: ";
$lang['alchemy_disabled'] = "Unfortunately the admin has disabled the Alchemy System for this site, you may send him/her a message for more information.";
$lang['alchemy_success'] = "Congratulations!";
$lang['alchemy_newitem'] = "You have successfully produced a new item "; 
$lang['alchemy_newitem2'] = " by using Alchemy, sweet isnt it? You may now manage it in your inventory, or continue to use the alchemy system.";
$lang['alchemy_invalid'] = "The specified item combination is invalid, it does not produce a new item...";
$lang['alchemy_empty'] = "You have not entered two valid items for doing alchemy.";
$lang['alchemy_insufficient'] = "You do not have the necessary items for producing a new item through alchemy.";
$lang['alchemy_chance'] = "The alchemy fails! How unfortunate, maybe you wanna try again with better effort?";
$lang['alchemy_cost'] = "Apparently you do not have enough money to afford the alchemy service, please come back later.";
$lang['alchemy_license'] = "You appear to lack the license required to perform alchemy, please make sure you have the license in your inventory first.";
$lang['alchemy_recipe'] = "It seems that you do not have the recipe to produce an item from the two selected items.";
$lang['alchemy_usergroup'] = "Unfortunately, the admin has specified that only certain users can perform alchemy, you may consult him/her by sending a message.";
There is something missing in the manual install thing, but I found a fix in case someone had this problem. Everything else seems to be working fine, thankfully.
 
I need a little bit help please.

I would like to show the image, which item the users have produced.
What have I change ?

Thanks
 
As a continuation from my other thread,

I had sorta figured that making the mod diverse would be a bit more complex so we came up with a work around.

One more question, is there a way to make the mod not care about the order the items are inserted into it? Like for example if there's a crafting recipe that calls for:

Item1, Item2

or

Item1, Item1, Item2

How can I make it so that it will create the item if you put in:

Item2, Item1

or

Item2, Item1, Item2

As the mod is currently set up the items have to be inserted in the exact same order as it was created in the acp.
 
I think the mod already handles items in reverse order. So if Item 1/Item 2 works, Item2/Item 1 should work too. Are you sure it doesnt work for you?
 
I didn't try the original, but in the one I edited, I believe I allowed for the order. It doesn't seem to work though.

../admincp/alchemy.php @ line 85
I changed:
PHP:
$whereClause = "(item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")}) OR (item = {$mysidia->input->post("item2")} and item2 = {$mysidia->input->post("item")})";

to
PHP:
$whereClause = "(item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")} and item3 = {$mysidia->input->post("item3")}) OR (item = {$mysidia->input->post("item")} and item3 = {$mysidia->input->post("item3")} and item2 = {$mysidia->input->post("item2")}) OR (item2 = {$mysidia->input->post("item2")} and item = {$mysidia->input->post("item")} and item3 = {$mysidia->input->post("item3")}) OR (item2 = {$mysidia->input->post("item2")} and item3 = {$mysidia->input->post("item3")} and item = {$mysidia->input->post("item")}) OR (item3 = {$mysidia->input->post("item3")} and item2 = {$mysidia->input->post("item2")} and item = {$mysidia->input->post("item")}) OR (item3 = {$mysidia->input->post("item3")} and item = {$mysidia->input->post("item")} and item2 = {$mysidia->input->post("item2")})";

and I changed ../classes/class_alchemy.php @ line 27
from:
PHP:
$whereClause = "(item = {$this->item->id} and item2 = {$this->item2->id}) OR (item = {$this->item2->id} and item2 = {$this->item->id})";

to
PHP:
$whereClause = "(item = {$this->item->id} and item2 = {$this->item2->id} and item3 = {$this->item3->id}) OR (item = {$this->item->id} and item3 = {$this->item3->id} and item2 = {$this->item2->id}) OR (item2 = {$this->item2->id} and item = {$this->item->id} and item3 = {$this->item3->id}) OR (item2 = {$this->item2->id} and item3 = {$this->item3->id} and item = {$this->item->id}) OR (item3 = {$this->item3->id} and item2 = {$this->item2->id} and item = {$this->item->id}) OR (item3 = {$this->item3->id} and item = {$this->item->id} and item2 = {$this->item2->id})";

Didn't seem to work. Don't know if I did something wrong or not.
 
Of course it doesnt work, because you are just reversing the order of the WHERECLAUSE, rather than changing the actual content. In your sample code, these two are equivalent, and make no difference:

Code:
[COLOR=#000000][COLOR=#DD0000]item = [/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"item"[/COLOR][COLOR=#007700])}[/COLOR][COLOR=#DD0000] and item2 = [/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"item2"[/COLOR][COLOR=#007700])}[/COLOR][COLOR=#DD0000] and item3 = [/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"item3"[/COLOR][COLOR=#007700])}[/COLOR][/COLOR]
vs

Code:
[COLOR=#000000][COLOR=#DD0000]item2 = [/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"item2"[/COLOR][COLOR=#007700])}[/COLOR][COLOR=#DD0000] and item = [/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"item"[/COLOR][COLOR=#007700])}[/COLOR][COLOR=#DD0000] and item3 = [/COLOR][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]"item3"[/COLOR][COLOR=#007700])}[/COLOR][/COLOR]
Do you understand what I mean? Lets consider this example. To say 'you have an apple and your friend has a banana', or to say 'your friend has a banana and you have an apple', it means the same thing. You are just reversing the logical order of the statement, but doesnt change the fact that apple belongs to you and banana belong to your friend. But its different if you say 'you have a banana and your friend has an apple', since in this case banana belongs to you and apple belongs to your friend. Now you can have either apple or banana, and so are with your friend. Sorry if I aint good at explaining, but I hope you get the idea.
 
Oh, wow. I see the difference in the first statement now, I can't believe I overlooked that the first time. Thanks a bunch. I'mma rewrite it a bit, I'm sure I'll be able to get it to work this time. xD

Man, I feel so stupid for not noticing the placements.

I just need to figure out how many different 'OR's that I need now.

EDIT: Yep, all good and functional now. Thanks for the help, still new to trying to program/edit stuff.
 
Last edited:
You are very welcome, I am glad I can help. You can also try SQL IN clause, so you will get rid of the OR operators. However, you will need to compare each user input, ie. $mysidia->input->post("item"), and $mysidia->input->post("item2") so that your users wont enter the same item for item1, item2, etc. Here is an example for two items SQL:

Code:
$items = "([COLOR=#000000][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'item'[/COLOR][COLOR=#007700])}[/COLOR][/COLOR], [COLOR=#000000][COLOR=#007700]{[/COLOR][COLOR=#0000BB]$mysidia[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]input[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000BB]post[/COLOR][COLOR=#007700]([/COLOR][COLOR=#DD0000]'item2'[/COLOR][COLOR=#007700])}[/COLOR][/COLOR])";
[COLOR=#000000][COLOR=#0000BB]$whereClause [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#DD0000]"(item IN {$items}[/COLOR][COLOR=#DD0000] and item2 IN [/COLOR][COLOR=#DD0000]$items)[/COLOR][COLOR=#DD0000]"[/COLOR][COLOR=#007700];  [/COLOR][/COLOR]

Read the below tutorial on w3schools, and it will help:
http://www.w3schools.com/sql/sql_in.asp
 
Ah, alright! Thanks again, I'm learning so much by messing around with everything, realizing what means what etc. Still a complete beginner, but learning is still learning.

Would there be a simple way to change the URL for the alchemy stuff or would that be too difficult to do?

Also, where can the alchemy page be edited? I'd like to add images and specific things to that page, but I can't find where to edit it.
 
Last edited:
Well there are two view files you can edit to add images and other specific things to the alchemy page:
/view/inventoryview.php
/admincp/view/alchemyview.php

Note you need to understand GUI programming in order to make changes, its not the HTML a front end designer may be familiar with. The style of coding is similar to Java swing, so if you understand how swing works, it will be easy for you.
 
Yeah, I figured out after reading some guides that I would have to edit the view pages to change what the user sees, so I went in there and tried looking around to see what made sense. Absolutely nothing! So, I've decided to leave that alone until I've reached a bit more advanced stage.
 
Its not actually that hard to understand, you just need some OOP skills and understand how the composite design pattern works. I would recommend you to read the tutorial for Java swing, and after going through it you should have no problem dealing with Mysidia's GUI API(although you will need basic Java programming knowledge to follow the tutorial):
http://www.tutorialspoint.com/swing/
 
Using the FTP, you upload the contents of the folder to the public_html folder. All the directories should split and upload into their appropriate folders so long as you do it correctly.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,121
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top