Jump to content

Photo

Special Message script, for videos/cutscenes

2.55 Alpha 83

  • Please log in to reply
35 replies to this topic

#1 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 13 August 2020 - 06:09 PM

I need a ffc script for some special cutscenes.
(or possibly a script that can cooperate with Hoffs_Message_Script)
 

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;
	    }
	}
    }
}

The script should play the message (or call hoffs script) and automaticly switch to the next string (set in the string editor), at the end of each message, after a variable delay (til it reaches a string, set to "Next: none")
...one more REALLY important function.
The script should disable the "messages freeze all screen action" rule.


Edited by Bagu, 08 October 2020 - 09:59 AM.


#2 Mani Kanina

Mani Kanina

    Rabbits!

  • Members

Posted 13 August 2020 - 09:11 PM

You can use the drawstring function instead if you want to avoid that quest rule, you'll have to put the string into code instead, it's more work, but in practice you have much finer control over display method and timing.


  • Twilight Knight and Bagu like this

#3 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 13 August 2020 - 09:20 PM

Yeah, that would be an option.

...but I'm really not a good scripter.
I also would prefer to use this script (with one default timing/delay between strings)
and be able to use the script multiple screens, without modifying/copying
the code or add more and more strings to it


Edited by Bagu, 13 August 2020 - 09:20 PM.


#4 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 14 August 2020 - 06:01 PM

If you're using 2.55, you can just disable a QR via script.


  • Bagu likes this

#5 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 14 August 2020 - 06:43 PM

yeah, I'm using 2.55 Alpha 79
But I'm still not good enough in scripting, to write such a script on my own.



#6 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 15 August 2020 - 01:57 AM

What I thought about (additional to the disable QR "message freeze screen action" function and calling "next" string in editor, without input)
is basicly three variables.

D0 = delay (frames) before playing the first string
D1 = number of (first) string to play
​D2 = delay (frames) before calling each following string


Edited by Bagu, 15 August 2020 - 02:17 AM.


#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 15 August 2020 - 02:37 PM

So, it appears that there's no way to tell when an engine string is done playing, aside from freeze all action un-freezing. So, with freeze all action off, there is no clean way for a script to do what you want using engine strings; meaning you likely need to either:

1. Use Freeze All Action

2. Get into scripted message box stuff, such as 'tango.zh', which is a whole thing.

 

The second may be easier if you use my 'TangoHandler.zh' from the database, which handles a lot of tango's more complex stuff for you, at the cost of shutting out a couple of it's more advanced features.

If you set up my 'TangoHandler.zh' ( here ), then THIS should handle what you need. You do need to fully set up the TangoHandler header, though. Mostly, you need to set up a set of constants to tell it how the message box should look, and how the text should look. With the TangoHandler imported, and the pastebin-linked script added, you should be good to go, I think.


  • Bagu likes this

#8 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 15 August 2020 - 02:42 PM

Thanks! :)
 I  will do my best, to set it up correctly and try it via Tango Handler.
 


Edited by Bagu, 15 August 2020 - 02:43 PM.


#9 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 15 August 2020 - 03:08 PM

The Cutscene Message ffc script seems to be exactly what I was looking for
...I'm gonna set the constants in TangoHandler.zh now (this will surely take some time) and check it out.

I'll post a feedback later.

Thanks, once more!
U R GREAT!


Edited by Bagu, 15 August 2020 - 03:10 PM.


#10 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 21 August 2020 - 07:00 AM

Sorry, that it took me so long, to make the setup.

I was a little buisy during the last days.
So I didn't find the necessary concentration, to modify the Tango_Handler Setup.
...now I finnished the setup, but I have a few problems with rhe Message_Cutscene Script.

First thing ...It only plays the init message string and doesn't call the next, after the variable between delay.

Next is, I need variables for X/Y position of the Message Box, the Message box tiles, Message sound and font.
...cause the script ignores the original string attributes.



#11 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 21 August 2020 - 07:25 AM

Wenn dies zu viele Variablen sind (sieht 1 zu viel aus), könnte ich einige davon über TangoHandler-Konstanten ändern.
Zum Beispiel, ich benutze es nur zwei spezielle Cutscenes, die keine Nachricht Kasten benötigen, weil der Text erscheint bereits
oben leer, schwarzer Hintergrund.


btw...
Header related question...
Should I use the standard "Tango.zh" or the "customTango.zh" from your ZIP folder?

At the moment, I try with "customTango.zh"
But I also use "Classic.zh" and so I changed the relevant line 7 of "Classic.zh".

 

//Classic.zh

//Include Headers
#include "ffcscript.zh"
#include "stdExtra.zh"
#include "ghost.zh"
#include "customTango.zh"

And also the relevant  lines in the global script:
 

"Tango_Start();" to "TangoInit();"
 


Edited by Bagu, 21 August 2020 - 07:48 AM.


#12 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 21 August 2020 - 01:58 PM

So, `customTango.zh` is correct, as is `TangoInit()`.

The variables you want for all that stuff are at the top of `TangoHandler.zh`, fairly blatantly there for you.

As for why it would not be playing the `next` message.... that I have absolutely no clue about, and don't have time right now to debug. I'll take a look when I can.


  • Bagu likes this

#13 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 21 August 2020 - 02:28 PM

Thanks for your help.

Aint it constant's, at the top of TangoHandler?
I can change them.
....but what to do if I want one string (box) to be displayed at x24 y90, and another at x24 y60 in the next screen?
that's why I asked for variables.
I didn't find a changable constant for the font in Tango_Handler.

Or do I have to change this line:

​ #include "tango/font/tango_GUI.zh"

...or any line in the "tango_GUI.zh" file?

Sorry,, maybe I missunderstood something.
 


Edited by Bagu, 21 August 2020 - 02:40 PM.


#14 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 21 August 2020 - 02:49 PM

The font, is much harder to change. TangoHandler is designed to be a cheap-and-easy method of tango, which only handles one style of textbox, at one position. If you want to do more, you'll need to just use regular tango, and set up your own method of making it work. You sacrifice the extra features and styles, to gain simplicity of setup.

 

To change the font, you need to change the font import file, and change a constant in the middle of the setupStyles function. If you change the import, you'd get a compile error pointing you to the constant.

 

To confirm, you have this set on all the strings but the last one, yes?

unknown.png



#15 Bagu

Bagu

    Fandomizer

  • Members
  • Real Name:A.I. Bot Bottomheimer
  • Location:Germany

Posted 21 August 2020 - 03:04 PM

To confirm, you have this set on all the strings but the last one, yes?

unknown.png

...no, sorry. I thought the script would call the next string that is set in the string Editor.
I left it as "next in list"

So if it has to be "none" in the string editor, where should I confirm the set of strings?

the first screen (using Message_Cutscene script) should play string 37 (=init string), 38, 39, 40, 41, 42, 47, 48 49 (end)

the second screen shoald play 44 (=init string), 45, 46, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61 (end)

This list of string numbers is so messy, because the text was a bit shorter first, but I added a few lines by using "add new here".
...it's for my intro lore "video".




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users