Welcome to the Forum Archive!

Years of conversation fill a ton of digital pages, and we've kept all of it accessible to browse or copy over. Whether you're looking for reveal articles for older champions, or the first time that Rammus rolled into an "OK" thread, or anything in between, you can find it here. When you're finished, check out the boards to join in the latest League of Legends discussions.

GO TO BOARDS


@Riot Reinboom/Shop Devs: API for RecItems now? :O

Comment below rating threshold, click here to show it.

Wriggle

Adjudicator

11-16-2012

API Posted: http://na.leagueoflegends.com/board/showthread.php?p=31604090#31604090
ItemID List: http://na.leagueoflegends.com/board/showthread.php?p=31604980#31604980

Also, bug: if you click an item in the left area then navigate to a different item in the right area, the item stays selected in the left area so you can't go back to it.

Example:
Click Aegis in left list. Aegis is highlighted.
Click Ruby Crystal in Aegis recipe.
Click "Builds: Catalyst" so Catalyst is now the active item.
Aegis is still highlighted in left area so I cannot click it to go back to Aegis.


Comment below rating threshold, click here to show it.

Sambrosia

Senior Member

11-16-2012

Boldly, I insert the necessary "riotpls".


Comment below rating threshold, click here to show it.

EdgarAlanPWN88

Senior Member

11-16-2012

I AGREE! I know it just got on the PBE, but can we get the API now? Really want to customize my recommended items!

Quote:
Riot Reinboom:
The API for recommended items is already implemented, I was very careful about not accidentally messing power users up that much. For the final format of that API, you'll need to wait at least until the item shop is present in the PBE though.


Comment below rating threshold, click here to show it.

Wriggle

Adjudicator

11-17-2012

Wanna get that API info.


Comment below rating threshold, click here to show it.

Wriggle

Adjudicator

11-18-2012

Reinboooooom, you haven't forgotten us, have you?


Comment below rating threshold, click here to show it.

Wriggle

Adjudicator

11-19-2012

It's Monday! That means Riot's around now, right?


Comment below rating threshold, click here to show it.

ploki122

Senior Member

11-19-2012

Roit Pls

Honestly, I don't think i'll use it (didn't use the previous one), but given how much more useful this one is, I could actually do...
Otherwise, I'll try poking around to find how to use it...

EDIT: probably another 15-20 mins till i'm logged in...


Comment below rating threshold, click here to show it.

Riot Reinboom

Software Engineer

11-19-2012

Quote:
Wriggle:
Reinboooooom, you haven't forgotten us, have you?


I have not!

So here's the quick rundown of the API, in steps.

Step 1 - Location
The path you will be looking for is:

%LOLINSTALLDIR%\Config\Champions\%CHAMPIONID%\Recommended\

%LOLINSTALLDIR% is wherever your PBE install is
%CHAMPIONID% is the game folder ID for a champion. Such as Ahri or DrMundo

This location isn't made for you. Go ahead and create the Characters, the ID, and the Recommended folders as necessary.

Step 2 - The File
You place any number of *.json files (the actual filename isn't relevant, as long as it ends in .json) in this folder.

The JSON file commands the recommended item page and the overall structure appears like the following:
[code]{"champion":"Ahri","title":"default","type":"riot","map":"any","mode":"any","priority":false,"blocks":[{"type":"starting","items":[{"id":"1001","count":1},{"id":"3010","count":3}]},{"type":"essential","items":[{"id":"3001","count":1},{"id":"3089","count":1}]},{"type":"offensive","items":[{"id":"3100","count":1},{"id":"3128","count":1},{"id":"3135","count":1}]},{"type":"defensive","items":[{"id":"3140","count":1},{"id":"3157","count":1}]}]}[/code]

Or, in slightly more human readable form:
[code]
{
"champion":"Ahri",
"title":"default",
"type":"riot",
"map":"any",
"mode":"any",
"priority":false,
"blocks":[
{
"type":"starting",
"items":[
{
"id":"1001",
"count":1
},
{
"id":"3010",
"count":3
}
]
},
{
"type":"essential",
"items":[
{
"id":"3001",
"count":1
},
{
"id":"3089",
"count":1
}
]
},
{
"type":"offensive",
"items":[
{
"id":"3100",
"count":1
},
{
"id":"3128",
"count":1
},
{
"id":"3135",
"count":1
}
]
},
{
"type":"defensive",
"items":[
{
"id":"3140",
"count":1
},
{
"id":"3157",
"count":1
}
]
}
]
}
[/code]

(Note: It likely requires to be minified).


The important keys here:
1. "map"
This key may either be "any" or a single map id number (in string form). Some common ones you may wish to use:
"1" is Summoners Rift
"8" is Crystal Scar
"10" is Twisted Treeline

2. "mode"
This key may either by "any" or a single mode string id. The available modes are:
"CLASSIC"
"ODIN" (Dominion)
"ARAM"

3. "priority"
This defines if it should be loaded at top priority or not. This is mostly to reorder the data structure internally. We've left it false for most of the Riot made ones.
Make sure this is true. This gives it priority over the Riot ones.

The keys champion, title, and type are all used for organizational purposes and you won't have to use it. They also open us up to enabling multiple recommended pages in the future, so I still encourage you to use them. Just not required yet.
Just make sure "type" is NOT "riot"

4. "blocks"
This is where the actual page begins. Blocks is an array of section. Each section begins with a type. The type is displayed as the header. The types "starting", "essential", "offensive", and "defensive" will also be localized for you (if you need more, I can add more based on recommendation).

Each piece in the block, under the "items" key lists an item. The item currently simply has an id and a count to purchase.


Overall, pretty simple. Though, there are parts of this that will likely expand and change.


Comment below rating threshold, click here to show it.

ploki122

Senior Member

11-19-2012

Quote:
Riot Reinboom:
I have not!

The important keys here:
1. "map"
This key may either be "any" or a single map id number (in string form). Some common ones you may wish to use:
"1" is Summoners Rift
"8" is Crystal Scar
"10" is Twisted Treeline
No PG?
Quote:
The types "starting", "essential", "offensive", and "defensive" will also be localized for you (if you need more, I can add more based on recommendation).

So for now we can only use those 4? I thought you said we could create any blocks we'd like...



Otherwise, thanks a lot, once again, Reinboom... You are, yet again, moving up in my favorite Rioter ranking (still under Ames though, but about 4th-5th, with BuffMePlz being the top, uncontested)



EDIT : Also, any ways to find the new item codes? since they aren't in the main site's item list...


Comment below rating threshold, click here to show it.

Riot Reinboom

Software Engineer

11-19-2012

Quote:
ploki122:
No PG?

So for now we can only use those 4? I thought you said we could create any blocks we'd like...



Otherwise, thanks a lot, once again, Reinboom... You are, yet again, moving up in my favorite Rioter ranking (still under Ames though, but about 4th-5th, with BuffMePlz being the top, uncontested)

Proving Grounds is "3"

You can use any block title you'd like, even:
"Riot Reinboom is a meany mean head and I hate her."
It just won't be translated for you.