Jump to content

Photo

Script Request: Item Activated Switch


  • Please log in to reply
2 replies to this topic

#1 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 09 May 2019 - 06:02 AM

I am requesting a combo that switches to the next combo beside it (similar to bushes and hammer pegs and what not) based on if I am carrying a certain item. The item I want to make is the Jewel of Open based off SotN, but I want the item to put down all particular barriers upon purchase. 

 

Details:

  • ZC 2.50.2
  • There are at least 4 or 5 screens that has barriers that block access to other areas if you don't have the Jewel of Open. 
  • If you have any other questions, please ask. 
  • In case anybody is wondering, I've added script request to the title of this topic mainly so people can tell what it is by looking at the forum sidebar.


#2 ywkls

ywkls

    Master

  • Members

Posted 09 May 2019 - 03:46 PM

Here you go.

//D0- Item that triggers this secret.
//D1- Placed flag on combo that is affected by item.

ffc script Item_Secret{
	void run(int item_id,int flag){
		while(!Link->Item[item_id])
			Waitframe();
		for(int i=0;i<=175;i++){
			if(Screen->ComboF[i]==flag)
				Screen->ComboD[i]++;
                        //Combo Id version
                        //if(Screen->ComboD[i]==flag)
                              //Screen->ComboD[i]++;
		}
	}
}

Be sure to set it to run the script at Screen Init to keep from walking into walls or stuff.

Also, be sure that the flag you select isn't being used by anything else on that screen.

I chose a flag rather than a combo number, since that's more versatile in my opinion.

The commented out version is for using a specific combo number, if that's what you prefer.



#3 TheLegend_njf

TheLegend_njf

    Deified

  • Members
  • Real Name:Grant

Posted 16 May 2019 - 12:05 PM

This one seems to work great for what I need! Thank you! I'll message here again if I run into any problems. 


  • ywkls likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users