PDA

View Full Version : Very Simple Request.



bigjoe
06-08-2007, 06:40 PM
In the quest I'm working on, you collect three Spiritual Stones instead of a triforce.

http://bigjoesquests.googlepages.com/zelda003.gif

http://bigjoesquests.googlepages.com/zelda001.gif

What I would like, is a script that pit warps you to another screen if you happen to have all three of them. I dont know if this will help, but the item names were originally z200, z201, and z202. Their item families are the same number.

I've tried to script it myself, but nothing I've done has the desired effect.

ShadowMancer
06-08-2007, 07:17 PM
ffc script custom_warp
{
void run()
{
while(true)
{
if (Link->Item[200] && Link->Item[201] && Link->Item[202])
{
Link->PitWarp(dmap,screen);
}
Waitframe();
}
}
}

You would have to put the ffc on the screen you want this to happen at.
this is untested just off the top of my head, but give it a try and let me know if it works for you

C-Dawg
06-08-2007, 07:30 PM
Hah, someone else asked for exactly this script in Z.Suggestions yesterday.

Yea, checking link's inventory is probably the easiest thing to script. You'd probably want to add a bit to that script so it only executes when Link steps onto the FFC, though. So the warp can be placed. As is, it will activate as soon as he goes onto the screen.

bigjoe
06-08-2007, 07:49 PM
ffc script custom_warp
{
void run()
{
while(true)
{
if (Link->Item[200] && Link->Item[201] && Link->Item[202])
{

Link->PitWarp(dmap,screen)
}
}
}
}

You would have to put the ffc on the screen you want this to happen at.
this is untested just off the top of my head, but give it a try and let me know if it works for you

All that seems to do is freeze the game :( even with the correction of adding a semicolon after Link->PitWarp()

EDIT: Does the same thing whether or not you have the items.

Ah, well, thanks for trying.

ShadowMancer
06-08-2007, 09:02 PM
ah crap. I forgot you need to put a Waitframe(); in the while loop somewere otherwise as you said it will just freeze the game. sorry :rolleyes:

bigjoe
06-08-2007, 09:07 PM
That fixed it. Thanks! :D With a system like this in place, a person could easily replace triforce peices as their main collectible, and potentially have as many collectibles as they wish!

The_Amaster
06-08-2007, 09:52 PM
Sweet. I can use this. This should be moved into the Showcase. I mean, it's simple, but when 2.5 comes, it's the kind of utility script that everyones going to use.

C-Dawg
06-10-2007, 02:41 AM
Sweet. I can use this. This should be moved into the Showcase. I mean, it's simple, but when 2.5 comes, it's the kind of utility script that everyones going to use.

Well, before you move it to showcase, change it so that the player can specify the items needed to trigger the warp in the FFC Data fields at least.

The_Amaster
06-10-2007, 10:37 AM
Isn't that what:

if (Link->Item[200] && Link->Item[201] && Link->Item[202])
is for?

C-Dawg
06-10-2007, 01:06 PM
What? No. That snippet hard-codes certain item values into the script. Better to do this:

void run (int item1; int item2; int item3){

if(Link->Item[item1} && Link->Item[item2} && Link->Item[item3]){

stuff

}

}

Plus, if you're activating regardless of link's location, why use Waitframe? It'll execute as soon as he's on the screen anyway.

bigjoe
06-10-2007, 04:20 PM
What? No. That snippet hard-codes certain item values into the script.Better to do this:

Well, for some intents(including mine), that would work, but what if you have more than 10 collectibles? There are only 10 arguments in an FFC.


Plus, if you're activating regardless of link's location, why use Waitframe? It'll execute as soon as he's on the screen anyway.

Without Waitframe it seems to freeze the game up.

C-Dawg
06-13-2007, 12:06 PM
1. Yes, you will need to hard-code more than 7 collectables. Unless you want to do some fancy stuff with the way you encode the collectables in the Data fields (that is, D0, D2, D3, ... D7 could be just binary digits encoding what combination of items you have) but that starts to get pretty complicated.

2. No, Waitframe is not needed. Waitframe is only needed in a While(true) loop. Without it, the game keeps executing the loop without ever waiting for a frame for other scripts and the game to execute, so it freezes. If you don't have a loop, you don't need waitframe. Theres no need for a loop if you want the FFC to execute immediately when you come onto the screen.