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.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.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.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")
Wagtunes' Modding Questions
Re: Useful scripts repository
Re: Useful scripts repository
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.
Re: Useful scripts repository
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. )
*Also the name "self" is arbitrary. Its position as first argument is what's important.
Re: Useful scripts repository
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.Isaac wrote: ↑Tue May 11, 2021 1:48 amThe 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. )
*Also the name "self" is arbitrary. Its position as first argument is what's important.
Re: Useful scripts repository
What —precisely— are you designing?
And what needs to happen?
And what needs to happen?
Re: Useful scripts repository
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.
Re: Wagtunes' Modding Questions
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.
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.
Re: Wagtunes' Modding Questions
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.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.
Re: Wagtunes' Modding Questions
They must have a flask, or they cannot pick it up; there are many many flasks.
The Ectoplasm piles fade with time.
The Ectoplasm piles fade with time.
Re: Wagtunes' Modding Questions
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.