Magnum Express Posted December 29, 2011 What are some tips for creating custom states? For example, I want to try to create a state where the monster follows a specified path until it sees or hears the player. Also, would this involve anything other than DECORATE? 0 Share this post Link to post
Gez Posted December 29, 2011 For following paths, you might want to have that custom state sequence include calls to Thing_SetGoal. You can use specials directly in DECORATE code. I think if you use a TID of 0 it'll affect only the activator (that is to say, the monster that calls that special from its states) but I'm not sure about that. 0 Share this post Link to post
Magnum Express Posted December 29, 2011 How would I set this up? Individually for each monster? 0 Share this post Link to post
Kappes Buur Posted December 29, 2011 http://www.zdoom.org/zdkb/zdoom7.html or http://www.mediafire.com/?x6co8exow7wl5j9 0 Share this post Link to post
Magnum Express Posted December 29, 2011 Is the monster supposed to walk in zig-zags? I tested this on a Former Sergeant, and it didn't keep to a straight path. Also, it didn't pause at the proper node, but at the one before it. 0 Share this post Link to post
Magnum Express Posted December 30, 2011 Never mind that last question, as I have a state that I want to create: Instead of the normal "alert" state (I'm not sure if that is its name), if a monster hears the player attack, a projectile hit a wall, or another monster get hit/killed, it will go investigate the area (at a speed slower than its normal movement speed) that it estimates the sound to have come from (that is going to be the tricky part). The monster will investigate this area for a while (5-10 seconds or so), and then return to its previous location. However, if it sees the player or the corpse of another monster in this state, it should go on alert. I also wanted this "investigation" state to be triggered when the monster momentarily spots the player (within a period of a few tics or so) instead of going on alert, but that part can wait. I'm not sure if a state like this is possible, but I would like to know if there is some way of creating it. 0 Share this post Link to post
Magnum Express Posted December 31, 2011 I have an idea on how to trigger this state, but I don't know how to set up the state itself. Could someone help me with this, or at least point me in the right direction? 0 Share this post Link to post
Magnum Express Posted February 26, 2012 A "stunned" or "blinded" state wouldn't hurt, either. 0 Share this post Link to post
Gez Posted February 27, 2012 You'll want to use custom damage types so that you can set up multiple different pain states. 0 Share this post Link to post
Magnum Express Posted February 27, 2012 Thanks, Gez. I am still looking for a solution to my other problem, though. 0 Share this post Link to post
Magnum Express Posted March 18, 2012 If my "investigation" state is impossible, you guys can just go ahead and tell me. I've been waiting for help on that for long enough. 0 Share this post Link to post
Maes Posted March 18, 2012 AFAIK monsters can "lock in" to a specific THING as their target, and always home for its exact X,Y,Z coordinates, even if they appear to be wandering aimlessly, and even if the target moves. In order to do an "area investigation", as you put it, the monster would have to be headed to the location where the sound was generated (even if the cause of the sound has moved), and not actively follow the player by tracking his map position (like they normally do). This can't be done unless you use a modified state that causes the monster to "hunt" this fixed, "sound generated" position instead of the player. A way to do that would be to spawn an invisible "sound decoy" object at the position of the player whenever a monster is alerted by hearing alone (not by visual contact), and have the monsters home into that object instead of the player's actual position. Of course different monsters may be investigating different sound sources at the same time. Once the source is found however, if the player has moved and is not visible, the monsters should revert to either a dormant or an "aimless wander" state, without actually having the player as a target. 0 Share this post Link to post
Magnum Express Posted March 18, 2012 This is what I was going to do. I'm still curious about how to activate the Alert state when the monster sees a dead monster, though. But thanks for the help! EDIT: This "Sound Source" thing that you mentioned is supposed to be dropped when the player fires or the hit monster screams, right? That is what I had in mind. 0 Share this post Link to post