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

MTrop's Doom Tools Update (DMXConv, DImgConv, DECOHack, DoomMake)

Recommended Posts

Very nice! Seems to work as expected, but I got a problem getting auto things in action pointer functions to work. I have this DECOhack code (converted from ZScript Blood Demon from Realm 667):


 

auto thing BloodDemonArm "Blood Demon Arm"
{
    ...
}


auto thing BloodDemon "Blood Demon"
{
    ...

    states
    {
        ...
        Death:
            ...
            SRG2 J 0 A_SpawnObject(thing BloodDemonArm, 0.0, 10.0, 0.0, 32.0, 0.0, -8.0, 4.0) // This is line 68
            ....
        ...
    }
}

 

That's pretty much as in the example, but I get the following error:

 

ERROR: (src\decohack\blooddemon.dh) Line 68, Token ",": Expected thing label name.

 

Line 68 is the one with the A_SpawnObject action pointer function. DECOhack recognized BloodDemonArm as a correct thing, because changing the thing to something invalid produces a different error.

 

A_SpawnObject(thing lalala, 0.0, 10.0, 0.0, 32.0, 0.0, -8.0, 4.0)

 

results into the error

 

ERROR: (src\decohack\blooddemon.dh) Line 68, Token ",": Expected valid thing alias: "lalala" is not a valid alias.

 

Full DECOhack file is attached.

 

 

blooddemon.zip

Share this post


Link to post

D'oh! I'll take a look.

 

I wonder if I should also make things named with an identifier use that name as the display name by default, if none was specified. Hmmm...

Share this post


Link to post

Since it looks like it'll take some more time for DSDHacked to get some more traction, and DEHEXTRA being more widespread, I'm wondering if it'd be viable to have some "auto sprite" feature in DECOHack. I.e. being able to use new (not defined in Doom or DEHEXTRA) sprites, like the "SRG2" sprite in the example I posted at the top of this page, then have DECOHack figure out which "SPxx" it wants to assign when compiling to DEHACKED. Same for the actual sprite image files, they could have their normal names (like "SRG2A0.xxx") in the "assets/sprites" or "convert/sprites" directory and just be compiled into the asset .WAD as "SPxx".

 

That would also make it easier to build a repository of DECOHack things, since the things could use unique sprite names, without the user having to go on a renaming spree to sort out all the "SPxx" names.

Share this post


Link to post

This loop

    each (pngFile : pngList) {
        arguments = ["/c3", "/f0", "/d8", "/kgrAb", "/y"];
        arguments->listadd(pngFile, 0);
        println("Compressing " + pngFile + "...");
        execresult(exec(exepath, arguments, envvars(), exeworkdir, stdout(), stderr(), stdin());
    }

iterates properly but only displays to stdout the first time through. Worse, the loop stops the rest of the script from displaying its own output, though I've confirmed that everything does get built correctly. I've spent the past day or two trying to figure out what's going on, trying different things, and I'm fairly sure I'm simply too much of a novice to understand.

 

bad.png.c490a3e84b97d6003edc19e381ef8bfc.png

With the output-quashing loop

 

normal.png.2c26745fddc37f6f33465ae428817f3f.png

What the script outputs normally; note the textures and project wads print their success.

Share this post


Link to post

Uh oh. Hopefully this isn't a terrible bug in exec. I'll have to dig further. It's probably a stream issue. Maybe standard-out is getting closed after the process finishes when it shouldn't be? I'll have to take a look.

 

For the time being, you may be able to write to a buffer (bufnew), open an output stream to it (bosopen), pass that to exec as the output, then read it into a string (bisopen, csropen), and print the string output (each csiterate), but that's gonna get complicated.

 

EDIT: Maybe something like this?

each (pngFile : pngList) {
    arguments = ["/c3", "/f0", "/d8", "/kgrAb", "/y"];
    arguments->listadd(pngFile, 0);
    println("Compressing " + pngFile + "...");

    outbuf = bufnew(32 * 1024) // 32k.
    execresult(exec(exepath, arguments, envvars(), exeworkdir, bosopen(outbuf), stderr(), stdin());
    each (line : outbuf->bisopen()->csropen()->csiterate()) {
        println(line);
    }
}

 

Edited by MTrop : added example

Share this post


Link to post
8 hours ago, boris said:

Since it looks like it'll take some more time for DSDHacked to get some more traction, and DEHEXTRA being more widespread, I'm wondering if it'd be viable to have some "auto sprite" feature in DECOHack. I.e. being able to use new (not defined in Doom or DEHEXTRA) sprites, like the "SRG2" sprite in the example I posted at the top of this page, then have DECOHack figure out which "SPxx" it wants to assign when compiling to DEHACKED. Same for the actual sprite image files, they could have their normal names (like "SRG2A0.xxx") in the "assets/sprites" or "convert/sprites" directory and just be compiled into the asset .WAD as "SPxx".

 

That would also make it easier to build a repository of DECOHack things, since the things could use unique sprite names, without the user having to go on a renaming spree to sort out all the "SPxx" names.

 

With MBF21 quickly superceded by DSDHACKED, I can't imagine that you'd see much use out of a mid-generational feature like this, especially since what you are suggesting requires the cooperation of more than just DECOHack to get the job done for very little gain.

 

Perhaps this will be the nudge that the other ports need to adopt DSDHACKED! Until then, people just sharing their source code should suffice. It's possible to copy the source DECOHack code into a single file with a DECOHack switch, so that it can be stored in the released WAD (I recommend "DEHSRC" for the lump name, or maybe a different one so that the program used is more clear?). DoomMake can do this in its DECOHack template projects, automatically.

Share this post


Link to post

 

On 11/6/2021 at 8:40 PM, MTrop said:

Uh oh. Hopefully this isn't a terrible bug in exec. I'll have to dig further. It's probably a stream issue. Maybe standard-out is getting closed after the process finishes when it shouldn't be? I'll have to take a look.

To give you more details, the process in question is a windows-native command line utility called pngout. Your idea for a workaround was partially successful, at least, as the rest of the doommake script was able to print to the console. Unfortunately, however, pngout also refused to print to the buffer, so I made do with declaring the output stream as null, which worked.

 

 

 

 

Edited by Giomancer : Improved post

Share this post


Link to post

Is there a "reference implementation" of all the things and weapons? I.e. how each one of them would look like in DECOHack, like the GZDoom wiki has? Looking at the GZDoom wiki works ok-ish, but the actors have some stuff that DeHackEd doesn't have.

Share this post


Link to post

At the moment, no.

 

I also debated whether DECOHack should prefill its "base" data with a reference code set, but I felt that would be a lot of needless extra parsing, not to mention that states and stuff would end up in incorrect places without micromanaging the state fill (not very readable or useful).

 

I wonder if I could get away with having a mechanism that auto-generates certain actors, but that too will need to know about some kinds of hardcodings or else some implementations would not work on a straight copy (I'm looking at you, chaingun code pointers!).

 

It might have to be done by hand, but at the moment, it's not a priority. The GZDoom wiki stuff works okay enough for a reference point.

Share this post


Link to post

Bumping to let you all know that DECOHack had a major bug fixed (introduced around the DSDHACKED support version):

 

Sound definitions and use of EXTENDED sound indices were off by 1, which would have potentially broken your EXTENDED patches (and a few sound definitions if you replaced those).

 

Please doomtools --update or download the new release!

 

https://github.com/MTrop/DoomTools/releases/tag/2021.11.30-RELEASE

Share this post


Link to post

Getting this error whenever I use the alias thing normally like the guide says i could.image.png.f2f29bcb6ecc506a969b4ec765e1fce4.png

image.png.ad3dcc10055f43adf0d5a04aae1437bd.png

Am I doing something wrong?

Share this post


Link to post
7 hours ago, boris said:

It's probably some error before that line. What does the full file look like?

if it'll help any, here

image.png.baf499fab2a4a151c8e18fcbfd81e9db.png

Share this post


Link to post

That's strange. I can't replicate this error. From that message, it sounds like a thing definition is unclosed or unterminated from a previously included file, and the internal includes don't have anything like that. 

 

This code produces no errors on my side:

/*****************************************************************************
 * DECOHack Patch File
 * Main
 ****************************************************************************/

#include <extended>
#include <friendly>

alias thing AmbienceTemplate 151

 

What version of DECOHack/DoomTools are you running? Aliases were added in DECOHack 0.19.0.

 

Share this post


Link to post

I was expecting the issue to still be occurring but for some reason suddenly when I reach out for help it just magically stops throwing errors. Weird.

Share this post


Link to post

Ran into a new problem where, for some reason, the directories that are supposed to be converted just don't get converted. They just get sent into the wads as just pngs. Is there a way to have them properly convert?

image.png.61a9787b09631c318ac5dfc5cbfc3a8e.png

For some reason, it says "up to date" even though nothing's in them.

Edited by Obsidian Plague : actually y'know what there is a problem

Share this post


Link to post

I think you're using it the wrong way around.

 

You have to put the files you want to convert into the "convert" subdirectories, not in the "assets" subdirecoties. The converted files will be written to the "assets" subdirectories. The files in the "assets" subdirectories will be put into the WAD without any other modification.

Share this post


Link to post

To add, a directory tree is considered "up-to-date" if no changes were detected in it from the last execution - which includes an empty directory staying empty.

Share this post


Link to post

Hey sorry if this is out of place here, but im pretty confused as to exactly how to install this, so if anybody is able to help me, it would be greatly appreciated.

 

 

Share this post


Link to post
3 hours ago, Lemonlytical said:

Hey sorry if this is out of place here, but im pretty confused as to exactly how to install this, so if anybody is able to help me, it would be greatly appreciated.

 

Installation is pretty staightforward, but can be a bit tricky for the uninitiated:

 

  1. Install Java (JDK) as described in the "But I hate Java!" section on https://mtrop.github.io/DoomTools/. Personally I installed the Microsoft one, which works fine
  2. Get the latest version of DoomTools from https://mtrop.github.io/DoomTools/ and unzip it in a clean directory
  3. (optional, but higly recommended) Add the directory where you unzipped DoomTools to to the PATH environment variable. How to do this depends on your OS, so you probably should google for it. For english Windows 10 versions here's a tutorial: https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/

 

If you included step 3 you can just open a command prompt and just type and of the DoomTools commands, otherwise you always have to specify the full path to them (hence why it's recommended to add the directory to the PATH environment variable).

 

 

Share this post


Link to post
2 hours ago, boris said:

 

Installation is pretty staightforward, but can be a bit tricky for the uninitiated:

 

  1. Install Java (JDK) as described in the "But I hate Java!" section on https://mtrop.github.io/DoomTools/. Personally I installed the Microsoft one, which works fine
  2. Get the latest version of DoomTools from https://mtrop.github.io/DoomTools/ and unzip it in a clean directory
  3. (optional, but higly recommended) Add the directory where you unzipped DoomTools to to the PATH environment variable. How to do this depends on your OS, so you probably should google for it. For english Windows 10 versions here's a tutorial: https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/

 

If you included step 3 you can just open a command prompt and just type and of the DoomTools commands, otherwise you always have to specify the full path to them (hence why it's recommended to add the directory to the PATH environment variable).

 

 

Thank you so much for the reply, do I have to rename the directory when in the place for the Path environment variable

Share this post


Link to post

Hey, all - I'm bumping this thread to let you know that you should head to the Official DoomTools Thread in Doom Editing if you want to have up-to-date info on everything.

 

Also, there's an installer, now! It'll set all that PATH and Java stuff up for you if you're on Windows! Fun!

 

Go there now and follow that thread if you want to be notified of updates!

Share this post


Link to post

Question - how can I create custom monster missile? Example Spider that shots BFG. Where to add BFG and how look script?

 

Spoiler

#include "classpath:decohack/mbf21.dh"
#include "classpath:decohack/constants/friendly_things.dh"

 

auto thing BFGSpider "BFGSpider"
{
        Health 8000
        Speed 16
        Radius 128
        Height 100
        Damage 0
        ReactionTime 8
        PainChance 40
        Mass 1000
        
  clear flags
  +BOSS
  +SOLID
  +SHOOTABLE
  +COUNTKILL
  
  clear sounds
        
         clear States
         States
        {
Spawn:
    SPID AB 10 A_Look
    Loop
  See:
    SPID A 3 A_Metal
    SPID ABB 3 A_Chase
    SPID C 3 A_Metal
    SPID CDD 3 A_Chase
    SPID E 3 A_Metal
    SPID EFF 3 A_Chase
    Loop
  Missile:
    SPID A 20 Bright A_FaceTarget
    SPID G 4 Bright A_MonsterProjectile
    SPID H 4 Bright A_MonsterProjectile
    SPID H 1 Bright A_SpidRefire
    Goto Missile
  Pain:
    SPID I 3
    SPID I 3 A_Pain
    Goto See
  Death:
    SPID J 20 A_Scream
    SPID K 10 A_Fall
    SPID LMNOPQR 10
    SPID S 30
    SPID S -1 A_BossDeath
    Stop
    }
}

 

 

Share this post


Link to post
On 11/13/2021 at 6:12 PM, boris said:

Is there a "reference implementation" of all the things and weapons? I.e. how each one of them would look like in DECOHack, like the GZDoom wiki has? Looking at the GZDoom wiki works ok-ish, but the actors have some stuff that DeHackEd doesn't have.

I want see too... I did some monsters txt. but they dont shot. Dont know why

Monsters.zip

Share this post


Link to post

I don't know how to fix this error...

 

Compiling patch...
WARNING: (src\decohack\main.dh) Line 68, Token "BFGmissile￯ᄏ﾿": The use of a "thing" clause as a parameter in an action pointer is unneccesary. You can just use an index or a thing alias.
ERROR: (src\decohack\main.dh) Line 68, Token ")": Expected valid thing alias: "BFGmissile￯ᄏ﾿" is not a valid alias.
ERROR: [ToolError]: DECOHack threw an error.

 

Spoiler

#include "classpath:decohack/mbf21.dh"
#include "classpath:decohack/constants/friendly_things.dh"

 

auto thing BFGmissile "BFGmissile"
{
    Radius 13
    Height 8
    Speed 25
    +MISSILE
    +DROPOFF
    +NOBLOCKMAP
    +NOGRAVITY
    +TRANSLUCENT
    
    States
    {
            Spawn:
                BFS1 AB 4 
                Loop
              Death:
                BFE1 AB 8 
                BFE1 C 8 A_BFGSpray
                BFE1 DEF 8 
                Stop
    }    
}


auto thing BFGSpider "BFGSpider"
    { 
        EdNum 1000
        
        Health 8000
        Speed 16
        Radius 128
        Height 100
        Damage 0
        ReactionTime 8
        PainChance 40
        Mass 1000
    
        clear flags
        +SOLID
        +SHOOTABLE
        +COUNTKILL
    
        SeeSound "spisit"
        AttackSound ""
        PainSound "dmpain"
        DeathSound "spidth"
        ActiveSound "dmact"
        
        states
        {
              Spawn:
                SPID AB 10 A_Look
                Loop
              See:
                SPID A 3 A_Metal
                SPID ABB 3 A_Chase
                SPID C 3 A_Metal
                SPID CDD 3 A_Chase
                SPID E 3 A_Metal
                SPID EFF 3 A_Chase
                Loop
              Missile:
                SPID A 20 Bright A_FaceTarget
                SPID G 4 A_MonsterProjectile(thing BFGmissile) 
                SPID H 4 A_MonsterProjectile(thing BFGmissile)
                SPID H 1 A_SpidRefire
                Goto Missile
              Pain:
                SPID I 3
                SPID I 3 A_Pain
                Goto See
              Death:
                SPID J 20 A_Scream
                SPID K 10 A_Fall
                SPID LMNOPQR 10
                SPID S 30
                SPID S -1 A_BossDeath
                Stop
        }
    }    

 

Share this post


Link to post
On 5/24/2022 at 4:32 PM, CrazyDoomguy said:

I don't know how to fix this error...

 

That's strange - there are weird invisible characters at the end of both uses of BFGmissile on lines 68 and 69. Maybe they were picked up on copy-paste from somewhere else?

 

Retyping those lines fixed it for me. You can also remove "thing" before BFGmissile on those lines as well - that is what is causing the warning. DECOHack is smarter about alias/value usage in pointers, now.

Share this post


Link to post
16 hours ago, MTrop said:

That's strange - there are weird invisible characters at the end of both uses of BFGmissile on lines 68 and 69. Maybe they were picked up on copy-paste from somewhere else?

That is the UTF-8 BOM, indeed frequently included in copy-pastes from this forum, e.g. to the Doom Wiki.

Share this post


Link to post
20 hours ago, MTrop said:

 

That's strange - there are weird invisible characters at the end of both uses of BFGmissile on lines 68 and 69. Maybe they were picked up on copy-paste from somewhere else?

I copied script from wiki and fixed some of them

Spiderdemon

BFGball

 

20 hours ago, MTrop said:

Retyping those lines fixed it for me. You can also remove "thing" before BFGmissile on those lines as well - that is what is causing the warning. DECOHack is smarter about alias/value usage in pointers, now.

 

I removed thing and there show error

image.png.acc29b2e23a810883a247527acbed1ef.png

 

Compiling patch...
ERROR: (src\decohack\main.dh) Line 68, Token ")": Expected valid thing alias: "BFGmissile￯ᄏ﾿" is not a valid alias.
ERROR: (src\decohack\main.dh) Line 68, Token ")": Expected valid thing index: positive integer, or thing alias.
ERROR: [ToolError]: DECOHack threw an error.

 

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
×