[C++] access ZScript class member fields

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
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

[C++] access ZScript class member fields

Post by Nash »

Is it possible for the engine to access member fields from ZScript-defined (mod) classes?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [C++] access ZScript class member fields

Post by Graf Zahl »

Yes. DObject has some member functions like IntVar, FloatVar and PointerVar. You pass the name of the field you want to access to them and get a writable reference. I used that myself when fully exporting the base inventory classes.
Post Reply

Return to “Scripting”