SWORD SFX
#31
Posted 08 November 2008 - 05:24 AM
You haven't copied in the bool at the top called 'ComboFI' into your file, and the 'StringOnce' declaration is a different script entirely.
That's from the message string script.
#32
Posted 08 November 2008 - 06:23 AM
#33
Posted 08 November 2008 - 06:24 AM
#34
Posted 08 November 2008 - 07:17 AM
#35
Posted 08 November 2008 - 07:18 AM
#36
Posted 08 November 2008 - 07:33 AM
Glad it works.
Also, try not to press the 'Add Reply' button twice if it's not working ;-)
Patience is a virtue.
#38
Posted 09 November 2008 - 04:38 AM
#39
Posted 09 November 2008 - 04:43 AM
So what you need to do is...
Copy this script into a notepad document with the first line saying
bool HasFairy = true;
bool FairyInit = true;
int FairyMovementCounter;
int FairyMovementMax = 30;
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;
}
}
Save it as a.z filetype.
If you have any other scripts apart from these, be sure to keep them all in the same file.
Then, go to the top of the script, and you'll see a number with a note about what it does.
Go to your combopage, and set up your fairy tiles adjacent in this order:
Up, Down, Left, Right.
Set the noted number at the top of the script to be the Combo ID Number of the Up facing fairy combo.
Then save the file, and go to ZQuest.
Quest->Scripts->Compile ZScript.
Click on 'Import' and find your file, and then press 'OK', and 'Compile'.
That'll take you to the assign compiled script dialogue.
Assign the ffc scripts to a slot each, and then click the 'global' tab.
Assign the script called 'Slot_2' to the second slot, and 'Slot_3' to the third slot.
Then press ok, and that's pretty much all there is to it.
The only other thing is those ffc scripts.
They're pretty self-explanitory.
If you want to get rid of the fairy for a few screens (say, for a cutscene or summat), put the 'RemoveFairy' script on the screen. When you want to bring it back, put the 'ReturnFairy' script.
#40
Posted 10 November 2008 - 10:38 PM
#41
Posted 10 November 2008 - 11:24 PM
#42
Posted 11 November 2008 - 10:06 PM
#43
Posted 12 November 2008 - 04:22 AM
#44
Posted 12 November 2008 - 04:03 PM
As it is now, you start with the fairy. If you don't want this to occur, just change the line "bool HasFairy=true;" at the top of the script to "bool HasFairy=false;". Then just use the ReturnFairy script to give Link the fairy for the first time, and everything else will be the same.
Sounds simple enough. Thanks!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users