[ZSCRIPT] Get Pointer From Class (function argument)

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.

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!)
Post Reply
Kan3x
Posts: 62
Joined: Tue Nov 08, 2022 4:19 pm

[ZSCRIPT] Get Pointer From Class (function argument)

Post by Kan3x »

I have a perhaps convoluted question:

Is there a way to retrieve a pointer from a class<> which is an argument of a custom function?

What I mean is:

Code: Select all

action state A_LoadBow(class<Weapon> secondary = 'Bow')
I would like to retrieve a pointer to this 'secondary' argument, but I cannot find a working way (if it's there).

What I want is to be able to get the 'AmmoType1' of the weapon specified in the function's argument.

How ca I do that?
Post Reply

Return to “Scripting”