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
Is it possible to use standalone Voxel models which do not replace sprites ?
Re: The "How do I..." Thread
I doubt it. The voxels are attached to the sprite frame defined in DECORATE.
Re: The "How do I..." Thread
I'm trying to figure out how to perform a jump from inside an anonymous function. For example, here's a simplified monster charging code:
Obviously that doesn't work, but should illustrate what I'm basically after. Do I need to use "return state" in some way (Actor states), and if so, how do I use it exactly?
Code: Select all
Charge:
MONS ABCD 4
{
...
if (GetDistance(false) < 128)
{
A_Jump(256, "Melee")
}
}
Loop
- Xeotroid
- Posts: 448
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
Re: The "How do I..." Thread
Try using it like this, as shown in an example here:
Code: Select all
Charge:
MONS ABCD 4
{
...
if (GetDistance(false) < 128)
{
return A_Jump(256, "Melee")
}
}
LoopRe: The "How do I..." Thread
This produces an error: "All return expressions must deduce to the same type".
- Xeotroid
- Posts: 448
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
Re: The "How do I..." Thread
Do you have any other Return actions in the function? All return actions in a function must be of the same type - int, float, bool or state. For instance: You can have multiple "return state("Melee");" in a function, but you can't have both "return state("Melee");" (which is a state) and "return false" (which is a bool)
Re: The "How do I..." Thread
No, the "return" you suggested adding is the only one in that function.
Re: The "How do I..." Thread
Why not just use this:
EDIT: Oh, you're learning. That's fine. Carry on then, you can ignore my post.
Code: Select all
MONS ABCD 4
{
...
A_JumpIf(GetDistance(false) < 128, "Melee");
}
LoopRe: The "How do I..." Thread
Anyone got any tips for audio optimization? I want to use custom music in my campaign that originates from high quality wav and mp3 files, and I'd rather not have them balloon the crap out of my filesize if I can avoid it. I use Audacity to edit audio but I don't know very much about quality vs filesize.
Re: The "How do I..." Thread
MP3 is compressed and generally has lower quality, though that may vary. WAV, on the other hand, is uncompressed and is sure to bloat your filesize, but the quality is top notch. Can't say what's up with OGG since I don't have enough knowledge regarding it.
-
Blue Shadow
- Posts: 5046
- Joined: Sun Nov 14, 2010 12:59 am
Re: The "How do I..." Thread
You need one at the end of the function:D2JK wrote:No, the "return" you suggested adding is the only one in that function.
Code: Select all
return state(""); Re: The "How do I..." Thread
Script 0 is supposed to be engine stuff that nobody is supposed to touch. ACC will refuse to compile a script 0... unless there are the brackets.Xeotroid wrote:What's the use for those angle brackets around 0?
Because there are line types that refer to music or quest item by their index.Xeotroid wrote: Also, why are there string arrays for QuestItem and music names? There is this one switch case that uses it but... why?
The big switch case is actually there to switch on line types that are not handled natively by ZDoom. Instead they're translated to a call to script 0 with the line's original type number as a parameter, which is used by the switch case. So for example line types 203 and 204 change the music.
Re: The "How do I..." Thread
Various things that factor in:CJacobsSA wrote:Anyone got any tips for audio optimization? I want to use custom music in my campaign that originates from high quality wav and mp3 files, and I'd rather not have them balloon the crap out of my filesize if I can avoid it. I use Audacity to edit audio but I don't know very much about quality vs filesize.
- Bit-depth is how many bits are used to represent each PCM sample. The most common now are 16-bit, 24-bit, 32-bit floating-point, etc. 16-bit can help trim the filesize, but if there is too much noise in the original audio (e.g. crash cymbals, white noise, raw synths), you may start hearing the quantization at lower settings.
- Sample-rate is how many samples are played per second. The range you want to be working with is 22.05kHz to 44.1kHz (CD quality). Using lower sample rates will reduce the filesize by lowering the total sample count. However, like bit-depth, the greater the delta between samples, the more audible the quality-loss will be.
- Compression can also help reduce file size. You have lossy formats, such as MP3 and OGG vorbis, and lossless formats, like FLAC. For streaming background music, you always want lossy-compressed audio to save bandwidth. For sound effects, lossless compressed audio should be just fine.
In general, OGG vorbis offers either on-par or superior compression for the same quality settings to MP3. In Audacity, you can set the quality on export; I would suggest sticking with no less than five. It also is very easy to get OGG vorbis to seamlessly loop and supports loop-points in zdoom (unlike MP3).
Re: The "How do I..." Thread
Lud wrote:MP3 is compressed and generally has lower quality, though that may vary. WAV, on the other hand, is uncompressed and is sure to bloat your filesize, but the quality is top notch. Can't say what's up with OGG since I don't have enough knowledge regarding it.
Sweet, thanks. I appreciate the help.Arookas wrote: Various things that factor in:From my experience, the compression and sample-rate are the two biggest factors. The sample-rate, bit-depth, and compression format you need depends all on how much is "good enough" in terms of quality for you. Every song is different, so work with the lowest acceptable quality format and gradually increment the quality until the filesize is no longer acceptable.
- Bit-depth is how many bits are used to represent each PCM sample. The most common now are 16-bit, 24-bit, 32-bit floating-point, etc. 16-bit can help trim the filesize, but if there is too much noise in the original audio (e.g. crash cymbals, white noise, raw synths), you may start hearing the quantization at lower settings.
- Sample-rate is how many samples are played per second. The range you want to be working with is 22.05kHz to 44.1kHz (CD quality). Using lower sample rates will reduce the filesize by lowering the total sample count. However, like bit-depth, the greater the delta between samples, the more audible the quality-loss will be.
- Compression can also help reduce file size. You have lossy formats, such as MP3 and OGG vorbis, and lossless formats, like FLAC. For streaming background music, you always want lossy-compressed audio to save bandwidth. For sound effects, lossless compressed audio should be just fine.
In general, OGG vorbis offers either on-par or superior compression for the same quality settings to MP3. In Audacity, you can set the quality on export; I would suggest sticking with no less than five. It also is very easy to get OGG vorbis to seamlessly loop and supports loop-points in zdoom (unlike MP3).
- jazzmaster9
- Posts: 875
- Joined: Wed Apr 18, 2012 11:37 pm
- Contact:
Re: The "How do I..." Thread
How do i add custom BIGFONTs to my mod?

