Decorate Inventory Check Functions

Moderator: GZDoom Developers

Post Reply
User avatar
cypherphage
Posts: 213
Joined: Sun Feb 27, 2011 2:54 am

Decorate Inventory Check Functions

Post by cypherphage »

If i wanted to have a weapon deal more damage as a player's "strength" went up, like the strife dagger, I would currently need to implement tons of jumps. So a feature to get the number of items in the player's inventory would be useful. For instance

Code: Select all

  Fire:
    STFF B 6
    STFF C 8 A_StaffAttack(random[StaffAttack](5, 20)+CheckInventory("StrengthItem"), "StaffPuff")
    STFF B 8 A_ReFire
    Goto Ready
If such a function isn't feasible, the other way I could think of doning it is a function like A_SetUserVar, except checking the amount of inventory instead. Either of these functions seem useful for modular weapons.
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

Re: Decorate Inventory Check Functions

Post by Ryan Cordell »

Or you could use ACS_ExecuteWithResult in the damage function. Works for some functions, dunno about A_StaffAttack in particular.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Decorate Inventory Check Functions

Post by NeuralStunner »

Should work in any function where a number is called for.
User avatar
cypherphage
Posts: 213
Joined: Sun Feb 27, 2011 2:54 am

Re: Decorate Inventory Check Functions

Post by cypherphage »

I still wish I could just pass the item name in decorate, but this works pretty well and a lot better than the way i was doing it. Thanks.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”