Can DECORATE call static functions?

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
GrayFace
Posts: 40
Joined: Mon Feb 13, 2023 1:34 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7 x64
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Can DECORATE call static functions?

Post by GrayFace »

The restriction that Actor class can't be extended even with simple non-virtual functions leads to inability of adding any code pointers for use in DECORATE without creating a multitude of sub-classes, one for every standard class that you inherit from. I'd expect it to be solvable with static functions with object pointer as parameter, but neither "TNT1 A 0 { MyClass.StaticFunction(); }" nor "TNT1 A 0 { MyClass::StaticFunction(); }" work. The only way to do it seem to be by adding an ACS script that would in turn call "ScriptCall("MyClass", "StaticFunction")".
Is there a better way?
Post Reply

Return to “Scripting”