PDA

View Full Version : Ok a simpler question



Master_of_Power
07-06-2007, 05:22 PM
As you may know, I was discouraged from using any form of scripting language due to its limited documentation. However, I'd love to give this another go, as I highly doubt anyone would want to do all the complex work for me. :rolleyes:

With all of that said... WHUZ WRONG WITH DIS??? :googly:


import "std.zh"

fcc_script test
{
void run()
{
Link->InputStart = false;

if(Link->InputStart)
{
Link->Pitwarp(0,8)
}
}
}

Dan Furst
07-06-2007, 05:57 PM
Here's a working script.


ffc script test
{
void run()
{
while(true)
{
if(Link->InputStart)
{
Link->PitWarp(0, 0x08);
}
Waitframe();
}
}
}

(Note: The tabification is meaningless, I just think it's easier to read.)

Your errors:
1.) You dont (yet) need to import std.zh because you aren't using and functions or variables within it. (But it's ok to leave it there.)

2.) fcc_script should read ffc script

3.) You don't need to set InputStart to false. It's ok to, but it doesn't do anything.

4.) PitWarp is the proper spelling. Note the capital W.

5.) The second parameter in PitWarp(dmap, screen) is referenced in hexadecimal, so you should preface it with 0x.

6.) The insctruction line with PitWarp needed a semicolon.

7.) Waitframe is the most important function in all of ZScript. When your script gets to Waitframe(), it will pause until the next frame of the game is drawn. Your script will then continue from there.

8.) Since you want to check for InputStart for more than the very first frame of execution, you need a forever while loop.


It's good to see people trying to learn scripting. I'm trying to put together some solid documentation in the SPEC topic in the Beta Discussion forum, although it is slow going. (Hey, I'm writing a script of my own!)

Post back with more questions as they come up.

Master_of_Power
07-06-2007, 06:31 PM
meh, a lot of the errors on the post weren't actually preset in the script I wrote beforehand.

Apparently DMaps start at 1

This happened to be one of the biggest reasons why I don't like using any sort of programming language, not all errors are picked up by the compiler, and worse yet, not all errors are picked up by the programmer either. I just want to get this, and everything, right once so I know what I'm doing.

Dan Furst
07-06-2007, 07:31 PM
Well yeah, no compiler can divine what it is you're trying to do. I think that, once you get over the syntax hurdle, things get much easier.

Master_of_Power
07-06-2007, 07:32 PM
I hope you're right, because there are so many things I want to do with Zelda Classic now that a majority of it is possible.