Wagtunes' Modding Questions

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Isaac wrote: Tue May 11, 2021 1:13 am First, I just erased an unused line that was overlooked when I posted. Update to the most recent script.

The way it auto-runs is that the script calls its own function when loaded; see the last line.

Delete (or comment out) the line at the end that calls the function, and your connector will work as expected.

You can delete either one of these lines, as best suits:
You only need one.

Code: Select all

local altar = spawn("altar",1,16,26,0,"ironkeyaltar") 

local altar = spawn("altar",self.level,self.x,self.y,self.facing,"ironkeyaltar")
The call to findEntity is to ensure that the object "ironkeyaltar" does not exist before using the name for a new object. It's good to always check first, as the game will crash if this situation occurs.
Okay, something very odd is happening now. The altar is being spawned where the party is standing and not where I have the script located.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Okay, I hardcoded the coordinates and it works fine. Not sure why the other method is doing what it's doing but it's working now.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Useful scripts repository

Post by Isaac »

wagtunes wrote: Tue May 11, 2021 1:43 am Okay, I hardcoded the coordinates and it works fine. Not sure why the other method is doing what it's doing but it's working now.
The self variable is whatever object that called the function; when it was the script, it spawned at the script_entity.

(If called by a pressure plate it would spawn at the plate. I should have mentioned this. :oops: )

*Also the name "self" is arbitrary. Its position as first argument is what's important.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Isaac wrote: Tue May 11, 2021 1:48 am
wagtunes wrote: Tue May 11, 2021 1:43 am Okay, I hardcoded the coordinates and it works fine. Not sure why the other method is doing what it's doing but it's working now.
The self variable is whatever object that called the function; when it was the script, it spawned at the script_entity.

(If called by a pressure plate it would spawn at the plate. I should have mentioned this. :oops: )

*Also the name "self" is arbitrary. Its position as first argument is what's important.
Ah, okay. Well, it spawned at where I stuck in the key to activate the script. So obviously that won't work. So I had to hard code it. Unless you know some other way to make this work without hard coding it.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Useful scripts repository

Post by Isaac »

What —precisely— are you designing?
And what needs to happen?
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Useful scripts repository

Post by wagtunes »

Isaac wrote: Tue May 11, 2021 5:02 am What —precisely— are you designing?
And what needs to happen?
First of all, thanks to the admins for creating this new thread. Now all my stuff is in one place and easy to find.

Okay, here's what's going on. It's the last room of level 1 before we go to level 2. The room has 8 locks and it appears no exit. Along the way, there are 8 keys that hadn't been used for other doors that the party collects. If they have all 8 keys then what happens next is they insert each key into its corresponding lock. When the last key is inserted, a script is triggered that spawns an altar in the center of the room. On the altar are the ingredients to make the Potion Of Unlocking. The party creates the potion and then goes to the alcove that is next to a secret wall that the party can't see. They put the potion in the alcove and the secret wall opens leading to the stairs down to level 2.

Now I just realized that if they don't have all 8 keys (I will have to check for this) I will need to spawn a teleporter that will take them back to the first room of the level so that they can retrace their steps and find the key(s) that are missing. That part I haven't figured out yet. I guess I will need to create a script to go through the party's inventory and check to see that all 8 keys are in their possession. Honestly, I have no idea how to do this but I'll cross that bride when I get to it. It is a script that will have to automatically run as soon as they enter the room. Something else I don't know how to do. So far, I only know how to trigger scripts by performing some kind of action.

Anyway, that's what's supposed to happen and that's where I am right now.

Any help you can give on how to automatically run a script to check for the 8 keys upon entry to the room (which is done through teleportation) will be greatly appreciated.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Wagtunes' Modding Questions

Post by Isaac »

I have secrets in my ORRR2 Foundry that do essentially the same things you describe.

In the Pantry room one triggers a spawned pedestal with an item on it (when the player solves the One-Eyed-Jack clue); to do that they must have the Eye from the magician's vault upstairs.
The pedestal is a custom altar model, just sized for holding a single item. ;)

The other secret is that when the party kills ghosts (the skeletons in the halls), some of them drop ectoplasm, and when the party picks these (piles of goo) up, there is first a check to ensure that the party has an empty flask to put them in; it takes the first available empty flask, and spawns an ectoplasm flask on the mouse cursor.
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

Isaac wrote: Tue May 11, 2021 6:27 pm I have secrets in my ORRR2 Foundry that do essentially the same things you describe.

In the Pantry room one triggers a spawned pedestal with an item on it (when the player solves the One-Eyed-Jack clue); to do that they must have the Eye from the magician's vault upstairs.
The pedestal is a custom altar model, just sized for holding a single item. ;)

The other secret is that when the party kills ghosts (the skeletons in the halls), some of them drop ectoplasm, and when the party picks these (piles of goo) up, there is first a check to ensure that the party has an empty flask to put them in; it takes the first available empty flask, and spawns an ectoplasm flask on the mouse cursor.
Ah, that's interesting. What if the party doesn't have any flasks at all? Does it still spawn an ectoplasm flask? If it didn't, there would be no way of cleansing the Foundry.
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Wagtunes' Modding Questions

Post by Isaac »

They must have a flask, or they cannot pick it up; there are many many flasks.

The Ectoplasm piles fade with time. ;)
wagtunes
Posts: 316
Joined: Sun Feb 04, 2018 11:04 pm

Re: Wagtunes' Modding Questions

Post by wagtunes »

Isaac wrote: Tue May 11, 2021 6:57 pm They must have a flask, or they cannot pick it up; there are many many flasks.

The Ectoplasm piles fade with time. ;)
Yes, I noticed that. Those devils start coming fast and furious if you don't clean that place out quick. As I said, my favorite room of the whole dungeon. An absolute masterpiece of design.

Anyway, I gotta get back to work on this last room. If I get stuck, I'll be back.
Post Reply