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
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

Hmm, ok.
It is very hard to trouble shoot if I can't see how you are calling the Samples from grimtk
Can you post some examples of your code used to call them?
Have you tried adding the grimtk files to a fresh new dungeon without any other modded files?
User avatar
Xardas
Posts: 83
Joined: Fri Jul 28, 2017 12:30 am

Re: Ask a simple question, get a simple answer

Post by Xardas »

So i made new dungeon and i worked perfect there, but what you said gave me an idea. I now imported grimtk last to my init.lua and now it works fine for what i tested now. Seems like the other assets overwrote something in the grimtk asset. I hope i don´t have other Bugs now. :lol:
Many thanks for your help akroma.
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
User avatar
Xardas
Posts: 83
Joined: Fri Jul 28, 2017 12:30 am

Re: Ask a simple question, get a simple answer

Post by Xardas »

How can i disable the clickable component of a base alcove in the objects Definition?
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Xardas wrote:How can i disable the clickable component of a base alcove in the objects Definition?
Any (or almost any?) component can be disabled in any onInit function.

Code: Select all

defineObject{
	name = "dungeon_alcove",
	baseObject = "base_alcove",
	components = {
		{
			class = "Model",
			model = "assets/models/env/dungeon_wall_alcove.fbx",
			staticShadow = true,

			onInit = function(self) self.go.clickable:disable() end
		
		},
		{
			class = "Occluder",
			model = "assets/models/env/dungeon_wall_alcove_occluder.fbx",
		}
	},
}
It's also possible to make a null component for the purpose; and just add it to the components table.

Code: Select all

	{
			class = "Null",
			name = "initialize",
			onInit = function(self) self.go.clickable:disable() end
		},
Last edited by Isaac on Sun Sep 03, 2017 5:56 pm, edited 1 time in total.
User avatar
Xardas
Posts: 83
Joined: Fri Jul 28, 2017 12:30 am

Re: Ask a simple question, get a simple answer

Post by Xardas »

That makes sense to me, but i can´t make it work. It gives me an error, when i place one of your Options inside the components field. It says i have to close some brackets, but i already did so.
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Xardas wrote:That makes sense to me, but i can´t make it work. It gives me an error, when i place one of your Options inside the components field. It says i have to close some brackets, but i already did so.
Double check. A good text editor might even have the option to highlight matched pairs of brackets, to help with this very (common) problem.

**Another very common issue is forgetting to add the necessary coma after the previous component, when adding a new one.
User avatar
Xardas
Posts: 83
Joined: Fri Jul 28, 2017 12:30 am

Re: Ask a simple question, get a simple answer

Post by Xardas »

You were right, it was an issue of the text Editor. It doesn´t like copy paste for some reason. :roll: Now it works fine, thanks for your help
In order to get to the other side of the pit you have to get hit by the fireball and die....
Yep.....moving on!
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Does anyone remember if there is some limitation with the way delayedCall works? (besides string arguments)

I have an object with a script component, and have tried to use delayedCall to call a function in that object's script. The function itself works, and I've called it from other functions and the console, but I find that delayedCall will silently fail to call it (Timers too!). Have I forgotten something intrinsic about this; or have I missed something else (not related to delayedCall) ?

Link to the code in question: viewtopic.php?f=22&t=14814&p=111861#p111861
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

You forgot to name your ScriptControllerComponent "controller" again.
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: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

minmay wrote:You forgot to name your ScriptControllerComponent "controller" again.
Aha. I knew it must be something like that. I did try changing the letter case, but not cropping the name to controller. Thanks. 8-)
Post Reply