[DONE]: Working treasure chests - v1.4

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [DONE]: Working treasure chests - v1.4

Post by Xanathar »

Problem 1: I keep getting the internal chestblockage reported damage but not found in the g_ChestByBlockage.id message every time I create a chest with hitpoints (I change nothing else about the script other than put in hitpoints = 50). The characters are dealing damage to the chest just fine and once enough damage is dealt the chest opens and the normal chance of breaking an object occurs (I put in 25 for the percentage and that part of it works fine). I just keeping getting the error and the lack of any particle system going off.
This is strange, but also reported by someone else (hyteria IIRC). Never happened to me, I check again.. :S
Problem 2: When I try to spawn tentacles I get an invalid spawn location message and the tentacles either don't appear or appear for just a second before vanishing. I can set a trap on the chest just fine and it goes off as normal, but when I type in mimicry = "tentacles" I get the invalid message and the disappearing monster-act.
The message of invalid spawn is ok.. it wouldn't be visible from players anyway and happens anytime you spawn a monster onto a blockage; for example it happens also in AH example of hatching spider eggs. The fact the monster disappears is weird and seem related to timing. Again doesn't happen to me, I investigate :|
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: [DONE]: Working treasure chests - v1.4

Post by hyteria »

i keep continue using the ancient script , now i know how to use it , i will try if i get again the same errors
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [DONE]: Working treasure chests - v1.4

Post by Grimfan »

As a side note I think there should be an option for disabling a trap or even a spawned mimic if you unlock a locked chest with the correct key (as opposed to battering it open). I don't know whether this could be incorporated into your existing script easily Xanathar, but it might be more elegant to include it that way that in a separate script.

Just food for thought. ;)

Also, the tentacles appear to be disappearing once the animation for the opening chest finishes almost as if they are existing only for as long as the chest is actually opening. :?
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [DONE]: Working treasure chests - v1.4

Post by Xanathar »

What you wrote is doubly strange because when there is the tentacle, the animation should not play at all!

Can you paste the declaration of your chest here?
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [DONE]: Working treasure chests - v1.4

Post by Grimfan »

Don't worry about the tentacles. I sorted it out. I had an open chestpit inside the chest and each time the tentacles spawned they fell down the pit. :lol: I just took out the chestpit and everything was fine.

I also solved the chestblockage error. I had simply forgotten to remove a chestblockage I had placed in the chest's space earlier. Once I removed it the error disappeared.

I can be such an idiot sometimes. :oops:

It does make me ask a question though. What are a chestpit and a chestblockage for, since they don't seem to have any impact on the functioning of the chest at all (that I can see)?

By the way, if you put a closed chestpit (trapdoor) inside a closed chest you end up having two lids; one opened and one closed (though that might be something you already know). ;)
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [DONE]: Working treasure chests - v1.4

Post by Xanathar »

Good to hear the problems solved!

chestpit and chestblockage (and chestbutton) are objects created (one each of them for each chest) by the chestmanager when you first start your dungeon, they are used to implement the chests and for internal use - in practice you should never put them directly in a dungeon.

Technical bits:
in practice the work is all done by those 3 objects and a teleporter, the "chest" you put into the dungeon editor is basically a placeholder.
The chestpit is the model of the chest, animation included, used for the visual part.
The chestbutton is an invisible button put in front of the chest to detect user clicks and perform the correct action.
The chestblockage (and an invisible teleporter which is also created behind the scenes) are used so that the player can't go in the chest square, and no items can be thrown/put there either - to avoid falling down when the chestpit is open.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [DONE]: Working treasure chests - v1.4

Post by Grimfan »

I thought that was the case initially, but because they had icons I thought I had to place them in manually for them to work. Realizing that was not the case was the thing that allowed me to solve both problems very quickly.

Thanks for taking the time to help me. :)

As a side note, would there be some way of making the chests hold items placed into them, or would that require a comprehensive rewrite of the code?
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: [DONE]: Working treasure chests - v1.4

Post by Neikun »

Alcoves! owo
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: [DONE]: Working treasure chests - v1.4

Post by Grimfan »

Okay Neikun - potentially stupid question coming up (since I've had no experience with programming language before 2 weeks ago).

Would the best way to do this be with:

A) An alcove somehow hidden within the chest object via a script; or
B) by defining a new chest_alcove_object in objects.lua

And if it were via a newly defined alcove object wouldn't the chestmanager script need to be changed to recognize it as a chest or does it just care that the model is the same? I would assume it would be a little more complex than that, wouldn't it?
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: [DONE]: Working treasure chests - v1.4

Post by Xanathar »

We can do it with an alcove as a placeholder (instead of a scripting_entity as a placeholder), but then it would really work only for the basic chest, as you can't specify a key, a trap, a monster, etc.
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
Post Reply