PDA

View Full Version : im requesting an ffc script..



bluedeath
11-25-2007, 08:49 PM
I need a script that makes the FFC move the opposite direction of link. I also need to know how to import scripts :D. I want the FFC to be able to step on switches.

Russ
11-25-2007, 09:07 PM
To import scripts:

1. Got to tools, compile Zscript.
2. Click import, and select the script you wish to import.
3. Press compile.
4. Assign it to one of the script slots shown. For example, if it was an item script, choose the item tab, choose an empty slot, choose the script, and hit the arrow button.
5. Press okay.
6.
A. If it was a ffc script, assign it to the ffc through the freeform combo editor.
B. If it was an item script, assign it with the item editor.
C. If it was a global script, there is nothing else that needs to be done!


As for your request, I think there is a script like this in the script showcase forum.

bluedeath
11-26-2007, 06:46 PM
Well actually when I want to compile the script the script is not showing in the folder when im on zquest but it is when I check the folder. Is there a certain way I have to save the code?

Russ
11-26-2007, 07:02 PM
I said before, you must save it as a .z file.

bluedeath
11-26-2007, 07:37 PM
How do you save it as a .Z file. I have been gone away from zc too long, it was 5 months, and I dont remember most of anything.

Russ
11-26-2007, 08:34 PM
Copy the script into notepad. Press "save as". Enter the name as "whatever.z". For instance, if you wanted the script to be called rollerscript, you would save it as "rollerscript.z".

bluedeath
11-26-2007, 08:54 PM
Ok thanks russadwan, you have been alot of help lately thanks alot :P

Russ
11-26-2007, 09:04 PM
Ok thanks russadwan, you have been alot of help lately thanks alot :P
You're welcome.

bluedeath
11-26-2007, 09:06 PM
Ok im using a rolling script every thing is perfect no problems just wondering how to change the tile for when link rolls, because when he rolls a blue picture of him self come up as he rolls and goes away as link finishes.

C-Dawg
11-26-2007, 09:19 PM
The rolling script probably uses "Link tile offsets." Check the script to see which item it is giving Link while he rolls. (It's a null item that doesn't show up on your inventory and is only there to change the link graphics). Check the item number. Set up your tiles and that item's Link offset to set up the rolling graphics.

bluedeath
11-26-2007, 09:34 PM
import "std.zh"

global script roll {

void run() {

int counter;
bool justRolled = false;
int DustTile = 20; //the starting animation tile of the 5-frame dust animation.
int DustCSet = 7; //the CSet of the tile animation.
int xca; int xcb; int xcc; int xcd; int xce;
int yca; int ycb; int ycc; int ycd; int yce;
int DustFrame;

while(true) {

if(Link->InputL && Link->Action == LA_WALKING) {

Link->Jump = 20;
counter = 20;
DustFrame = 1;
xca = -1;
xcb = -1;
xcc = -1;
xcd = -1;
xce = -1;
yca = -1;
ycb = -1;
ycc = -1;
ycd = -1;
yce = -1;
Game->PlaySound(66); //Change/Disable SFX if needed

while(counter > 0) {

Link->Z = 0;
Link->InputUp = false;
Link->InputDown = false;
Link->InputLeft = false;
Link->InputRight = false;
Link->InputA = false;
Link->InputB = false;
Link->InputR = false;
Link->InputL = false;

if(Floor(counter/2) == counter/2) { //trigger animation

xce = xcd;
xcd = xcc;
xcc = xcb;
xcb = xca;

yce = ycd;
ycd = ycc;
ycc = ycb;
ycb = yca;

xca = Link->X;
yca = Link->Y;

if(DustFrame >= 5) {

xca = -1;
yca = -1;

} //end if

DustFrame ++;

} //end if

if(!(xca == -1) && !(yca == -1)) {Screen->DrawTile(2, xca, yca, DustTile, 1, 1, DustCSet, 1, 0, 0, 0, 0, true, 128);}
if(!(xcb == -1) && !(ycb == -1)) {Screen->DrawTile(2, xcb, ycb, DustTile + 1, 1, 1, DustCSet, 1, 0, 0, 0, 0, true, 128);}
if(!(xcc == -1) && !(ycc == -1)) {Screen->DrawTile(2, xcc, ycc, DustTile + 2, 1, 1, DustCSet, 1, 0, 0, 0, 0, true, 128);}
if(!(xcd == -1) && !(ycd == -1)) {Screen->DrawTile(2, xcd, ycd, DustTile + 3, 1, 1, DustCSet, 1, 0, 0, 0, 0, true, 128);}
if(!(xce == -1) && !(yce == -1)) {Screen->DrawTile(2, xce, yce, DustTile + 4, 1, 1, DustCSet, 1, 0, 0, 0, 0, true, 128);}

if(Link->Dir == DIR_UP) {

if((Screen->ComboS[ComboAt(Link->X+8, Link->Y+6)] == 0) && (Screen->ComboF[ComboAt(Link->X+8, Link->Y+6)] != 97)) {Link->Y -= 2;}

} //end if

if(Link->Dir == DIR_DOWN) {

if((Screen->ComboS[ComboAt(Link->X+8, Link->Y+18)] == 0) && (Screen->ComboF[ComboAt(Link->X+8, Link->Y+18)] != 97)) {Link->Y += 2;}

} //end if

if(Link->Dir == DIR_LEFT) {

if((Screen->ComboS[ComboAt(Link->X-2, Link->Y+8)] == 0) && (Screen->ComboF[ComboAt(Link->X-2, Link->Y+8)] != 97)) {Link->X -= 2;}

} //end if

if(Link->Dir == DIR_RIGHT) {

if((Screen->ComboS[ComboAt(Link->X+18, Link->Y+8)] == 0) && (Screen->ComboF[ComboAt(Link->X+18, Link->Y+8)] != 97)) {Link->X += 2;}

} //end if

counter --;
justRolled = true;

Waitframe();

} //end while

} //end if

if(justRolled) {

Link->Jump = 0;
justRolled = false;

}

Link->InputL = false;

Waitframe();

} //end while

} //end void run

} //end script
Is dustframe the one I should be changing?

Russ
11-26-2007, 10:08 PM
Change the dust frame to what ever tiles you are using for dust. It uses five tiles. I suggest you don't use dust. Just set it to some blank tile with four blank tiles after it. And also, the dust cset needs to be changed to the cset of the dust tiles (if you use them).

Gleeok
11-27-2007, 01:19 AM
Here's a basic movement pattern script that will move opposite of wherever Link moves. You can combine it with another ffc script for other effects.



ffc script opposite{

void run(){

while(true){

if(Link->InputUp){ this->Y++;}
else if(Link->InputDown){ this->Y--;}
else if(Link->InputLeft){ this->X++;}
else if(Link->InputRight){ this->X--;}

Waitframe();
}
}
}

bluedeath
11-29-2007, 09:44 PM
Would the ffc move even though link is trying to walk into a unwalkable object?

Russ
11-29-2007, 10:05 PM
Yes. It just checks to see if Link is pressing a directional button.

Joe123
11-30-2007, 04:02 AM
The rolling script uses Link's Jumping tiles, so make sure you have those set in the Link Sprite editor.


ffc script opposite{

void run(){

while(true){

if(Link->InputUp && Link->Action == LA_WALKING){ this->Y++;}
else if(Link->InputDown && Link->Action == LA_WALKING){ this->Y--;}
else if(Link->InputLeft && Link->Action == LA_WALKING){ this->X++;}
else if(Link->InputRight && Link->Action == LA_WALKING){ this->X--;}

Waitframe();
}
}
}

And that one won't move unless Link is, because it checks whether he's pressing a direction key, and whether he's walking.

bluedeath
12-03-2007, 06:10 PM
How can I take that out?

Joe123
12-03-2007, 06:26 PM
take what out?

bluedeath
12-04-2007, 10:33 AM
FFC wont move unless Link is, I want so it moves when Link presses a directional button.

Gleeok
12-04-2007, 12:24 PM
FFC wont move unless Link is, I want so it moves when Link presses a directional button.

Well, That's what I posted. Although note that the ffc will move through unwalkable combos as is.

bluedeath
12-04-2007, 01:09 PM
Ok... I dont mean to be a pain in the ass but could you make it that way.