Jump to content

Looking for Fates Javascript help


VincentASM
 Share

Recommended Posts

I realise it's been a while, but I'm looking for someone (or some people) to help me port the Awakening max stats and growth rate calculators for Fates.

For the most part, the calculations between the two games are mostly the same, but there are a few things that are different or that could be simplified. Unfortunately, my own knowledge of Javascript is pretty much non-existent, so I can't update the calculators by myself.

What I primarily need help with is the actual calculations (i.e. editing the javascript file) and page implementation (i.e. editing the HTML page). The boring stuff like populating the tables and databases I can handle.

For instance, here's the javascript file for Awakening's max stats.

Below is Fates's max stats data, which I formatted earlier:

var empty = new Array(0, 0, 0, 0, 0, 0, 0, 0),
char_maxes = {
    'Avatar': empty,
    'Gunter' : new Array(0, 2, 0, 1, -2, 0, 2, -2),
    'Felicia' : new Array(0, -2, 2, 0, 1, 0, -1, 1),
    'Jakob' : new Array(0, 2, -2, 2, 0, -1, 0, -1),
    'Kaze' : new Array(0, -2, 0, 2, 3, -2, -1, 1),
    'Azura' : new Array(0, 0, 0, 1, 3, 0, -3, 0),
    'Silas' : new Array(0, 1, 0, 2, 0, -1, 0, -1),
    'Shura' : new Array(0, -1, 0, -1, 3, -1, -2, 2),
    'Izana' : new Array(0, 0, 1, 1, -2, 0, 0, 1),
    'Mozu' : new Array(0, 0, 0, 1, 1, 1, 0, -2),
    'Rinkah' : new Array(0, -1, 0, -2, 1, 0, 2, 0),
    'Sakura' : new Array(0, 0, 2, -1, 1, 0, -1, 0),
    'Hana' : new Array(0, 1, 0, 1, 2, -1, -3, 1),
    'Subaki' : new Array(0, -1, 0, 2, -2, -1, 3, -1),
    'Saizo' : new Array(0, 1, 0, 3, -2, 0, 1, -2),
    'Orochi' : new Array(0, 0, 3, 2, -2, -1, -2, 1),
    'Hinoka' : new Array(0, 1, -1, -1, 1, 0, -1, 2),
    'Azama' : new Array(0, 2, -3, 0, 1, 0, 1, 0),
    'Setsuna' : new Array(0, 0, 0, 1, 3, -1, -1, -1),
    'Hayato' : new Array(0, 0, 1, -1, 2, 1, -1, -1),
    'Oboro' : new Array(0, 1, -1, 1, 1, -1, 1, -1),
    'Hinata' : new Array(0, 1, 0, -1, -2, 0, 2, 0),
    'Takumi' : new Array(0, 1, 0, 3, -2, 1, 0, -2),
    'Kagero' : new Array(0, 3, 0, -1, -1, 0, -1, 1),
    'Reina' : new Array(0, 2, 0, 0, 2, -1, -2, -1),
    'Kaden' : new Array(0, 1, 0, -3, 2, 1, -2, 2),
    'Ryoma' : new Array(0, 1, 0, 2, 1, 1, -2, -2),
    'Scarlet' : new Array(0, 2, 0, 0, 1, -1, 1, -2),
    'Yukimura' : new Array(0, -1, 0, 3, -1, 0, -1, 0),
    'Elise' : new Array(0, -1, 3, -2, 1, 1, -3, 1),
    'Arthur' : new Array(0, 1, 0, 3, 0, -3, 1, -1),
    'Effie' : new Array(0, 3, 0, -1, 1, 0, -1, -1),
    'Odin' : new Array(0, 0, 1, 1, -1, 1, 0, -1),
    'Niles' : new Array(0, -2, 0, -1, 3, 0, 0, 1),
    'Nyx' : new Array(0, 0, 3, -2, 2, -1, -2, 1),
    'Camilla' : new Array(0, 1, -1, 1, 1, -2, 1, 0),
    'Selena' : new Array(0, -1, 0, -1, 2, 0, 1, 0),
    'Beruka' : new Array(0, -1, 0, 2, -2, 0, 2, -1),
    'Laslow' : new Array(0, 1, 0, 2, -1, 1, -1, -1),
    'Peri' : new Array(0, 1, 0, -1, 1, 0, -2, 2),
    'Benny' : new Array(0, 0, 0, 0, -3, 0, 3, 1),
    'Charlotte' : new Array(0, 3, 0, 0, 2, 0, -2, -2),
    'Leo' : new Array(0, -2, 2, 0, -2, 0, 0, 2),
    'Keaton' : new Array(0, 3, 0, -2, -1, 0, 2, -1),
    'Xander' : new Array(0, 2, -1, -1, -1, 2, 1, -2),
    'Flora' : new Array(0, 1, -1, 2, 0, -1, 1, -1),
    'Fuga' : new Array(0, 2, -1, 1, 0, -1, 2, -2),
    'Anna' : new Array(0, -1, 1, 0, -1, 2, -2, 2),
    'Marth' : new Array(0, -1, 0, 1, 1, 1, 0, -1),
    'Ike' : new Array(0, 2, 0, 0, -1, 0, 1, -1),
    'Lucina' : new Array(0, 0, 0, 0, 2, 0, -1, 0),
    'Robin' : new Array(0, 0, 2, 0, 0, -1, -1, 1),
    'Minerva' : new Array(0, 1, 0, 0, 1, -2, 3, -3),
    'Daniela' : new Array(0, 0, 1, 1, 0, -1, -1, 0),
    'Haitaka' : new Array(0, 1, 0, 2, 2, -2, -2, 0),
    'Kumagera' : new Array(0, 1, 0, 1, 0, -1, 1, -1),
    'Lloyd' : new Array(0, 2, -1, 2, -3, 0, 0, 0),
    'Llewelyn' : new Array(0, 1, -1, -3, 2, 0, 3, -2),
    'Nichol' : new Array(0, 1, -1, 1, 0, -1, 1, -1),
    'Candace' : new Array(0, 0, 1, -2, -2, 2, 1, 1),
    'Tarba' : new Array(0, 1, -1, 1, 1, -1, 0, -1),
    'Funke' : new Array(0, -1, 1, 2, 2, -2, -2, 1),
    'Daichi' : new Array(0, 1, 2, 2, -1, -1, -1, -2),
    'Gazak' : new Array(0, 1, -1, -2, -2, -2, 3, 3),
    'Senno' : new Array(0, -2, 2, 0, 1, 1, -3, 1),
    'Zhara' : new Array(0, -2, 2, -2, 1, 3, -3, 1),

    'Dwyer' : empty,
    'Kana (M)': empty,
    'Kana (F)': empty
},
genders = {
    'Avatar': false,
    'Gunter' : false,
    'Felicia' : true,
    'Jakob' : false,
    'Kaze' : false,
    'Azura' : true,
    'Silas' : false,
    'Shura' : false,
    'Izana' : false,
    'Mozu' : true,
    'Rinkah' : true,
    'Sakura' : true,
    'Hana' : true,
    'Subaki' : false,
    'Saizo' : false,
    'Orochi' : true,
    'Hinoka' : true,
    'Azama' : false,
    'Setsuna' : true,
    'Hayato' : false,
    'Oboro' : true,
    'Hinata' : false,
    'Takumi' : false,
    'Kagero' : true,
    'Reina' : true,
    'Kaden' : false,
    'Ryoma' : false,
    'Scarlet' : true,
    'Yukimura' : false,
    'Elise' : true,
    'Arthur' : false,
    'Effie' : true,
    'Odin' : false,
    'Niles' : false,
    'Nyx' : true,
    'Camilla' : true,
    'Selena' : true,
    'Beruka' : true,
    'Laslow' : false,
    'Peri' : true,
    'Benny' : false,
    'Charlotte' : true,
    'Leo' : false,
    'Keaton' : false,
    'Xander' : false,
    'Flora' : true,
    'Fuga' : false,
    'Anna' : true,
    'Marth' : false,
    'Ike' : false,
    'Lucina' : true,
    'Robin' : false,
    'Minerva' : true,
    'Daniela' : true,
    'Haitaka' : false,
    'Kumagera' : false,
    'Lloyd' : false,
    'Llewelyn' : false,
    'Nichol' : false,
    'Candace' : true,
    'Tarba' : false,
    'Funke' : false,
    'Daichi' : false,
    'Gazak' : false,
    'Senno' : false,
    'Zhara' : false,

    'Dwyer' : false,
    'Kana (M)': false,
    'Kana (F)': true
},
assets = {
    'HP':       new Array(0, 1, 1, 0, 0, 2, 2, 2),
    'Strength': new Array(0, 4, 0, 2, 0, 0, 2, 0),
    'Magic':    new Array(0, 0, 4, 0, 2, 0, 0, 2),
    'Skill':    new Array(0, 2, 0, 4, 0, 0, 2, 0),
    'Speed':    new Array(0, 0, 0, 2, 4, 2, 0, 0),
    'Luck':     new Array(0, 2, 2, 0, 0, 4, 0, 0),
    'Defence':  new Array(0, 0, 0, 0, 0, 2, 4, 2),
    'Resistance': new Array(0, 0, 2, 0, 2, 0, 0, 4),
    'None': empty,
    'Unknown': new Array('?', '?', '?', '?', '?', '?', '?', '?')
},
flaws = {
    'HP':       new Array(0, 1, 1, 0, 0, 1, 1, 1),
    'Strength': new Array(0, 3, 0, 1, 0, 0, 1, 0),
    'Magic':    new Array(0, 0, 3, 0, 1, 0, 0, 1),
    'Skill':    new Array(0, 1, 0, 3, 0, 0, 1, 0),
    'Speed':    new Array(0, 0, 0, 1, 3, 1, 0, 0),
    'Luck':     new Array(0, 1, 1, 0, 0, 3, 0, 0),
    'Defence':  new Array(0, 0, 0, 0, 0, 1, 3, 1),
    'Resistance': new Array(0, 0, 1, 0, 1, 0, 0, 3),
    'None': empty,
    'Unknown': new Array('?', '?', '?', '?', '?', '?', '?', '?')
},

classes = {
    'Unknown': { 'Class': 'Unknown', 'Stats': new Array('?', '?', '?', '?', '?', '?', '?', '?'), 'promoted': false },
    'Hoshido Noble': { 'Class': 'Hoshido Noble', 'Stats': new Array(60,34,28,29,30,33,31,28), 'promoted': true},
    'Samurai': { 'Class': 'Samurai', 'Stats': new Array(40,20,16,23,25,24,18,20), 'promoted': false},
    'Swordmaster': { 'Class': 'Swordmaster', 'Stats': new Array(55,30,28,32,35,33,27,31), 'promoted': true},
    'Master of Arms': { 'Class': 'Master of Arms', 'Stats': new Array(65,33,25,30,30,31,31,28), 'promoted': true},
    'Oni Savage': { 'Class': 'Oni Savage', 'Stats': new Array(45,24,19,16,20,17,23,18), 'promoted': false},
    'Oni Chieftain': { 'Class': 'Oni Chieftain', 'Stats': new Array(60,34,28,25,30,25,36,31), 'promoted': true},
    'Blacksmith': { 'Class': 'Blacksmith', 'Stats': new Array(65,33,25,32,31,30,32,27), 'promoted': true},
    'Spear Fighter': { 'Class': 'Spear Fighter', 'Stats': new Array(40,22,15,23,22,21,22,21), 'promoted': false},
    'Spear Master': { 'Class': 'Spear Master', 'Stats': new Array(60,34,25,33,32,29,30,29), 'promoted': true},
    'Basara': { 'Class': 'Basara', 'Stats': new Array(65,31,30,30,31,35,30,32), 'promoted': true},
    'Diviner': { 'Class': 'Diviner', 'Stats': new Array(35,17,22,20,23,19,16,20), 'promoted': false},
    'Onmyoji': { 'Class': 'Onmyoji', 'Stats': new Array(45,25,33,31,32,27,25,31), 'promoted': true},
    'Monk': { 'Class': 'Monk', 'Stats': new Array(35,18,21,20,22,23,17,24), 'promoted': false},
    'Shrine Maiden': { 'Class': 'Shrine Maiden', 'Stats': new Array(35,18,21,20,22,23,17,24), 'promoted': false},
    'Great Master': { 'Class': 'Great Master', 'Stats': new Array(55,32,30,31,33,32,28,32), 'promoted': true},
    'Priestess': { 'Class': 'Priestess', 'Stats': new Array(50,29,32,30,33,34,26,34), 'promoted': true},
    'Sky Knight': { 'Class': 'Sky Knight', 'Stats': new Array(35,19,16,21,23,25,18,25), 'promoted': false},
    'Falcon Knight': { 'Class': 'Falcon Knight', 'Stats': new Array(55,28,27,30,34,35,27,35), 'promoted': true},
    'Kinshi Knight': { 'Class': 'Kinshi Knight', 'Stats': new Array(50,27,26,33,31,34,25,31), 'promoted': true},
    'Archer': { 'Class': 'Archer', 'Stats': new Array(40,21,15,23,21,20,20,17), 'promoted': false},
    'Sniper': { 'Class': 'Sniper', 'Stats': new Array(55,31,25,35,33,30,31,28), 'promoted': true},
    'Ninja': { 'Class': 'Ninja', 'Stats': new Array(35,17,15,25,25,18,19,20), 'promoted': false},
    'Master Ninja': { 'Class': 'Master Ninja', 'Stats': new Array(55,27,25,35,35,28,26,34), 'promoted': true},
    'Mechanist': { 'Class': 'Mechanist', 'Stats': new Array(60,30,25,33,30,30,31,31), 'promoted': true},
    'Apothecary': { 'Class': 'Apothecary', 'Stats': new Array(45,24,15,19,19,21,23,20), 'promoted': false},
    'Merchant': { 'Class': 'Merchant', 'Stats': new Array(65,33,25,29,28,32,33,30), 'promoted': true},
    'Kitsune': { 'Class': 'Kitsune', 'Stats': new Array(40,20,18,23,24,24,18,23), 'promoted': false},
    'Nine-Tails': { 'Class': 'Nine-Tails', 'Stats': new Array(55,29,29,33,34,33,27,34), 'promoted': true},
    'Songstress': { 'Class': 'Songstress', 'Stats': new Array(45,28,27,31,31,35,27,28), 'promoted': false},
    'Villager': { 'Class': 'Villager', 'Stats': new Array(35,19,15,19,19,22,18,15), 'promoted': false},
    'Dread Fighter': { 'Class': 'Dread Fighter', 'Stats': new Array(55,32,28,29,31,26,29,34), 'promoted': true},
    'Nohr Prince': { 'Class': 'Nohr Prince', 'Stats': new Array(40,23,17,19,21,22,21,19), 'promoted': false},
    'Nohr Princess': { 'Class': 'Nohr Princess', 'Stats': new Array(40,23,17,19,21,22,21,19), 'promoted': false},
    'Nohr Noble': { 'Class': 'Nohr Noble', 'Stats': new Array(60,32,31,28,32,27,29,32), 'promoted': true},
    'Cavalier': { 'Class': 'Cavalier', 'Stats': new Array(40,22,15,21,20,24,22,21), 'promoted': false},
    'Paladin': { 'Class': 'Paladin', 'Stats': new Array(60,31,26,30,30,32,32,32), 'promoted': true},
    'Great Knight': { 'Class': 'Great Knight', 'Stats': new Array(65,35,25,29,27,28,37,28), 'promoted': true},
    'Knight': { 'Class': 'Knight', 'Stats': new Array(45,24,15,22,17,22,26,18), 'promoted': false},
    'General': { 'Class': 'General', 'Stats': new Array(70,38,25,32,25,32,40,30), 'promoted': true},
    'Fighter': { 'Class': 'Fighter', 'Stats': new Array(45,25,15,23,22,21,19,18), 'promoted': false},
    'Berserker': { 'Class': 'Berserker', 'Stats': new Array(70,40,25,32,33,25,27,25), 'promoted': true},
    'Mercenary': { 'Class': 'Mercenary', 'Stats': new Array(40,22,15,24,22,20,21,19), 'promoted': false},
    'Hero': { 'Class': 'Hero', 'Stats': new Array(60,32,25,35,32,31,30,27), 'promoted': true},
    'Bow Knight': { 'Class': 'Bow Knight', 'Stats': new Array(55,29,25,32,33,30,27,32), 'promoted': true},
    'Outlaw': { 'Class': 'Outlaw', 'Stats': new Array(35,19,18,20,24,18,17,22), 'promoted': false},
    'Adventurer': { 'Class': 'Adventurer', 'Stats': new Array(50,27,31,27,34,27,25,34), 'promoted': true},
    'Wyvern Rider': { 'Class': 'Wyvern Rider', 'Stats': new Array(40,22,17,21,20,19,24,15), 'promoted': false},
    'Wyvern Lord': { 'Class': 'Wyvern Lord', 'Stats': new Array(60,33,25,33,29,28,35,26), 'promoted': true},
    'Malig Knight': { 'Class': 'Malig Knight', 'Stats': new Array(55,31,30,28,27,25,31,31), 'promoted': true},
    'Dark Mage': { 'Class': 'Dark Mage', 'Stats': new Array(35,19,24,16,19,18,19,22), 'promoted': false},
    'Sorcerer': { 'Class': 'Sorcerer', 'Stats': new Array(50,25,35,26,29,26,29,33), 'promoted': true},
    'Dark Knight': { 'Class': 'Dark Knight', 'Stats': new Array(55,32,31,28,27,31,34,30), 'promoted': true},
    'Troubadour': { 'Class': 'Troubadour', 'Stats': new Array(35,16,19,24,20,23,16,21), 'promoted': false},
    'Strategist': { 'Class': 'Strategist', 'Stats': new Array(45,25,33,28,31,33,25,32), 'promoted': true},
    'Maid': { 'Class': 'Maid', 'Stats': new Array(50,28,31,33,33,32,29,29), 'promoted': true},
    'Butler': { 'Class': 'Butler', 'Stats': new Array(50,28,31,33,33,32,29,29), 'promoted': true},
    'Wolfskin': { 'Class': 'Wolfskin', 'Stats': new Array(45,24,15,18,22,17,21,15), 'promoted': false},
    'Wolfssegner': { 'Class': 'Wolfssegner', 'Stats': new Array(65,36,25,29,31,26,32,26), 'promoted': true},
    'Lancer': { 'Class': 'Lancer', 'Stats': new Array(60,31,25,29,29,30,31,29), 'promoted': true},
    'Dark Falcon': { 'Class': 'Dark Falcon', 'Stats': new Array(45,27,32,28,33,32,26,34), 'promoted': true},
    'Ballistician': { 'Class': 'Ballistician', 'Stats': new Array(50,39,25,31,25,32,27,26), 'promoted': true},
    'Witch': { 'Class': 'Witch', 'Stats': new Array(50,25,36,27,34,28,26,29), 'promoted': true},
    'Lodestar': { 'Class': 'Lodestar', 'Stats': new Array(60,29,26,35,33,40,30,29), 'promoted': true},
    'Vanguard': { 'Class': 'Vanguard', 'Stats': new Array(65,36,25,29,30,30,32,27), 'promoted': true},
    'Great Lord': { 'Class': 'Great Lord', 'Stats': new Array(60,30,25,32,34,35,29,31), 'promoted': true},
    'Grandmaster': { 'Class': 'Grandmaster', 'Stats': new Array(55,31,33,33,29,26,28,33), 'promoted': true},
    'Pegasus Knight': { 'Class': 'Pegasus Knight', 'Stats': new Array(55,30,26,31,34,35,26,35), 'promoted': true},
    'Modifiers': { 'Class': 'Modifiers', 'Stats': empty, 'promoted': false }
},

Right now, it should be possible to paste that into the javascript file and edit the HTML page slightly to create a calculator for Fates.

However what I'd like to do is to automatically generate a list of available classes for the Gen 1 characters, similar to how the list of classes is generated for the Awakening DLC/SpotPass characters. Since most of the characters can be any class, especially if they marry the Avatar with a particular talent.

But there would be some slight variations, like Azura, Keaton, Kaden and the Avatar, who have exclusive access to one class each.

Link to comment
Share on other sites

I might be interested. What remains to be done after a simple substitution of the correct numbers for Fates?

Also, playing around with the Awakening one, there doesn't seem to be a listener for when you scroll through the list with the arrow keys, but only when you click an option.

Link to comment
Share on other sites

Thanks, let me try and remember exactly everything I needed.

I'll start with the max stats page to prevent confusion. Also, I should mention I'm not the best with logic, so I'm not sure if these are the best ways to do it.

1. In the javascript file, Instead of defining individual class arrays for each character like

'Chrom': new Array(		classes['Lord'], classes['Great Lord (M)'],		classes['Cavalier'], classes['Paladin'], classes['Great Knight'],		classes['Archer'], classes['Sniper'], classes['Bow Knight'],		classes['Dread Fighter'],		classes['Modifiers']

I want to assign each character a generic class array (with every regular playable class), plus possible exclusive classes. Eg. Avatar would have Nohr Prince(ss), Hoshido Noble, Nohr Noble, while Azura would have Songtress, Kaden has Kitsune and Nine-Tails etc.

Perhaps you could use the character's gender value to pick from male and female classes.

2. SImilar to the above, I would like the dropdown boxes in the HTML page to pull data from the characters' class arrays, rather than having to manually list all the classes (since there would be a LOT of repeats otherwise).

3. Children only inherit the first class from each parent (instead of every class like in Awakening).

I think that's the most important things. In any case, once I have a bit more time, I'll try and post an updated version with the Fates data substituted in and some unnecessary data removed ^^

Edited by VincentASM
Link to comment
Share on other sites

Okay, after several hours of struggle, I think I've done everything I can. From here, I think I can just add in a whole lot of repeated content to get the results I want, but I'm hesitant to do that.

Fates Max Stats (WIP)

Javascript file

If you mess around with the two Kanas, they should be fully functional, while every other character is missing a whole bunch of classes.

What I'd like ideally is, as mentioned above:

1. A function (or way) to automatically generate and fill in the dropdown box for the 1st gen characters in the HTML file. In the javascript file, I have provided four arrays for this purpose. Search for:

    // Generic classes

Ideally, the function should take a class array and a default class as inputs. From those two, it will add the default class to the top of the dropdown list and the rest of the classes below.

2. A way to assign or copy generic class arrays for the 1st gen characters in the javascript file. Basically, I want everybody except the Avatar (and a few others) to use the 'Generic' array.

Hope everything makes sense ^^

Edited by VincentASM
Link to comment
Share on other sites

Thanks, let me try and remember exactly everything I needed.

I'll start with the max stats page to prevent confusion. Also, I should mention I'm not the best with logic, so I'm not sure if these are the best ways to do it.

1. In the javascript file, Instead of defining individual class arrays for each character like

'Chrom': new Array(

		classes['Lord'], classes['Great Lord (M)'],
		classes['Cavalier'], classes['Paladin'], classes['Great Knight'],
		classes['Archer'], classes['Sniper'], classes['Bow Knight'],
		classes['Dread Fighter'],
		classes['Modifiers']
I want to assign each character a generic class array (with every regular playable class), plus possible exclusive classes. Eg. Avatar would have Nohr Prince(ss), Hoshido Noble, Nohr Noble, while Azura would have Songtress, Kaden has Kitsune and Nine-Tails etc.

Perhaps you could use the character's gender value to pick from male and female classes.

2. SImilar to the above, I would like the dropdown boxes in the HTML page to pull data from the characters' class arrays, rather than having to manually list all the classes (since there would be a LOT of repeats otherwise).

3. Children only inherit the first class from each parent (instead of every class like in Awakening).

I think that's the most important things. In any case, once I have a bit more time, I'll try and post an updated version with the Fates data substituted in and some unnecessary data removed ^^

1) Being tinkered with; you still need to set the characters' base classes in their class sets so they display on top and for inheritance purposes.

2) Done

3) Being worked on; is difficult. Do you have more details on how inheritance works, such as if the child already has the base class of the variable parent? Is Kitsune/Wolfskin passed down to not-Selkie/Velouria?

Here's the copy I'm editing; it should always be up to date since it's just in my dropbox. I have not tinkered with the childrens' cap calculation yet.

https://www.dropbox.com/s/rquoxpx2gczp7f0/fe-fates-max-stats.js?dl=0

I'll work on it more during class tomorrow again

Yet another edit: I think it'd be handy to keep track of the base class corresponding to promoted ones, and vice versa. Expect to see it in the next edit I made to the code.

Edit yet again: Linked wrong file

Edit the 4th: Actually, keeping track of the bases that go with a promoted class won't work since there are multiple classes that can promote to the same class. So there are several solutions:

1) Have multple versions of each promoted class that keeps track of what it was promoted from

2) Give prepromotes their base class anyway in the calculator

3) Associate with each character the base class that they would pass down (possibly best solution)

4) ??? (profit?)(some other option)

Edited by Crazycolorz5
Link to comment
Share on other sites

Thanks for the help ^^

Class inheritance can definitely get very complicated. However, since we're using generic arrays, we don't have to worry about the rules, I think. We can assume players will use Friendship or Partner Seals to potentially acquire any class.

EDIT: Although it'd be nice to separate the inherited classes and borrowed classes since you're limited to one A+ and one S rank..

All classes can get passed down except for Songtress. So you can have Kana with Kitsune/Wolfskin by pairing the Avatar with Kaden, Keaton, Selkie or Velouria,

As for the specific rules, to the best of my knowledge:

Default: Child inherits fixed parent's first class + variable parent's first class.

Exceptions:

A: If the fixed OR variable parent's first class is the same as the child's first class: Child inherits fixed OR variable parent's second class.

B1: If the fixed parent is Azura: Child inherits Troubadour from Azura

B2: If the variable parent is Azura: Child inherits Sky Knight from Azura

C: If the child ends up inheriting the same class from fixed AND variable parent: Child inherits variable parent's second class. If B1 OR B2 is true: Child inherits Wyvern Rider. [Note: Not 100% sure]

Hmm, I did consider linking the base and promoted classes, but is it really that useful? In any case, I think solution 1 would make the most sense. Eg. Onmyoji (Diviner) and Onmyoji (Monk/Shrine Maiden).

EDIT2:

I'll see if I can make a flowchart for inheritance rules.

Edited by VincentASM
Link to comment
Share on other sites

EDIT: Although it'd be nice to separate the inherited classes and borrowed classes since you're limited to one A+ and one S rank..

Are you saying we should section off the dropdown box into like, for example

--Base Classes--
Nohr Princess
--Inherited Classes--
Sky Knight
Ninja
--Borrowed Classes--
<everything else>

... actually with the way I'm generating the class list right now, this is very feasible.

I think, given those rules, it might just make the most sense to hardcode the class that the child obtains form the fixed parent (since it is fixed, after all)

I'm trying out #3 right now. It requires an extra bit of data but otherwise works really cleanly.

I think it's worth at least linking the base classes to the promoted ones, since then you can more easily declare each character's class sets (as 2-3 classes instead of a whole bunch of them). It also makes inheritance simpler, as you only need to list the one base class passed down.

Link to comment
Share on other sites

Are you saying we should section off the dropdown box into like, for example

Pretty much. Or you can lump the Base and Inherited Classes together. Not sure which way is more useful.

You could have Base Classes and Borrowed Classes for Gen 1 characters too.

I think it's worth at least linking the base classes to the promoted ones, since then you can more easily declare each character's class sets (as 2-3 classes instead of a whole bunch of them). It also makes inheritance simpler, as you only need to list the one base class passed down.

Yup, I just realised that!

Hmm, I think I'll quickly start a Birthright file to test the inheritance.

Link to comment
Share on other sites

Okay, I think this should be it. You need to go through all the steps in sequence.

Child Inheritance Flowchart

1. Child's first class = Fixed and decided by the game.

2. Child's second class = Father's first class.

IF Father's first class is same as child's first class, <use father's second class instead>.

3. Child's third class = Mother's first class.

IF Mother's first class is same as child's first class OR Mother's first class is Songstress, <use mother's second class instead>.

IF Class inherited from mother is same as child's first class OR class inherited from father, <use parallel version of mother's first class>

IF Class inherited from mother is STILL the same as class inherited from father OR not available, <use parallel version of mother's second class>

IF The result is that no class can be inherited from mother, child does not acquire a third class.


Example 1. If Nina's mother is Nyx, Nina inherits Dark Mage from Niles.
She tries to inherit Dark Mage (1st class) from Nyx, but fails.
Next, she tries to inherit Outlaw (2nd) from Nyx, but fails.
Finally she inherits Diviner (parallel version of 1st class).

Example 2. If Kana F's mother is Azura and Avatar's talent is Sky Knight, Kana F inherits Sky Knight from Avatar.
She tries to inherit Songstress from Azura (1st class), but fails.
Next, she tries to inherit Sky Knight (2nd class) from Azura, but fails.
Finally. she inherits Troubadour (parallel version of 1st class).

Example 3. If Shigure's father is Jakob, Shigure inherits Troubadour from Jakob.
He tries to inherit Songstress (1st class) from Azura, but fails.
Next, he tries to inherit Sky Knight (2nd class) from Azura, but fails.
Afterwards, he tries to inherit Troubadour (parallel version of 1st class), but fails.
Finally he inherits Wyvern Rider (parallel version of 2nd class).

Example 4. If Kana M's father is Silas and Avatar's talent is Cavalier, Kana M inherits Cavalier from Silas.
He tries to inherit Nohr Prince from Avatar (1st class), but fails.
Next, he tries to inherit Cavalier (2nd class) from Avatar, but fails.
Afterwards, he tries to inherit the parallel version of Nohr Prince, but it's not available.
Finally, he inherits Samurai (parallel version of 2nd class).

Example 5. If Kana M's father is Jakob and Avatar's talent is Troubadour, Kana M inherits Troubadour from Jakob.
He tries to inherit Nohr Princess from Avatar (1st class), but fails.
Next, he tries to inherit Troubadour (2nd class) from Avatar, but fails.
Afterwards, he tries to inherit the parallel version of Nohr Prince (1st class), but it's not available.
Finally, he tries to inherit the parallel version of Troubadour (2nd class), but it's not available.

No class is inherited from the Avatar.

Edited by VincentASM
Link to comment
Share on other sites

https://www.dropbox.com/s/tp9vop22u3nv4bu/Screenshot%202016-06-14%2011.47.56.png?dl=0

Most of the logic for inheriting classes is done; I just need to script in what class parallels to what.

As per the flowchart, it goes:

1) try to inherit a class from the father

1.1) Do this by looping through his class set until you find something you can inherit (don't already have/isn't songstress)

2) try to inherit a class from the mother

2.1) Loop through his class set etc etc

I have the loop in place for parallel classes but I haven't inserted the data of what class parallels to what into the class table yet.

Also, for now, Kana (m and f) inherit all generic classes (from the Avatar). I think it might be worth it, in the future, to add a dropdown to set the Avatar's talent, and calculate the avatar's class set based on that.

Link to comment
Share on other sites

Thanks for the work. It's looking good : )

I can insert the parallel classes if you tell me where/how to, or you can use this list.

Oh yeah, selecting the Avatar's talent is a really good idea. I was gonna suggest that, but forgot about it ^^;;;

Link to comment
Share on other sites

By the way, is the Mother's third class ever inherited? Or is it that in all the cases where that could be the case, the second class works?


Edit:
Todos from here:
Talent dropdown
Generate parent options for the children?
Python script to generate a base HTML file for this to work with (so you can have a row for every character etc).


Anyway, try playing around with this for a while? And if you break it, please tell me how:
https://www.dropbox.com/s/8rap8ubn14j0chn/fe-fates-max-stats-6-14-16-2-55-pm.zip?dl=0

More edits:
https://www.dropbox.com/s/vess9b55qq6gf7j/Screenshot%202016-06-14%2014.16.47.png?dl=0

More Edits:
Oke, talents should work properly with the avatar's dropdown/Kana's classes.
By default, if no Talent is select, the Avatar has no secondary class.

M000re Edits:

Example 4. If Kana M's father is Silas and Avatar's talent is Cavalier, Kana M inherits Cavalier from Silas.
He tries to inherit Nohr Prince from Avatar (1st class), but fails.
Next, he tries to inherit Cavalier (2nd class) from Avatar, but fails.
Afterwards, he tries to inherit the parallel version of Nohr Prince, but it's not available.
Finally, he inherits Samurai (parallel version of 2nd class).

I need to confirm: the page you linked has Ninja as the parallel to Cavalier. Is the observed in-game behavior that Kana inherits Samurai, or did you make a mistake while making the example, and it should be Ninja?

Edited by Crazycolorz5
Link to comment
Share on other sites

By the way, is the Mother's third class ever inherited? Or is it that in all the cases where that could be the case, the second class works?

It's never used.

I need to confirm: the page you linked has Ninja as the parallel to Cavalier. Is the observed in-game behavior that Kana inherits Samurai, or did you make a mistake while making the example, and it should be Ninja?

Oh dear, good job on spotting that. It's a mistake in the example, so it should be Ninja.

Thanks! I'll check out the new build once I catch a break from E3 hype and other activities : )

Link to comment
Share on other sites

It's never used.

I just quickly worked out this logic; I checked the class sets page for all Females that have more than 2 class sets and they all only support with Corrin, so it's just never the case that they would be forced to pass down their third class (or any parallel class, for that matter)

Flora   troubadour darkMage mercenary
Reina     Sky Knight     Diviner     Ninja
Scarlet     Wyvern Rider     Outlaw     Knight
Anna     Outlaw     Troubadour     Apothecary


All of them non issues, since only support with Avatar, so Kana only has at most ONE non-Nohr Prince/ss class, so cannot not-have the first two classes of the parent.

Same logic for 2nd gen parents; One of their first two classes won't match Kana's 2nd class, and neither will match the first, so... pigeonholing...

So it seems like I can keep just going down the list of classes until I find one inheritable, yaaaay.... (Really the only issue is just Corrin since I do have the Avatar having both Nohr Prince and Princess which would be the only time the count is messed with... but still no need to change anything, hahah).

Link to comment
Share on other sites

Smart thinking : )

I finally had time to play around and everything seems to work fine. Fantastic job!

It really made me smile with how amazing it is, no joke.

Only thing I noticed is that you can't select a Gen 2 character as one of Kana's parents. Not sure if you disabled it on purpose or accident.

EDIT: Actually, thinking back to your previous comments, I assume it's intentional.

Edited by VincentASM
Link to comment
Share on other sites

Only thing I noticed is that you can't select a Gen 2 character as one of Kana's parents. Not sure if you disabled it on purpose or accident.

EDIT: Actually, thinking back to your previous comments, I assume it's intentional.

It's more along the lines of "it wasn't a functionality in the original js file I was handed" combined with "and that functionality (along with parent-generating in general) hasn't been added"

... Or maybe I just messed something up. Kappa.

Link to comment
Share on other sites

Here's something I've been working on (mostly using information from SF, haha)

http://hiushi.github.io/FE14Stuff/

The data structures I used for the character info are organized a little differently, but I've already tackled the logic for the complicated passing classes and skills via inheritance/seals mechanics, including (hopefully) all of the edge cases.* If I can get confirmation from you guys whether the results are accurate, then I can try to help with this as well.

*One exception/bug I'm aware of is that when the Avatar marries a unit whose primary class matches the Avatar's talent, the non-Avatar unit should pick up the parallel of his/her primary class when using a Partner Seal. Should be a relatively simple fix but I haven't gotten around to it yet

Link to comment
Share on other sites

Here's something I've been working on (mostly using information from SF, haha)

http://hiushi.github.io/FE14Stuff/

The data structures I used for the character info are organized a little differently, but I've already tackled the logic for the complicated passing classes and skills via inheritance/seals mechanics, including (hopefully) all of the edge cases.* If I can get confirmation from you guys whether the results are accurate, then I can try to help with this as well.

*One exception/bug I'm aware of is that when the Avatar marries a unit whose primary class matches the Avatar's talent, the non-Avatar unit should pick up the parallel of his/her primary class when using a Partner Seal. Should be a relatively simple fix but I haven't gotten around to it yet

I ctrl+f'd your code for ".map" and ".reduce" and ".filter(" and got many matches for each, so, like, I mean, I approve. :P

Source though? I'd rather not deal with view page source -> get script source -> It's all on one line.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...