Door that opens if you have 8 specific items.
Started by
Alestance
, Mar 12 2009 02:40 PM
7 replies to this topic
#1
Posted 12 March 2009 - 02:40 PM
Basically, I want a secret to occur if you have 8 specific items. This script is only required once, so the items can be constants.
This is something I want for Exploration, kind of like a hidden quest if you find the 8 supar sekret items. The items are not triforce pieces, some are weapons, some are equipment, some is knowledge(attack scrolls) but its nothing to do with the triforce(and there is no real goal item in the game anyway.)
This is something I want for Exploration, kind of like a hidden quest if you find the 8 supar sekret items. The items are not triforce pieces, some are weapons, some are equipment, some is knowledge(attack scrolls) but its nothing to do with the triforce(and there is no real goal item in the game anyway.)
#2
Posted 12 March 2009 - 03:41 PM
CODE
import "std.zh"
const int ITEM1 = 0;
const int ITEM2 = 0;
const int ITEM3 = 0;
const int ITEM4 = 0;
const int ITEM5 = 0;
const int ITEM6 = 0;
const int ITEM7 = 0;
const int ITEM8 = 0;
bool EVENT_8ITEMS
{
if(Link->Item[ITEM1] && Link->Item[ITEM2] && Link->Item[ITEM3] && Link->Item[ITEM4] && Link->Item[ITEM5] && Link->Item[ITEM6] && Link->Item[ITEM7] && Link->Item[ITEM8])
return true;
else
return false;
}
//D0: map
//D1: screen
//D2: the flag you want to enable
ffc script 8ITEMS_SECRET
{
void run(int map, int screen, int flag)
{
while(true)
{
if(EVENT_8ITEMS)
Game->SetScreenState(map, screen, flag, true);
Waitframe();
}
}
}
Tell me if it works.
Edited by lucas92, 12 March 2009 - 03:42 PM.
#3
Posted 12 March 2009 - 03:45 PM
Alright, give me about 20 minutes and I'll test it.
EDIT: Didn't compile
EDIT: Didn't compile
Edited by Alestance, 12 March 2009 - 03:56 PM.
#4
Posted 12 March 2009 - 04:09 PM
You need to put '()' after the declaration and usage of your bool.
It also might be a bit tidier to include it inside the script after void run aswell, but that's not essential.
Got to have a space to declare input variables even if you don't want to use any.
And if I was going to tidy it up, I'd change the boolean so that it didn't use an if, and used 'while(boolean) Waitframe(), screen->state[secretes] = true' rather than how you did it, but I'm just picking at straws here really 'cause it'll work fine =P
It also might be a bit tidier to include it inside the script after void run aswell, but that's not essential.
Got to have a space to declare input variables even if you don't want to use any.
And if I was going to tidy it up, I'd change the boolean so that it didn't use an if, and used 'while(boolean) Waitframe(), screen->state[secretes] = true' rather than how you did it, but I'm just picking at straws here really 'cause it'll work fine =P
#5
Posted 12 March 2009 - 04:20 PM
Ok, I'll try and get this to work now. Thanks.
#6
Posted 12 March 2009 - 04:26 PM
Ah ok. Thanks for the tips.
#7
Posted 12 March 2009 - 04:47 PM
No problem =)
#8
Posted 12 March 2009 - 06:28 PM
I have this, pretty much does what you want. I'm pretty sure Joe made it, so credit him and not me.
Set the Item IDs in the constants and slap an FFC on the tiles you want to change when you have the 8 items. D0 is the combo it changes to. Something like that.
CODE
const int Triforce1 = 145; //set the Item ID values of your 8 custom triforce piece items here
const int Triforce2 = 146;
const int Triforce3 = 147;
const int Triforce4 = 148;
const int Triforce5 = 149;
const int Triforce6 = 150;
const int Triforce7 = 151;
const int Triforce8 = 152;
ffc script Level9Entrance{
void run(int change){
while(!Link->Item[Triforce1] || !Link->Item[Triforce2] || !Link->Item[Triforce3] || !Link->Item[Triforce4] || !Link->Item[Triforce5] || !Link->Item[Triforce6] || !Link->Item[Triforce7] || !Link->Item[Triforce8]) Waitframe();
Screen->ComboD[ComboAt(this->X,this->Y)] = change;
}
}
const int Triforce2 = 146;
const int Triforce3 = 147;
const int Triforce4 = 148;
const int Triforce5 = 149;
const int Triforce6 = 150;
const int Triforce7 = 151;
const int Triforce8 = 152;
ffc script Level9Entrance{
void run(int change){
while(!Link->Item[Triforce1] || !Link->Item[Triforce2] || !Link->Item[Triforce3] || !Link->Item[Triforce4] || !Link->Item[Triforce5] || !Link->Item[Triforce6] || !Link->Item[Triforce7] || !Link->Item[Triforce8]) Waitframe();
Screen->ComboD[ComboAt(this->X,this->Y)] = change;
}
}
Set the Item IDs in the constants and slap an FFC on the tiles you want to change when you have the 8 items. D0 is the combo it changes to. Something like that.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users