Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Mechadon

New projectile by replacing Lost Soul (it works!)

Recommended Posts

I've been trying lots of weird dehacked hijinks for Supplice. In particular I've been looking for ways to make a new monster projectile that doesn't require me to replace projectiles I want to keep. The problem with this is, of course, there are only codepointer to fire the existing projectiles, and you can't really make new codepointers :P

My first attempt used the BossSpit codepointer. It sort of worked but required the use of a moving spawn spot thing and it was very unpredictable and unreliable. A few days ago I remembered that the Pain Elemental has the codepointer which "shoots" Lost Souls, and it had me wondering if it would be possible to turn the Lost Soul into a projectile and use the PE spawn codepointer to "fire" it.

I put together a quick test patch and it seems to work...well, sorta. Here's the wad and bex:

http://mekworx.the-powerhouse.net/mekastuff/wads/supppub/newprojtest.wad
http://mekworx.the-powerhouse.net/mekastuff/wads/supppub/newprojtest.bex

The first thing I noticed is that the projectile's death state won't activate on walls. It will if it hits the player or another monster though. I've tried a couple of things but I can't seem to fix it or figure out why it's doing that in the first place.

The second thing I noticed is that the projectile flight pattern seems to be really off at times. Sometimes they will fly way above horizontal, up and over the player. I'm wondering if this has something to do with the Lost Soul's thing slot (perhaps some sort of hard coded behavior that I'm not entirely aware of). Or maybe it has more to do with the PE's spawn codepointer.

I'm worried about bugs that might pop up from this method as well, mostly from unknowns and/or hardcoded behavior. It seems to work ok on a basic level though and I'm seriously considering replacing the Lost Soul in Supplice if I can figure out the first bug I mentioned.

Anyways, can anyone shed some light on this for me?

By the way, those dart sprites are free to use. I made them from scratch originally for Supplice, but my intended use didn't really pan out.

Share this post


Link to post

That's interesting. I don't know anything about EDGE, but does it support Boom features?

I guess it wasn't very clear in my original post, but I am looking for some insight and help with the bugs I encountered. Mostly in regards to the projectiles not entering their death state upon contact with walls. And whether or not replacing the Lost Soul as a projectile will cause me issues later on down the road.

Share this post


Link to post
Mechadon said:

That's interesting. I don't know anything about EDGE, but does it support Boom features?


EDGE and Boom are two branches of DOSDoom, from what I can make out from the Doom Wiki's page on it, it doesn't look like it.

Share this post


Link to post

@ErisFalling:

EDGE is limit removing but can't handle some of Boom's moving textures.
Boom, Doomsday and the "Z" family all descend from the linux source side of the Doom family. Doom Legacy and EDGE are the only dos doom ports that I know of, at least that's my understanding.

@Mechadon:

Other than Edge, everything seemed to work as you described, even the 3 projectiles spawned at the pain elemental's death all stuck to the walls. No death post wall stick, although something remaining stuck to the walls is cool on its own merits.

Share this post


Link to post

Ok I think I understand. This is bex format, so if EDGE doesn't support Boom features (I'm assuming this just based on the fact that is wasn't derived from Boom (perhaps it has gained support for Boom or will in the future?)) then that makes sense. In which case this is still within the realm of possibility for Supplice as it is a Boom compatible project.

zZaRDoZz said:

No death post wall stick, although something remaining stuck to the walls is cool on its own merits.


I'll admit it actually looks neat and makes sense within the context of metal dart projectiles. I'm not sure what sort of projectile I'll make for the new monsters in Supplice using this method, but it most likely won't be those darts. It needs to go to its death state like the other projectiles in that case (and maybe this isn't possible for some reason unknown to me).

Share this post


Link to post

The problem with the projectile not exploding on walls is due to the A_PainAttack() code pointer, which calls A_SkullAttack() on the newly created lost soul and this sets the MF_SKULLFLY flag.

The MF_SKULLFLY flag is what stops the missile exploding when hitting a wall (since lost souls are meant to just stop when they hit something).

I'm not sure yet if there is any workaround.....

ok, try adding the 'TOUCHY' flag.

otherwise you would need to make the missile explode after a fixed delay, though that will not be perfect since when it hits a wall, the lost soul goes back to its spawn state (restarting the delay).

Share this post


Link to post

Interesting DeHacked hacking! About the wall hitting: Sounds like what the Lost Souls do when they hit the wall. Can't you simply make the projectile die a few seconds after spawnning, so, if it hits the wall, it'll just disappear soon anyway?
EDIT: In seconds too late :)

Share this post


Link to post

Ok I see now, the PainAttack codepointer has some of the Lost Soul's behaviors built into it. That makes sense now that I think about it.

Having the projectile disappear after a few seconds would probably work ok with the dart sprites. I'd have to make sure it lasts long enough that it would still be useable at longer ranges. With an animating projectile though, it still might look sort of weird.

andrewj said:

ok, try adding the 'TOUCHY' flag.


I'm sort of confused by which flag your referencing. Do you mean the "Invisible and Touchable" flag? I did try that but it makes the object invisible...obviously :P. I'm using WhackEd2 to edit my bex patch, so maybe it uses a different name for the flag your talking about.

If we can figure out if it's possible to make this method look and behave as seamless as possible in relation to the stock projectiles, then I'll definitely consider using it in Supplice. Otherwise it might just have to be another idea to toss in the experiment folder.

Thanks for your insight and help andrewj and kb1 :D

Share this post


Link to post
Mechadon said:

I'm sort of confused by which flag your referencing. Do you mean the "Invisible and Touchable" flag? I did try that but it makes the object invisible...obviously :P. I'm using WhackEd2 to edit my bex patch, so maybe it uses a different name for the flag your talking about.

The flag is actually an MBF feature, which PrBoom and probably some other source ports support. It is meant to turn an item into a touchable mine which explodes when an actor touches it.

The PrBoom code suggests that having this flag means the missile will explode when it stops moving, but I'm not sure if it will actually work, or if it does, whether it will work in Boom-compatible source ports.

P.S. tried it with PrBoom and -complevel 11 (MBF), and it didn't work.

But I had another idea: put the A_Die code pointer into the lost soul's spawn state. In Doom, Boom and PrBoom the action in a spawn state is not executed when an object is spawned. But the lost soul will re-enter its spawn state (and execute the action) whenever it stops.

Share this post


Link to post

I decided to come back to this problem today and see if the A_Die codepointer would work. Turns out it doesn't :P. I've tried a combination of different things, including A_Die and the TOUCHY flag, but to no avail.

Any other ideas guys? Is there any way to trick the engine into removing the MF_SKULLFLY from the object?

Right now I'm looking at the timer-to-death idea. It is the only method so far that actually removes the projectile (dart in this case) and plays the death animation after the tics run through. It looks kind of weird and would look even weirder with an animating projectile. Although at the current moment in time, I don't actually have a clear idea of what my new projectile will be, so I'm trying to think of a design where having it stuck on a wall won't look so stupid.

I do have one idea I'm going to try, but I don't know if it will work. And if is does work, I don't know if there would be any repercussions. Basically it involves making a replica projectile object using another thing slot. When the first projectile (replaced Lost Soul) is called, it would then immediately switch over to the new thing slot via using new frames. So the replaced Lost Soul projectile would just serve to fire the frame via the PE spawn codepointer, and then switch over as soon as possible to the new thing slot. Hopefully this would remove the MF_SKULLFLY flag in the process, but I do not if it will work at all or if will cause more serious problems. Seems like this is a really long shot anyways, so I'm not holding my breath :P

*edit*

Nope, my silly double-thing idea didn't work either. Oh well!

Share this post


Link to post

Oh man. I've solved this problem of PainAttack = projectile, for another Doomworld user. But I don't remember the thread! It involved a complicated sequence of painattack and skullattack and JUSTHIT flag and chase states and reactiontime = 1 to make the projectiles go straight to you and really explode on any impact. It worked in vanilla Doom without crashes.

Good luck finding the thread.

Share this post


Link to post

Whoa that actually works printz!

I tried dissecting why it works but it's a bit beyond me. All I know is that without the Spawn and Move states as well as the "Attack Right Back" flag enabled, it won't work right. It seemed like it would be redundant to have the Look and Chase codepointers like that but well..I dunno, it works!

I did mess around with a few other things (while trying to break it and see how it works) and I disabled and changed a few things without any noticeable effect. I changed the thing ID to -1 (like the other projectiles), removed the action sound, and removed the "FaceTarget" and "SkullAttack" codepointers from the attack state. Like I said, it still seemed to work fine, but do you know if there are any repercussions to making those changes?

I did a bit more experimenting around last night with an idea I had for a new projectile. I noticed that I couldn't change the projectile speed or do a couple of other things I wanted (like make it a tracer missile like the Revenants projectile). So what I'm thinking about doing is swapping out one of the other projectiles in the game with this Lost Soul method (possible the HK/Baron projectile) and then use the normal projectile I replaced to create something entirely different. I'm not entirely sure how it will work out, but at least this Lost Soul projectile hack is working. So that's a big part of the problem knocked out of the equation.

Thanks a ton printz :D

Share this post


Link to post

Beware that if you replace other regular projectiles with this one, monsters that shoot that one will be likely to hurt each other -- and if they hit other species, that monster won't consider them enemy. It also spawns at a different position. I think they can even hurt themselves.

Share this post


Link to post

I'm going to experiment around with the projectile swapping idea a bit before I commit to doing anything final with it. The lack of in-fighting potential seems like it would be the biggest drawback at this point. I'm just going to have to play around with it a bit and see.

Share this post


Link to post

By the way printz, I believe I found that thread you were talking about.

Reading through it, I noticed you listed some drawbacks to this idea, some of which I knew already. The last one is probably going to make keep me from going through with my projectile swap idea though; the projectiles will be stopped by items. Crap :P

After some thought, I decided what type of projectile I wanted to make. I got some inspiration from an Armored Core game to make a slow moving but homing missile that would do a ton of damage and use the A_Mushroom codepointer. This projectile was going to be added to the final boss for Supplice in addition to his current attack behavior. But after I started messing around with the Tracer codepointer, I noticed that it would never home in, even when the smoke trail appeared.

I'm guessing the homing effect will only take place when both the Tracer and the Revenant attack codepointer is used in conjunction? I was going to make another help thread asking about this, but now I'm not sure it will be worth it because of the limitation with the Lost Soul and being blocked by items. I should still be able to use the Lost Soul projectile on the boss monster though since he will be used in a more controlled environment.

Share this post


Link to post
Mechadon said:

I'm guessing the homing effect will only take place when both the Tracer and the Revenant attack codepointer is used in conjunction?


Yep.

The missile needs to know what it's aimed at. Most projectiles are dumb things that go straight ahead, they don't need to know at what they're aimed, so the only attack function that tells the projectile what is being targeted is the revenant's missile function.

If you cannot use it, then you have to either forget the idea or use something like DECORATE instead of DeHackEd...

Share this post


Link to post

Thanks for clearing that up for me Gez. I figured that might be the case. The descriptions that show up in WhackEd2 don't really clarify that both need to be used in order for the projectile to home.

Seeing as the Lost Soul projectile is going to be pretty limited anyways, I'm probably going to forget about my homing missile idea and just go with a more normal projectile to be used solely on the boss monster.

I appreciate all of the helps guys!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×