New hooks?

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:

Re: New hooks?

Post by JKos »

+1 for onDrawGui

Not a hook, but would be nice if we could have an access to the default camera (eg. GameObject.getDefaultCamera()) If we set camera with GameMode.setCamera(camera), we can't return back to default camera anymore, so GameMode.setCamera() is pretty useless now. Or has someone found a way to restore default camera?
- 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: New hooks?

Post by JohnWordsworth »

@JKos: Have you tried GameMode.setCamera(nil)? Not tested (and at work at the moment), but that might work?
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

Re: New hooks?

Post by Jgwman »

Maybe an onLoad hook for maps? Unless I missed one. Things like adding items to inventories must be done after the map loads, or so it seemed to me. I've had to do it so far with a suicidal timer.

Side question: can we still spawn things "in the air"? Passing nil to the location params on the spawn function didn't work.
swampie
Posts: 9
Joined: Sun Nov 02, 2014 1:12 am

Re: New hooks?

Post by swampie »

Prozail wrote:
Also, an onDamage hook on the HealthComponent would be nice.
I second that :)
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: New hooks?

Post by MrChoke »

I second Prozail's suggestion. A hook to say when a teleporter is being used. Also, one for when an exit is being used.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: New hooks?

Post by petri »

JKos wrote:Not a hook, but would be nice if we could have an access to the default camera (eg. GameObject.getDefaultCamera()) If we set camera with GameMode.setCamera(camera), we can't return back to default camera anymore, so GameMode.setCamera() is pretty useless now. Or has someone found a way to restore default camera?
setCamera(nil) should work.
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: New hooks?

Post by msyblade »

+1 for onDrawGui.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: New hooks?

Post by petri »

Jgwman wrote:Side question: can we still spawn things "in the air"? Passing nil to the location params on the spawn function didn't work.
No, because that would cause subtle but hard to find garbage collection issues (because the spawned object is nowhere, it can be garbage collected). You can use someobj:spawn() to spawn in someobj's location.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: New hooks?

Post by NutJob »

If you take a look at this video (Skuggasveinn's Tutorials) you'll see (at 31 seconds in) a lantern not against the wall. I'm guessing this was done so it would be flush with a pillar but it's not flush with a wall. Any chance we can get these pushed back some so they get put flush on a wall? The current work around is from Lark.

...oh, yes, removeConnector like everyone else is asking for though that would only save me a step or two; deactivate or disable actually works well enough and 2) some teleporter hooks and a dysfunctional onMapOpen hook that crashes the application would be nice (I don't want players to use their map). <-- yes, that's a joke, please don't reply-focus on that statement.

~cheers~
Thanks, Matt
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: New hooks?

Post by petri »

Ok, let's spare the rest of the ideas for the Glögg sessions. Making a new build now...
Post Reply