Forum,
Looking to modify the "Leave Your Life or Money" screen to the following:
"Leave Your Arrow or Key"
Anybody know how this would be possible? Thanks in advance!
Forum,
Looking to modify the "Leave Your Life or Money" screen to the following:
"Leave Your Arrow or Key"
Anybody know how this would be possible? Thanks in advance!
As far as I know, you cannot modify the built-in room types beyond the catch all in the Screen drop down. You'd have to write this with an FFC script that you attach to an FFC in the room. I'm not quite sure how I'd do it, I'd have to think about it.
Actually, you could get away with this using an item script and two custom items:
1.) Make an item script that removes the Arrow item from Link's array (I won't pseudo-script right now because I'm a little rusty, but I'm sure someone can help with this)
2.) Make an item script that reduces the key counter by one.
3.) Attach these two scripts to two unused item slots in your game. Rename the items "Lose Arrow" and "Lose Key" and give them the same Item Class
4.) Make a shop type with these two items.
5.) Set the room type to the newer version of "Potion or HC" (I think it's called Choose Three) and set the shop type of the room to the one created in step 4.
There's one little setback with this, though... if Link doesn't have the item he can still choose to 'sacrifice' it and bypass the room. I'm not sure how to work around that short of making the game kill Link for such treachery (Buried in the item script, if he picks the item and does not meet the criteria his health is set to 0). Perhaps someone else will have an idea to make it more functional.
I Wrote an FFC script that seems to work. I have to spend some time commenting it so you can set it up and I'll post it later today or tomorrow.
Wow, thanks Flounder! I actually just submitted my first quest to the Forum on Sunday, and I can't wait for it to be published. But no time to rest on my laurels...have to start working on a 2nd quest. Thanks again!!
Ok I think this will work. It works on a test quest I made. Actually let me post a link to that too..
http://1drv.ms/1lxv95c
I'm assuming you know how to set up an FFC script? If not Anyone here can probably help you.
Here is the code:
Hope this will work!PHP Code:
import "std.zh"
ffc script LeaveXorY //This script implements a room that requires Link to leave a specified number of a choice of consumable items to progress.
//For example, you could require Link to choose between leaving a 2 keys or leaving 10 arrows, or some magic or some life, etc.
{ // D0 D1 D2 D3 D4 D5 D6 D7
void run (int CounterX, int CounterY, int Guy, int Msg, int TileX, int TileY, int AmountX, int AmountY)
{ // CounterX and Y are the counters to adjust. Use the CR_ constants in std.zh.
// Guy is the NPC you wish to create for the room. The NPC_ constants 1-9 in std.zh are the built in guys.
//Msg is the string number to display.
//TileX and Y are the tiles to use for the two items. The numbers are from the tile screen.
//AmountX and Y are the amount to adjust the specified counters.
if(Screen->State[ST_SECRET]) //This if section will check to see if the room has already been solved, and if so
{ //it will open the shutters and skip the rest of the script
int i=0;
for(i=0; i<4; i++)
{
if (Screen->Door[i]==D_SHUTTER)
{
Screen->Door[i]=D_OPENSHUTTER;
Game->PlaySound(SFX_SHUTTER);
}
Game->PlaySound(SFX_SECRET);
}
Quit();
}
npc A=Screen->CreateNPC(Guy); // this is where the NPC is created and placed.
A->X=120;
A->Y=64;
npc flame1=Screen->CreateNPC(5); // These lines place flames in the room like in the classic quest.
// if you don't want flames, comment these lines.
npc flame2=Screen->CreateNPC(5);
flame1->X=64;
flame1->Y=64;
flame2->X=176;
flame2->Y=64;
Waitframes(30);
Screen->Message(Msg); //message displayed here
while(!chooseX(CounterX, AmountX)&&!chooseY(CounterY, AmountY)) //This while loop will display the items until one of the functions is true.
{
Screen->FastTile(2, 88, 88, TileX, 8, OP_OPAQUE); //the "8" in these lines is the CSet. you may need to change it.
Screen->FastTile(2, 152, 88, TileY, 8, OP_OPAQUE);
Screen->DrawCharacter(2, 80, 112, FONT_Z1, 1, -1, 0, 0, 45, OP_OPAQUE);
Screen->DrawCharacter(2, 144, 112, FONT_Z1, 1, -1, 0, 0, 45, OP_OPAQUE);
Screen->DrawInteger(2, 88, 112, FONT_Z1, 1, -1, 0, 0, AmountX, 0, OP_OPAQUE);
Screen->DrawInteger(2, 152, 112, FONT_Z1, 1, -1, 0, 0, AmountY, 0, OP_OPAQUE);
Waitframe();
}
A->X=-16; //this section will move the NPCs off screen once the room is solved, and it sets the Secret state to true
A->Y=-16;
flame1->X=-16; //remember to comment out the flame lines if not using flames
flame1->Y=-16;
flame2->X=-16;
flame2->Y=-16;
Screen->State[ST_SECRET]=true;
int i=0;
for(i=0; i<4; i++) //This for loop will open all shutters if they are closed
{
if (Screen->Door[i]==D_SHUTTER)
{
Screen->Door[i]=D_OPENSHUTTER;
Game->PlaySound(SFX_SHUTTER);
}
}
Game->PlaySound(SFX_SECRET);
}
bool chooseX(int CounterX, int AmountX) //These two functions detect which item Link is standing on and adjusts the respective counter.
//If Link doesn't have the required item, nothing happens.
{
if((Link->X>80&&Link->X<96)&&(Link->Y>80&&Link->Y<96))
{
if((Game->Counter[CounterX]-AmountX)<0) {return false;}
else {Game->Counter[CounterX]-=AmountX; return true;}
}
else{return false;}
}
bool chooseY(int CounterY, int AmountY)
{
if((Link->X>144&&Link->X<160)&&(Link->Y>80&&Link->Y<96))
{
if((Game->Counter[CounterY]-AmountY)<0) {return false;}
else {Game->Counter[CounterY]-=AmountY; return true;}
}
else{return false;}
}
}
Last edited by Floundermaj; 07-01-2014 at 09:04 PM.
Perfect - at the moment, I do not know how to work with FFC scripts, but I'll do some research as I'm sure people have posted on that front here in the past. I may shoot you a question in the future, but thanks for going out of your way to look into this and give me a "go by"!
There are currently 1 users browsing this thread. (0 members and 1 guests)