Jump to content

Monsters teleport themselves in Dehacked?


Recommended Posts

I've been trying to come up with a way that a monster could be given a teleporting power just using Dehacked, and was wondering if anyone else out there had any ideas, or had made this happen themselves. My knowledge of the power of .deh modifications is somewhat limited, but I'm thinking the solution might use IoS cube spawn points or something like that. I looked through the forums and found this one-post thread which tantalizingly references a WAD where archviles were given just such an ability, though nobody ever responded to the thread and I've found no references to it anywhere else. Does anybody have any ideas?

(And before anybody suggests DECORATE I'm stubbornly keeping this WAD limit-removing-compatible.)

Share this post


Link to post

I've succeeded to make a counterpart of D3's Wraith in DEHACKED. I took sprites from Realm667.com. I gave him a punch melee attack, and then a special kind of missile attack: Instead of firing anything, he just stopped for a moment and displayed teleport flash sprite (I've made a modified Wraith sprite with teleport flash pasted over him), then he performed numerous "Chase" steps with 0 frame duration each. This way, he changed his position, and then he just showed teleport flash again and continued chasing the player normally. However, if he managed to get close to the player while "teleporting", he just went to perform his melee attack immediately. I couldn't fix it, but I left it in, as it made him an efficiently threatening enemy. The wad never had any maps and was never released.

Share this post


Link to post

Oooh, that's a fiendishly clever solution! I might have to use that idea myself (if I actually can draw the sprite I've envisioned this for.) I'm hoping I can figure out a way to give this monster a projectile attack as well as this teleporting thing, but I think Dehacked might allow that too if I'm clever about it.

Share this post


Link to post
StupidBunny said:

I'm hoping I can figure out a way to give this monster a projectile attack as well as this teleporting thing, but I think Dehacked might allow that too if I'm clever about it.

You can make him fire a projectile after he performs his teleporting (perhaps use SpidRefire to prevent him from doing so if the player is no longer in his line of sight). You can also make him throw a projectile from a pain state. In the worst case, you can make him throw a projectile during his standard Chasing animation, but then you have to make it long-enough (many frames with Chase) and also constantly use SpidRefire to check for a player in line of sight. SpidRefire has a hardcoded 5% chance of failing, so I recommend using this function 3-times in a row instead of just once, to be sure that he won't start firing randomly without seeing the player.

Share this post


Link to post

I've implemented what is basically your teleport solution as the enemy's standard attack, using every chase state I could to extend the teleport as much as possible and then ending with the monster teleporting in using states poached from the monster spawn fire (though with frames from the teleport fog instead) while launching plasma bolts in rapid succession. Something strange which happens is that the monster keeps reverting to the FaceTarget state at the beginning of the attack sequence, which has a duration of 10 and during which the monster is still visible, often jumping around several times like this before actually releasing its attack. The effect is actually pretty cool, since it makes the monster more unpredictable and makes it move a hell of a lot faster, but for the sake of control I'd like to know why it's doing this. I've found I can mitigate the effect by using far fewer chase states, or else giving the FaceTarget state a duration of 0, but I'm not sure either option is preferable. I also discovered that giving the FaceTarget state a duration of 1 makes it look like the monster goes apeshit and flies all over the map every time it attacks, which is terrifying but may be a bit overkill.

I hope that was articulate. It's sort of hard to explain what's happening without actually seeing it.

Share this post


Link to post

It's clear. Each call of the Chase function has a probability to send the monster to his first Missile state. That's how all missile attacks are normally handled. Chase function wasn't meant to be used inside the Missile animation, but no fatal bugs happen if you do so. You just have to count with that. ;)

However, never put a frame with Chase to be performed within the first tic of missile animation. This also means that your first FaceTarget call shouldn't have a duration of 0 if a frame with Chase immediately follows it. It will lead to an infinite recursion and a crash on Nightmare! difficulty.

Share this post


Link to post
scifista42 said:

It's clear. Each call of the Chase function has a probability to send the monster to his first Missile state. That's how all missile attacks are normally handled. Chase function wasn't meant to be used inside the Missile animation, but no fatal bugs happen if you do so.

Except if you call A_Chase in the first missile attack state. Then you can get an infinite loop, as entering the state makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which makes it enter the state which makes it call A_Chase which ...

Share this post


Link to post
scifista42 said:

However, never put a frame with Chase to be performed within the first tic of missile animation. This also means that your first FaceTarget call shouldn't have a duration of 0 if a frame with Chase immediately follows it. It will lead to an infinite recursion and a crash on Nightmare! difficulty.


That would explain all those times PrBoom crashed.

I guess that makes sense...most states seem to do quirky stuff when they're put where they shouldn't be (though it's nice to have an explanation why.) I also tried turning the spawn cube into an exploding, tracing projectile, trying to work all sorts of trickery eth moving spawn points and whatnot, and it almost worked but kept blowing up in the monster's face and killing him instead. In any case I think a plasma flurry may be a more fitting attack anyway.

I guess the tradeoff of limiting myself to Dehacked would be limited control and quirky side-effects. It's still kinda fun though.

Share this post


Link to post

One could perhaps have the monster just be invisible as he walks around and then have ranged and melee state set's that start and end with him going through sprites that show him appearing/reappearing.

That's how I made a similar bad guy in the past, albeit, not using Dehacked.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...