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.
- Dr_Cosmobyte
- Posts: 2759
- Joined: Thu Jun 04, 2015 9:07 pm
- Location: Killing spiders.
Re: The "How do I..." Thread
Thanks a bunch guys.
- Carbine Dioxide
- Posts: 1927
- Joined: Thu Jun 12, 2014 3:16 pm
- Location: Anywhere.
Re: The "How do I..." Thread
Is there a way to speed up the A_Lower or A_Raise function?
- worldendDominator
- Posts: 288
- Joined: Sun May 17, 2015 9:39 am
Re: The "How do I..." Thread
Call it multiple times in the same tic.
- DoomKrakken
- Posts: 3482
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: The "How do I..." Thread
I'm trying to make a puff change its damagetype according to what weapon you have out currently. Here's an example:
To my horror, I realized that the damage of a hitscan attack is applied BEFORE the puff spawns. Is there a way to change the puff's damagetype before damage is applied?
Code: Select all
ACTOR DynamicPuff : BulletPuff replaces BulletPuff
{
+PUFFGETSOWNER
States
{
Spawn:
TNT1 A 0 NoDelay
{
if (CountInv("ShotgunSelected", AAPTR_TARGET) > 0)
{
A_SetDamageType("Shotgun");
}
else if (CountInv("ChaingunSelected", AAPTR_TARGET) > 0)
{
A_SetDamageType("Chaingun");
}
}
Goto Super::Spawn
}
}
Re: The "How do I..." Thread
@doomkrakken Did you try my suggestion on the previous page?
- DoomKrakken
- Posts: 3482
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: The "How do I..." Thread
I didn't see the next thing you posted... be right back...
EDIT: Alright I'm back. Looking at it again... I can see it working for custom weapons sharing the same puff... but what I'm really trying to do is modify Trailblazer's code via a patch. The weapons already use an A_FireBullets parameter, which means that they already have a damage value assigned to them. This means that they'll deal normal damage, and then deal the additional damage dealt by A_DamageTracer. Now, unless A_DamageTracer happens to modify the DamageType and Damage value of a puff itself BEFORE any damage is dealt, then I don't see it working in what I'm trying to do.
EDIT 2: Nonetheless, this could prove very, very useful for something else in the future. Thanks.
EDIT: Alright I'm back. Looking at it again... I can see it working for custom weapons sharing the same puff... but what I'm really trying to do is modify Trailblazer's code via a patch. The weapons already use an A_FireBullets parameter, which means that they already have a damage value assigned to them. This means that they'll deal normal damage, and then deal the additional damage dealt by A_DamageTracer. Now, unless A_DamageTracer happens to modify the DamageType and Damage value of a puff itself BEFORE any damage is dealt, then I don't see it working in what I'm trying to do.
EDIT 2: Nonetheless, this could prove very, very useful for something else in the future. Thanks.
Re: The "How do I..." Thread
I see. The only other method I can think of is using ZScript and do
I think that should work.
Oh and unrelated to your current predicament since you seemed interested:
Code: Select all
override void BeginPlay()
{
if(target)
{
if (CountInv("ShotgunSelected", AAPTR_TARGET) > 0)
{
A_SetDamageType("Shotgun");
}
}
}
Oh and unrelated to your current predicament since you seemed interested:
Spoiler:
- DoomKrakken
- Posts: 3482
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: The "How do I..." Thread
Ah, ZScript... I gotta update someday soon... XD
Alright, I'm just jumping around here... but how do I use shaders? I've seen them utilized in mods like D4D... but I don't know how they connect to the rest of the code.
Alright, I'm just jumping around here... but how do I use shaders? I've seen them utilized in mods like D4D... but I don't know how they connect to the rest of the code.
Re: The "How do I..." Thread
Thanks for the explanation (I did read the whole thing, not just the tl;dr). I don't suppose I'll be doing it any time soon then.Nash wrote:tl;dr it's a lot of work, sorry.
Re: The "How do I..." Thread
On the subject of MENUDEF, how would I place an episode that is "greyed out" and not selectable, but still appears in the episode list?
- 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
A_Raise(32) or somethingCarbine Dioxide wrote:Is there a way to speed up the A_Lower or A_Raise function?
default seems to be 16
- DoomKrakken
- Posts: 3482
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: The "How do I..." Thread
Ooh, something new... now this could prove useful.
Actually, the default is 6.
Actually, the default is 6.
Re: The "How do I..." Thread
Shaders can be binded to textures and sprites via [wiki]GLDEFS[/wiki] (scroll all the way to the bottom to "Hardware shaders".DoomKrakken wrote:Ah, ZScript... I gotta update someday soon... XD
Alright, I'm just jumping around here... but how do I use shaders? I've seen them utilized in mods like D4D... but I don't know how they connect to the rest of the code.
As for how to WRITE shaders? Shaders are written in a language called GLSL which is just as complicated (or even more) than ZScript and/or C++. The fact that there's not many people around here with the GLSL proficiency like dpJudas goes to show that it's no easy thing that you can pickup in a day or two. :P
Even then, GZDoom does not expose too much functionality for user shaders, and you're currently limited to only altering the surface of the texture (you can't, for example, alter the screen). For even more complicated shader functionality, you have to do engine modifications in C++ inside GZDoom (like what dpJudas did for the bloom, SSAO and other post processing stuff).
Re: The "How do I..." Thread
Again, not without ZScript (gee, it's that thing again isn't it XD).Nevander wrote:On the subject of MENUDEF, how would I place an episode that is "greyed out" and not selectable, but still appears in the episode list?
You'd have to modify the widget's Drawer function to check specifically under what condition will the widget be greyed out and unselectable (that is entirely up to you - a CVar perhaps? I can imagine using a CVar to "lock" out episodes).
- DoomKrakken
- Posts: 3482
- Joined: Sun Oct 19, 2014 6:45 pm
- Location: Plahnit Urff
- Contact:
Re: The "How do I..." Thread
Ah, GLDEFS.Nash wrote:Shaders can be binded to textures and sprites via [wiki]GLDEFS[/wiki] (scroll all the way to the bottom to "Hardware shaders".DoomKrakken wrote:Ah, ZScript... I gotta update someday soon... XD
Alright, I'm just jumping around here... but how do I use shaders? I've seen them utilized in mods like D4D... but I don't know how they connect to the rest of the code.
As for how to WRITE shaders? Shaders are written in a language called GLSL which is just as complicated (or even more) than ZScript and/or C++. The fact that there's not many people around here with the GLSL proficiency like dpJudas goes to show that it's no easy thing that you can pickup in a day or two.
Even then, GZDoom does not expose too much functionality for user shaders, and you're currently limited to only altering the surface of the texture (you can't, for example, alter the screen). For even more complicated shader functionality, you have to do engine modifications in C++ inside GZDoom (like what dpJudas did for the bloom, SSAO and other post processing stuff).
Yeah, all I was interested in currently was with using that to create tints (for glory kills and possibly Tiberium afflictions, etc.), creating spheres... stuff like that.
I was talking about a SHADERS lump, or files to be stored in a Shaders folder. Not really writing shaders...
Thanks!