Pickup messages tell player their value

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
captainmann
Posts: 4
Joined: Thu Jul 04, 2024 9:45 pm

Pickup messages tell player their value

Post by captainmann »

Good day,

I was trying to create an ammo object that would tell the player how much of it they picked up, no matter if a difficulty changes the ammo factor or if the player is picking it up from a dead enemy. (Ex. On Nightmare it would say you picked up 8 shells, but on easier skills it says you picked up 4.) I'm not sure how I would do that, and this page on the ZDoom Wiki isn't doing what I want it to. Can anybody help with this? Any help would be greatly appreciated!
User avatar
m8f
 
 
Posts: 1511
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Location: Siberia (UTC+7)

Re: Pickup messages tell player their value

Post by m8f »

Try multiplying amount by

Code: Select all

AllSkills[skill].AmmoFactor
Not sure, maybe DropAmmoFactor also should be accounted, if somehow it can be determined if this object is dropped or not.

https://zdoom.org/w/index.php?title=ZSc ... _variables
https://zdoom.org/w/index.php?title=CVA ... tion#skill
https://zdoom.org/w/index.php?title=Structs:SkillInfo
User avatar
Jay0
 
 
Posts: 102
Joined: Tue Aug 21, 2018 9:31 pm
Preferred Pronouns: She/Her
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Brazil

Re: Pickup messages tell player their value

Post by Jay0 »

m8f wrote: Thu Jul 02, 2026 7:30 am Try multiplying amount by

Code: Select all

AllSkills[skill].AmmoFactor
Not sure, maybe DropAmmoFactor also should be accounted, if somehow it can be determined if this object is dropped or not.

https://zdoom.org/w/index.php?title=ZSc ... _variables
https://zdoom.org/w/index.php?title=CVA ... tion#skill
https://zdoom.org/w/index.php?title=Structs:SkillInfo
think you also need to multiply by sv_ammofactor

Return to “Scripting”