Link (ZScript)

From ZCWiki

Jump to: navigation, search

This page describes the ZScript object Link along with its properties and methods. For information on the character Link, see Link.

The Link object allows quest designers to control and inspect various aspects of the Link character in Zelda Classic.

Contents

[edit] Syntax

The Link object (or a pointer to it, more specifically) is automatically made available to ZScript scripts; you do not need to declare a Link variable or instantiate it in any way.

The syntax for accessing the methods and properties associated with Link is as follows:

Link->method-or-property;

where method-or-property is one of the methods or properties listed below. As with any expression, you can use Link methods or properties as the evaluation criteria in control loops, if statements, and so forth.

[edit] Methods and Properties

[edit] Methods

[edit] Warp

The Warp method warps link to the given screen in the given DMap, at the position of the blue 'warp return' square.

Introduced in Version
2.50 (beta)
Prototype and Arguments
void Warp(int dmap, int screen)
  • int dmap: The number of the DMap to which Link should warp.
  • int screen: The screen in the specified DMap to which Link should warp.

It should be noted that the screen to warp to can be inputted as a hexidecimal coordinate - as ZQuest identifies its screens - or, it can be inputted as a decimal number. If inputted as a decimal number, screens are counted from 0 to 15 across the top row, 16 to 31 across the second row etc. This is the same for Link->PitWarp.


[edit] PitWarp

The PitWarp method warps link to the given screen in the given dmap, at his current coordinates on the screen.

Introduced in Version
2.50 (beta)
Prototype and Arguments
void PitWarp(int dmap, int screen)
  • int dmap: The number of the DMap to which Link should warp.
  • int screen: The screen in the specified DMap to which Link should warp.

[edit] Properties

[edit] int Action

Link's current action. Use the LA_ constants in std.zh to set or compare this value.

[edit] int Dir

The direction Link is facing. Use the DIR_ constants in std.zh to set or compare this variable. Note: even though Link can move diagonally if the quest allows it, his sprite doesn't ever use any of the diagonal directions, which are intended for enemies only.

The effects of writing to this variable are denoted as undefined, however writing to Link->Dir will actually function as required. Joe123 00:02, 7 June 2008 (PDT)

[edit] int Drunk

To be determined.

[edit] int HP

Link's current hitpoints, in 16ths of a heart.

[edit] int HeldItem

The item that Link is currently holding up; reading or setting this field is undefined if Link's action is not current a hold action. Use the IT_ constants in std.zh to specify the item, or -1 to show no item. Setting HeldItem to values other than -1 or a valid item ID is undefined.

[edit] bool InputA

True if the player is pressing the A key. Writing to this variable simulates the press or release of the A key.

[edit] bool InputB

True if the player is pressing the B key. Writing to this variable simulates the press or release of the B key.

[edit] bool InputDown

True if the player is pressing the down arrow. Writing to this variable simulates the press or release of the down arrow.

[edit] bool InputL

True if the player is pressing the L key. Writing to this variable simulates the press or release of the L key.

[edit] bool InputLeft

True if the player is pressing the left arrow. Writing to this variable simulates the press or release of the left arrow.

[edit] int InputMouseX

The mouse's in-game X position. This value is read-only, and undefined if the mouse pointer is outside the Zelda Classic window.

[edit] int InputMouseY

The mouse's in-game Y position. This value is read-only, and undefined if the mouse pointer is outside the Zelda Classic window.

[edit] bool InputR

True if the player is pressing the R key. Writing to this variable simulates the press or release of the R key.

[edit] bool InputRight

True if the player is pressing the right arrow. Writing to this variable simulates the press or release of the right arrow.

[edit] bool InputStart

True if the player is pressing the start button. Writing to this variable simulates the press or release of the start button.

[edit] bool InputUp

True if the player is pressing the up arrow. Writing to this variable simulates the press or release of the up arrow.

[edit] int ItemJinx

The time, in frames, until Link regains use of his items. -1 signfies a permanent loss of his items.

[edit] bool Item[]

True if Link's inventory contains the item whose ID is the index of the array access. Use the IT_ constants in std.zh as an index into this array.

[edit] int Jump

Link's upward velocity. It uses the same units as an FFC's Vx and Vy variables. However, the quest's Gravity constant acts as downward acceleration on Link at all times if the 'Sideview Gravity' screen flag is checked, or if Link->Z > 0.

[edit] int MP

Link's current amount of magic, in 32nds of a magic block.

[edit] int MaxHP

Link's maximum hitpoints, in 16ths of a heart.

[edit] int MaxMP

Link's maximum amount of magic, in 32nds of a magic block.

[edit] int SwordJinx

The time, in frames, until Link regains use of his sword. -1 signfies a permanent loss of the sword.

[edit] int X

Link's X position on the screen, in pixels.

[edit] int Y

Link's Y position on the screen, in pixels.

[edit] int Z

Link's Z position on the screen, in pixels.

Personal tools