Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

hottehead

Unofficial API Documentation

Recommended Posts

hottehead    13

Hello community,

 

I recently started an unofficial API documentation to get an overview about all this LUA code which is given to us. I finally have a domain for it and it is ready to be used. I specifically want to thank Blueberrys and Mobbstar for helping me to get the first content ready. Visit the site at 

 

http://www.dontstarveapi.com

 

Everyone is welcome to contribute. Check our

How to contribute page!

 

 

 

Current Status (12/04/2015)

 

94 published pages

15 contributors

4 authors

1 editor

Share this post


Link to post
Share on other sites
Mobbstar    13,263

We have a status/progress bar on the main page now. This is great, it shows how few people actually contribute to the site.

 

...

 

What are you waiting for? If you know anything to say about even just the pig head prefab, put it up there.

Share this post


Link to post
Share on other sites
RedRock911    36

As soon as I know what I am doing, I'd love to contribute! Since I'm basically on the bottom ground, do you guys want me to post what things I have trouble understanding here? Could give a good base for whats missing in the API, Like Widgets..............................

Share this post


Link to post
Share on other sites
Mobbstar    13,263

As soon as I know what I am doing, I'd love to contribute! Since I'm basically on the bottom ground, do you guys want me to post what things I have trouble understanding here? Could give a good base for whats missing in the API, Like Widgets..............................

 

To be fair, there are still so many things missing. When you feel like you know enough about something to write about it, please do so. If you notice a lack essential information, please point that out. If you're confused about a page, please ask for clarification.

Share this post


Link to post
Share on other sites
RedRock911    36

, please point that out. If you're confused about a page, please ask for clarification.

Well, I'm working on a custom lantern atm. As a new modern I'm confused where I put all the information in the custom prefab. That, and I'm not exactly sure when opening a DS prefab, what information I need specifically.

In fact I'll just say it. Please, if you would like, use this as an example:

I'm making 2 versions of a customized lantern. One is character specific, and the other is craftable. The character specific one I want to not require a fuel source, while the other does (say, a piece of charcoal).

Also I want my character specific one to automatically turn on at night, while the craft able needs to be turned on.

On top of that, (if I wasn't asking a lot in the first place) I wanted to give the character specific one to have a different colored light.

The problem that I have, is I can find the prefab, and components, but I have no idea exactly where to put them.

There is a light resource tab in the API. It is helpful, but it is extremely basic. If anyone would like to work that part of the API, I'd appreciate it. And if I figure it out myself, I'd love to contribute!

Share this post


Link to post
Share on other sites
Mobbstar    13,263

I'm making 2 versions of a customized lantern. One is character specific, and the other is craftable. The character specific one I want to not require a fuel source, while the other does (say, a piece of charcoal).

Also I want my character specific one to automatically turn on at night, while the craft able needs to be turned on.

On top of that, (if I wasn't asking a lot in the first place) I wanted to give the character specific one to have a different colored light.

The problem that I have, is I can find the prefab, and components, but I have no idea exactly where to put them.

There is a light resource tab in the API. It is helpful, but it is extremely basic. If anyone would like to work that part of the API, I'd appreciate it. And if I figure it out myself, I'd love to contribute!

 

Regarding your example: The fueled component is needed for the second light, it also needs the machine component (for turning on/off). The former light requires event listeners for automatic toggling. The colouring is explained on the Docs already.

 

I'm afraid, however, that there isn't much more to say about the light in specific. At best one could add examples and applications, if that is what you meant. I will look into getting the events explained, and the prefab pages need to be set up at some point too (they'll have a rundown of the prefabs properties, a copy of the prefabs code, and comments/explanation).

 

Also, you should be able to leave editorial comments at a page, that will be seen by its author(s), but not by non-registered users.

Share this post


Link to post
Share on other sites
RedRock911    36

Also, you should be able to leave editorial comments at a page, that will be seen by its author(s), but not by non-registered users.

 

On it, signing up now. I was thinking about this all day at work "maybe the API needs at least one inexperianced modder to ask some further explanation, to better improve the API. 

One of the things I do want to contribute, is how exactly to aid in updating tutorials. I feel they become abandoned once the general feel good of making a helpful article is over. Another opinion is there is a "this is mentioned a million times, I don't really think I need to add this to mine" which I feel isn't a particular good opinion. Especially the very popular tutorials such as the item creation from scratch (which IS amazing btw) 

I also wonder when I'll lose that new car smell and not notice little things like that, lol. 

Share this post


Link to post
Share on other sites
JoJo54696    0

I think more Vet don't starve modders should be contributing to this site.

 

I know how to code in c++ and Java and am a computer science major so i understand all the code in the mods

 

It would be nice to have a directory where one could just simply look up the variable or function they would like to modify instead of looking through millions of examples/current mods to try and find the correct API function call.

 

A site like this is exactly what I was looking for when I first downloaded don't starve. It is an AMAZING idea so why aren't people contributing. I can't contribute because I have yet to mod this game BECAUSE it is so hard to find the variables and functions and such that you actually want to modify, without finding a mod that does something similar or accesses the same data you would like to access. WE NEED API DOCUMENTATION. with that a could easily create quality mods for this game without wasting hours of my time looking for variable names

 

PLEASE HELP THIS DATABASE!

Share this post


Link to post
Share on other sites
hottehead    13

Hey folks,

 

the API docs have been getting some more accounts lately. All that is left now is start writing your knowledge down ;)

 

Mobbstarr is doing great work and maintaing a lot! Thanks again.

So far we have a decent amount of components and prefabs documented. We also have ported a lot of tutorials regarding DS and LUA from the forums. And furthermore we are improving the sites functionality. 

 

 

cheers hottehead ( webmaster )

Share this post


Link to post
Share on other sites
Mobbstar    13,263

Hey folks,

 

the API docs have been getting some more accounts lately. All that is left now is start writing your knowledge down ;)

 

Mobbstarr is doing great work and maintaing a lot! Thanks again.

So far we have a decent amount of components and prefabs documented. We also have ported a lot of tutorials regarding DS and LUA from the forums. And furthermore we are improving the sites functionality. 

 

 

cheers hottehead ( webmaster )

 

:roll: Pff, you call such a tiny introduction to all (not even all) the subjects to be explained "great work"? :razz: I'm mostly spending spare minutes on tiny-winy wee pages, an easy task anybody who has touched related code before could perform.

 

Looking at a page, be it a simple prefab, a component or something more abstract like a behaviour, reveals exactly what kind of information you need to give. Looking up the file and using a bare minimum of experience with that thing is the only research needed. Then put the research in the suggested format, and there you go. :ugeek:

 

But yes, the website is still growing, slowly but growing. Some people pop in and presented fantastic page styles, others just point out text passages that aren't clear enough. :encouragement:

Share this post


Link to post
Share on other sites
Maris    213

It could be much faster if everyone can edit the pages like on Wikipedia.

Share this post


Link to post
Share on other sites
Blueberrys    172

@Maris I don't think that would particularly help. Anyone is able to edit in changes or new additions, even brand new accounts. Those are reviewed by higher level users before published. We don't have a large team to monitor everything, so it's safer this way. The higher ranked users are active enough to keep the flow going so far. The issue with speed is simply because there isn't enough contribution. People are either busy, don't know enough to post, or afraid to post what they do know.

Share this post


Link to post
Share on other sites
TemporaryMan    1,021

Which version of the game are you documenting?  Is it only the latest version of DST, or do you have some format for showing differences between DS, RoG and DST?  I've looked over the site several times and this has been my main cause for hesitation since the particular components I know the most about are different in all three versions.  (And I don't have DST, but that'll only be a problem for one more month.)

Share this post


Link to post
Share on other sites
Blueberrys    172

@TemporaryMan Actually, we don't have any structure for that as of yet. I think most of the pages refer to DS RoG, but there are some incomplete pages for DST. Feel free to organize it or suggest ideas to make the separation more obvious and rigid.

Share this post


Link to post
Share on other sites
TemporaryMan    1,021

I can see one potential reason for the slow pace of progress on the site: all the dynamic language witchcraft at play.  Take the beard component for example; it has a canshavetest field that isn't defined anywhere in beard.lua itself, but in the beefalo prefab of all things.  So there's the benefit that each prefab that has a beard gets to define that function on their own terms, but it compromises object oriented design because the class isn't self-contained and depends on the classes it interacts with to define what instance variables it has and how its functions work.  So to describe any class you need to know the sum total of its relationships with the outside world; for a programmer used to static, structured languages like C++ and Java that's like telling a writer who's used to defining characters by personality traits, beliefs and abilities that they need to define characters by a web of relationships instead.

 

It makes it much more of a headache to gather the information than if the classes were all static, self-contained islands.  Which reminds me of Simon & Garfunkel for some reason.  And that's reminding me of the lengths some DST players are going to to keep their bases from being burned & hammered...

Share this post


Link to post
Share on other sites
Blueberrys    172

@TemporaryMan I understand why that would be an issue for programmers who are used to other type of languages, but I think Lua has it's own benefits and attractions too. The ability to switch up your mindset is an extremely useful skill, in programming and practically everywhere else where you must think of something. Perhaps, it's ideal for that little learning curve to exist. It gives an interesting challenge, and challenges are good for brains.

 

Specifically, in the case of the beard, I think it makes sense for the shave test to be per-prefab based. Even in real life; you might not be willing to shave a large animal with just an inch of hair, but with your own facial/body hair, an inch is quite a bit. Hair also grows at different speeds, so that can be a factor.

If the same thing was implemented completely inside of the component, the prefabs would have to define a new function to work with it or override it anyways if they needed some sort of variation.

 

Awesome song btw.

 

 

Regarding the separation of the different DS versions.

I think the page structure is fairly okay as it is now. Each page can contain generic information that applies to all versions, and contain specific tags which let the user know if something exists in a version or not. Some pages may be tagged to be entirely for a specific version, such as the Network pages being only for DST.

Now, the way to implement the tags is something I'm unsure of. I was thinking something like a little icon before the relevant paragraphs or table-rows, something like this:

post-484324-0-94974000-1431025959_thumb.

A little tool tip on hovering would help too.

Maybe someone can come up with something better though.

Share this post


Link to post
Share on other sites
Mobbstar    13,263

Regarding the separation of the different DS versions.

I think the page structure is fairly okay as it is now. Each page can contain generic information that applies to all versions, and contain specific tags which let the user know if something exists in a version or not. Some pages may be tagged to be entirely for a specific version, such as the Network pages being only for DST.

Now, the way to implement the tags is something I'm unsure of. I was thinking something like a little icon before the relevant paragraphs or table-rows, something like this:

attachicon.gificon.png

A little tool tip on hovering would help too.

Maybe someone can come up with something better though.

 

But since some components and prefabs are different in each version, it should be possible to mark certain text passages rather than only the entire article. It would be no problem to copy-paste an "only available in DS X" header, right?

 

If there was an easy solution to it, then it'd be so already. :razz:

 

EDIT: Can any forum fellows think of a good solution?

Share this post


Link to post
Share on other sites
Blueberrys    172
But since some components and prefabs are different in each version, it should be possible to mark certain text passages rather than only the entire article. It would be no problem to copy-paste an "only available in DS X" header, right?
 Mhm. We can use smaller icons to put above or on the side of text/code bits. Copy-pasting can work, but new contributors might be unsure how to format it correctly. It might be the only way considering it's so customized, but we can explore our options. Perhaps a combination of some tag/icon plug-ins for simplicity and a formatting guide for contributors would wean out these issues.

Share this post


Link to post
Share on other sites
RedRock911    36

But since some components and prefabs are different in each version, it should be possible to mark certain text passages rather than only the entire article. It would be no problem to copy-paste an "only available in DS X" header, right?

If there was an easy solution to it, then it'd be so already. :razz:

EDIT: Can any forum fellows think of a good solution?

Why not just say it in the article: just put something like: DST only or Rog only somewhere in the article?

I get it's simplicity might not be the best of options, but for now couldn't that offer some clarity? Or, since I just woke up (and extremely early with not enough coffee) , and possibly have missed it, is that being done already in some form?

Share this post


Link to post
Share on other sites
Mobbstar    13,263

I just published a page about behaviour nodes and will complement that with practical examples (brains). For the case anyone has trouble understanding that stuff, even after reading the article(s), please inform me so I can amend the documentation.

 

And yes, I still have to repair some component explanations. And yes, combat is still missing. But I am the only one really working on the components pages, I can't work wonders for free.

 

sry 4 necro

Share this post


Link to post
Share on other sites
Mobbstar    13,263

Mobbstar, your awesome. Just sayin.

 

Thanks.

 

Also we have 100 pages! Woohoo! :wilson_celebrate:

Only 985 left! *sigh* Oh well, at least 984 now.

Share this post


Link to post
Share on other sites
RedRock911    36

Thanks.

Also we have 100 pages! Woohoo! :wilson_celebrate:

Only 985 left! *sigh* Oh well, at least 984 now.

I wish there was a creature creation tutorial that leads through the complete process. I like the tutorials already made, they help with a basic intro (Cheerios tutorial). But you can't make a complete workable mod using them. One that goes from point A from scratch, if I ever complete my ridiculous mods (courage the cowardly dog and flapjack) I was thinking of getting together with some API gurus and creating a standalone Monty pythonesque rabbit as a tutorial.

But I have sooooo much to do. I'd like to really help. But I need help to help,lol helpception!

If I had the help I need, I could clear my table in a month, and then spend my time helping the API build.

Share this post


Link to post
Share on other sites
Mobbstar    13,263

I wish there was a creature creation tutorial that leads through the complete process. I like the tutorials already made, they help with a basic intro (Cheerios tutorial). But you can't make a complete workable mod using them. One that goes from point A from scratch, if I ever complete my ridiculous mods (courage the cowardly dog and flapjack) I was thinking of getting together with some API gurus and creating a standalone Monty pythonesque rabbit as a tutorial.

But I have sooooo much to do. I'd like to really help. But I need help to help,lol helpception!

If I had the help I need, I could clear my table in a month, and then spend my time helping the API build.

 

Pfff you'll never stop making mods when modding, trust me on that one.

 

I usually expand the docs based on problems people have, or on my own research. For instance, covering the rest of the components seems kinda tedious to me, but behaviours are fine.

Share this post


Link to post
Share on other sites