Scripting Reference (work in progress)

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
gambit37
Posts: 218
Joined: Fri Mar 02, 2012 3:40 pm

Re: Scripting Reference (work in progress)

Post by gambit37 »

petri wrote:Hey Matt! Great to see you here! When can we see the first Grimrock mod from you ? ;)
Hmmm. Probably after my house is finished...! :D :? (It's taking much longer than we expected to renovate this old dump!)
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Scripting Reference (work in progress)

Post by JKos »

Because the scripting reference is so amazingly long and not very well formatted at the moment (I'm not complaining :) ), I made a quick greasemonkey script which makes it a bit more readable.

Code: Select all

// ==UserScript==
// @name        LOG2 scripting reference
// @namespace   jkos
// @include     http://www.grimrock.net/modding/scripting-reference/
// @version     1
// @grant       none
// ==/UserScript==
        
$('h3').css('cursor','pointer')
$('h3').nextUntil('h3').hide();

$('h3').click(function(e){
  if ($(e.target).next().is(":visible") ){
    $('h3').nextUntil('h3').hide();
  }else{
    $(e.target).nextUntil('h3').show() ;
  }
})

$('em').css('font-weight','bold');
$('em').css('font-size','1.1em');
$('li').html(function(i, val) {
  return '<span style="font-weight: bold">'+val.replace(':', ':</span>');
});
https://addons.mozilla.org/fI/firefox/a ... asemonkey/
- 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
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Scripting Reference (work in progress)

Post by Doridion »

JKos wrote:Because the scripting reference is so amazingly long and not very well formatted at the moment (I'm not complaining :) ), I made a quick greasemonkey script which makes it a bit more readable.

Code: Select all

// ==UserScript==
// @name        LOG2 scripting reference
// @namespace   jkos
// @include     http://www.grimrock.net/modding/scripting-reference/
// @version     1
// @grant       none
// ==/UserScript==
        
$('h3').css('cursor','pointer')
$('h3').nextUntil('h3').hide();

$('h3').click(function(e){
  if ($(e.target).next().is(":visible") ){
    $('h3').nextUntil('h3').hide();
  }else{
    $(e.target).nextUntil('h3').show() ;
  }
})

$('em').css('font-weight','bold');
$('em').css('font-size','1.1em');
$('li').html(function(i, val) {
  return '<span style="font-weight: bold">'+val.replace(':', ':</span>');
});
https://addons.mozilla.org/fI/firefox/a ... asemonkey/
God ! Thanks JKos !!! Excellent stuff ! Sticked in the superthread ;)
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Scripting Reference (work in progress)

Post by JKos »

I uploaded that greasemonkey script here:
https://greasyfork.org/en/scripts/6292- ... -reference

So it's much easier to install now:
- Install greasemonkey: https://addons.mozilla.org/fI/firefox/a ... asemonkey/
- go https://greasyfork.org/en/scripts/6292- ... -reference
- click install this script

Edit: works with Chrome too with tampermonkey
So if you use Google Chrome, install Tampermonkey
https://chrome.google.com/webstore/deta ... ldmpobfkfo
instead of greasemonkey
- 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: Scripting Reference (work in progress)

Post by petri »

Added defineTile() to scripting reference.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Scripting Reference (work in progress)

Post by Doridion »

JKos wrote:I uploaded that greasemonkey script here:
https://greasyfork.org/en/scripts/6292- ... -reference

So it's much easier to install now:
- Install greasemonkey: https://addons.mozilla.org/fI/firefox/a ... asemonkey/
- go https://greasyfork.org/en/scripts/6292- ... -reference
- click install this script
I'll change the link for your GM script to this one. Thanks for it JKos ;)
petri wrote:Added defineTile() to scripting reference.
Alredy said but .... YUP YUP YUP !
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Scripting Reference (work in progress)

Post by petri »

Updated scripting reference with new stuff from beta 2.1.15 (new properties for custom skills and spells).
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Scripting Reference (work in progress)

Post by Doridion »

petri, in the defineTile, would says it seems that "builder" argument is not optional ( crashes when removing it ). Could just reomve the "optional" from it ? Thanks in advance ^^
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Scripting Reference (work in progress)

Post by JKos »

New version of scripting reference formatter available. And sorry if someone installed the previous version, it had a bug which messed up the whole website :mrgreen: extra tabs at the beginning of the file caused that, but this version works.

https://greasyfork.org/en/scripts/6292- ... -reference

Screenshots
SpoilerShow
Image
Image
- 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
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Scripting Reference (work in progress)

Post by JKos »

For AH: I have noticed that the official scripting reference is missing at least the properties of the Brain component:

blockedLeft
blockedRight
blockedBack
blockedFront
seesParty
partyDiagonal
partyAdjacent
partyRight
partyLeft
partyStraightBehind
partyStraightAhead
partyBehind
partyAhead
partyOnLevel
partyLastSeen
partyDistY
partyDistX
partyY
partyX


Which are really useful if you are going to fiddle with AI. Just thought to post this in case these were left out by accident.
- 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
Post Reply