Community documentation

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Community documentation

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Community documentation

Post 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?
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Community documentation

Post 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
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Community documentation

Post 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.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Community documentation

Post by JKos »

Ok, thanks I think that got it now after some sleep and thanks for updating the Wiki too.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Community documentation

Post 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.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Community documentation

Post 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
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Community documentation

Post by JohnWordsworth »

Great work jkos! If there are any gaps left come the Christmas break, I will be sure to contribute!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
ReFreezed
Posts: 8
Joined: Tue Nov 25, 2014 7:10 pm
Contact:

Re: Community documentation

Post by ReFreezed »

Having the documentation as a wiki is such a good idea! I'll add things if I notice something is missing.
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Community documentation

Post 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.
Breath from the unpromising waters.
Eye of the Atlantis
Post Reply