Macro Documentation

Macro Documentation

Postby scj643 » Tue Jul 15, 2014 2:23 pm

I have noticed a huge lacking in the documentation for the macro system. There is no documentation on the wiki except the examples.
User avatar
scj643
 
Posts: 13
Joined: Tue Nov 12, 2013 8:31 pm

Re: Macro Documentation

Postby lugdunon » Wed Jul 16, 2014 12:49 am

That is something that has been on my plate for quite some time. The macro system does contain access to the entire client-side API, which means that I really need to be providing API docs and a general section on common patterns.

I am hoping that this is so etching that I can start dedicating a night or two per week to doing (documentation as a whole) because the more I get implemented in game, means the more I am going to have to document at some point.

Thanks for putting this oversight into my sights again. :)

Chris
User avatar
lugdunon
Site Admin
 
Posts: 407
Joined: Tue Nov 05, 2013 5:53 pm

Re: Macro Documentation

Postby jcwilk » Sun Aug 31, 2014 10:22 pm

lugdunon wrote:the entire client-side API,


Could you at least gist up some dumps of example code, even if uncommented? Or a link to a js file that might indicate interfaces? It seems odd to have such a nice feature as in game script editing without anything besides two short code examples in the wiki (unless I missed other info)... Even if it was bumped up to 5 examples that would be helpful.
jcwilk
 
Posts: 5
Joined: Sun Aug 31, 2014 10:15 pm

Re: Macro Documentation

Postby lugdunon » Mon Sep 01, 2014 12:11 am

Hi there!

One thing that I have been sorely remiss in providing is adequate documentation. I am working on fixing that and should have some improvements to the wiki as well as beginning to publish javadoc and jsdoc to lugdunon.net automatically as part of the build process. I will also be unveiling with the 0.7.1 release (which will be out at the latest this coming Thursday) the official github repos that will be home to example mods, and the ant tasks that will make building and packaging mods as well as generating the repository metadata as simple as executing an ant task.

I'll also make sure to get some more macro examples up in the next day or two. I know I have a few laying around for exporting player sprites, and modifying the time of day. Is there anything in particular that you would like to see?

Thanks for the reminder to get myself busy filling in this hole by providing docs. :)

Cheers,
Chris
User avatar
lugdunon
Site Admin
 
Posts: 407
Joined: Tue Nov 05, 2013 5:53 pm

Re: Macro Documentation

Postby jcwilk » Mon Sep 01, 2014 3:14 pm

lugdunon wrote:Is there anything in particular that you would like to see?


Thanks for the quick reply. I guess I'd be most interested in stuff around resource gathering, or more generalized, stuff around scanning, moving, wandering, drawing resources, etc... So maybe...

- Walk to nearest ore deposit and mine it with the pickaxe in your first slot
- Walk to the nearest tree and chop it down with the axe in your first slot
- Walk to the nearest field and start planting the first seeds you have in a slot

I imagine a few examples like that would give enough hints to do quite a bit, like the ore deposit script could be expanded by a player to keep wandering through the mine aimlessly until a certain kind of ore is found, to use certain types of pickaxes for certain types of ore, maybe even to run back to the village to make new pickaxes when they run out, etc. Oh, that's another one that could be interesting:

- Craft something on an anvil/forge/oven/whatever

Also, I saw something about a REST API, is that just for auth?
jcwilk
 
Posts: 5
Joined: Sun Aug 31, 2014 10:15 pm

Re: Macro Documentation

Postby lugdunon » Mon Sep 01, 2014 9:36 pm

I think I can accommodate those requests. :) Will see what I can knock out after I get finished with this release.

There are a few REST APIs, namely:

  • auth.lugdunon.net has a few for making queries on currently connected users as well as accounts registered / active / etc.
  • Coming with 0.7.1, a public listing server will provide REST access to the public server listing.
  • Lugdunon server REST services currently support:
    • Player Achievements
    • Player Listing
    • Player Metrics
    • Server Properties
    • World Properties
    • Compendium Information: each compendium can expose information via REST (more info available here)

Modders are also free create their own REST APIs, as this is fully supported in the mod spec, and server admins will be able to determine which APIs are actually exposed.

If you like, I can try and compile a list of the existing APIs for you tomorrow if you would like.

Cheers,
Chris
User avatar
lugdunon
Site Admin
 
Posts: 407
Joined: Tue Nov 05, 2013 5:53 pm

Re: Macro Documentation

Postby jcwilk » Tue Sep 02, 2014 2:57 pm

lugdunon wrote:I think I can accommodate those requests. :) . . . If you like, I can try and compile a list of the existing APIs for you tomorrow if you would like.


Awesome! It sounds like with a few more macro examples and the info that will come with the 0.7.1 release (especially that github repo you mentioned) there will be quite a bit to play with :) don't want to distract you from your work more than necessary. I'll come back and bug you though once I've run out of things to muck with after seeing those examples and github codes :P Thanks a bunch.
jcwilk
 
Posts: 5
Joined: Sun Aug 31, 2014 10:15 pm

Re: Macro Documentation

Postby lugdunon » Tue Sep 02, 2014 3:00 pm

Thanks so much for the question and for giving the game a play. :)

Look forward to hearing your further input and any criticisms or shortcomings you may find.

Cheers,
Chris
User avatar
lugdunon
Site Admin
 
Posts: 407
Joined: Tue Nov 05, 2013 5:53 pm

Re: Macro Documentation

Postby lugdunon » Fri Sep 05, 2014 8:48 am

Oh, and if you still want an accounting of the REST services available on your server (and you don't mind parsing the JSON) you can hit this url:

http://{your-server-ip}:{your-csport-41976-by default}/rest/

Bibracte's is here: http://bibracte.lugdunon.net:41976/rest/.

You can get the JSON returned into a more readable format by copy and pasting it into the validator at: http://jsonlint.com.
User avatar
lugdunon
Site Admin
 
Posts: 407
Joined: Tue Nov 05, 2013 5:53 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 13 guests

cron