Advertisement
ZoriaRPG

New ZScript Shortlist Beta 52 (Early)

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