Jump to content

Photo

SFX on entry/on command script


  • Please log in to reply
15 replies to this topic

#1 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 20 April 2018 - 10:04 PM

Hey guys. I'm looking for a script where an SFX plays on entry, as well as others I can define, and when if possible. 

 

For example, for a cutscene I'm making needs two people shouting at the same time (two sfx's) and the entry one.

 

Thanks a bunch!



#2 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 20 April 2018 - 10:29 PM

ffc script PlaySound{
	void run(int sfx, int delayFrames){
		Waitframes(delayFrames);
		Game->PlaySound(sfx);
	}
}

D0: Sound to play

D1: Frames to wait before playing

 

If you want to have two sounds play at once, you could have two copies of the ffc, or you could combine the sounds in a program like Audacity.


Edited by Moosh, 20 April 2018 - 11:39 PM.

  • Jared likes this

#3 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 20 April 2018 - 11:10 PM

This is what Ive used for all of my cutscenes, as well as a disable movement script, which I could provide if you need.

 

Im only going by Moosh's description of his script, but unlike Moosh's, this can be put on a screen several times, for however many sfx are needed (no script duplicates). Just put an FFC with this script and use D0 for the SFX value.However, his has the option to wait a certain amount of time before playing. It depends on what you want.

ffc script playSFX
{
  void run(int sfx)
  {
    Game->PlaySound(sfx);
  }
}

This script was given to me quite a while ago. Im not 100% sure who gave it to me.

 

That being said, I do highly recommend Audacity for editing sound effects. Its done me a lot of good, anyway. Just thought Id throw my two-cents in.


Edited by Octorockoncrack, 20 April 2018 - 11:14 PM.


#4 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 20 April 2018 - 11:42 PM

Thanks a bunch, guys! And OoC, I'd love the script where you disable movement. Does it disable items/input as well? :)



#5 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 20 April 2018 - 11:42 PM

Im only going by Moosh's description of his script, but unlike Moosh's, this can be put on a screen several times, for however many sfx are needed (no script duplicates).

Welp, this is what I get for rushing things without proofreading. I meant to say put a duplicate of the FFC. They're basically the same script, just mine has a delay so you can play the sound partway through a cutscene screen.



#6 Tabletpillow

Tabletpillow

    Hi

  • Members
  • Real Name:Xavier
  • Location:Oregon

Posted 21 April 2018 - 02:02 AM

Look on the database :^)


  • Jared likes this

#7 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 21 April 2018 - 08:57 AM

Sorry I didnt get back sooner, but here is the NoInput script that I use for my cutscenes. I believe this script was given to me by Avataro.

 

Link wont be able to do anything on a screen that has this FFCscript on it, so there has to be either a timed warp out, or you could use FFC changers to bring an Autowarp combo into the screen. Strings will override the script, meaning A and B can still be used to speed up and skip messages.

 

If you need a more in depth explanation, just let me know. Id be happy to walk you through my method of making cutscenes.

ffc script NoInput {
    void run() {
        while(true) {
            Link->InputR = false;
            Link->InputL = false;
            Link->InputA = false;
            Link->InputB = false;
            Link->InputLeft = false;
            Link->InputRight = false;
            Link->InputUp = false;
            Link->InputDown = false;
            Link->InputStart = false;
            Waitframe();
        }
    }
}

Edited by Octorockoncrack, 21 April 2018 - 08:59 AM.

  • Jared likes this

#8 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 22 April 2018 - 04:05 AM

Sorry I didnt get back sooner, but here is the NoInput script that I use for my cutscenes. I believe this script was given to me by Avataro.
 
Link wont be able to do anything on a screen that has this FFCscript on it, so there has to be either a timed warp out, or you could use FFC changers to bring an Autowarp combo into the screen. Strings will override the script, meaning A and B can still be used to speed up and skip messages.
 
If you need a more in depth explanation, just let me know. Id be happy to walk you through my method of making cutscenes.

ffc script NoInput {
    void run() {
        while(true) {
            Link->InputR = false;
            Link->InputL = false;
            Link->InputA = false;
            Link->InputB = false;
            Link->InputLeft = false;
            Link->InputRight = false;
            Link->InputUp = false;
            Link->InputDown = false;
            Link->InputStart = false;
            Waitframe();
        }
    }
}

That doesn't block Link->Press*, you know.
  • judasrising likes this

#9 Octorockoncrack

Octorockoncrack

    Crystal Warrior

  • Members
  • Real Name:Tyler
  • Location:walking The Path

Posted 22 April 2018 - 07:31 AM

*? When would you ever need to press *?


  • Jared likes this

#10 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 22 April 2018 - 07:49 PM

* as in a stand in for anything, eg. PressA. There's two ZScript commands for any button, Link->Press* and Link->Input*. The NoInput script you're using doesn't block button presses, so you'd still be able to use just about any item that just runs when you press the button (e.g. arrow) and doesn't need you to keep holding it (e.g. hookshot). You'd need to add Link->PressA = false;, Link->PressB = false;, etc to fix it.

#11 Jared

Jared

    Deified

  • Members
  • Real Name:Jared
  • Pronouns:He / Him
  • Location:New Hampshire

Posted 22 April 2018 - 08:05 PM

So how would his script affect the game? So far, I've had no problems. I don't plan on using any other buttons beside L and R either.



#12 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 23 April 2018 - 02:20 PM

Failing to block ->Press* would result in bugs. In addition to what Russ said (using items), the player could repeatedly press a directional button to leave the screen.

The short of it, is that ->Input* only matters one frame after ->Press* is regiatered. If a button is held for more then one frame, then ->Input for that button returns true. Mashing right but not holding it down doesn't r3egister as ->InputRight.

To cover most cases, add:

Link->PressA = false; Link->PressB = false; Link->PressL = false;
Link->PressR = false; Link->PressRight = false; Link->PressUp = false;
Link->PressLeft = false; Link->PressDown = false: Link->PressMap = false;
Link->PressEx1 = false; Link->PressEx2 = false; Link->PressEx3 = false;
Link->PressEx4 = false; Link->PressStart = false;

Link->InputEx1 = false; Link->InputEx2 = false; Link->InputEx3 = false;
Link->InputEx4 = false; Link->InputMap = false; Link->InputStart = false;

  • judasrising likes this

#13 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 24 April 2018 - 08:21 AM

https://cdn.discorda...808/NoInput.qst

 

This test quest only disables all Link->Input's. You still can't move or do anything though. So you guys aren't right about that. xD Maybe it matters for something else though, idk.



#14 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 24 April 2018 - 03:59 PM

I believe Link->Press* only matters for script compatibility. Link->Press* doesn't affect anything in vanilla ZC, but it still gets set if a button has been pressed that frame and other scripts can detect this and do things.


  • Avaro likes this

#15 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 24 April 2018 - 11:35 PM

I believe Link->Press* only matters for script compatibility. Link->Press* doesn't affect anything in vanilla ZC, but it still gets set if a button has been pressed that frame and other scripts can detect this and do things.


Wot?

1. Writing to Link->Press simulates button inputs:
(a). Setting Press true, is the same as if the player manually pressed a button this frame.
(b). Setting ->Press false, disables a button press that happened on the current frame.
2. Pressing a button that was not held on the previous frame, sets ->Press for that button on the current frame.
3. If ->Press was valid on the previous frame for a given button, ->Press for that button becomes false, and ->Input for that button is true.

So, if you fail to set ->Press false, then the player can still press buttons, and things will happen, as normal, for those button presses. Setting ->Input false does not dampen button presses that occur on the same frame.

Further, if you set ->Input false for a button, and it is held down, on the very next frame ZC will register it as a new press of that button.

This can lead to some quite nasty, and unfortunate bugs. Try making an item script that launches an ffc, and have the ffc set ->Input false for the button with the item that launched it, to see what happens.

Spoiler



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users