Showing Posts For smiley.1438:

GW2 google dynamic map : duplicate problems

in API Development

Posted by: smiley.1438

smiley.1438

The commented example isn’t too complex and you should be able to strip a few lines of code so that you get what you want – just play a bit with it. I can’t teach you in Javascript – i assume that you at least know the basics of it.

(edited by smiley.1438)

Another live WvW Map. Checking legality..

in API Development

Posted by: smiley.1438

smiley.1438

Well, WvW stats are currently not implemented, but will be in the Overwolf app then

Another live WvW Map. Checking legality..

in API Development

Posted by: smiley.1438

smiley.1438

AFAIK there was never a download for it, but you might want to have a look at this: https://forum-en.gw2archive.eu/forum/community/api/Gw2-Location-Tracker
I’m currently creating an app for Overwolf ( http://www.overwolf.com/ ) for this…

GW2 google dynamic map : duplicate problems

in API Development

Posted by: smiley.1438

smiley.1438

Ok, i’ve added some comments to the simple Google Maps example i created ages ago, so that it should be a good point to start from – i think it’ll answer most of your questions:

https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2maps-gmaps-simple.html
(may look a bit messy, i forgot to uncheck “reformat code on commit” in phpstorm -.-)

GW2 google dynamic map : duplicate problems

in API Development

Posted by: smiley.1438

smiley.1438

No, leaflet has native support for custom maps and therefore also a nice bounding feature. But on the other hand it has still a lot of bugs and a lot of features are still missing, or only available as sometimes incomplete/undocumented/buggy plugins. So you’d best choose the map library based on the features your map should provide.

For example: i chose Google Maps for the location tracker because of it’s native support for SVG icons and stuff and i chose leaflet for the Wikimaps project because of it’s bounding features (and of course because it’s open source)

(edited by smiley.1438)

GW2 google dynamic map : duplicate problems

in API Development

Posted by: smiley.1438

smiley.1438

Theres actually no way to prevent the horizontal wrapping of the markers (and other overlays) – i’ve googled like 500 pages on that topic and didn’t yet find a solution. However, it is at least possible to lock the horizontal and vertical panning of the map, have a look at this: https://github.com/codemasher/gw2api-tools/blob/master/js/gw2location-gmaps.js#L88

(but anyway, i’d also be happy if someone has a handy solution to prevent overlay wrapping in GMaps)

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

I still wonder why (a very few) people still demand XML as data format. Ok, i can understand that it might be easier to parse in certain languages but i can’t see an advantage over JSON in the case of the GW2 API (and many more…). Don’t get me wrong, but personally i’d kill XML with fire – along with excel. Any decent language has possibilities to parse JSON easily (either native or as library) and also i heard that SQL databases are pretty handy when it comes to statistics. So when you’re working with MS-Office, you should at least favor Access over Excel.

Also for the notes – just for example:

https://twitter.com/thomasfuchs/status/379675885647192065 / https://gist.github.com/madrobby/6584720

E-mail notification doesn't work

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

I have “Email Private Messages” checked in my forum settings, but i don’t get any notifications. Ever.

Can we get the current server time?

in API Development

Posted by: smiley.1438

smiley.1438

I don’t think it’s too hard to calculate that

Progress is reset each day at midnight, 00:00 UTC (02:00 UTC+2).

http://wiki.guildwars2.com/wiki/Daily#Notes

Easy way to compile API data?

in API Development

Posted by: smiley.1438

smiley.1438

I think you may want to take a look at this: https://github.com/codemasher/gw2-database

[MumbleLink] Need home world id

in API Development

Posted by: smiley.1438

smiley.1438

You have to keep in mind that you will need to send the position to a webserver (or whatever on the net) in order to share it with the other people you play with. So as long as you don’t use some kind of VPN tunnel, there’s always the possibility to send spoofed data – and an SHA1 key can’t be spoofed that easy unless you work for the NSA…

[MumbleLink] Need home world id

in API Development

Posted by: smiley.1438

smiley.1438

I’d also recommend you the “shared key” concept of our location tracker:
https://forum-en.gw2archive.eu/forum/community/api/Gw2-Location-Tracker/2380078

[MumbleLink] Need home world id

in API Development

Posted by: smiley.1438

smiley.1438

The only current problem i see with the MumbleLink data is that it returns garbage values for WvW and overflow servers. I hope this will change one day. (WvW → home world, Overflow → overflow server’s id)

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

One more wrong named item which has also no name in spanish:

https://api.guildwars2.com/v1/item_details.json?item_id=39925 ((Clerics Chainmail Helm))
https://api.guildwars2.com/v1/item_details.json?item_id=39925&lang=es

One more item which is incorrectly named in the same way:

https://api.guildwars2.com/v1/item_details.json?item_id=40978 ((Knights Chainmail Armor))

Return proper error codes

in API Development

Posted by: smiley.1438

smiley.1438

I don’t usually quote myself but i think it fits this topic:

The 500 error which is thrown on any API error is somewhat misleading anyway. No matter if it’s a user error like wrong or missing params (could possibly end up in a 416), items not found (maybe a 416 as well, a 404 would be inappropirate) or “real” server errors (which are actually 500).

https://forum-en.gw2archive.eu/forum/community/api/Bug-in-Items-api/2622811

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: smiley.1438

smiley.1438

Suggestion: Indicate time-gated recipes, for example the recipe to create Lump of Mithrillium.

+1

The “flags” Array is under-used here anyway

Ignore functionality for the forum

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

There must be an ignore feature – in a way… Feature requests and bug reports about the forums software and website are successfully ignored for months now ^.^

Gw2 Location Tracker

in API Development

Posted by: smiley.1438

smiley.1438

Without the code or a link to your site so that i could test it myself i can’t help you much – feel free to PM me.

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

I can still see no reason to include this info in an API response – like i said, most of it is obvious and if not, it is (or should be) covered in the wiki since it’s the official API documentation. Feel free to apply as API editor to help and add info which you think is missing.

Btw. in the MySQL example you mentioned, of course you wouldn’t create a varchar(x) field if you don’t exactly know the data length – you’d just use a tinytext/text/mediumtext/longtext http://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html

(also: keep in mind the overhead a response would have, especially XML)

(edited by smiley.1438)

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

Regarding #2: Javascript is a typeless language and since JSON is a subset of Javascript it’s typeless aswell. I don’t think there’s much need for extra information about the datatypes since most of them are obvious. The wiki already covers this information if you really need it (e.g. http://wiki.guildwars2.com/wiki/API/item_details).

Dynamical Map API

in API Development

Posted by: smiley.1438

smiley.1438

Third, the lowest zoom level is 1, not 0.

No, it’s really 0, which is 1 tile with the whole map, zoom 1 is already 2×2 tiles, because 2^0 = pow(2,0) = (1 << 0) = 1…

https://tiles.guildwars2.com/1/1/0/0/0.jpg
https://tiles.guildwars2.com/2/1/0/0/0.jpg

Try something like this (php):


$zoom = 0;
$tiles = [];

for($y = 0; $y < (1 << $zoom); $y++){
	echo '<div style="white-space: nowrap; width: '.((1 << $zoom)*256).'px;">'."\n";
	for($x = 0; $x < (1 << $zoom); $x++){
		if($x >= 0 && $y >= 0 && $x < (1 << $zoom) && $y < (1 << $zoom)){
			echo '<img src="https://tiles.guildwars2.com/1/1/'.$zoom.'/'.$x.'/'.$y.'.jpg" />';
			$tiles[$y][$x] = 'https://tiles.guildwars2.com/1/1/'.$zoom.'/'.$x.'/'.$y.'.jpg';
		}
	}
	echo '</div>'."\n";
}

print_r($tiles);

In other words: https://twitter.com/ProgrammingCom/status/312391036087451648

(edited by smiley.1438)

API Changes with upcoming WvW changes?

in API Development

Posted by: smiley.1438

smiley.1438

Great, thanks for that one, Stefan!

[API Suggestion] Colors API

in API Development

Posted by: smiley.1438

smiley.1438

Thats the reason why there were just the HSL values on the intial release of the colors API. The precalculated colors were added later and the base color [128,26,26] was used for the precalculation, while everything where colors applied to seems to have its very own base and so it results in a different color in the end.

See also: https://forum-en.gw2archive.eu/forum/community/api/How-To-Colors-API/first#post2148826

(edited by smiley.1438)

Plotting events on a map

in API Development

Posted by: smiley.1438

smiley.1438

For calculation of the map-coordinates -> world-coordinates have a look at this thread:
https://forum-en.gw2archive.eu/forum/community/api/Event-Details-API-location-coordinates/first#post2262330

tl;dr: use the following to recalculate your coords:

function recalc_coords(continent_rect, map_rect, coords){
	return [
		Math.round(continent_rect[0][0]+(continent_rect[1][0]-continent_rect[0][0])*(coords[0]-map_rect[0][0])/(map_rect[1][0]-map_rect[0][0])),
		Math.round(continent_rect[0][1]+(continent_rect[1][1]-continent_rect[0][1])*(1-(coords[1]-map_rect[0][1])/(map_rect[1][1]-map_rect[0][1])))
	]
}

live example (caution, overkill!) http://gw2.chillerlan.net/examples/gw2maps-jquery.html

€: i checked your fiddle, the x coordinates were correct, buy y was far out, you should get [29753,12677]

(edited by smiley.1438)

[API Suggestion] Colors API

in API Development

Posted by: smiley.1438

smiley.1438

I think “hue” is a bit misleading, i changed it in the example due to Ish’s suggestion, but it’s basically the tone of the color, and yea, we could try to get that from the HSL values. These are the values of the sort options of the hero/dye panel ingame and we’ve categorized the colors by these in the wikis – would make it easier to sort and assign without any computing.

I’m trying to generate a color list by tone, so that i can help the french and spanish wiki to easily create all the related color articles.
http://gw2.chillerlan.net/examples/gw2color.php
http://wiki-de.guildwars2.com/wiki/Farbstoff/Liste_aller_Farben

(edited by smiley.1438)

[API Suggestion] Guilds

in API Development

Posted by: smiley.1438

smiley.1438

Info on these API-things.

in API Development

Posted by: smiley.1438

smiley.1438

The wikimaps Project might be such an example – it just needs 1 line of HTML, 1 seperate javascript file and like 10 lines of javascript to invoke that stuff

Info on these API-things.

in API Development

Posted by: smiley.1438

smiley.1438

These are things which are easily possible with the current API. I think there’s no mod for a forum so far, but since one can write such apps mostly in javascript it would’t require much of a mod, more like one or 2 lines HTML in a forums template, the rest could be managed by the script which would be needed to include.

[API Suggestion] Colors API

in API Development

Posted by: smiley.1438

smiley.1438

Would it be possible to assign the color tone and materials for each color to colors.json?

126: {
	name: "Hot Pink",
	tone: "red", //red, orange, yellow, green, blue, purple, brown, gray
	set: "rare", //starter, common, uncommon, rare, special
	material: "vibrant",//vibrant, natural leather, natural metallic
	base_rgb: [128,26,26],
	cloth: {
		...
	},
	...
},

(edited by smiley.1438)

XML Output

in API Development

Posted by: smiley.1438

smiley.1438

Not to speak of the overhead XML has compared to JSON.

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

A lot (or possibly all?) items from Karma vendors seem to be missing. Also Mystic Forge recipes…

Hi-Res WvW Maps

in API Development

Posted by: smiley.1438

smiley.1438

Not really. The bitmap maps are alot clearer in details – compare for yourself:

http://gw2.chillerlan.net/examples/gw2maps-gmaps-simple.html (API map)
https://chillerlan.net/gw2/wvw.html (self created PNG map from the source God Of Fissures.8627 provided)

Pan to Stonemist castle at max zoom and compare the details and you’ll notice a huge difference.

Hi-Res WvW Maps

in API Development

Posted by: smiley.1438

smiley.1438

Generating these from the API is pretty easy if you cheat a bit. :P

But there’s the downside that the API-Maps are only JPEG while those from the gw2.dat are actually hi-res bitmap formats. (YES, i wish the maps API had an option for .png maps!)

List of apps/websites using the API

in API Development

Posted by: smiley.1438

smiley.1438

Thought this thread was dead

This thread is actually (more or less) meant to be dead, see: https://forum-en.gw2archive.eu/forum/community/api/List-of-apps-websites-using-the-API/2571058

Just hop over to the wiki: http://wiki.guildwars2.com/wiki/API_talk:List_of_applications to advertise your application

(edited by smiley.1438)

Hi-Res WvW Maps

in API Development

Posted by: smiley.1438

smiley.1438

God Of Fissures.8627 created them, you should PM him

Dynamical Map API

in API Development

Posted by: smiley.1438

smiley.1438

x and y are not the pixel coordinates but the tile coordinates. z is the desired zoom level of the requested tile.

See: http://leafletjs.com/reference.html#tilelayer or https://developers.google.com/maps/documentation/javascript/reference#ImageMapTypeOptions

API Changes with upcoming WvW changes?

in API Development

Posted by: smiley.1438

smiley.1438

I’ve added the translations as well as the approx coordinates to my gist – grab this for a full featured objectives.json:
https://gist.github.com/codemasher/bac2b4f87e7af128087e
;)

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

For the current naming convention in objective_names.json they should be all named “ruin”. See also:
https://forum-en.gw2archive.eu/forum/community/api/WvW-objective-names/first#post2068553

(I’d like to update my Gist with the JSON which contains all names and translations, but GitHub currently thinks that i’m not a human and hid my profile from the public… -.-) €: it’s available again: https://gist.github.com/codemasher/bac2b4f87e7af128087e

While i’m at it: https://api.guildwars2.com/v1/maps.json?map_id=922 (Labyrinthine Cliffs) is missing in maps.json and map_floor.json while still 9 events are listed for this map_id.

(edited by smiley.1438)

Cities in Map Names API

in API Development

Posted by: smiley.1438

smiley.1438

Since this is still unanswered: i just discovered that https://api.guildwars2.com/v1/map_names.json returns all maps which have events available (i think that isn’t documented at all) so the primary usage of this one is https://api.guildwars2.com/v1/events.json or https://api.guildwars2.com/v1/event_details.json

Try to throw anything in event_details into a database and run some SQL like this:

SELECT `map_id` FROM `gw2_events` GROUP BY `map_id` ORDER BY `map_id`

and compare the result with map_names.json – i belive it’s generated in the same way
Oh and using the maps.json isn’t too hard – it’s actually quite handy.

see https://gist.github.com/codemasher/dc3b232b3ccd2609a43b

(edited by smiley.1438)

Dynamical Map API

in API Development

Posted by: smiley.1438

smiley.1438

There are tons of examples around and also the API documentation – it’s the best way to get started

http://wiki.guildwars2.com/wiki/API:Main

A simple Google maps example:

https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2maps-gmaps-simple.html (demo)

For more advanced stuff, just have a look at my GitHub repo, the Wiki maps widget or the other examples listed on the official wiki.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: smiley.1438

smiley.1438

There have been countless renamings of several items in the german translation (not only) recently. Some items have been renamed more than once. So if you’d like to maintain a database where you’re able to search items by name, a full update after patches seems to be mandatory.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: smiley.1438

smiley.1438

I belive at least you are aware, Ish. My comment pointed more at this:

I would call that an exception rather than the norm. It is rare for them to change so many items at one go.

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: smiley.1438

smiley.1438

The obvious gap in a system like DarkSpirit’s is, of course, when an already known item/recipe changes. This happened to a lot of them on Sept. 3, when all existing equipment with Magic Find had their attributes removed, upgrade components that affected MF had their attributes/effects modified, and the recipes that crafted MF equipment were updated with a new output_item_id.

I would call that an exception rather than the norm. It is rare for them to change so many items at one go. Having said that, it is probably wise to do a full item/recipe update after a massive item patch release like that one.

If you operate under the assumption that the item/recipe data themselves rarely change, then that should not be a big issue.

You guys seem not to know about translation issues and stuff ^.^
At least the german translations and possibly also the french and spanish change with nearly every patch and so they give us a hard time in the wikis to find and move all that stuff. So once more the suggestion: An API which delivers all IDs of changed items for a given build (and therefore an API which delivers the recent build numbers – this could be done by the already existing build.json)

(edited by smiley.1438)

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: smiley.1438

smiley.1438

Right now as I’m testing it takes almost 20 minutes to download full item detail for the ~30k items in the game.

Wait WHAT? Only 20 minutes? A full update takes us about 20 hours (for all 4 languages of course at ~2-3 seconds per request, wiki check and recipe update not included)
I still think, the most important feature would be an API which provides a list of the changed items/events/recipes since the last patch, so that we can safely do incremental rather than full updates after updates where we don’t exactly know what has changed.

API Changes with upcoming WvW changes?

in API Development

Posted by: smiley.1438

smiley.1438

The best way would actually be to provide all the WvW icons via the https://api.guildwars2.com/v1/files.json API

[MumleLink] Security questions

in API Development

Posted by: smiley.1438

smiley.1438

Regarding security: If you use the concept of a “shared key”, “stealing” data is pretty impossible – this was also one of my concerns. Regarding maths’n’stuff, have a look at mine and Heimdall’s repos over here (or this thread too):

https://gw2apicpp.codeplex.com/ (C++ Mumble link part)

https://gw2apicpp.codeplex.com/SourceControl/latest#GW2API_Upload/Gw2Maps/Position.cpp

	//Avatar View
	sprintf_s(num, NUM_SIZE, "%s%d,", J_AVATAR_FRONT, mod((atan2(image.fAvatarFront[2], image.fAvatarFront[0])*180/PI), 360));

https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location-receiver.php (receiver for the Mumble link data)
https://github.com/codemasher/gw2api-tools/blob/master/sql/gw2_player_pos.sql (SQL database schema)
https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location.html (web frontend)
https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2location-ajax.php (ajax part of the web frontend)

(edited by smiley.1438)

PIRATES!!!

in Suggestions

Posted by: smiley.1438

smiley.1438

I agree with the OP in general, but this (API) is simply the wrong subforum for this topic.

(edited by smiley.1438)

Files API giving map_waypoint_hover twice

in API Development

Posted by: smiley.1438

smiley.1438

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

It seems a lot of Items were readded to the items pool after the recent changes on magic find, for example:

https://api.guildwars2.com/v1/item_details.json?item_id=28586
is now:
https://api.guildwars2.com/v1/item_details.json?item_id=47087

Is it for sure that the infix_upgrade is missing for all the “old” items, so that we can 100% tell which are the “new” ones? Or would it be possible to add something like a “deprecated” flag if not? Otherwise it would sooner or later mess up the IDs which are added to the wiki articles, i guess.

Monospace font for code

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

In the meantime you could give this a try: https://gist.github.com/codemasher/5884119