Custom Powerup

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Custom Powerup

Postby Adamast0r » Mon Mar 29, 2021 11:22 am

Hey guys.
I just created my first custom powerup, which is basically a Quad Damage.
However, I'm interested in giving it other properties, such as increasing the player's speed, firing speed, and resistance to damage. Unfortunately, I'm not getting those to work, and I'm only being successful as far as the damage output goes.
If anyone can lend some of their superior modding knowledge, I'd be much obliged.
As I'm not savvy with modding, I'm only using DECORATE.
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Custom Powerup

Postby Ac!d » Mon Mar 29, 2021 1:18 pm

Use a CustomInventory, you can also take exemple on the Berserk and Megasphere.
User avatar
Ac!d
Perfection is a way, not an end. - Korean Proverb
 
Joined: 02 Apr 2019
Location: France
Discord: Ac!d#2732

Re: Custom Powerup

Postby Adamast0r » Mon Mar 29, 2021 2:59 pm

Ac!d wrote:Use a CustomInventory, you can also take exemple on the Berserk and Megasphere.

I tried to, but I'm not getting it to work.
I just want to add double player speed, firing speed, and damage resistance.
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Custom Powerup

Postby Virathas » Tue Mar 30, 2021 12:53 am

There you go! A CustomInventory version of your Slayersphere that grants all 4 powerups you wanted :) (It might have some "stacking" problems, but it should tell you how you can do things like that)
You do not have the required permissions to view the files attached to this post.
User avatar
Virathas
 
Joined: 10 Aug 2017

Re: Custom Powerup

Postby Adamast0r » Tue Mar 30, 2021 2:39 am

Virathas wrote:There you go! A CustomInventory version of your Slayersphere that grants all 4 powerups you wanted :) (It might have some "stacking" problems, but it should tell you how you can do things like that)

This is great. Thank you, Virathas.
I'm not sure what you mean by "stacking" problems though, as I was able to pickup a few in a short period of time and it worked, and it's effects remained intact or, at least, that was what it seemed to me.
Additionally, do you know if there's a way to make weapon switch faster in the powerup? Nothing over-the-top, just a slight increase. Maybe make the Pistol, Shotgun and SSG fire with no delay?
I saw that this was done only in DECORATE in the attached mod by DTDSphere. However, I know it replaces the player, so I don't know if it can be done as a temporary change as well.
And, once again, thanks for helping me out.
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Custom Powerup

Postby Virathas » Tue Mar 30, 2021 3:06 am

The only DECORATE way to change weapon switch speed (that i am aware of) is to replace weapons themselves, just like in this mod. That includes "temporary" changes like with powerup. Using example from that mod
Code: Select allExpand view
ACTOR PistolFixed : Pistol replaces Pistol
{
Decal BulletChip
States
   {
     Deselect:
        TNT1 A 0 A_JumpIfInventory("PowerThatIncreaesWeaponSwapSpeed",1,"DeselectNormal")
   TNT1 AA 0 A_Lower
         DeselectNormal:
   PISG A 1 A_Lower
      Goto Deselect+1
     Select:
        TNT1 A 0 A_JumpIfInventory("PowerThatIncreaesWeaponSwapSpeed",1,"SelectNormal")
   TNT1 AA 0 A_Raise
          SelectNormal:
   PISG A 1 A_Raise
      Goto Select+1

}

I am not sure if you need to add a playerclass to use new weapons though, i do not believe so.

PS: A handy tip if you are not using ZScript - A PowerSpeed powerup set to 1 Speed and the notrailflag will have no visual effects for the player, and can be used as a number of other timed effects that are checked elsewhere (At least that is what i was using it for :P)
User avatar
Virathas
 
Joined: 10 Aug 2017

Re: Custom Powerup

Postby Adamast0r » Tue Mar 30, 2021 3:35 am

Virathas wrote:The only DECORATE way to change weapon switch speed (that i am aware of) is to replace weapons themselves, just like in this mod. That includes "temporary" changes like with powerup. Using example from that mod
Code: Select allExpand view
ACTOR PistolFixed : Pistol replaces Pistol
{
Decal BulletChip
States
   {
     Deselect:
        TNT1 A 0 A_JumpIfInventory("PowerThatIncreaesWeaponSwapSpeed",1,"DeselectNormal")
   TNT1 AA 0 A_Lower
         DeselectNormal:
   PISG A 1 A_Lower
      Goto Deselect+1
     Select:
        TNT1 A 0 A_JumpIfInventory("PowerThatIncreaesWeaponSwapSpeed",1,"SelectNormal")
   TNT1 AA 0 A_Raise
          SelectNormal:
   PISG A 1 A_Raise
      Goto Select+1

}

I am not sure if you need to add a playerclass to use new weapons though, i do not believe so.

PS: A handy tip if you are not using ZScript - A PowerSpeed powerup set to 1 Speed and the notrailflag will have no visual effects for the player, and can be used as a number of other timed effects that are checked elsewhere (At least that is what i was using it for :P)

I see. That might be a little too much for me, for now. I also went ahead and nerfed some of the powers in the sphere and, following your precedent, added a minor drain effect.
I did another sphere previously, just a basic Quad Damage, but I'm being unable to get it to play a custom sound, even though it's already there. Would you care to take a look at it?
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Custom Powerup

Postby Virathas » Tue Mar 30, 2021 5:22 am

It is actually extremely simple (though it took me way too long to diagnose :P )
The sounds need to be in "Sounds" folder - but you have a "Sound" folder - otherwise it won't find it.
User avatar
Virathas
 
Joined: 10 Aug 2017

Re: Custom Powerup

Postby Adamast0r » Tue Mar 30, 2021 7:26 am

Virathas wrote:It is actually extremely simple (though it took me way too long to diagnose :P )
The sounds need to be in "Sounds" folder - but you have a "Sound" folder - otherwise it won't find it.

I just did that, but it's still not working.
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Custom Powerup

Postby Jarewill » Tue Mar 30, 2021 7:44 am

1) SNDINFO assigns PICKUP2 instead of the actual sound name: quad_damage.

2) You have to specify the entire path to the sound using a .pk3 format:
Code: Select allExpand view
quad_damage "sounds/quad_damage"
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Custom Powerup

Postby Adamast0r » Tue Mar 30, 2021 8:00 am

Jarewill wrote:1) SNDINFO assigns PICKUP2 instead of the actual sound name: quad_damage.

2) You have to specify the entire path to the sound using a .pk3 format:
Code: Select allExpand view
quad_damage "sounds/quad_damage"

It's fixed now. Thanks, Jarewill.
Additionally, is there any way to make the powerup play another sound during it's effect, and yet another when it runs out? I included the other two Quad Damage sounds from Q1.
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Custom Powerup

Postby Jarewill » Tue Mar 30, 2021 8:30 am

You can play sounds with powerups, but they are restricted to PowerProtection, so you will have to create a new powerup inheriting from PowerProtection that plays the sounds and give it alongside your own.
Otherwise I'm sure it's possible to do with ZScript, maybe ACS could also be used.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Custom Powerup

Postby Adamast0r » Tue Mar 30, 2021 10:08 am

Jarewill wrote:You can play sounds with powerups, but they are restricted to PowerProtection, so you will have to create a new powerup inheriting from PowerProtection that plays the sounds and give it alongside your own.
Otherwise I'm sure it's possible to do with ZScript, maybe ACS could also be used.

I'll go ahead and try that.
User avatar
Adamast0r
UAC Employee ID #1992
 
Joined: 22 May 2020
Location: Phobos
Discord: Adamast0r#1899
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests