I want a ffc fairy that will follow you like in majora's mask and ocarina of time, any help is appreciated. I would make a script myself, but the scripting is a bit confusing, but I will hopefully learn someday.
I want a ffc fairy that will follow you like in majora's mask and ocarina of time, any help is appreciated. I would make a script myself, but the scripting is a bit confusing, but I will hopefully learn someday.
Hi russadwan, thanks, but if you can't get it it's not a problem. :) I believe you have helped me before on some kind of script too. You do visit purezc also don't you? Oh well, see ya.:)
I just accidentally found this script on my computer I found awhile back, but it says something about an itemclass is not found, could you check this for me?
import "std.zh"
ffc script followfairy{
void run(){
if(link->item[I-LEAF]){
if(epona) xspd = 1.4{
else xspd = 1;
if(fairyinit){
leaf->flags[0]=true;
leaf->flags[3]=true;
leaf->data=fairycombo+1;
leaf->cset=;
ran=rand(28)+link->x-16;
leaf->x=ran;
ran=rand(28)+link->y-16
leaf->y=ran;
}
if(screennumber1=game->getcurscreen()){
ran=rand(28)+link->x-16;
leaf->x=ran;
ran=rand(28)+link->y-16
leaf->y=ran;}
x1=leaf->x;x2=link->x2;
y1=leaf->y;y2=link->y2;
if(t==tcap){
ran=rand(5)/10+0.4;
if(rand(2)==1)ran*=-1;
leaf->vx=ran
ran=rand(5)/10+0.4;
if(rand(2)==1)ran*=-1;
leaf->vy=ran
t=0:
dircheck=true;}
if(distance(x1,y1,x2,y2)>32){
if(x1<x2){
ran=rand(5)/10+xspd;
leaf->Vx=ran;}
if(y1<y2){
ran=rand(5)/10+xspd;
leaf->Vy=ran;}
if(x1>x2){
ran=rand(5)/10+xspd;
leaf->Vx=-ran;}
if(y1>y2){
ran=rand(5)/10+xspd;
leaf->Vy=-ran;}
dircheck=true;}
if(dircheck){
if(leaf->vy<o&&(abs(leaf->vx)<0.6)){leaf->data=fairycombo;dircheck=false;}
if(leaf->vy<o&&(abs(leaf->vx)<0.6)){leaf->data=fairycombo+1;dircheck=false;}
if(leaf->vx<0&&dircheck){leaf->data=fairycombo+2;dircheck=false;}
if(leaf->vx>0&&dircheck){leaf->data=fairycombo+3;dircheck=false;}}
if(link->imputr){
if(cantalk&&!falling&&link->action!=LA_FROZEN&&link->z==0&&srpt==0){
game->playsound(leafsfx);
screen->message(leafstring0;}}
if(srpt>0)srpt--;
screennumber=game->getcurscreen();
t++;}
Heh, don't worry about that Russ.
I don't like to keep scripts hidden away; feel free to share any of them.
And what you have won't work at the moment...
Have a go with that one.Code:const int CMB_FAIRY = 0; // Set here the first of the 4 Fairy combos, in the order Up, Down, Left, Right bool HasFairy = true; bool FairyInit = true; int FairyMovementCounter; global script Slot_2{ void run(){ int ScreenNumber; while(true){ //Call the Fairy functions if(HasFairy) Fairy(ScreenNumber); //Put any other global functions here... ScreenNumber = Game->GetCurScreen(); Waitframe(); } //Fairy functions void Fairy(int ScreenNumber){ ffc Fairy = Screen->LoadFFC(32); bool ChangeDir; if(FairyInit){ Fairy->Flags[0] = true; Fairy->Flags[3] = true; Fairy->Data = CMB_FAIRY+1; FairyInit = false; Fairy->X = Rand(28) + Link->X-16; Fairy->Y = Rand(28) + Link->Y-16; } if(ScreenNumber != Game->GetCurScreen()){ Fairy->X = Rand(28) + Link->X-16; Fairy->Y = Rand(28) + Link->Y-16; } if(FairyMovementCounter == FairyMovementMax){ Fairy->Vx = (Rand(5)/10+0.4)*(Rand(2)*2-1); Fairy->Vy = (Rand(5)/10+0.4)*(Rand(2)*2-1); ChangeDir = true; FairyMovementCounter = 0; } if(Distance(Fairy->X,Fairy->Y,Link->X,Link->Y) > 32){ if(Fairy->X < Link->X) Fairy->Vx = (Rand(5)/10+1); else Fairy->Vx = -(Rand(5)/10+1); if(Fairy->Y < Link->Y) Fairy->Vy = (Rand(5)/10+1); else Fairy->Vy = -(Rand(5)/10+1); ChangeDir = true; } if(ChangeDir){ if(Fairy->Vy < 0 && (Abs(Fairy->Vx) < 0.6)) Fairy->Data = CMB_FAIRY; else if(Fairy->Vy > 0 && (Abs(Fairy->Vx) < 0.6)) Fairy->Data = CMB_FAIRY+1; else if(Fairy->Vx < 0) Fairy->Data = CMB_FAIRY+2; else if(Fairy->Vx > 0) Fairy->Data = CMB_FAIRY+3; ChangeDir = false; } FairyMovementCounter++; } } global script Slot_3{ void run(){ if(HasFairy) FairyInit = true; } } ffc script RemoveFairy{ void run(){ HasFairy = false; ffc Fairy = Screen->LoadFFC(30); Fairy->Data = 0; } } ffc script ReturnFairy{ void run(){ HasFairy = true; FairyInit = true; } }
Put the two global scripts on the slots it says in their names, and if you place the other two scripts on an ffc on a screen, they do what the name suggests.
Make sure to set up the integer at the top to what combos you want to use for the fairy.
Thanks for the script, but I have a few questions about it.
So do I need to set the ffc on a screen in a certain way or does it just follow me when you start?
Also, it will follow me when I go to another screen or a dmap?
And how and where exactly do I put the combo's numbers at, it says put the first one in but then it tells me to put them in a certain order?
I have put the script in and I get this error:
Line 20: syntax error, unexpected Lparen, expecting assign, on token (
Fatal error P00: can't open or parse input file!
any idea what is wrong?
Oh, oops.Code:const int CMB_FAIRY = 0; // Set here the first of the 4 Fairy combos, in the order Up, Down, Left, Right bool HasFairy = true; bool FairyInit = true; int FairyMovementCounter; global script Slot_2{ void run(){ int ScreenNumber; while(true){ //Call the Fairy functions if(HasFairy) Fairy(ScreenNumber); //Put any other global functions here... ScreenNumber = Game->GetCurScreen(); Waitframe(); } } //Fairy functions void Fairy(int ScreenNumber){ ffc Fairy = Screen->LoadFFC(32); bool ChangeDir; if(FairyInit){ Fairy->Flags[0] = true; Fairy->Flags[3] = true; Fairy->Data = CMB_FAIRY+1; FairyInit = false; Fairy->X = Rand(28) + Link->X-16; Fairy->Y = Rand(28) + Link->Y-16; } if(ScreenNumber != Game->GetCurScreen()){ Fairy->X = Rand(28) + Link->X-16; Fairy->Y = Rand(28) + Link->Y-16; } if(FairyMovementCounter == FairyMovementMax){ Fairy->Vx = (Rand(5)/10+0.4)*(Rand(2)*2-1); Fairy->Vy = (Rand(5)/10+0.4)*(Rand(2)*2-1); ChangeDir = true; FairyMovementCounter = 0; } if(Distance(Fairy->X,Fairy->Y,Link->X,Link->Y) > 32){ if(Fairy->X < Link->X) Fairy->Vx = (Rand(5)/10+1); else Fairy->Vx = -(Rand(5)/10+1); if(Fairy->Y < Link->Y) Fairy->Vy = (Rand(5)/10+1); else Fairy->Vy = -(Rand(5)/10+1); ChangeDir = true; } if(ChangeDir){ if(Fairy->Vy < 0 && (Abs(Fairy->Vx) < 0.6)) Fairy->Data = CMB_FAIRY; else if(Fairy->Vy > 0 && (Abs(Fairy->Vx) < 0.6)) Fairy->Data = CMB_FAIRY+1; else if(Fairy->Vx < 0) Fairy->Data = CMB_FAIRY+2; else if(Fairy->Vx > 0) Fairy->Data = CMB_FAIRY+3; ChangeDir = false; } FairyMovementCounter++; } } global script Slot_3{ void run(){ if(HasFairy) FairyInit = true; } } ffc script RemoveFairy{ void run(){ HasFairy = false; ffc Fairy = Screen->LoadFFC(30); Fairy->Data = 0; } } ffc script ReturnFairy{ void run(){ HasFairy = true; FairyInit = true; } }
Missed an R brace.
Anyway, you put that as your global script, and then the fairy will follow you everywhere.
If you want it to go away for a bit, put the 'RemoveFairy' FFC script on a screen, then the fairy will stop following you.
If you want it to come back, put the 'ReturnFairy' FFC script on a screen.
On your combosheet you should have 4 fairy combos in a row.
The first facing up, then next down, the next left and then right.
Put the Combo ID of the first one as the integer at the top of the script.
The script didn't work at first so I tweaked it a little bit, I added
import"std.zh"(of course)
int FairyMovementMax; after int FairyMovementCounter
and now it works, Thanks a ton.:)
This doesn't require scripts but I was wondering if you could help me make a cutscene. All I want is when you enter a dungeon it says something like, It sure is creepy down here, and then you start playing again. I have the actual screen you see on layer 3 with teleports to warp you to the screen you start with. It will take me to that screen, but it won't display the text, and I have the room set to special item with the string and Abei as the "guy".Also I would like to know how you could make it a one time only thing.
D0:the string you want to showCode:bool showmessage=true; ffc script messagecutscene { void run(int s,int t) { while(true) { if (showmessage==true) { Screen->Message(s); Waitframes(t*60); showmessage=false; Quit(); } else { Quit(); } } } }
D1:the time in seconds you want it to be shown
I think it might work... I'm not even sure if you need a script for that anyway...
Cool, I will try it out, thanks.:)
There are currently 1 users browsing this thread. (0 members and 1 guests)