Problem: Weapons and ammo for some odd reason don't have a PickUp: state like the custom inventory and they already use inheritance which must not be changed.
Thought process:
A hacky way would be to make a new text def file in which a lot of ammotrackers per pickup are defined and a couple of ammotypes
Code: Select all
4ShotgunTrack: CustomInventory .................... ShotGunTrackAmmo: Ammo
20ShotGunTrack: CustomInventory .................... CellTrackAmmo: Ammo
20CellTrack: CustomInventory .................... RocketTrackAmmo: Ammo
100CellTrack: CustomInventory .................... HeavyBulletTrackAmmo: Ammo
etc...
These CustomInventory actors
have something like this in their pickup state.
Code: Select all
[4ShotgunTrack] A_GiveInventory("ShotGunTrackAmmo", 4)
[20ShotgunTrack] A_GiveInventory("ShotGunTrackAmmo", 20)
[20CellTrack] A_GiveInventory("CellTrackAmmo", 20)
[100CellTrack] A_GiveInventory("CellTrackAmmo", 100)
This fakeammo doesn't get used so it's easy to set a variable to = Checkinventory ("One of the fake ammos").
At first, I wanted to do something like "Acs execute" to raise some global on every ammo and weapon upon pickup but then I realized the problem above ...
Any other more .... practical ways of solving this ?
Hardmode: Inheritance is already used on weapons and ammo actors so that's not an option.
The Goal:
[Hit at least x of the ammo you picked up on target]
Amount of ammo picked up / 2 * other factors in previously made functions