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

A little DeHacked test that needs some input


So, I'm doing a little DeHacked test: I want to see if it is possible in a "Vanilla .deh file" to save 1 state location from the "Berserk sphere" by copying another state location from the "Medical kit" and changing the "Medical kit" sprite into a green box that can be modified by the DeHacked color switcher box, while still having the Berserk work as a Berserk and the Medical kit work as a Medical kit.


To elaborate:


Here is the standard Vanilla DeHacked stats for a Medical kit:




Here it is for Berserk:




Here is the change I made for the Berserk (note the Spawn State number and the color 1 and 2 boxes):




Here is the end result for the .deh file that I created:

Patch File for DeHacKEd v3.0

Doom version = 21
Patch format = 6

Thing 58 (Berserk sphere)
Initial frame = 841
Bits = 209715201

Here is a quick testing sprite I made for the experiment:




And here is the important part:



I have a Medical kit on the left and a Berserk on the right!




The Medical kit works like a Medical kit as it should!




However, the Berserk doesn't work as a Berserk power-up, it works as a Medical kit! This is not what I wanted!

I know that I can change the sprite on the Berserk spawn state without copying the state from the Medical kit, but my goal here is to see if I can save the state that occupies the Berserk object while still having the Berserk work as intended and not the sprite itself.


Is this a lost cause? Or maybe there is a solution?

Share this post

Link to post

4 answers to this question

Recommended Posts

  • 1

Short version, no.


P_TouchSpecialThing() in vanilla Doom uses the sprite ID to decide what powerup it is.


You change the initial frame for this mobj type from states[852] which is SPR_PSTR, frame (so frame 0 + fullbright flag), infinite duration.


to states[841] which is SPR_MEDI, frame 0, infinite duration.



So when you step on your edited berserk, special->sprite is SPR_MEDI so it's running the pickup code for the medikit.


Yes, it's kind of weird.

I can't see any reason why is this done by special->sprite instead of special->type. It would be cleaner and more flexible that way.

As is, the mobjtypes for powerups aren't even named, they're just MT_MISCxx similarly to decorations and other "don't care" objects. (MT_MISC11 and MT_MISC13 respectively).


For a moment I thought that maybe multiplayer/nightmare item respawning works on the basis of "change to null sprite, wait, change to normal sprite", but no, the pickup item is removed every time just like anything else.

In multi, P_RemoveMobj queues up the mapthing_t up to a timer, and all the data for the newly created item is read from mapthing_t, just like when map starts and all items/monsters are created.

Share this post

Link to post
  • 1

Unlike pickups, monsters are done by mobj type.


I.e a mobj with the ID VILE, won't be retaliated against. You can't have multiple mobjs with the same ID.

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