Jump to content

Photo

Specific Item Trigger


  • Please log in to reply
5 replies to this topic

#1 DietWater

DietWater

    Hyrule Historian

  • Members
  • Real Name:Tristan
  • Gender:Male

Posted 21 February 2021 - 05:37 PM

In my quest I am having the player visit an area, and as soon as they get there they warp to a different location to get an item and return back to that area to progress. In screen data you can disable a timed warp if a secret is enabled, the thing is I have no idea on how to enable a secret/ trigger using the item obtained (The Magic Meter) I'd be cool if I got some help  :)


Edited by DietWater, 21 February 2021 - 05:38 PM.


#2 Moosh

Moosh

    Tiny Little Questmaker

  • Members
  • Gender:Male

Posted 21 February 2021 - 09:10 PM

Pretty simple FFC script. D0 on the FFC specifies which item to check for to trigger the secret.

ffc script ItemSecret{
	void run(int itemID){
		while(!Link->Item[itemID]){
			Waitframe();
		}
		Screen->TriggerSecrets();
		Screen->State[ST_SECRET] = true;
	}
}

But you also said your item in question is a magic container and not an inventory item, so it may require something slightly different:

ffc script MagicSecret{
	void run(){
		while(Link->MaxMP==0){
			Waitframe();
		}
		Screen->TriggerSecrets();
		Screen->State[ST_SECRET] = true;
	}
}

  • DietWater likes this

#3 DietWater

DietWater

    Hyrule Historian

  • Members
  • Real Name:Tristan
  • Gender:Male

Posted 21 February 2021 - 09:25 PM

Hmm, I'm getting syntax errors. Is this script compatible with 2.53? 



#4 Mani Kanina

Mani Kanina

    Rabbits!

  • Members
  • Gender:Female

Posted 21 February 2021 - 10:59 PM

It looks fine to me, did you copy it correctly?

What's the exact error message?

#5 Moosh

Moosh

    Tiny Little Questmaker

  • Members
  • Gender:Male

Posted 21 February 2021 - 11:04 PM

My first guess would be missing std.zh.

 

Edit: Though I suppose that wouldn't give a syntax error exactly. So hmm...You're importing the script from a txt file right? (File extension doesn't matter, but the format does)


Edited by Moosh, 21 February 2021 - 11:06 PM.

  • DietWater likes this

#6 DietWater

DietWater

    Hyrule Historian

  • Members
  • Real Name:Tristan
  • Gender:Male

Posted 21 February 2021 - 11:15 PM

Ah, I know why it was doing that. I had both the .zh file and the .txt file with the same names, so I bet the system was confused or something




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users