I have a question: where can I find the item codes for items? I want to use the same formula for the 99 soulstones but replace soul stones with chalk (chalk is so hard to find)
Viewing post in Cheshire's Fear & Hunger Mods comments
Luckily it's pretty simple, to access the item data follow this folder path in the game's files.
www -> data -> Item.json
Open Item.json in notepad or a similar program of your choice.
Search for the word "chalk" in either the item's description or name.
Afterwards keep track of the line in which the the "chalk" word is referenced to get the "id" in this case it's 207.
If you are planning on repurposing a mod i already made in order to get the chalks just make sure to change the number value where the '.contains("TERMINA")' part is mentioned or the $dataItems[insertNumberHere] part in case you want to do that there.
Hope this helps you!
It's fine, it's also more readable when questions are separated in case i have to give you a detailed explanation.
I will assume this is mainly for termina given the chalk question, so i'll tell you about that.
Affinities in Fear & Hunger 2: Termina are stored within variables starting from id 261 to 266(so long as i didn't miss anything).
261 - God of Fear & Hunger
262 - Alll-mer
263 - Rher
264 - Sylvian
265 - Vinushka
266 - Gro-goroth
so you need to include the following if you want to alter their values.
$gameVariables.setValue(variableId, value);
Example:
$gameVariables.setValue(261, 100); // Increase affinity with the God of Fear & Hunger by 100 points.
To include it in the game and apply the effect you can put the line/s inside your custom mod or create a new one with a similar structure to the soul stone one if you want to keep things more organized.
Example:
Scene_Map.prototype.onMapLoaded = function() {
TY_Scene_Map_OnMapLoaded.call(this);
const id = soulStoneId();
$gameParty.gainItem($dataItems[id], 99);
$gameVariables.setValue(261, 100); // your code line/s go here
};
Oh, you are right. I forgot to tell you to include this line:
const TY_Scene_Map_OnMapLoaded = Scene_Map.prototype.onMapLoaded;
Above this line, in order to get the mod to be functional.
Scene_Map.prototype.onMapLoaded = function() {
Also, if you don't plan on using the item gain functionality in this mod, specifically these 2 lines:
const id = soulStoneId();
$gameParty.gainItem($dataItems[id], 99);
I would suggest you to remove them, otherwise the affinity mod won't work.