About the Alchemy Sorter Modder's Resource.
I included two esp files, one for plain Morrowind (sorter_mw.esp), and one for Morrowind and the expansions (sorter_exp.esp) and two Word files containing the scripts for either. I find it much easier to work with these scripts in Word then copy and past them over, especially w 12512l1112m hen you have to change as many IDs as you will here.
Please change the names of ALL of the scripts and containers in the CS (and don't forget the global). You will find the containers and activators set up in a cell called "_sorter". The first two bookshelves have the ingredient containers for Morrowind, the third is for Tribunal, and the last is for Bloodmoon. If you make different containers, make sure that you check the "reference persist" box for each one or the scripts won't find them. You will also find three eggs, one gold and two regular. These are set up as activators to hold the scripts.
Here is a break down of each script:
kw2_SortState -- This is the global, DO NOT FORGET TO RENAME IT.
kw2_SortScript_start - - This script is attached to an activator, creature or NPC that you want the player to interact with to start the sorting process. You will find it attached to a golden egg in the esp that I provided. Feel free to change it to something cooler. Here are the important and customizable parts of the script.
Messagebox, "What do you want me to do?", "Sort", "Nevermind"
You can change this line to say whatever it is you want the sorter to say. The first part is the question or statement that will be on the message box, the second ("Sort") will tell the other two scripts to start running; the third will cancel the dialogue and not sort.
messagebox "Done."
This line is what the sorter will say to the player once sorting has finished. Again, you can change the word "done" to anything.
Startscript " kw2_SortScript_sort "
set kw2_SortState to 1
startscript " kw2_SortScript_Stop "
Be sure to change these names to correspond with the names that you choose for the other two scripts. I am not certain that the two startscript lines need to be in there, but the "set kw2_SortState to 1" line is essential. This is what changes the global script causing the sorting script to start.
kw2_SortScript_sort - this script is the one that does all the sorting. This is attached to a small kwama egg that has the same name as the script. It needs to be attached to some type of activator somewhere in the cell; I recommend keeping it out of site so the player doesn't accidentally delete it. Here is a breakdown of the main parts of the script.
if ( kw2_SortState == 0 )
Be sure to change this to match the global that you use. This line is key to keeping the script from running as soon as you enter the room. Once kwsortstate is set to 1 by the start script, then this scrip will kick in and remove all the ingredients from the player's inventory and add them to the specified container. It will keep running until the global is changed back to 0 by the stop script.
if ( player->getitemcount " ingred_alit_hide_01" > 0 )
This line looks at the player's inventory and sees if it contains the specified ingredient. If it does, then it moves on to the next line, otherwise it moves on to the next ingredient
player->removeitem "ingred_alit_hide_01" 1
If the previous line found an ingredient, then this line takes one out. This repeats until there are not more ingredients left.
"kw2_alit_hide"->additem "ingred_alit_hide_01" 1
After the script takes the ingredient out of the player's inventory, this line adds the ingredient to the appropriate container.
You will not only need to change the names of the containers in each line of the script, but for each of the containers in the CS. The easiest way to change the names in the script is to open it in word (the word file is included) and use Edit>Replace. (or Ctrl+H) tell it to search for "kw2" and have it replace with some other beginning that is unique to you. This will change the names of all the scripts and containers in one shot. You will still have to do the containers in the CS manually, sorry but I have not found a way to easily change this.
kw2_SortScript_Stop - this script check the players inventory, once there are no ingredients left, it changes the global back to 0 stopping the sorting script. This is attached to a small kwama egg that is bares the same name as this script. It needs to be attached to some type of activator somewhere in the cell; I keep it out of site so the player doesn't accidentally delete it.
short kw2_stopcounter
Again, be sure to rename this. There are a number of the "kw2_stopcounter" variables in the script, so I recommend changing them the same way as the containers, by using Word.
if ( kw2_SortState == 0 )
Rename this too to match you global, see explanation of kw2_SortState above. In this script it is found twice, one in the beginning and once at the end.
if ( player->getitemcount "ingred_alit_hide_01" <= 0 )
This line is the one that check the amount of the ingredient left in the inventory, once it hits 0 for all ingredients; it then resets the global and itself, stopping the sorting process.
Tips:
https://www.morrowind-mod.com/Alchemy%20Items.htm
For any questions, comments, or suggestions, feel free to contact me via PM at https://www.elderscrolls.com/forums/. My screen name there is kwshipman. Or you can email me at [email protected]. Please don't try to contact me through MSN Messenger, as I won't accept people that I don't know.
Credits:
Rolach created the scripts and all credit should be given to him, not me.
|