Ask a simple question, get a simple answer

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
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Have we lost the onMove and onTurn hooks for monsters? :shock:
(They existed in LoG1, but I don't see them in LoG2.)

According to the script ref, only the party seems to have them.

**Or has the functionality been shifted over to the onThink hook?
If so... How does one implement an onMove-like feature without replacing the monster brain?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Isaac wrote:According to the script ref, only the party seems to have them.
I'm pretty sure MonsterMoveComponent and MonsterTurnComponent are MonsterActionComponents so they have onBeginAction hooks, onEndAction hooks, and onAnimationEvent hooks. AND you have a general onPerformAction hook in MonsterComponent, as well as the ability to do it in the brain obviously. MonsterMoveComponent and MonsterTurnComponent hooks are even used in the asset pack.
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
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Aha. This works. Thank you.

* I like that there is a begin and an end hook available.
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Ask a simple question, get a simple answer

Post by Duncan1246 »

I have scaled small objects in Blender to obtain bigger objects, but it seems that if the object initially is height 3, scaling it in Blender don't transform it in the Editor?
Other silly question: is it possible to replace in game (by script) a tile brush by another? or to make a brush invisible until a specific call?
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Duncan1246 wrote:I have scaled small objects in Blender to obtain bigger objects, but it seems that if the object initially is height 3, scaling it in Blender don't transform it in the Editor?
Did you apply the transformation before exporting?
Duncan1246 wrote:Other silly question: is it possible to replace in game (by script) a tile brush by another? or to make a brush invisible until a specific call?
No, I'm pretty sure the tile map, heightmap, noise map, and reflection map are all immutable once the dungeon starts. (And it would be pretty useless to be able to change the heightmap or noise map anyway since the heightmap geometry has already been built...)
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
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Has anyone come across the "bad argument #1 to removeNode" error?
If so, what are some tips to ferreting out the cause?

*Although it certainly suggests relation to deleting of objects. ;)
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Can you post the full error message with the stack trace? It's quite impossible to figure out what you did without even knowing where the call came from.
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
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

minmay wrote:Can you post the full error message with the stack trace? It's quite impossible to figure out what you did without even knowing where the call came from.
Don't I know it... ;)

But it's one of those every once in a while... not at all sure what caused it... kind of errors. Last time it happened, I had let the editor run, and eventually it just quit. I'll have to screenshot it when it happens again. This next time I will keep an eye on its resource use to see if its memory footprint spikes.
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: Ask a simple question, get a simple answer

Post by Duncan1246 »

minmay wrote:
Duncan1246 wrote:I have scaled small objects in Blender to obtain bigger objects, but it seems that if the object initially is height 3, scaling it in Blender don't transform it in the Editor?
Did you apply the transformation before exporting?
Duncan1246 wrote:Other silly question: is it possible to replace in game (by script) a tile brush by another? or to make a brush invisible until a specific call?
No, I'm pretty sure the tile map, heightmap, noise map, and reflection map are all immutable once the dungeon starts. (And it would be pretty useless to be able to change the heightmap or noise map anyway since the heightmap geometry has already been built...)
Yes, I have scaled object in Blender first, then export and create a new object in LG. It's works well for a little object (scope) but I fails to do the same for forest_oak,I don't know why.
I don't plan to change the heighmap, but I want to fill a zone initially ground-mapped with water using the trick of water-adjusted on a custom water surface. But it seems, like you say, that there is no way to do so.
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

Duncan1246 wrote:Yes, I have scaled object in Blender first, then export and create a new object in LG. It's works well for a little object (scope) but I fails to do the same for forest_oak,I don't know why.
Again, did you apply the transformation? Object -> Apply -> Scale.
The animation for forest_oak probably includes setting the object location, rotation, and scale. So if you make an object transformation it probably won't do anything. You need to apply it to the actual mesh. Of course this will also likely break the animation.
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.
Post Reply