Ask a simple question, get a simple answer
Re: Ask a simple question, get a simple answer
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...
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...
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: Ask a simple question, get a simple answer
Then just replace name with id in minmay's code and it should work.
Re: Ask a simple question, get a simple answer
true
HOOORAYYYY!!!
HOOORAYYYY!!!

Re: Ask a simple question, get a simple answer
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?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"
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
@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?)
(At first reading, I took it to mean all doors.)
** Is "dungeon_secret_door_THOM_a" the asset name? (...for a set of doors?)
Re: Ask a simple question, get a simple answer
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.
@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.
Re: Ask a simple question, get a simple answer
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Ask a simple question, get a simple answer
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.
Re: Ask a simple question, get a simple answer
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
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,
}
Re: Ask a simple question, get a simple answer
Add the components
and the definition
Code: Select all
{
class = "ProjectileCollider",
},
{
class = "Door",
hitSound = "impact_blunt",
},
Code: Select all
automapIcon = 88,