Advertisement
ZoriaRPG

Some New ZScript Syntax

Sep 18th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. script typedef ffc class; //can now declare 'class script'.
  2. class cript my_class
  3. {
  4.     const int SZ = 256; //constant defined at script scope
  5.     //globally available as my_class.SZ
  6.     //access locally as 'SZ'
  7.     int RAM[SZ]; //array defined at script scope, sized to constant SZ
  8.     //globally available as my_class.RAM[]
  9.     //acces locally as 'RAM[]'
  10. }
  11.  
  12.  
  13. void foo()
  14. {
  15.     int size = my_class.SZ; //get the constant SZ from pasudo-class 'my_script'
  16.     int a = myclass.RAM[1]; //get data from the array in that 'class'
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement