Fairy Script "L" additions
#1
Posted 06 June 2011 - 04:59 PM
Thanks,
~Sepulcher
bump, cause i need this for my demo that i hope to finish in a few weeks.
#2
Posted 06 June 2011 - 05:22 PM
void run(int message, int sfx) {
while(true) {
if(Link->InputL) {
Game->PlaySound(sfx);
Screen->Message(message);
Link->InputL = false;
}
Waitframe();
}
}
}
#3
Posted 06 June 2011 - 05:47 PM
#4
Posted 06 June 2011 - 08:59 PM
#5
Posted 06 June 2011 - 09:36 PM
#7
Posted 07 June 2011 - 03:32 PM
int currentobjective;
ffc script ScreenMessage {
void run(int message, int sfx) {
while(true) {
if(Link->InputL) {
if(sfx == 0) Game->PlaySound(DEFAULT_SFX);
else Game->PlaySound(sfx);
if(message == 0) Screen->Message(currentobjective);
else Screen->Message(message);
Link->InputL = false;
}
Waitframe();
}
}
}
It's similar to before, but now it's possible to have screens where the displayed string changes over time throughout the quest by leaving D0 set to 0 for those screens. It could be useful as the player completes objectives, for instance. This string can be changed from any script, such as this one:
void run(int newobjective) {
currentobjective = newobjective;
}
}
You can also set a default sound effect by changing the value for DEFAULT_SFX and it will play when D1 is set to 0.
#8
Posted 07 June 2011 - 03:47 PM
Edited by Sepulcher, 07 June 2011 - 03:51 PM.
#9
Posted 07 June 2011 - 04:21 PM
As for item detection, how exactly would you like that to work? Would you like the string to change right away when Link picks up an item, or do you have something else in mind?
Edited by Colossal, 07 June 2011 - 04:22 PM.
#10
Posted 07 June 2011 - 04:24 PM
#11
Posted 07 June 2011 - 05:15 PM
int defaultsfx;
ffc script ScreenMessage {
void run(int message, int sfx) {
while(true) {
if(Link->InputL) {
if(sfx == 0) Game->PlaySound(defaultsfx);
else Game->PlaySound(sfx);
if(message == 0) Screen->Message(currentobjective);
else Screen->Message(message);
Link->InputL = false;
}
Waitframe();
}
}
}
ffc script SetObjective {
void run(int newobjective, int newsfx) {
currentobjective = newobjective;
if(newsfx > 0) defaultsfx = newsfx;
}
}
const int SETOBJECTIVEITEM_D = 7;
ffc script SetObjectiveItem {
void run(int newobjective, int newsfx, int screenitem) {
if(Screen->D[SETOBJECTIVEITEM_D] == 1) Quit();
while(true) {
if(Link->Item[screenitem]) {
currentobjective = newobjective;
Screen->D[SETOBJECTIVEITEM_D] = 1;
if(newsfx > 0) defaultsfx = newsfx;
Quit();
}
Waitframe();
}
}
}
ScreenMessage is unchanged from before, if D0/D1 are set to 0, the current objective/sfx are used.
For SetObjective and SetObjectiveItem, D0 is the next string, D1 is the next sfx (if set to 0, sfx will not change), and, for SetObjectiveItem, D2 is the item ID.
A FFC using SetObjectiveItem can be placed on the screen with the item to get the string to change when Link picks up the item. The SETOBJECTIVEITEM_D constant is the screen-specific D variable to use. I left it at 7, which will be ok unless any other scripts on that screen are using that D variable.
#12
Posted 07 June 2011 - 06:06 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users