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

A little DeHacked test that needs some input

Question

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:

Spoiler

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

 

000.png.4284e8cd929b200e2a0b3e8f230621e7.png001.png.05ecc941ecdcd4a484efe921ad777053.png

 

Here it is for Berserk:

 

002.png.11a164a56b69f9833f107185b5bbef49.png003.png.8a16e9cef1e83acda9da3df19cb4ad24.png

 

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

 

004.png.d3b5d1baaef9cb49a7cbbb79fa5fa2aa.png005.png.da13648c19527543c65db9497af11f5e.png

 

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:

 

Untitled.png.5049c44649e203e34f451b1e1385c91f.png

 

And here is the important part:

doom00.png.8b442962fc34e248dc30746c456a6cf5.png

 

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

 

doom01.png.1fcb46fd97a8a92212d4dfb69d6bcc8b.png

 

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

 

doom02.png.4bdb767e39daa9420683cec74102dce1.png

 

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.

https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/p_inter.c#L366-L653

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.

https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/info.c#L988

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

https://github.com/id-Software/DOOM/blob/master/linuxdoom-1.10/info.c#L977

 

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
×