Page 1 of 1

counter anomoly?

Posted: Sun Feb 24, 2013 7:12 pm
by Ryeath_Greystalk
I am spawning 4 monsters with an onDie function to decrement a counter an open the door when the counter hits 0 (ie all monsters dead).

What I find is if I use K to kill the monsters quickly the counter decrements, but the door doesn't open.
If I kill them manually then the counter decrements and the doors open.

I know that using K doesn't give XP and such, but if the counter decrements to 0 (verified using hudPrint and counter:getValue) shouldn't it still open the door regardless of how I killed the monsters?

Re: counter anomoly?

Posted: Sun Feb 24, 2013 7:21 pm
by Komag
I would think it should work. Have you made sure it does in fact open when killing them normally? Because maybe there is some other small oversight

Re: counter anomoly?

Posted: Mon Feb 25, 2013 12:13 am
by Ryeath_Greystalk
Komag wrote:I would think it should work. Have you made sure it does in fact open when killing them normally? Because maybe there is some other small oversight
I can't understand it either. It's one room only on the map, so there's no possibility of something from another area affecting it.
There's only one counter in the room, so theres no way I could accidentally be calling the wrong counter unless Grimrock adds one on it's own, which I doubt.
There's no physical entities (switches, levers plates etc) working the counter with the exception of the shortcut button I use to spawn monsters.
The only thing decrementing the counter is the onDie hook on the modified monsters.
The counter triggers a Lua script to print out the getValue and it shows the value is decrementing whether I use K or physically kill the monster.
I've even taken the counter past 0 and into negative numbers.

I have tried at least a half dozen times using both the shortcut button and physically solving the puzzle to spawn the monsters with the same results, physically killing opens the door and just pressing K doesn't. I even tried a combination of pressing K for some and killin others but if I use K for at least on monster the door doesn't open.

The level works as designed so it's not holding up my room development, but it would be nice to know what is happening.

I have a similiar puzzle in my main dungeon I'm working on. I'm going to load that and test it a bit, I don't recall if I tried using K when I did that one.. I'll post my test results in a bit.

Re: counter anomoly?

Posted: Mon Feb 25, 2013 12:24 am
by Ryeath_Greystalk
Ok puzzle works the same in my main dungeon. If I kill using K, no door opens, but phyically killing the mobs opens every time.

Oh well.

Re: counter anomoly?

Posted: Mon Feb 25, 2013 1:20 am
by Komag
maybe that's a bug then, dunno. You could always script the door if the counter value == 0, that should be pretty darn foolproof.

Re: counter anomoly?

Posted: Mon Feb 25, 2013 1:30 am
by Ryeath_Greystalk
That's a good suggestion because the counter is triggering the Lua script when I use K, just not the doors. I'll give it a shot.

Re: counter anomoly?

Posted: Mon Feb 25, 2013 1:56 am
by Ryeath_Greystalk
So I was incorrect on the one point, the monsters are not activating the Lua script as I stated. I forgot I had added a line to the onDie hook to display the counter getValue.

When I phyically killed the monsters though it did trigger both the hard connection to the door (via the GUI) and opened a second door via a Lua script.

At this point I am going to surmise that when a monster is killed via the K key even though the counter value is decremented some flag is not set or some variable is not passed in the counter function.
Everything works as it should in game, just makes it more time consuming to test is all.

As usual Komag I much appreciate the time you take to answer my noobish queries.

Re: counter anomoly?

Posted: Mon Feb 25, 2013 2:05 am
by Marble Mouth
Hi Ryeath_Greystalk. If this increases your time required to test, I have a suggestion. Place one of these:

Code: Select all

cloneObject{
    name = "one_hit_wonder",
    baseObject = "dagger",
    attackPower = 1000000,
    accuracy = 1000000,
}
at your Starting Location, and then use that to kill monsters instead of K.

Re: counter anomoly?

Posted: Mon Feb 25, 2013 2:06 am
by Komag
I set my champions to have a zillion strength in my dungeon for testing, so every monster dies with one hit bare hands or with torch or whatever, then I can test for realz and not rely on k

Re: counter anomoly?

Posted: Mon Feb 25, 2013 3:13 am
by Ryeath_Greystalk
Awesome ideas komag & marble. I added some weapons (sling & rocks, machette, and cudgel), but never thought about a custom thumper. Thanks.