owmygowd towers are not even in the API already, let's complain ^^
Posted 5 months ago by
Lemo

|
Permalink
locations.streetInfo will now work for home street and towers (for everyone) and house interiors (for owners only)
(Staff reply)
Posted 5 months ago by
Bees!

|
Permalink
yeaa wow indeeed I just noticed!!! cool bees!
Most useful info would be neighbors links still, and I'm not seeing any "connections":{} :\
The tower works just fine, but I still get an error for my house
It's gonna be fun to showcase people tower images from the API now ^^
Lemo's House
Lemo's Home Street
Lemo's Tower
Posted 5 months ago by
Lemo

|
Permalink
your house will only work if you're authenticated
(Staff reply)
Posted 5 months ago by
Bees!

|
Permalink
Ow yeah, sure /dumb, was so used to have this call without auth
The point about neighbors is still valid though :]
Posted 5 months ago by
Lemo

|
Permalink
Sweet!
Now that you're around...
wouldn't it be fun to have the note pole contents in there as well?
not sure about the actual uses of that yet, but it could be quite powerful, like tags or something for ex.
Posted 5 months ago by
Lemo

|
Permalink
Hmmm. I wonder why we don't just return a list of all items in a location. Then i'd just need to add the note contents to the getInfo method for note poles.
(Staff reply)
Posted 5 months ago by
Bees!

|
Permalink
You mean, like, Everything? the stuff on the ground and all that?
That'd be a lot of fun to play with for sure :p
In that case how about coins? ^^ (roobrik & balzare don't have much to tell to the API right now)
Posted 5 months ago by
Lemo

|
Permalink
All items in a location sounds super! If that's not possible, it would be very helpful to return the presence of Machines, Icons, and Cultivation Projects. Thanks for the updates!
Posted 5 months ago by
TomC

|
Permalink
Alright, I'm pretty much a JSON newbie here, but in the idea of having a list of neighbors when you don't know each of their TSID yet, wouldn't it be more simple to have a simple array here, rather than a hierarchy with unknown variables? I mean, in that case why do we have the same TSID value in the child properties as well?
I'm thinking about:
Before
After
Or another example with the "results" listing
here
Posted 5 months ago by
Lemo

|
Permalink
is there any chance that locations.streetInfo of a Tower returns as features the SDB it has... with each one price? :)
TIA
Posted 5 months ago by
UXRoot

|
Permalink
Lemo: you don't have to know the keys to iterate over a hash/object. In JavaScript, just do this:
for (var tsid in ret.neighbors){
console.log("neighor TSID is "+tsid);
console.log("neighor name is "+ret.neighbors[tsid].name);
}
(Staff reply)
Posted 5 months ago by
Bees!

|
Permalink
Thx Bees
Actually I'm making a Flash app, and I'm using
this library to parse JSON
With the other calls I just had to use something simple like: o.hub.name
(would be like o.neighors[0].name and a loop here)
Will have a look how to translate your code to actionscript...
Posted 5 months ago by
Lemo

|
Permalink
it will be the same in ActionScript...
for(tsid .... ret.neighbors) is returning... not the content of .neighbors[], but each "key" (in this case each neighbor tsid).
then for each key, you get the actual content of that element with ret.neighbors[tsid]
the reason is that instead of returning arrays Glitch always returns a hashmap, where each key is the tsid and the "value" is the object of that tsid.
what version of Flash are you using because AdobeFlash already comes with a JSON library. you just call "JSON.parse()" and that returns an object, in the Bees! example will be the "ret" object.
Posted 5 months ago by
UXRoot

|
Permalink
Yeah I'm using an Ancient flash version :p hence the custom lib
Had no idea these for-in loop thingies existed
Well it seems to work indeed, thx for the help!
Posted 5 months ago by
Lemo

|
Permalink
I don't know if you are using the "design" part of Flash a lot, but IMO the best IDE for ActionScript is Intellij IDEA
www.jetbrains.com/idea/feat...
I think the free version supports it too. and Flex/ActionScript SDK is free. so you could use the latest version of ActionScript for free.
HTH
Posted 5 months ago by
UXRoot

|
Permalink
Okay I'll have a look!
But yeah I kinda like using the design part at the same time
Posted 5 months ago by
Lemo

|
Permalink
Hmmm, tower name in the API currently simply returns "<player name>'s tower". Is there any way to get the actual name of the tower?
Posted 5 months ago by
Boom and Bust

|
Permalink
Oh, and the 'active_project' field doesn't actually work right now. I just tested it against a cultivation project on someone's home street.
Posted 5 months ago by
Boom and Bust

|
Permalink
we need a projects.searchActive(...) method!!
I think that the connections list needs a field location_type (tower, interior) (those two right now), but if there will be more, we need a way to know which one is each one, specially if the name is changed.
Posted 5 months ago by
UXRoot

|
Permalink
Also the hub.name is empty right now, maybe you could stick the type of the current street in there as well
Posted 5 months ago by
Lemo

|
Permalink
The active_project field is for street projects, but it will always be false on home streets, towers etc since they aren't street projects.
Posted 5 months ago by
TomC

|
Permalink
And, uh, also, can we have some consistency in the "features" field please? If the street is uncultivated, the API returns an empty object, but if there is something on it, it returns an array with a single element, a HTML string containing all the features. This doesn't make sense at all, especially considering in JavaScript, {} == true, which is rather annoying.
Posted 5 months ago by
Boom and Bust

|
Permalink
Planned additions:
* All items in location, with some details for certain item classes (SDB contents, note text, etc)
* Custom name for towers
* Street 'type' for interior/exterior/tower locations
* (Restoration) projects on interior/exterior/tower locations
The format of the `features` data should be ignored and will probably be removed from the API in favor of information about the actual items in the location. It's currently just the data the client uses for loading screens, which is why it has such a hard-to-parse format.
As many of you have figured out, the web site and game client both use the API (with hundreds of private methods) and cruft like this get exposed when we open up these API methods.
(Staff reply)
Posted 5 months ago by
Bees!

|
Permalink