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
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Okay, some thing are mixed up right now.

minmay, in your code, you close a door named "dungeon_secret_door_THOM_a_"

I want to close all doors named "dungeon_secret_door_THOM_a_1" or "dungeon_secret_door_THOM_a_22" or "dungeon_secret_door_THOM_a_104"

My mistake: I am not looking for e.name but for e.id !

But I still do not know how to placehold the numbers...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

true



HOOORAYYYY!!! Image
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2789
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

THOM wrote:minmay, in your code, you close a door named "dungeon_secret_door_THOM_a_"

I want to close all doors named "dungeon_secret_door_THOM_a_1" or "dungeon_secret_door_THOM_a_22" or "dungeon_secret_door_THOM_a_104"
The code opens any door with a name containing "dungeon_secret_door_THOM_a_" which includes the strings you mentioned. Do you have a religious objection to reading the string library tutorial or something?
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: 3188
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

@Thom: Is it that you only want those specific doors; and not all doors?

(At first reading, I took it to mean all doors.)

** Is "dungeon_secret_door_THOM_a" the asset name? (...for a set of doors?)
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Well, my problem is solved, that's the most important thing.

@Isaac: I have a mass of doors, that have to open and close at specific moments. "dungeon_secret_door_THOM_a_[number]" is the id I have given to some of these doors, others have "dungeon_secret_door_THOM_b_[number]" or something like that.

So I was trying to find a way to open all doors named xy, and close all doors named yz in one moment. And I have a way, now... :)

@minmay: yes, your code is searching for doors which ids contains that specific string. Shame on me - I missed the point, what "find" meant in this context. I am really a silly guy and it is absolutely correct, that you poured sarcasms over me. That scripting newbies annoying professionals and do not penetrate every coding-mystery at the first glance is really unbearable. Sorry, it wasn't my intention to disturb you in your ivory tower.

But, sorry for now - must go to church.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2789
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

The StringLibraryTutorial page that AndakRainor linked to tells you exactly what the find() method does. It's not a mystery.
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
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

well, for me it is. already before AndakRainor recommended this site to me, I started reading it - and failed to find a solution. Most of that what is written there is very desorientating for me.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: Ask a simple question, get a simple answer

Post by Drakkan »

I hope, this could be easy - I need following object to be non-walkable like real wall and also it should display itself as a regular wall on the automap. What I need to define here ?
edit: the same goes for standrad castle_wall object

Code: Select all

defineObject{
	name = "castle_wall_outside_01",
	baseObject = "base_wall",
	components = {
		{
			class = "Model",
			model = "assets/models/env/castle_outside_wall_01.fbx",
			dissolveStart = 6,
			dissolveEnd = 8,
			staticShadow = true,
		},
		{
			class = "Occluder",
			model = "assets/models/env/castle_wall_01_occluder.fbx",
		},
	},
	minimalSaveState = true,
}
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Add the components

Code: Select all

	   {
	      class = "ProjectileCollider",
	   },
	   {
	      class = "Door",
	      hitSound = "impact_blunt",
	   },
and the definition

Code: Select all

	automapIcon = 88,
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Post Reply