Today we will making ZScript print "Hello, world of hyrule!" on the screen
1. File->New
2. ZScript->Compile ZScript...
3. Click 'Edit' button
4. Copy the following into the 'Edit ZScript' window (be careful; an #include is already there):
Code:
#include "std.zh"
global script Init
{
void run()
{
int layer = 1;
int x = 0;
int y = 0;
int font = 0;
int color = 1;
int format = 0;
int bg_color = 0;
char32 str = "Hello, world of hyrule!";
int opacity = OP_OPAQUE;
Screen->DrawString(layer, x, y, font, color, format, bg_color, str, opacity);
}
}
5. Press Esc
6. Click 'Yes' to save changes to buffer
7. Click 'Compile'; ZScript compiler should return code 0 for success
8. Click 'OK' to dismiss ZScript Parser window
9. Click 'OK' to dismiss Assign Compiled Script window
10. Click 'Close' to dismiss "Slots Assigned" msgbox (it should say "ZScripts successfully loaded into script slots")
11. Click 'OK' to dismiss "Init Script Changed" msgbox
12. Quest->Test; save quest as "zscript_hello_world_tut.qst"; click 'OK' to dismiss "ZC Editor" window
13. Click 'Test' in Test Quest window
14. Observe "Hello, world of hyrule!" briefly appears below the subscreen during iris transition