Converting DEHACKED things into Decorate

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
NeoSpearBlade
Posts: 51
Joined: Tue Mar 26, 2013 1:35 pm

Converting DEHACKED things into Decorate

Post by NeoSpearBlade »

A project I wanna do in the future is to modify my collected mods that use DEHACKED monsters, weapons and items into Decorate format to make them generally more mod-friendly. I'm aware that in the end I have to edit the maps themselves and place the things where DEHACKED had them.

Let's have a starting example: The Dopefish from Doom 2 the Way id Did. DEHACKED had him replace the SS Nazi and it behaved like "a lost soul on steroids" which means the following:
  • 1. He only has sounds when he charges at you.
    2. He deals considerable amount of damage.
    3. He has 5000 hit points; 1000 more than the Cyberdemon.
So, as a starting example, how do I go about into converting him for Decorate? What do I need to know from both DEHACKED and Decorate?

Whatever useful information I learn here will help me with this future project of mine.

EDIT: I forgot to post the DEHACKED code of Dopefish.

Here you go:

Code: Select all

Thing 24 (Dopefish)
Action sound = 87
Respawn frame = 0
Death frame = 745
Attack sound = 87
Missile damage = 10
Exploding frame = 0
Height = 5242880
Pain sound = 101
Hit points = 5000
Width = 2097152
Alert sound = 0
Speed = 12
Mass = 10000
Pain chance = 0
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Converting DEHACKED things into Decorate

Post by Gez »

You'll want to look at dehsupp.txt as it will be the document you'll cross-reference constantly. You'll also want to grab the original doom source code info.h for the statenum_t enum because it'll make it much easier to match frame numbers to what state exactly we're talking about.

For example:

Code: Select all

    Thing 24 (Dopefish)
    Action sound = misc/chat2
    Respawn frame = Stop
    Death frame = WolfensteinSS::Death+1
    Attack sound = misc/chat2
    Missile damage = 10
    Exploding frame = Stop
    Height = 80
    Pain sound = wolfss/sight
    Hit points = 5000
    Width = 32
    Alert sound = ""
    Speed = 12
    Mass = 10000
    Pain chance = 0
Sound 87 is the 87th sound in the sound list (sound 0 is no sound); that maps to misc/chat2 (dstink). Frame 745 is S_SSWV_DIE2, which is the frame after SSWV_DIE1, so it's not the SS's death state but the state after (hence, death+1). Width and height are fixed point values, so divide by 65536 to get a more reasonable-looking value.

Now that you have that you can start writing the DECORATE code, but it's only the simplest half of the job. The more complicated part comes in converting the states (aka frames). Here the frame references that are changed are Respawn (Raise), Exploding (XDeath), and Death (Death). That means that the other standard states (Spawn, Chase, Pain) are not changed. You'll have to take each of them and look how it's been modified. So for example the spawn frame will still be S_SSWV_STND, aka 726.

Code: Select all

Frame 726
Sprite subnumber = 32768
If the sprite subnumber is 32768 or larger, consider that the state is bright and remove 32768. Count the resulting value after A in the alphabet to get the sprite letter. That means that here the state is SSWV A Bright. Duration, codepointer, and next state aren't changed here, so keep things the same:

Code: Select all

Spawn:
SSWV A 10 Bright A_Look
Goto Spawn+1

Code: Select all

Frame 727
Sprite subnumber = 32769
Same deal, so:

Code: Select all

Spawn+1:
SSWV B 10 Bright A_Look
Goto Spawn
Which means that in effect, you have:

Code: Select all

  Spawn:
    SSWV AB 10 Bright A_Look
    Loop
Spawn's an easy one. Now do the same for Chase, Pain, and Death.




When you have a lot of monsters, and their coding is complex; it becomes madness to try to do it by hand like this. That's where you'll want for a program to do it automatically...
Worst
Posts: 115
Joined: Sat Apr 28, 2007 5:29 am
Location: finland
Contact:

Re: Converting DEHACKED things into Decorate

Post by Worst »

Here's some numbered lists that might help:
Spoiler: Dehacked sprite numbers
Spoiler: Dehacked sound numbers
Spoiler: Dehacked thing numbers
Spoiler: Dehacked state numbers (which actors they belong to)
Gez wrote: When you have a lot of monsters, and their coding is complex; it becomes madness to try to do it by hand like this. That's where you'll want for a program to do it automatically...
Does a such program exist?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Converting DEHACKED things into Decorate

Post by Gez »

Blzut might have made one to create this. I once modified ZDoom to output DECORATE code for actors modified by DEHACKED but I haven't kept that code unfortunately.
Locked

Return to “Editing (Archive)”