Jump to content

Photo

Message Script

FFC

  • This topic is locked This topic is locked
21 replies to this topic

#1 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 28 May 2013 - 03:29 AM

Message Script by Hoff123

 

 

Description

 

A script by "Hoff123" to show a message(string) on the screen.
 
Includes multiple ways to display a message:
Normal, delay, no return, switch string, toggle switch string, and if you have a certain item or not
 
Code
 
//A script by "Hoff123" to show a message(string) on the screen
//Includes multiple ways to display a message
//Normal, delay, no return, switch string, toggle switch string, and if you have a certain item or not
 
//D0: The string you want to use. If all you want is to show a simple message, leave the other arguments as is
//    If you're using D6, this will be the string shown if you don't have a certain item
//D1: How long until the message is showed. 60 = 1 second. If you don't want any delay, leave this as is
//D2: If you want the message to be showed only the first time you enter the screen, set this to 1
//    If you're using D6, this will be the string shown if you do have a certain item
//D3: If you want to switch to another string when you enter the screen a second time
//    It will then show the second string every time you visit that screen, unless...
//D4: If you want to toggle between the first and second string every time you enter the screen, set this to 1
//D5: The Screen->D[] variable you want to use for either D2 or D3/D4
//    If you have no idea what that means, just leave it as is
//D6: If you want to show a string depending on if you have an item or not, set this to the ID of the item
//    This one doesn't require any Screen->D variable(s) and just checks if you actually have an item or not in your inventory
 
//Note that for obvious reasons you can't use both D2 and D3/D4 in the same screen
//But you can mix them with delay. E.g "delay + no return" and "delay + switch string" 
//But note that there will always be a delay when you enter the screen if you use it

//D6 uses string and string2 to show a message depending on if you have an item or not
//and can't be mixed with any of the other ways, except for delay which works with everything

//You are meant to use one instance(one FFC) of this script per screen
//If you try to use multiple instances(multiple FFC's) on the same screen
//it will most likely cause some troubles
 
ffc script Hoffs_Message_Script
{
    void run(int string, int delay, int no_return, int string2, int toggle, int screen_var, int item_id)
    {
	//This variable is used to check if you have entered the screen before
	int screen_check = 1;
		
	//If you have chosen to use a delay(more then 0)
	if (delay > 0)
	{
            //Wait for "delay" amount of frames. 60 frames = 1 second
	    Waitframes(delay);
	}
		
	//If you want to show a string depending on if you have a certain item or not
	if ((item_id > 0))
	{
	    //If you do not have a certain item
	    if (!Link->Item[item_id])
	    {
		//Show the first string on the screen
		Screen->Message(string);
	    }
		
	    //If you do have that item
	    else if(Link->Item[item_id])
	    {
		//Show the second string on the screen
		Screen->Message(string2);
	    }
	}
		
	else
	{
	    //This runs the first time you enter the screen
	    if (Screen->D[screen_var] != screen_check)
	    {
		//Show the first string on the screen
		Screen->Message(string);
			
		//If you have chosen to use a second string
		if (string2 > 0)
		{
		    //Set Screen->D[screen_var] to be equal to screen_check(1)
		    Screen->D[screen_var] = screen_check;
		}   
	    }
	    
	    //This runs if you have chosen to use a second string,
	    //and you have already visited the screen once before
	    else
	    {
		//Show the second string on the screen
		Screen->Message(string2);
			
		//If you want to toggle between string1 and string2 every time you enter the screen
		if (toggle > 0)
		{
		    //Now Zelda Classic will think that you have never visited the screen before :)
		    //(Seriously, this just changes the Screen->D[screen_var] variable to the default value)
		    Screen->D[screen_var] = 0;
		}
	    }
		
	    //This only runs if you have set D2(no_return) to 1 or more
	    if (no_return > 0)
	    {
		//Set Screen->D[screen_var] to be equal to screen_check(1)
		Screen->D[screen_var] = screen_check;
	    }
	}
    }
}

 

 

Setup
 
Just create a new FFC(freeform combo), and change the combo to someone that is not the default transparent one(preferably the one right next to it which is also transparent). Then choose a script for it(Hoffs_Message_Script), and then go to Arguments and enter whatever you want.
 
D0: The string you want to use. If all you want is to show a simple message, leave the other arguments as is

       If you're using D6, this will be the string shown if you don't have a certain item
D1: How long until the message is showed. 60 = 1 second. If you don't want any delay, leave this as is
D2: If you want the message to be showed only the first time you enter the screen, set this to 1
       If you're using D6, this will be the string shown if you do have a certain item
D3: If you want to switch to another string when you enter the screen a second time
       It will then show the second string every time you visit that screen, unless...
D4: If you want to toggle between the first and second string every time you enter the screen, set this to 1
D5: The Screen->D[] variable you want to use for either D2 or D3/D4
       If you have no idea what that means, just leave it as is
D6: If you want to show a string depending on if you have an item or not, set this to the ID of the item
      This one doesn't require any Screen->D variable(s) and just checks if you actually have an item or not in your inventory

Note that for obvious reasons you can't use both D2 and D3/D4 in the same screen
But you can mix them with delay. E.g "delay + no return" and "delay + switch string"
But note that there will always be a delay when you enter the screen if you use it

D6 uses string and string2 to show a message depending on if you have an item or not
and can't be mixed with any of the other ways, except for delay which works with everything

You are meant to use one instance(one FFC) of this script per screen
If you try to use multiple instances(multiple FFC's) on the same screen
it will most likely cause some troubles

 

 

 

Updates

17/09/2013: I added a way to "toggle" between the 2 strings when using switch string. I also edited the code and comments a little.

                    Watch the new Youtube video to see it all in action.

 

01/10/2013: I added a way to show a different string depending on if you have a certain item or not.

 


Edited by Hoff123, 22 April 2014 - 11:50 AM.


#2 David

David

  • Administrators
  • Real Name:David
  • Gender:Male

Posted 12 September 2013 - 02:29 PM

This hasn't been posted to for a while, but I really like the script! It looks cool! :D


  • Hoff123 likes this

#3 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 12 September 2013 - 02:36 PM

This hasn't been posted to for a while, but I really like the script! It looks cool! :D

Wohoo a comment! Thank you, and I hope the script works fine for you(if you're gonna use it) :).



#4 David

David

  • Administrators
  • Real Name:David
  • Gender:Male

Posted 12 September 2013 - 02:45 PM

Wohoo a comment! Thank you, and I hope the script works fine for you(if you're gonna use it) :).

I probably will use it for like when NPC talk and such; they can have delays which I thought was really cool! :D Thanks for the script too! :D


  • Hoff123 likes this

#5 Magi_Hero

Magi_Hero

    .parakeet

  • Members
  • Real Name:Tim
  • Gender:Male
  • Location:NJ

Posted 12 September 2013 - 03:06 PM

This is a neat little script.

#6 David

David

  • Administrators
  • Real Name:David
  • Gender:Male

Posted 12 September 2013 - 04:03 PM

It's strange, but how did the script get ignored for so long (since May)? I saw it because I saw Hoff on it while looking at the online list. It looked interesting, and it was interesting because this is a really nice script, if I do say so myself! :D


Edited by DaviAwesome, 12 September 2013 - 04:03 PM.

  • Hoff123 likes this

#7 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 12 September 2013 - 04:24 PM

It's strange, but how did the script get ignored for so long (since May)? I saw it because I saw Hoff on it while looking at the online list. It looked interesting, and it was interesting because this is a really nice script, if I do say so myself! :D

Well, it does have over 200 views. I guess no one really wanted to comment on it...



#8 David

David

  • Administrators
  • Real Name:David
  • Gender:Male

Posted 12 September 2013 - 05:02 PM

Well, it does have over 200 views. I guess no one really wanted to comment on it...

Who knows, but hopefully more people will see it now! ;)



#9 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Gender:Male
  • Location:USA

Posted 12 September 2013 - 06:06 PM

Is the "no return" option make string only play once?



#10 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 12 September 2013 - 10:59 PM

Is the "no return" option make string only play once?

Yes, that's the point of it :).



#11 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 17 September 2013 - 09:28 AM

I've updated the script a little. Read the first post and watch the new Youtube video :).



#12 David

David

  • Administrators
  • Real Name:David
  • Gender:Male

Posted 17 September 2013 - 10:55 AM

Cool! Makes the script better than it already is, even though it was already amazing ;)
  • Hoff123 likes this

#13 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 17 September 2013 - 10:58 AM

Cool! Makes the script better than it already is, even though it was already amazing ;)

Thank you.

 

I was also gonna make it so that you could have more then 2 strings when "message switching"(lol), but it turned out it was way too difficult and made the script look terrible lol.


  • David likes this

#14 David

David

  • Administrators
  • Real Name:David
  • Gender:Male

Posted 30 September 2013 - 08:03 PM

Have you done anything new with this? Still a great script :)

#15 Hoff123

Hoff123

    The Hoff :)

  • Members
  • Gender:Unspecified
  • Location:Sweden

Posted 30 September 2013 - 11:04 PM

Have you done anything new with this? Still a great script :)

No, but I can't come up with anything to add... :).

 

I do use it a lot in my quest I'm making. I'm even using that latest "switch string toggle" thing.

 

 

EDIT: LOL! So as I was working on my quest, I found yet another thing I could add. Now you can show a different message depending on if you have an item or not :).


Edited by Hoff123, 01 October 2013 - 10:26 AM.

  • David likes this



Also tagged with one or more of these keywords: FFC

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users