How to change the ammo limits when you create a New skill

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.

How to change the ammo limits when you create a New skill

Postby TheMightyLostSoul » Mon Sep 06, 2021 9:34 am

Hello, I'm new here and sorry for my bad english, english is not my first language.
So, I want to make a new Skill and I want to modify the limit of ammo.
For exmeple the max of bullets it's 200, but I want to change this limit to a higher number. And how to do this for backpack as well. I want to do this for all ammo type.
Thanks for answer.
TheMightyLostSoul
 
Joined: 06 Sep 2021

Re: How to change the ammo limits when you create a New skil

Postby maxx_tnt » Wed Sep 08, 2021 1:38 pm

There's probably a better way to do this but the one I would personally use is this:

1 - Make multiple separate weapon actors that can hold different ammo capacities (eg: Pistol_Easy, Pistol_Normal, Pistol_Hard)
2 - Make a new CustomInventory actor and use a ACS script on PickUp to give player a different weapon depending on current skill level
3 - Replace the base weapon with that CustomInventory item
maxx_tnt
 
Joined: 01 Sep 2021

Re: How to change the ammo limits when you create a New skil

Postby Player701 » Thu Sep 09, 2021 1:03 am

maxx_tnt wrote:1 - Make multiple separate weapon actors that can hold different ammo capacities (eg: Pistol_Easy, Pistol_Normal, Pistol_Hard)

You will also have to redefine the ammo types themselves, along with all their specific ammo pickups (e.g. both the ammo box and the clip will have to be defined for each skill).

maxx_tnt wrote:2 - Make a new CustomInventory actor and use a ACS script on PickUp to give player a different weapon depending on current skill level
3 - Replace the base weapon with that CustomInventory item

Note that this will break item respawning and weapon stay. Use ReplaceActor in the skill definition instead.

You will also have to assign weapon slots via Weapon.SlotNumber or in the player class defintion.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: How to change the ammo limits when you create a New skil

Postby Jarewill » Thu Sep 09, 2021 10:45 am

You can also use SetAmmoCapacity in ACS.
You can detect the current skill with GameSkill.
Jarewill
 
 
 
Joined: 21 Jul 2019


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest