ZoriaRPG

ZC 2.54 New ZScript Short List

Dec 26th, 2016
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Beta 44
  2.  
  3. /////////////////
  4. /// ZScript ///
  5. /////////////////
  6.  
  7. The ZScript language now supports function pointers, using the AT_SIGN token (@) as a delimiter.
  8.  
  9. The ZScript language now supports C-Style comment blocks using the traditional syntax of:
  10.  
  11. /*
  12. COMMENT BLOCK
  13.  
  14. */
  15.  
  16.  
  17. Arrays now support being declared with a formula:
  18.  
  19. int arr[10*4];
  20.  
  21. This is now the same as int arr[40];
  22.  
  23. Nesting array calls should now work properly. (e.g. arrA[ arrB[ arrC[ arrd[4] ] ] ] )
  24.  
  25. //////////////
  26. // Global //
  27. //////////////
  28.  
  29. void OverlayTile(int firsttile, int secondtile);
  30. Overlay one tile onto another.
  31.  
  32. /************************************************************************************************************/
  33.  
  34. ////////////
  35. // Game //
  36. ////////////
  37.  
  38. bool CappedFPS
  39. * Check if the game is uncapped.
  40.  
  41. int Version;
  42. * Returns the version of ZC being used.
  43.  
  44. int Build;
  45. * Returns the Build ID of the version of ZC being used.
  46.  
  47. int Beta;
  48. * Returns the Beta ID of the version of ZC being used. If the build is not a beta, this returns 0.
  49.  
  50. bool DisableActiveSubscreen;
  51. * If set true, the active subscreen will not fall into view ehen the player presses Start.
  52.  
  53.  
  54. /************************************************************************************************************/
  55.  
  56. /////////////////
  57. /// LWeapon ///
  58. /////////////////
  59.  
  60. int Range;
  61. * The range of the weapon in pixels. At present, this only affects boomerange class lweapons.
  62.  
  63. /////////////////
  64. /// *weapon ///
  65. /////////////////
  66.  
  67. float Misc[32];
  68. * Epanded fro a size of [16] to [32]. An array of 32 miscellaneous variables for you to use as you please.
  69.  
  70.  
  71. /************************************************************************************************************/
  72.  
  73. /////////////
  74. /// NPC ///
  75. /////////////
  76.  
  77.  
  78. int ScriptDefense[10];
  79. * The npc's Script Weapon Defense values. This corresponds to the 'Defenses 3' tab in the Enemy Editor.
  80.  
  81. /************************************************************************************************************/
  82.  
  83. //////////////
  84. /// Link ///
  85. //////////////
  86.  
  87. int Animation;
  88. * Link;s Animation style, as set in Quest->Graphics->Sprites->Link
  89.  
  90. int WalkASpeed;
  91. * Link's Walking Animation speed as set in Quest->Graphics->Sprites->Link
  92.  
  93. int SwimASpeed;
  94. * Link's Swiming Animation speed as set in Quest->Graphics->Sprites->Link
  95.  
  96. int InvFrames;
  97. * This returns how long Link will remain invincible, 0 if not invincible. Can be set.
  98.  
  99. bool InvFlicker;
  100. * If set false, Link will neither flash, nor flicker when invincible.
  101.  
  102. int HurtSound;
  103. * The sound that plays when Link is injured. By default this is '16', but you may change it at any time.
  104.  
  105. int HitHeight;
  106. * link's Hitbox height in pixels starting from his 0x,0y (upper-left) corner, going down.
  107.  
  108. int HitWidth;
  109. * Link's Hitbox width in pixels starting from his x0,y0 (upper-left) corner, going right.
  110.  
  111. int HitXOffset;
  112. * The X offset of Link's hitbox, or collision rectangle.
  113.  
  114. int HitYOffset;
  115. * The Y offset of Link's hitbox, or collision rectangle.
  116.  
  117. int Eaten;
  118. * It returns 0 if Link is not eaten, otherwise it returns the duration of him being eaten.
  119.  
  120. int Equipment;
  121. * Link->Equipment is now read-write, and needs testing.
  122.  
  123. int ItemA;
  124. * Contains the item IDs of what is currently equiped to Link's A button.
  125.  
  126. int ItemB;
  127. * Contains the item IDs of what is currently equiped to Link's B button.
  128.  
  129. int SetItemSlot(int itm_id, bool a_button, bool force);
  130. * This allows you to set Link's button items without binary operation. Needs testing. , and to decide whether to
  131.  
  132. int Extend;
  133. * Sets the extend value for all of Link's various actions.
  134.  
  135. int GetLinkExtend(int sprite, int dir);
  136. * Gets the extend value for one of Link's various actions based on a direction.
  137.  
  138. void SetLinkExtend(int sprite, int dir, int extend);
  139. * Sets the extend value for one of Link's various actions.
  140.  
  141. void SetLinkTile(int sprite, int tile, int dir)
  142. * Sets the tile for Link's various actions. This is intended to work as OTile for Link. Unverified.
  143.  
  144. int GetLinkTile(int sprite, int dir)
  145. * Returns the OTile for one of Link's various actions. Unverified.
  146.  
  147. int WalkTile, SwimTile, DiveTile, SlashTile, JumpTile, ChargeTile, StabTile, CastingTile, PoundTile, FloatTile
  148. Hold1LandTile, Hold2LandTile, Hold1WaterTile, Hold2WaterTile;
  149. * A series of fourteen individual setter/getter ints to set or return the tile for all of Link's various actions.
  150.  
  151. int WarpEffect;
  152. * Sets a warp effect type prior to doing Screen->Warp
  153.  
  154. int WarpSound;
  155. * Setting this to a value other than '0' will play that sound when Link warps.
  156.  
  157. bool SideWarpSounds;
  158. * If you enable this setting, the warp sound will play in side warps.
  159.  
  160. bool PitWarpSounds;
  161. * If you enable this setting, the warp sound will play in a pit warp, one time.
  162.  
  163. int UseWarpReturn;
  164. * Setting this to a value between 0 and 3 will change the target return square for Link->Warp
  165.  
  166. int UsingItem;
  167. * Returns the ID of an item used when Link uses an item. Returns -1 if Link is not using an item this frame.
  168.  
  169. int UsingItemA;
  170. * Returns the ID of an item used when Link uses an item on button A. Returns -1 if Link is not using an item this frame.
  171.  
  172. int UsingItemB;
  173. * Returns the ID of an item used when Link uses an item on button B. Returns -1 if Link is not using an item this frame.
  174.  
  175. bool Diagonal;
  176. * This corresponds to whether 'Diagonal Movement' is enabled, or not.
  177.  
  178. bool BigHitbox;
  179. * This corresponds to whether 'Big Hitbox' is enabled, or not.
  180.  
  181. float Misc[32];
  182. * Expanded from [16] to [32]. An array of 32 miscellaneous variables for you to use as you please.
  183.  
  184. /************************************************************************************************************/
  185.  
  186. //////////////////
  187. /// itemdata ///
  188. //////////////////
  189.  
  190.  
  191. int ID;
  192. * Returns the item number of the item in question.
  193.  
  194. int Modifier;
  195. * The Link Tile Modifier
  196.  
  197. int Tile;
  198. * The tile used by the item.
  199.  
  200. int CSet;
  201. * The CSet of the tile used by the item.
  202.  
  203. int Flash;
  204. * The Flash value for the CSet
  205.  
  206. int AFrames;
  207. * The number of animation frames in the item's tile animation.
  208.  
  209. int ASpeed;
  210. * The speed of the item's animation.
  211.  
  212. int Delay;
  213. * The Delay value, before the animation begins.
  214.  
  215. int Script;
  216. * The Action Script for the item.
  217.  
  218. int PScript;
  219. * The Pickup Script for the item.
  220.  
  221. int MagicCost;
  222. * The item's maic (or rupees, if this is set) cost.
  223.  
  224. int MinHearts;
  225. * The minimum number of hearts required to pick up the item.
  226.  
  227. int Misc1, Misc2, Misc3, Misc4, Misc5, Misc6, Misc7, Misc8, Misc9, Misc10;
  228. * These correspond to the pull-down options in the item editor 'Data' tab.
  229.  
  230. int Attribute1, Attribute2, Attribute3, Attribute4, Attribute5, Attribute6,
  231. Attribute7, Attribute8, Attribute9, Attribute10;
  232. * These correspond to the pull-down options in the item editor 'Action' tab.
  233.  
  234. bool Combine;
  235. * Corresponds to 'Upgrade when collected twice'.
  236.  
  237. bool Downgrade;
  238. * Corresponds to the 'Remove When Used' option on the Action tab of the item editor.
  239.  
  240. bool KeepOld;
  241. * Corresponds to 'Keep lower level items on the Pickup tab of the item editor.
  242.  
  243. bool RupeeCost;
  244. * Corresponds to the 'Use Rupees Instead of Magic' option on the item editor 'Action' tab.
  245.  
  246. bool Edible;
  247. * Corresponds to the 'Can be Eaten by Enemies' box on the Pickup tab of the item editor.
  248.  
  249. bool GainLower;
  250. * Corresponds to the 'Gain All Lower Level Items' box on the Pickup tab of the item editor.
  251.  
  252. bool Flag1;
  253. * This corresponds to the box directly below 'Equiment Item'. For swords, this is 'B.H. is Percent'.
  254.  
  255. bool Flag2;
  256. * This corresponds to the box directly below 'Flag 1, or two boxes down from 'Equiment Item'.
  257. * For swords, this is 'B.D. is Percent'.
  258.  
  259. bool Flag3;
  260. * This corresponds to the box directly right of 'Equiment Item'. For swords, this is 'B. Penetrates Enemies'.
  261.  
  262. bool Flag4;
  263. * This corresponds to the box directly right of 'Flag 2'. For swords, this is 'Can Slash'.
  264.  
  265. bool Flag5;
  266. * This corresponds to the box directly below 'Flag 4'. For swords, this is '<Unused>', and greyed out.
  267.  
  268. bool Unused;
  269. * ? - An extra script-only flag. It's a mystery to everyone.
  270.  
  271. /************************************************************************************************************/
  272.  
  273. ////////////
  274. /// npc ///
  275. ////////////
  276.  
  277. float Misc[32];
  278. * Epanded fron a size of [16] to [32]. An array of 32 miscellaneous variables for you to use as you please.
  279.  
  280. /************************************************************************************************************/
  281.  
  282. ////////////////
  283. /// Screen ///
  284. ////////////////
  285.  
  286. void WavyIn();
  287. * Replicates the warping screen wave effect (inbound) from a tile warp.
  288.  
  289. void WavyOut();
  290. * Replicates the warping screen wave effect (outbound) from a tile warp.
  291.  
  292. void ZapIn();
  293. * Replicates the warping screen zap effect (inbound) from a tile warp.
  294.  
  295. void ZapOut();
  296. * Replicates the warping screen zap effect (outbound) from a tile warp.
  297.  
  298. void OpeningWipe();
  299. * Replicates the opening wipe screen effect (using the quest rule for its type) from a tile warp.
  300.  
  301.  
  302. void DrawBitmapEx ( int layer,
  303. int bitmap_id,
  304. int source_x, int source_y, int source_w, int source_h,
  305. int dest_x, int dest_y, int dest_w, int dest_h,
  306. float rotation, int cx, int cy, int mode, int lit, bool mask);
  307.  
  308. * As DrawBitmap(), except that it can do more things.
  309.  
  310. /************************************************************************************************************/
  311.  
  312. ////////////////////////
  313. /// Not Implemented ///
  314. ////////////////////////
  315.  
  316. BitmapQuad
  317. //sdci[1]=layer
  318. //sdci[2]=x1
  319. //sdci[3]=y1
  320. //sdci[4]=x2
  321. //sdci[5]=y2
  322. //sdci[6]=x3
  323. //sdci[7]=y3
  324. //sdci[8]=x4
  325. //sdci[9]=y4
  326. //sdci[10]=sourcex
  327. //sdci[11]=sourcey
  328. //sdci[12]=sourcew
  329. //sdci[13]=sourceh
  330. //sdci[14]=width
  331. //sdci[15]=height
  332. //sdci[16]=tile/combo
  333. //sdci[17]=polytype
  334.  
  335. void ComboArray ( int layer, int number_of_combos,
  336. int combos[],
  337. int x_positions[],
  338. int y_positions[],
  339. int csets[]);
  340.  
  341. ZASM: COMBOARRAY
  342.  
  343. /**
  344. *
  345. * Draws a number of combos specified by 'number_of_combos' to 'layer'.
  346. * Specify the combos by populating an array with their IDs and passing the array ointer to 'combos'.
  347. * Specify the X coordinate for each by passing an array with their x coordinates to 'x_positions'.
  348. * Specify the Y coordinate for each by passing an array with their y coordinates to 'y_positions'.
  349. * Specify the CSet for each by passing an array with their csets to 'csets'.
  350. *
  351. * This function counts as a single draw.
  352. *
  353. * Transparency is not yet imlemented, but you may draw to a bitmap and render it translucent.
  354. *// Example:
  355.  
  356. int combos[4] = {16,19,31,20};
  357. int cmbx[4]= {0, 16, 32, 48}:
  358. int cmby[4]={8, 8, 8, 8);
  359. int cmbc[4]={0,0,0,0};
  360. Screen->ComboArray(6, 4, combos, cmbx, cmby, cmbc);
  361.  
  362.  
  363. /************************************************************************************************************/
  364.  
  365. //! This new mode does not work as intended, and will likely be deprecated by Screen->SetRenderSource
  366. void Quad ( int layer,
  367. int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4,
  368. int w, int h, int cset, int flip, int texture, int render_mode);
  369.  
  370. ZASM Instruction:
  371. QUADR
  372.  
  373. /**
  374. * Draws a quad on the specified layer with the corners x1,y1 through x4,y4.
  375. * Corners are drawn in a counterclockwise order starting from x1,y1. ( So
  376. * if you draw a "square" for example starting from the bottom-right corner
  377. * instead of the usual top-left, the the image will be textured onto the
  378. * quad so it appears upside-down. -yes, these are rotatable. )
  379. *
  380. * From there a single or block of tiles, combos **or a bitmap** is then texture mapped
  381. * onto the quad using the arguments w, h, cset, flip, and render_mode.
  382. * A positive vale in texture will draw the image from the tilesheet pages,
  383. * whereas a negative value will be drawn from the combo page. 0 will draw combo number 0.
  384. * Both w and h are undefined unless 1 <= blockh, blockw <= 16, and it is a power of
  385. * two. ie: 1, 2 are acceptable, but 2, 15 are not.
  386. *
  387. * To specify a bitmap as a texture, sum 65520 with the bitmap ID, or use the constant TEX_BITMAP + Bitmap
  388. * Example: Screen->Quad(6, 0, 0, 40, 25, 18, 50, 60, 110, 0, 0, 0, 0, TEX_BITMAP+RT_BITMAP0, PT_TEXTURE);
  389. *
  390. *
  391. * Flip specifies how the tiles/combos should be flipped when drawn:
  392. * 0: No flip
  393. * 1: Horizontal flip
  394. * 2: Vertical flip
  395. * 3: Both (180 degree rotation)
  396. * (!) See std.zh for a list of all available render_mode arguments.
  397. */ Example Use: !#!
  398.  
  399. void TileArray ( int layer, int number_of_tiles,
  400. int tiles[],
  401. int x_positions[],
  402. int y_positions[],
  403. int csets[]);
  404.  
  405. ZASM: TILEARRAY
  406.  
  407. /**
  408. *
  409. * Draws a number of tiles specified by 'number_of_tiles' to 'layer'.
  410. * Specify the tiles by populating an array with their IDs and passing the array ointer to 'tiles'.
  411. * Specify the X coordinate for each by passing an array with their x coordinates to 'x_positions'.
  412. * Specify the Y coordinate for each by passing an array with their y coordinates to 'y_positions'.
  413. * Specify the CSet for each by passing an array with their csets to 'csets'.
  414. *
  415. * This function counts as a single draw.
  416. *
  417. * Transparency is not yet imlemented, but you may draw to a bitmap and render it translucent.
  418. *// Example:
  419.  
  420. int tiles[4] = {16,19,31,20};
  421. int tilx[4]= {0, 16, 32, 48}:
  422. int tily[4]={8, 8, 8, 8);
  423. int tilc[4]={0,0,0,0};
  424. Screen->TileArray(6, 4, tiles, tilx, tily, tilc);
  425.  
  426.  
  427. /************************************************************************************************************/
  428.  
  429. void PixelArray ( int layer, int number_of_pixels,
  430. int x_positions[],
  431. int y_positions[],
  432. int colours[]);
  433.  
  434. ZASM: PIXELARRAY
  435.  
  436. /**
  437. *
  438. * Draws a number of pixel, similar to PutPixel, specified by 'number_of_pixels' to 'layer'.
  439. * Specify the X coordinate for each by passing an array with their x coordinates to 'x_positions'.
  440. * Specify the Y coordinate for each by passing an array with their y coordinates to 'y_positions'.
  441. * Specify the colour for each by passing an array with their csets to 'colours'.
  442. *
  443. * This function counts as a single draw.
  444. *
  445. * Transparency is not yet imlemented, but you may draw to a bitmap and render it translucent.
  446. *// Example:
  447.  
  448. int pix[4] = {16,19,31,20};
  449. int px[4]= {0, 16, 32, 48}:
  450. int py[4]={8, 8, 8, 8);
  451. int pc[4]={0x12,0xB0,0xDA,0x4F};
  452. Screen->TileArray(6, 4, pix, px, py, pc);
  453.  
  454. /************************************************************************************************************/
  455.  
  456. CreateBitmap(int id, int xsize, int ysize)
  457.  
  458. * Min size 1, max 2048
  459. /************************************************************************************************************/
  460.  
  461. SetRenderSource(int target, int x, int y, int w, int h)
  462.  
  463. /************************************************************************************************************/
  464.  
  465. void Polygon ( int layer, ... );
  466.  
  467. ZASM: POLYGON
  468.  
  469. * Adding to Beta 9 : Postponed -Z
  470.  
  471. /************************************************************************************************************/
  472.  
  473. // Game->
  474.  
  475. //! These do not yet work:
  476.  
  477. //Returns Screen->Door[index] for a given DMap and Screen
  478. int GetDMapScreenDoor( int dmap, int screen, int index )
  479.  
  480.  
  481. //Sets Screen->Door[index] for a given DMap and Screen to 'value'
  482. void SetDMapScreenDoor( int dmap, int screen, int index, int value)
  483.  
  484.  
  485. //Returns Screen->State[index] for a given DMap and Screen
  486. bool GetDMapScreenState( int dmap, int screen, int index )
  487.  
  488.  
  489. //Sets Screen->State[index] for a given DMap and Screen to 'value'
  490. void SetDMapScreenState( int dmap, int screen, int index, bool value)
  491.  
  492. /************************************************************************************************************/
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×