Jump to content

Photo

Trying ZASM


  • Please log in to reply
8 replies to this topic

#1 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 07 March 2007 - 08:20 PM

I've been trying to make a ZASM script for the first time, and I'm not doing so well.

CODE
WAIT WAITFRAME
COMPAREV INPUTSTART, 1
GOTOTRUE START
GOTO WAITFRAME
START SETV linky, 1
GOTOWAIT

This is supposed to move Link down when the Start key is pressed. But ZQuest keeps saying something's wrong with it. What's wrong with it though? I used Revfan's example script in his tutorial as the base for it. (the one that moved the FFC if the directional keys were pressed)

#2 Revfan9

Revfan9

    Hero of Time

  • Banned
  • Real Name:Dr. Pajamas
  • Location:In front of a screen

Posted 07 March 2007 - 08:25 PM

WAIT WAITFRAME
COMPAREV INPUTR, 1
GOTOTRUE START
GOTO WAIT
START ADDV linky,16
GOTO WAIT

Add a space between "GOTO" and "WAIT" in the last line, and change "GOTO WAITFRAME" to "GOTO WAIT". Instead of SETV'ing linky, you may want to ADDV linky,16, because SETV linky,1 will bring Link up to the top of the screen. You could also want to change INPUTSTART to INPUTR, because the start button will bring up the inventory.

#3 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 07 March 2007 - 08:43 PM

QUOTE(Revfan9 @ Mar 7 2007, 08:25 PM) View Post

WAIT WAITFRAME
COMPAREV INPUTR, 1
GOTOTRUE START
GOTO WAIT
START ADDV linky,16
GOTO WAIT

Add a space between "GOTO" and "WAIT" in the last line, and change "GOTO WAITFRAME" to "GOTO WAIT". Instead of SETV'ing linky, you may want to ADDV linky,16, because SETV linky,1 will bring Link up to the top of the screen. You could also want to change INPUTSTART to INPUTR, because the start button will bring up the inventory.


Ok, I just tried compiling it in ZQ, and I got an error. "The error was: Invalid instruction. The command was (INPUTR,) (1,)

By the way, in the script, shouldn't all the "START"s be changed to "R", now that the input is supposed to be R? Well, I tried the script both the way you typed it, and with the replaced STARTs... I got the same message both times. It might be just that I'm using an Alpha...

#4 Saffith

Saffith

    IPv7 user

  • ZC Developers

Posted 07 March 2007 - 08:54 PM

Put at least one space before every line except the first and the next-to-last.
If there are no leading spaces, the parser assumes the first thing on the line is a label and the next bit is the instruction.

#5 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 07 March 2007 - 09:29 PM

Cool, thanks. It was loaded fine this time. I also tried the script in ZC, and it did almost exactly what I wanted! (Link just went a little faster than I expected, but you won't be able to see Link on the screen anyway. icon_razz.gif

I hope I'll be able to make better scripts in the future. icon_smile.gif

#6 Revfan9

Revfan9

    Hero of Time

  • Banned
  • Real Name:Dr. Pajamas
  • Location:In front of a screen

Posted 07 March 2007 - 10:44 PM

Yeah. Remember that the forums want to delete the spaces for some odd, pathological, ungodly reason that messes with the scripts, so you'll have to add the spaces yourself unless it comes in a TXT file for you.

#7 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 07 March 2007 - 11:49 PM

Ok, just one more question. What if I wanted it to make link go north, not south? Would I change "linky, 16" to "linky, -16"? Don't worry, I think I know how to make him go right or left. Just change linky to linkx. icon_razz.gif

#8 Revfan9

Revfan9

    Hero of Time

  • Banned
  • Real Name:Dr. Pajamas
  • Location:In front of a screen

Posted 08 March 2007 - 05:11 PM

You could use -16, or you could change ADDV to SUBV, but that's your choice.

#9 Bayta

Bayta

    Follower of Destiny

  • Members
  • Real Name:Robin Evans
  • Location:Suffolk County, NY

Posted 08 March 2007 - 05:39 PM

Ok, yeah, I don't know why I didn't see that before. icon_sweat.gif Thanks for your help, Revfan. icon_smile.gif


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users