The "How do I..." Thread
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.
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.
Re: The "How do I..." Thread
I have a projectile that spawns blue sparks behind it, using A_SpawnItemEx and SXF_TRANSFERTRANSLATION (the untranslated spark sprites are yellow). Does it make sense that ZDoom is able to apply the translation correctly, while GzDoom isn't, leaving the sparks yellow? Should I report a bug, or is there something I should first try? The sprite is converted to "PNG (paletted)" in Slade.
- phantombeta
- Posts: 2166
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: The "How do I..." Thread
Is the palette being used by the PNG the Doom palette? If not, I think that might be messing it up.
Re: The "How do I..." Thread
It logically has to be (in ZDoom anyway, GZDoom may not be doing any conversions, making translation impossible), but the problem is PNGs need to have their palettes translated, and even with the exact same colours the index is not guaranteed to come out the same way.
If you want to use translation, it is highly recommended that you use the doom sprite format, where you have a guarantee which colour indexes are used.
If you want to use translation, it is highly recommended that you use the doom sprite format, where you have a guarantee which colour indexes are used.
Re: The "How do I..." Thread
First time posting here, I was wondering on how I would go about creating a new game with ZDoom? I already understand all the DECORATE stuff, but it seems I have no other choice but to modify the zdoom.pk3 for my own playerclass, mapinfo, and iwadinfo...
- phantombeta
- Posts: 2166
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: The "How do I..." Thread
Uhh... No.
PK3 files are just renamed zips, so if you can edit one, you can make them without editing zdoom.pk3.
And you don't need IWADINFO. It's not required. That's just so ZDoom can find it automatically for the list. You can use any WAD with the -iwad parameter... Well, almost any. It needs to have a PLAYPAL/palette.
PK3 files are just renamed zips, so if you can edit one, you can make them without editing zdoom.pk3.
And you don't need IWADINFO. It's not required. That's just so ZDoom can find it automatically for the list. You can use any WAD with the -iwad parameter... Well, almost any. It needs to have a PLAYPAL/palette.
Re: The "How do I..." Thread
Absolutely never modify ZDoom.pk3.Revanic wrote:but it seems I have no other choice but to modify the zdoom.pk3
- phantombeta
- Posts: 2166
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: The "How do I..." Thread
I think ZDoom should check against a stored MD5 hash to make sure it isn't edited. If it is, don't let the game start, with the message "Do not edit the zdoom.pk3 file."
Re: The "How do I..." Thread
Then a modding tutorial lied to me. Whoops. Alright then, look dumb now to look smart later I guess.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: The "How do I..." Thread
Can you post a link to this tutorial that tells you to mod zdoom.pk3? I think we need to call down the Spanish Inquisition on them.
Re: The "How do I..." Thread
Well, more specifically it was a GZDoom modding tutorial. Though I would believe it would still apply to not actually modify the gzdoom.pk3 either. I also just realized it was posted on April 1st. Perhaps I am just [censored word]? ._.
www.lofibucket.com/articles/modding_doom.html
www.lofibucket.com/articles/modding_doom.html
- Coincident
- Posts: 85
- Joined: Fri Aug 22, 2014 8:38 am
- Location: Portugal
Re: The "How do I..." Thread
I'm trying to pass a fixed point decimal from Decorate to an ACS call:
decorate
ACS
This prints 0.0000something
ACS
This prints 121.
Is this behaviour normal? How do I pass a fixed point as argument to an ACS call?
decorate
Code: Select all
Pickup:
TNT1 A 0 ACS_NamedExecuteAlways("testDecimal", 0, 121.5)
Stop
ACS
Code: Select all
script "testDecimal" (int decimal) {
printBold(f: decimal);
}
ACS
Code: Select all
script "testDecimal" (int decimal) {
printBold(d: decimal);
}
Is this behaviour normal? How do I pass a fixed point as argument to an ACS call?
Re: The "How do I..." Thread
Ints don't like decimals. You'll have to use a fixed_t, I believe, instead. ZDoom handles fixed_t's as floats and only floats give you the decimal place. As for printing it, I have no idea since I haven't tried ACS yet. Hopefully I'm not wrong this time. xD
Re: The "How do I..." Thread
Try 7962624 instead.121.5

Re: The "How do I..." Thread
Nothing in this post is correct.Revanic wrote:Ints don't like decimals. You'll have to use a fixed_t, I believe, instead. ZDoom handles fixed_t's as floats and only floats give you the decimal place. As for printing it, I have no idea since I haven't tried ACS yet. Hopefully I'm not wrong this time. xD
Nothing in this post is remotely helpful.cocka wrote:Try 7962624 instead.
Decorate has to truncate the decimal to pass a valid result to ACS, which doesn't have floating point values. There is a very functional solution to this, though, which can be used simply by remembering the basic rules of fixed point integers.Coincident wrote:I'm trying to pass a fixed point decimal from Decorate to an ACS call
In ZDoom, fixed point is 16.16, so 16 whole bits and 16 fractional. 1. is thus the 17th bit (1 << 16), making it an integer of 65536. Visually, this:

So this makes our magic number 65536. If we multiply any decimal (float/double) with this number, we get its 16.16 fixed point equivalent. Infact, you can just chuck that into decorate, like so:
Code: Select all
ACS_NamedExecuteAlways("testDecimal", 0, 121.5*65536)

Code: Select all
script "testDecimal" (int decimal)
{
printBold(f: decimal);
}
- Coincident
- Posts: 85
- Joined: Fri Aug 22, 2014 8:38 am
- Location: Portugal
Re: The "How do I..." Thread
Yeah, soon after I posted I realized that my question was quite sily: especially because ACS_NamedExecute takes INTs for arguments, unlike other action functions...
So, I have to multiply x 65536 (shift << 16) every decimal I have in decorate, to be able to pass them as a proper fixed point int.
Once again, thanks edward for the thorough response.
PS - a small follow-up question: is it possible to have custom decorate functions?
I already had this is ACS, but I wanted the same for Decorate:
The goal is to have "cleaner" code in decorate:
So, I have to multiply x 65536 (shift << 16) every decimal I have in decorate, to be able to pass them as a proper fixed point int.
Once again, thanks edward for the thorough response.

PS - a small follow-up question: is it possible to have custom decorate functions?
I already had this is ACS, but I wanted the same for Decorate:
Code: Select all
function int toDecimal(int someInt) {
return someInt * 65536;
}
Code: Select all
Pickup:
TNT1 A 0 ACS_NamedExecuteAlways("testDecimal", 0, toDecimal(121.5))
Stop
Last edited by Coincident on Mon Feb 02, 2015 5:18 pm, edited 1 time in total.