Jump to content

Photo

Where to adding earthquake


  • Please log in to reply
21 replies to this topic

#1 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 16 April 2017 - 02:44 PM

Hi i have a question. 
On certain games they got the earthquake secrets effects with the specific sound

but where i shall put the Screen->Quake(30); ? and where i have to open the script file for that ? 


Edited by Cedric, 16 April 2017 - 02:44 PM.


#2 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 16 April 2017 - 03:07 PM

Hi i have a question. 
On certain games they got the earthquake secrets effects with the specific sound

but where i shall put the Screen->Quake(30); ? and where i have to open the script file for that ? 

In what kind of script do you want to use it?



#3 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 16 April 2017 - 03:10 PM

Just place that line in the running part of the script. You can edit the number to change how long the screen will shake. As for the sound effect, you have to add another script line to play your wav : Game->PlaySound(10); (if your sound effect is number 10 in the ZQ effects list, for example)


  • judasrising likes this

#4 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 16 April 2017 - 03:24 PM

Like this way

 

item script KillEnemiesQuake
{
    void run (int sfx)
    {
        Screen-> Quake = 120;
        Game-> PlaySound(sfx);
Link->Jump = 1;
    }
}

  • ShadowTiger likes this

#5 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 16 April 2017 - 03:42 PM

alright thanks 
That works however how i could active this one when i hit a secret trigger or beat all enemys ? 


Edited by Cedric, 16 April 2017 - 03:53 PM.


#6 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 16 April 2017 - 05:34 PM

//Trigger on secrets
if(Screen->State[ST_SECRET] == true)
{
	Screen->Quake = 30;
	Game->PlaySound(sfx);
}

//trigger on all enemies defeated
if(Screen->NumNPCs() <= 0)
{
	Screen->Quake = 30;
	Game->PlaySound(sfx);
}


#7 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 16 April 2017 - 05:52 PM

Like this ? 

item script KillEnemiesQuake
{
    void run (int sfx)
    {
//Trigger on secrets
if(Screen->State[ST_SECRET] == true)
{
    Screen->Quake = 30;
    Game->PlaySound(sfx);
}

//trigger on all enemies defeated
if(Screen->NumNPCs() <= 0)
{
    Screen->Quake = 30;
        Game-> PlaySound(sfx);
Link->Jump = 1;
    }
}



#8 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 16 April 2017 - 05:54 PM

 

Like this ? 

item script KillEnemiesQuake
{
    void run (int sfx)
    {
//Trigger on secrets
if(Screen->State[ST_SECRET] == true)
{
    Screen->Quake = 30;
    Game->PlaySound(sfx);
}

//trigger on all enemies defeated
if(Screen->NumNPCs() <= 0)
{
    Screen->Quake = 30;
        Game-> PlaySound(sfx);
Link->Jump = 1;
    }
}

Yes that would work D0 is the number of the soundfx you want to use.

 

edit: you could rewrite that even further if you like.


Edited by judasrising, 16 April 2017 - 05:57 PM.


#9 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 16 April 2017 - 05:58 PM

I compile that and that not works... 



#10 judasrising

judasrising

    I play guitar

  • Members
  • Location:Sweden but born in Finland

Posted 16 April 2017 - 06:00 PM

I compile that and that not works... 

What is the error?



#11 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 16 April 2017 - 06:01 PM

Added the missing brace and streamed lined the if block. (Save the frames, always)

 

Note that it'll trigger if all NPCs are dead OR secrets are triggered. Also why is this a item script, doesn't seem like a item type script to me? Item scripts only run 1 frame when the item is used or picked up.

item script KillEnemiesQuake
{
    void run (int sfx)
    {
		//Trigger on secrets
		if(Screen->State[ST_SECRET] == true)
		{
			Screen->Quake = 30;
			Game->PlaySound(sfx);
			Link->Jump = 1;
		}

		//trigger on all enemies defeated
		else if(Screen->NumNPCs() <= 0)
		{
			Screen->Quake = 30;
			Game-> PlaySound(sfx);
			Link->Jump = 1;
		}
	}
}


#12 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 16 April 2017 - 06:06 PM

alright thanks



#13 Sans

Sans

    Hey kid wanna buy hot dogs ?

  • Members
  • Location:Judgement Hall

Posted 16 April 2017 - 08:04 PM

huh.. can you show me the setups with the screenshot ? 



#14 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 17 April 2017 - 11:09 AM

 

Like this ? 

item script KillEnemiesQuake
{
    void run (int sfx)
    {
//Trigger on secrets
if(Screen->State[ST_SECRET] == true)
{
    Screen->Quake = 30;
    Game->PlaySound(sfx);
}

//trigger on all enemies defeated
if(Screen->NumNPCs() <= 0)
{
    Screen->Quake = 30;
        Game-> PlaySound(sfx);
Link->Jump = 1;
    }
}

 

Missing bracket aside, this doesn't work because it's an item script. It should be "ffc script" and not "item script", and the ffc needs to be placed on the screen where you want this to happen.



#15 cavthena

cavthena

    Apprentice

  • Members
  • Real Name:Clayton
  • Location:I wish I knew

Posted 17 April 2017 - 11:54 AM

Well it works. Probably not as intended however.
If there're no enemies on screen or secrets have activated and you use/pickup the item then it'll trigger.

But I agree that this should be a ffc instead. It does need a few modifications to work correctly as an ffc however. A while() and quit() need to be added.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users