Because what you have at the moment will only happen once, and you want it to continue happening until Link is pushed off the screen.
And you're using Link->Input wrong. Gleeok corrected that, but he didn't explain what he did so I'll explain it.
In ZScript, there are variables. I'm aware of 3 types of variables (not so say there aren't more =P), and these are
Int - short for Integer, this stores a numerical value
Bool - short of Boolean, this stores a 'true/false' value
Float - short for Float, this stores a decimal numerical value
(by the way, integers are lying, you can also save them with decimal places)
The Link->Input command is a boolean, and you've tried to use it an an integer. (you're probably thinking, what's he on about, 'start' isn't a number?!, well if you try to use a word in place of a number, ZScript assumes you're trying to refer to a variable integer, which has been named with that word, so where you've put 'Link->Input == start', aside from the fact that just 'Link->Input' on it's own isn't a command, ZScript assumes that start is an integer. Which is bad because you haven't declared it)
Anyway, there are 9 commands that start with 'Link->Input', and the one you want is 'Link->InputStart'. If you want to access another button press, you just put that on the end, ie. 'Link->InputLeft'. And because it's a boolean, and you want to check if it's true, you want to put 'if(Link->InputStart == true){' (or as Gleeok put, just 'if(Link->InputStart){' because for a boolean that implies that you want it to be true anyway, but I wouldn't worry about that too much right now).
Also, there are better ways of making Link warp via ZScript than this.
Firstly, if you hold down 'Up' after pressing start, Link might be able to escape hitting the side warp (although moving at 16 pixels a frame is rather fast so I don't think he'd be able to escape that, I
think he usually walks at one pixel a frame).
If you look in ZScript.txt, which is the document containing all of the commands for ZScript, and how to use them, you'll see there is Link->Warp(); and Link->PitWarp();.
Just on a side note, the document is split up into sections. for the commands in the section called 'Link', you have to put 'Link->' before the command, this is called a pointer. So to make the game play a SFX, which is in the 'Game' section, you have to put 'Game->PlaySound();'. I had no idea of this, and it took me quite a while to work it out, so hopefully it'll be helpful to you.
Anyway, so if you were to put in 'Link->PitWarp(dmap, screen);' rather than Link->X, it would send Link via a scripted warp, without having to mess around with moving Link.
You have to understand integers however to make this work. If you want to use this script here, and only here, you could hard-code into the script your warp destination, or you could put some variable integers in the FFC's D0-D7 boxes, which I'll explain if you want?
Anyway, 'dmap' is just the number of the dmap you're going to, and screen is the number of the screen. Screens are counted across the top from 0-15, then on the next row from 16-31 etc.
This however isn't my preffered method, I'd make a combo into an autowarp type after you press start, which then sends Link via the sidewarp as it is. I was going to post up my script for making Link warp after you press start, but I thought I wouldn't because if you just use mine it wouldn't help your understanding, and you said you wanted to learn. I'll put it up if you want, though?
And if there's anything that I said that you don't understand, feel free to ask =P
It's great to see people learning though, good luck
Edited by Joe123, 24 November 2007 - 06:23 AM.