These are chat archives for arenanet/api-cdi

25th
Apr 2016
nah I didn't put any time into it yet
aside from a really simple nodejs thing to find out it doesn't work
Aralicia
@Aralicia
Apr 25 2016 09:45
I was wondering : since /v2/professions is getting big, is there a way to get a reduced version ? It's a bit strange to have to have to get all the trainings & weapons of every classes because you simply wanted to make a profession list with icons.
Archomeda
@Archomeda
Apr 25 2016 12:32
Ah that's good ^^
Archomeda
@Archomeda
Apr 25 2016 13:51
In some unrelated notes, I had a brilliant idea of making a SAB-themed Portal 2 map... but then I realized that I have little to none experience in Hammer, no modelling experience, and that I haven't gotten a clue either to what kind of puzzle I should make... D:
Also, not forgetting the actual copyrights of ArenaNet themselves x)
Edgar Doiron
@Coffee4cr
Apr 25 2016 14:20
lol
so in the end, it will stay an idea
Archomeda
@Archomeda
Apr 25 2016 14:27
Most likely :P
Christian
@zeeZ
Apr 25 2016 16:09
If I had shelves for my ideas I would have to put the ones labeled "bad" on the ground floor or basement due to their immensive weight
which is a word between impressive and massive
Edgar Doiron
@Coffee4cr
Apr 25 2016 16:09
lol
Christian
@zeeZ
Apr 25 2016 16:10
This is what you get when I'm trying to think after work
smiley
@codemasher
Apr 25 2016 16:23
@zeeZ "did you mean: immersive?" :D
Christian
@zeeZ
Apr 25 2016 16:24
immersive weight?
smiley
@codemasher
Apr 25 2016 16:24
This is what you get when I'm trying to think after work
sounds pretty much like that
Christian
@zeeZ
Apr 25 2016 16:27
been a weird day, anything is possible
darthmaim
@darthmaim
Apr 25 2016 16:28
:cow: moo
Edgar Doiron
@Coffee4cr
Apr 25 2016 16:29
Silicon valley started again! :D
To be clear, simply doing https://api.guildwars2.com/v2/recipes?ids=11807, does NOT return the recipe sheet ID but instead the crafted item ID.
I mean... I could build an index I guess.
Eearslya Sleiarion
@Eearslya
Apr 25 2016 17:26
Iunno, I'm just passing it along XD
I'm not sure that it'll produce clean data though
fair enough
Eearslya Sleiarion
@Eearslya
Apr 25 2016 17:27
I can only imagine how fun it would be to actually make a recipe ID->recipe sheet relationship
foreach (every item in the game) {}
I mean yeah, but just once on startup
Eearslya Sleiarion
@Eearslya
Apr 25 2016 17:29
Unless the backend has SQL-like searching..Does it?
the content reader takes a few minutes to start as-is (and that's presuming it doesn't have to patch the dat)
no it's reading from the .dat file
if you have to use a canvas to pull the image data, what's wrong with using a canvas to render? :/
my impression was that rendering them was hardware accelerated, even on mobile devices
Christian
@zeeZ
Apr 25 2016 18:37
that twitter page leaves a very internet hipster impression
well, mountain viewish
Eearslya Sleiarion
@Eearslya
Apr 25 2016 22:51
http://build.sleiarion.net/ Whee, lots of progress.
thief needs dual skills :>
Eearslya Sleiarion
@Eearslya
Apr 25 2016 22:52
lawton why must you crush my dreams
my job is to destroy the happiness of others
i have a very special set of skills
Eearslya Sleiarion
@Eearslya
Apr 25 2016 22:53
At least I got attunements done!
let me know if you run into any issues (like ... the API not providing enough data)
I think /v2/professions spits out everything you need but I'm rarely right about things
Eearslya Sleiarion
@Eearslya
Apr 25 2016 22:54
The only things I've had to hardcode so far is how many hands a weapon takes and whether or not it's underwater
Gonna need to hide certain weapons without elite specs at some point, but that's all available through the API
..I think
Yeah the weapons that require a specialization will have a specialization field with the id
Eearslya Sleiarion
@Eearslya
Apr 25 2016 22:55
Oh fantastic it's easier than I thought
There, done already (for now)
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:01
@lye There, thief fixed
yayifications
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:02
#297 Aww, for me? You shouldn't have.
I'm probably gonna forget to do it if there's no issue
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:08
Best part is, this whole build editor is currently working on 2 API calls. /v2/professions?ids=all and /v2/skills?ids=all just get called once and it keeps the data
probably want to avoid /v2/skills?ids=all since it returns so much data -- likely better to aggregate all the profession-referenced skills and get only those. Maybe.
JSON.parse has always been super slow for me.
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:14
Let's see..currently, from page load to everything being ready is 2.66 seconds
Feels like it would be a bit of a pain to loop through every weapon/utility/heal/elite/profession-specific skill to get just those IDs..
...Speaking of which...
Profession-specific skills are referenced...nowhere that I can see?
UHHHHHHHHHHHHH
that's a really good point
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:17
I did manually look up the icons for ele attunements, so I guess I lied about how much I hardcoded
Forgot about that
yeah those need to go on there somehow
the specialization-overridden ones are going to be annoying
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:18
At least you don't have to actually render them
Eearslya @Eearslya shudders
hahaha yeah ;-:
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:35
..I could have sworn there was somewhere in the API that just listed heal/utility/elite skills. Do I have to parse the training object?
yeah, they're in the training object
profession.training.reduce(
    (a, x) => a.concat(
        x.track
            .filter((e) => e.type === "Skill")
            .map((e) => e.skill_id)
    ),
    []
)
that took longer to type than I expected
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:46
wh
what is this sorcery
it's just javascript :trollface:
Pat Cavit
@tivac
Apr 25 2016 23:47
ES2015
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:47
    $.each(profdata[profession].training, function(key, train) {
        if (train.category != "Skills") return;
        $.each(train.track, function(key, step) {
            if (step.type != "Skill") return;
            if (skillcache[step.skill_id].slot == "Heal") heals.push(step.skill_id);
            if (skillcache[step.skill_id].slot == "Utility") utilities.push(step.skill_id);
            if (skillcache[step.skill_id].slot == "Elite") elites.push(step.skill_id);
        });
    });
    updateSlotSkills();
Pat Cavit
@tivac
Apr 25 2016 23:47
with terrible variable names
hey I didn't use x for everything
oh, mine doesn't separate them by category; it just sticks 'em into a list
anyway, so you could fetch only the profession-specific non-weapon skills via
fetch("https://api.guildwars2.com/v2/professions/Necromancer")
    .then((res) => res.json())
    .then((prof) =>
        prof.training.reduce(
            (a, x) => a.concat(
                x.track
                    .filter((e) => e.type === "Skill")
                    .map((e) => e.skill_id)
                ),
            []
        )
    )
    .then((skills) => fetch(`https://api.guildwars2.com/v2/skills?ids=${skills.join(",")}`))
    .then((res) => res.json())
    .then(console.log.bind(console));
you can throw a concat in there to gather the weapon skills too
also I may have spent more time on this than I should have
lye @lye gets back to work
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:56
oh my god
WHAT IS THIS
Vanilla.js bro do you even
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:56
I'm out of my depth
Pat Cavit
@tivac
Apr 25 2016 23:57
lawton is writing JS from THE FUTURE
Eearslya Sleiarion
@Eearslya
Apr 25 2016 23:57
Final size: 0 bytes uncompressed, 25 bytes gzipped.
Pat Cavit
@tivac
Apr 25 2016 23:58
Or I guess since it's ES2015 it's from the past?
i'm not even sure anymore
Pat Cavit
@tivac
Apr 25 2016 23:58
¯\_(ツ)_/¯
Nabrok
@Nabrok
Apr 25 2016 23:58
I do like arrow functions
the funny part is that I used to talk down to people who used babel and such
smiley
@codemasher
Apr 25 2016 23:58
Nabrok
@Nabrok
Apr 25 2016 23:58
They're so much cleaner
if ES2015 is a drug then I need to be sent to rehab asap
smiley
@codemasher
Apr 25 2016 23:59
but seriously, i need to more js :D ES2015 is so beyond me rn
Pat Cavit
@tivac
Apr 25 2016 23:59
http://buble.surge.sh transpiles just the shit you really want
the fetch stuff is so much nicer than using XmlHttpRequests
smiley
@codemasher
Apr 25 2016 23:59
yea, fetch is the thing i love
Pat Cavit
@tivac
Apr 25 2016 23:59
and then infects all your code with exception-swallowing promises