Page 1 of 2

Community documentation

Posted: Mon Dec 15, 2014 11:39 pm
by JKos
Hi,

As some of you may know, I copied and converted the official documentation to GitHub so anyone can improve it, because AH obviously doesn't have the time ( or motivation ;) )
https://github.com/JKos/log2doc/wiki

And I also added some missing pieces, like BrainComponent properties and added a list of Traits which I generated with JohnW's asset definition scraper script, but there is still a lots of unclear/missing stuff. So I thought that I'd start a new thread for this purpose. The idea is that anyone can post a documentation request here for some function/feature which needs some clarification and someone who has the time and understanding can post the description. I can add the answers to the GitHub (when I have the time), if you don't want/know how to do it.

REQUEST:
I for example would like to know that what the hell does toLocal(ox, oy, facing, x, y) function do? I think it's related to setWorldPostion somehow, calculates distances from ox,oy to x,y or something, but I don't quite get the logic behind it, anyone? I'm sure that it's useful.

Re: Community documentation

Posted: Mon Dec 15, 2014 11:51 pm
by minmay
toLocal(ox, oy, facing, x, y)
Given original X and Y coordinates, facing, and new X and Y coordinates, returns delta X and delta Y values local to facing. For example, toLocal(1,2,0,3,5) returns (2,-3), the X and Y movement necessary for a party facing north to get from (1,2) to (3,5).
Maybe useful for moving monsters towards arbitrary points?

Re: Community documentation

Posted: Tue Dec 16, 2014 12:23 am
by JKos
Thanks a lot minmay, but are you sure? Since toLocal(0,0,2,1,1) returns -1 1
Example:
party (P) is facing to the south (down)

Code: Select all

 01234
0P****
1*X***
2*****
3*****
I don't get how the movement to X is -1 1? Or is it world position not grid position? Maybe I just need some sleep :D

Re: Community documentation

Posted: Tue Dec 16, 2014 12:30 am
by minmay
JKos wrote:

Code: Select all

 01234
0P****
1*X***
2*****
3*****
I don't get how the movement to X is -1 1?
Global space is oriented north (up) so if the party is facing south, moving left oriented to the party will move east (right) in global space, and moving forward oriented to the party will move south (down) in global space. That's why it's called toLocal.

Re: Community documentation

Posted: Tue Dec 16, 2014 9:33 am
by JKos
Ok, thanks I think that got it now after some sleep and thanks for updating the Wiki too.

Re: Community documentation

Posted: Tue Dec 16, 2014 9:59 am
by petri
Again many thanks for taking the initiative!

toLocal simply transforms a grid coordinate to the local space of an "entity". ox,oy,facing are the origin and facing of that entity and x,y are the coords to be transformed.

Re: Community documentation

Posted: Tue Dec 16, 2014 10:34 pm
by JKos
Thanks to you Petri and AH for such a extensive modding support that even the documentation is too much work :)
I made some structure changes and added description for delayCall

Re: Community documentation

Posted: Wed Dec 17, 2014 9:44 pm
by JohnWordsworth
Great work jkos! If there are any gaps left come the Christmas break, I will be sure to contribute!

Re: Community documentation

Posted: Sat Dec 20, 2014 3:20 am
by ReFreezed
Having the documentation as a wiki is such a good idea! I'll add things if I notice something is missing.

Re: Community documentation

Posted: Sun Dec 21, 2014 3:53 pm
by Drakkan
I would welcome some informations about

- champion conditions - some list of it (like poisoned, petrified etc...), if it is possible to define some new and then just simply assign them to some monster attacks etc.

- some mortat and pestle information. if it is possible somehow define new ingredients and somehow to create clones of mortar (like tools for crafting other stuff). It was quite simple for Log1 but I do not see this possibility now, which is strange.