Page 5 of 6
Re: [DONE]: Working treasure chests - v1.4
Posted: Fri Jan 25, 2013 1:01 pm
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
Re: [DONE]: Working treasure chests - v1.4
Posted: Fri Jan 25, 2013 1:23 pm
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
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 4:33 am
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.
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 10:42 am
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?
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 12:45 pm
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.
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.
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).
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 3:01 pm
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.
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 3:17 pm
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?
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 3:40 pm
by Neikun
Alcoves! owo
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 4:55 pm
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?
Re: [DONE]: Working treasure chests - v1.4
Posted: Sat Jan 26, 2013 5:01 pm
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.