Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Very Simple Request.

11 replies · 3,128 views · Started 08 June 2007

In the quest I'm working on, you collect three Spiritual Stones instead of a triforce.

User posted image

User posted image

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.

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

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.

ShadowMancer wrote: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.

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 🙄

That fixed it. Thanks! 😃 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!

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.

Amaster42 wrote: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.

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.

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.

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.