I've been researching and working on creating an NPC in my mod. I've attended the LoG2 Discord and they (mostly minmay (Thank you, BTW!)) have been gracious enough to give me some pointers to use the monster brain instead of just monster commands (I assume because LoG2 was designed with using monster brains only and not just commands with no brain? I've noticed that there are fewer non-brain monster commands like seek() and goTo(). Note that this monster is there only to perform a set sequence of events, nothing more. It is not going to interact with the party or other monsters.), but I've been running into hurdles I can't seem to figure out. With each set of brain commands, the monster will wander around and go where the party is and I can't seem to stop this behavior. If I use no brain, the sequence of events is rather... mechanical. 1 second for each square move, etc. It just isn't as smooth. I've used both a timer object as well as delayedCall() which works better than the timer object as I can more easily set second limits until the next command.
I've been looking into this via the following forum post:
https://mail.grimrock.net/forum/viewtop ... ion#p93615
It informs that the wait() command sometimes is not followed when using the monster brain...
Note that calling wait() doesn’t appear to override the predefined brain behavior.
Forgive me if you've seen this before, I am just needing more clarification since if I simply add the commands in order, they are not followed and seemingly, they are all run at the same time instead of waiting for one command to complete before going to the next command.unlike if adding it to a predefined brain, where this will accomplish nothing
Basically, I need an NPC that does a specific set of instructions, like the following (waiting until each one completes before continuing to the next):
Code: Select all
monster spawns at x5,y16,z1 facing 3(west)
monster moveForward() twice (or two spaces/cells) (could be seek x3,y16,z0 if using brain since it seems that non-brain commands only move one space at a time)
monster at x3,y16,z0
monster waits for x seconds for dialogue to play
monster turnLeft()
monster moveForward()
monster at x3,y17,z0
monster turnRight()
monster moveForward()
monster at x2,y17,z0
monster turnLeft()
monster moveForward()
monster at x2,y18,z0
monster waits for lever at x2,y18,z0
monster waits for x seconds for dialogue to play
monster seeks to x4,y24,z0
monster waits for lever at x3,y24,z0 and then moves downstairs
I appreciate anyone who gives assistance.
Much appreciated,
TheMorlock