The "How do I..." Thread

Archive of the old editing forum
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.
User avatar
Dr_Cosmobyte
Posts: 2759
Joined: Thu Jun 04, 2015 9:07 pm
Location: Killing spiders.

Re: The "How do I..." Thread

Post by Dr_Cosmobyte »

Thanks a bunch guys.
User avatar
Carbine Dioxide
Posts: 1927
Joined: Thu Jun 12, 2014 3:16 pm
Location: Anywhere.

Re: The "How do I..." Thread

Post by Carbine Dioxide »

Is there a way to speed up the A_Lower or A_Raise function?
User avatar
worldendDominator
Posts: 288
Joined: Sun May 17, 2015 9:39 am

Re: The "How do I..." Thread

Post by worldendDominator »

Call it multiple times in the same tic.
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: The "How do I..." Thread

Post by DoomKrakken »

I'm trying to make a puff change its damagetype according to what weapon you have out currently. Here's an example:

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
    }
} 
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?
User avatar
kodi
 
 
Posts: 1355
Joined: Mon May 06, 2013 8:02 am

Re: The "How do I..." Thread

Post by kodi »

@doomkrakken Did you try my suggestion on the previous page?
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: The "How do I..." Thread

Post by DoomKrakken »

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. :D
User avatar
kodi
 
 
Posts: 1355
Joined: Mon May 06, 2013 8:02 am

Re: The "How do I..." Thread

Post by kodi »

I see. The only other method I can think of is using ZScript and do

Code: Select all

override void BeginPlay()
{
 if(target)
 {
  if (CountInv("ShotgunSelected", AAPTR_TARGET) > 0) 
  {
   A_SetDamageType("Shotgun");
  }
 }
}
I think that should work.

Oh and unrelated to your current predicament since you seemed interested:
Spoiler:
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: The "How do I..." Thread

Post by DoomKrakken »

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.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: The "How do I..." Thread

Post by Enjay »

Nash wrote:tl;dr it's a lot of work, sorry. :(
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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: The "How do I..." Thread

Post by Nevander »

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?
User avatar
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

Post by Matt »

Carbine Dioxide wrote:Is there a way to speed up the A_Lower or A_Raise function?
A_Raise(32) or something

default seems to be 16
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: The "How do I..." Thread

Post by DoomKrakken »

Ooh, something new... now this could prove useful. :)

Actually, the default is 6.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: The "How do I..." Thread

Post by Nash »

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.
Shaders can be binded to textures and sprites via [wiki]GLDEFS[/wiki] (scroll all the way to the bottom to "Hardware shaders".

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).
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: The "How do I..." Thread

Post by Nash »

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?
Again, not without ZScript (gee, it's that thing again isn't it XD).

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).
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: The "How do I..." Thread

Post by DoomKrakken »

Nash wrote:
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.
Shaders can be binded to textures and sprites via [wiki]GLDEFS[/wiki] (scroll all the way to the bottom to "Hardware shaders".

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).
Ah, GLDEFS.

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! :D
Locked

Return to “Editing (Archive)”