boris Posted October 28, 2021 (edited) 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 Edited October 28, 2021 by boris 0 Quote Share this post Link to post
MTrop Posted October 28, 2021 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... 0 Quote Share this post Link to post
MTrop Posted October 29, 2021 Fixed! New release for DECOHack: https://github.com/MTrop/DoomTools/releases/tag/2021.10.29-RELEASE -DecoHack- Changed for 0.19.1 Fixed: Thing indices were not being parsed properly in action pointer parameters. Update now! 3 Quote Share this post Link to post
boris Posted November 6, 2021 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. 0 Quote Share this post Link to post
Giomancer Posted November 6, 2021 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. With the output-quashing loop What the script outputs normally; note the textures and project wads print their success. 1 Quote Share this post Link to post
MTrop Posted November 7, 2021 (edited) 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 November 7, 2021 by MTrop added example 1 Quote Share this post Link to post
MTrop Posted November 7, 2021 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. 2 Quote Share this post Link to post
Giomancer Posted November 7, 2021 (edited) 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 November 19, 2021 by Giomancer Improved post 0 Quote Share this post Link to post
boris Posted November 13, 2021 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. 1 Quote Share this post Link to post
MTrop Posted November 13, 2021 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. 2 Quote Share this post Link to post
MTrop Posted November 30, 2021 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 1 Quote Share this post Link to post
Obsidian Plague Posted December 25, 2021 Getting this error whenever I use the alias thing normally like the guide says i could. Am I doing something wrong? 0 Quote Share this post Link to post
boris Posted December 25, 2021 It's probably some error before that line. What does the full file look like? 0 Quote Share this post Link to post
Obsidian Plague Posted December 25, 2021 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 0 Quote Share this post Link to post
MTrop Posted December 26, 2021 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. 0 Quote Share this post Link to post
Obsidian Plague Posted December 26, 2021 (edited) 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. Edited December 26, 2021 by Obsidian Plague 0 Quote Share this post Link to post
Obsidian Plague Posted December 26, 2021 (edited) 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? For some reason, it says "up to date" even though nothing's in them. Edited December 26, 2021 by Obsidian Plague actually y'know what there is a problem 0 Quote Share this post Link to post
boris Posted December 26, 2021 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. 0 Quote Share this post Link to post
MTrop Posted December 26, 2021 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. 0 Quote Share this post Link to post
Lemonlytical Posted February 6, 2022 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. 0 Quote Share this post Link to post
boris Posted February 6, 2022 (edited) 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: 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 Get the latest version of DoomTools from https://mtrop.github.io/DoomTools/ and unzip it in a clean directory (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). Edited February 6, 2022 by boris 1 Quote Share this post Link to post
Lemonlytical Posted February 6, 2022 2 hours ago, boris said: Installation is pretty staightforward, but can be a bit tricky for the uninitiated: 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 Get the latest version of DoomTools from https://mtrop.github.io/DoomTools/ and unzip it in a clean directory (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 0 Quote Share this post Link to post
MTrop Posted April 16, 2022 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! 5 Quote Share this post Link to post
CrazyDoomguy Posted May 18, 2022 (edited) Solved problem. You can ignore my comment Edited May 18, 2022 by CrazyDoomguy 0 Quote Share this post Link to post
CrazyDoomguy Posted May 18, 2022 (edited) 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 } } Edited May 18, 2022 by CrazyDoomguy 0 Quote Share this post Link to post
CrazyDoomguy Posted May 18, 2022 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 0 Quote Share this post Link to post
CrazyDoomguy Posted May 24, 2022 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 } } 0 Quote Share this post Link to post
MTrop Posted May 26, 2022 (edited) 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. Edited May 26, 2022 by MTrop 1 Quote Share this post Link to post
Xymph Posted May 27, 2022 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. 1 Quote Share this post Link to post
CrazyDoomguy Posted May 27, 2022 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 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. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.