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
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Scripting Reference (work in progress)

Post by petri »

Added list of hooks and their parameters to components.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Scripting Reference (work in progress)

Post by Doridion »

USEFUL !!! ( no more words coming :D )
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: Scripting Reference (work in progress)

Post by Grimfan »

Very useful... :D
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Scripting Reference (work in progress)

Post by Doridion »

Hum .... will I be annoying if I ask you to make the hook's writing in bold ? ( making them more visual )
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: Scripting Reference (work in progress)

Post by Grimfan »

If you eventually remove the unused objects from your editor Petri can you keep their definitions in the asset pack? Some people might want to use the beach overhang or get the tomb wall spears up and killing. ;)
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Scripting Reference (work in progress)

Post by NutJob »

I apologize for what you're about to read.

Can I use these events programmatically without using a hook into a definition? I rather (but probably can't) use a generic function to "route" *all* events that happen in the game. The events are still triggering even without a hook, yes? This is about the only area I'm desperately struggling and my major stopping point to proceed. I know what I want to use but not too sure how to get the event information. Hell, feel free to lambast me for not "getting it" with a detailed, but short, example description.

Here's something I have been trying to capture for literally days now and I have tried so many ways, now, I'm ashamed to be part of humanity: "How do I capture that the party was, just, actively teleported?" If anyone can answer that I promise to not ask another question for one week. Yes, one full week, amazing right? Telling me to simply use something like .onActivate will not affect my knowledge/progress. ~laughs~

I look forward to no one responding.
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: Scripting Reference (work in progress)

Post by Grimfan »

I wouldn't be too sure of that NutJob. You won't get a response from me but I bet Prozail or JKos might have a crack at answering your query if they feel inclined. ;)
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Scripting Reference (work in progress)

Post by Doridion »

Grimfan wrote:I wouldn't be too sure of that NutJob. You won't get a response from me but I bet Prozail or JKos might have a crack at answering your query if they feel inclined. ;)
Image
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Scripting Reference (work in progress)

Post by JohnWordsworth »

This is awesome Petri :). Loving that you can dynamically add hooks for most actions using connectors.

One thing I just noticed: In the scripting reference, it says Time.getCurrentTime() where it is actually Time.currentTime() from my experimentation!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
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 »

JohnWordsworth wrote:This is awesome Petri :). Loving that you can dynamically add hooks for most actions using connectors.
Yeah, it's great. I have played with hooks and connectors a bit and connectors differ from hooks so that their return value doesn't matter. So you can't for example prevent party from moving with a connector, you need a hook for that. But if onMove-hook returns false onMove-connectors aren't executed. Just something to keep in mind.
- 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