Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
40oz

Dehacked Random Props

Recommended Posts

I had an interesting idea this morning but I haven't touched dehacked in a while, so I'm not sure something like this is entirely possible.

Some ZDoom gameplay mods that substitute monsters for others will randomly select from a pool of different types of Dark Imps to replace normal imps with. Usually the monsters are different in the monsters places each time you play the map. Could something like that possibly be done in dehacked?

Lets say for example, that you wanted to create a forest out of sprites. So you have a bunch of sprites that look like slight variants of the same tree. Is there a way that i could place the same tree object a bunch of times in the map, and when I play the map, each tree looks like one of my variations? Perhaps by using the A_Look command on it to make the tree change permanently to one of the variants?

What would be the smartest way to go about this? Maybe the tree could cycle between 3 states in a short duration, calling A_Look each time, and when it sees or hears the player, it changes do a different tree variant when its "awoken" depending on which state it's in when it wakes up? Would something like that work?

There's some barrel sprites in the Doom 2 unreleased stuff that Romero shared that I'd like to make use of without creating individual things for.

Share this post


Link to post

The easiest way to achieve that in dehacked would be to target MBF compatibility so that you can use its A_Random codepointer.

Share this post


Link to post

The A_Look solution won't work, because A_Look always sends the actor to the same "See" state.

There is not much randomization doable through vanilla codepointers, but one of them is damage output. So, here is an idea for a tree that randomly chooses from 2 different appearances early after the map is launched:

Have 2 different actors. One is tree and one is dummy attacker. Place them onto each other in your map. Let the dummy attacker's spawn state infinitely loop the same frame with NULL codepointer on it. Let his pain chance be 256, and let him have very high health. Let the tree be SHOOTABLE and have health 141. Let the tree perform A_Explode right after it's spawned (you need to place one dummy frame with NULL codepointer before it, because the very first codepointer after an actor is spawned is never executed). This way, the tree will damage itself with constant damage 128, reducing its own health to 13. It will also damage the dummy attacker, who will enter pain state (and also, the tree should become his new target). His pain state should perform A_TroopAttack (imp's attack). It should damage the tree, and deal either 3, 6, 9, 12, 15, 18, 21 or 24 damage. It should either kill the tree, or not. If the tree is killed, it goes to a death state with different appearance than its default state. The dummy attacker should go to state 0 right after he attacks, which will remove him from the map.

This concept needs to be improved upon. For example taking advantage of gibbing animation in additing to normal death, which would allow the tree to randomly choose from 3 appearances, but the damaging mechanic would have to be changed, so that the tree won't damage itself by radius damage, so it's health can be low enough to allow gibbing animation. The splash damage also has the drawback that trees must be placed in a way to not damage each other. And then, the tree will still be damagable when the player approaches it. So this method is not really usable as is. But I believe an improvement should be possible. I just don't feel like thinking about it now.

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
Sign in to follow this  
×