Jump to content

Photo

Scripts wanted for my Quest

Quest; Script

  • Please log in to reply
35 replies to this topic

#1 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 02 March 2015 - 11:53 AM

Hello Guys.

 

I need some scripts in my own Quest Zephyrian Conquest.

 

I'm too busy to learn scripting and I s**k at it because of the requirement of high level maths knowledge.

 

Can you post one script that does this:

  • When a specific Enemy is on the screen it should play the MIDI or enhanced music (as seen in Flow of Time:Remastered).
  • After it has been defeated it has to switch back to MIDI or another enhanced music.
  • This should work on both non-ghosted and ghosted enemies.

I hope you understand that. Thank you for your regards.

 

Sparkster

 

 



#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 02 March 2015 - 11:57 AM

Hey :D
I've found this script in the database: http://www.purezc.ne...e=scripts&id=23
It does what you want, except it doesn't check for a specific enemy, but any enemy on a specific Screen. Does that work for you?

#3 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 02 March 2015 - 01:47 PM

I don't think this would help. What kind of NPC do you mean with?

 

I mean in Flow of Time:Remastered where was enhanced music when a boss or mid-boss was in room. And it switched to MIDI again after you defeated him



#4 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 02 March 2015 - 03:36 PM

Yes the script is used for boss music in boss rooms. ;)

#5 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 02 March 2015 - 05:50 PM

requirement of high level maths knowledge.

False! If you can:

  • Add
  • Subtract
  • Multiply
  • Divide
  • Read
  • Write
  • Learn

You can script. Higher level math can be used in scripting, but it is not a requirement. When I don't understand how do do something, I typically just find a function that does it for me. :P

 

That said, if you're just too busy that's understandable.

 

For the script you requested, the one Avataro linked will work fine. Enemies are called NPCs in ZScript. Of course it won't work for enhanced music because enhanced music uses a file name, not a number. In order to have a script play enhanced music, you'd need to modify the script itself.



#6 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 03 March 2015 - 02:17 AM

Ahh Ok.
Obderhodes Flow of Time Remastered has such a script that plays enhanced music for an Npc.

#7 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 03 March 2015 - 05:27 AM

I found something that a member called Orithan wanted:

Enhanced music set by script:

 

Is a combination of this chunk of code possible?

Spoiler

If you say that I have to do this by myself, wish me good luck to do it. :D



#8 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 03 March 2015 - 11:15 AM

Triple post I know but I don't want to wait soooo long for an answer.

I tried it by myself with this code.

int filename[] = "Boss Battle 1.ogg";
bool PlayEnhancedMusic(int filename);

ffc script EnemyMusic
{
	void run(int filename, int nmidi);
	{
		while(true)
		{
			if (Screen->NumNPCs() != 0)
			{
				Game->PlayEnhancedMusic(int filename);
			}
			else
			{
				Game->PlayMIDI(nmidi);
			}
			Waitframe();
		}
	}
}

Well it doesn't work... this error cames out.

 

Pass 1: Parsing
line 2: syntax error, unexpected SEMICOLON, expecting LBRACE, on token ;
Fatal Error P00: Can't open or parse input file!

 

Can you help me?



#9 justin

justin

    Adept

  • Members

Posted 03 March 2015 - 11:42 AM

you have a whole bunch of errors there, the compiler is just catching the first one.

 

try this, untested.  it takes no arguments.  it will just play one enhanced music file that is hardcoded.  it'll play it if there are enemies on screen.  if there are no longer enemies on screen it'll play the midi that would normally play on that dmap.

 

ffc script EnemyMusic
{
    void run();
    {
        int filename[] = "Boss Battle 1.ogg";
        int cmidi = Game->GetMIDI();
 
        while(true)
        {            
             if (Screen->NumNPCs() != 0)
            {
                Game->PlayEnhancedMusic(filename,0);
            }
            else
            {
                Game->PlayMIDI(cmidi);
                Quit();
            }
            Waitframe();
        }
    }
}


#10 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 03 March 2015 - 12:00 PM

Using the std.zh header on top I tested it and it won't compile. The error is:

 

Pass 1: Parsing
line 5: syntax error, unexpected SEMICOLON, expecting LBRACE, on token ;
Fatal Error P00: Can't open or parse input file!

 

EDIT: Compiled successfully by taking out the semicolon on the void run but the Enhanced music doesn't play when enemies are on the screen it just plays the DMAP midi.


Edited by Sparkster, 03 March 2015 - 12:19 PM.


#11 justin

justin

    Adept

  • Members

Posted 03 March 2015 - 12:22 PM

Is your music filename exactly the same as in the script? Is it in the same directory as zc?

#12 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 03 March 2015 - 12:26 PM

Is your music filename exactly the same as in the script? Is it in the same directory as zc?

Yes. It is.



#13 justin

justin

    Adept

  • Members

Posted 03 March 2015 - 12:36 PM

Oh, right after the void run(){ add line
Waitframes(5);

Edited by justin, 03 March 2015 - 12:37 PM.


#14 Sparkster

Sparkster

    The Sparking Spark of ZC

  • Members

Posted 03 March 2015 - 12:40 PM

Ok. Now it's a bit better but...

 

I can't hear the enhanced music while NPCs are on it. Only switching to the DMAP MIDI works fine.



#15 justin

justin

    Adept

  • Members

Posted 03 March 2015 - 05:47 PM

ok, let's try this...

 

ffc script EnemyMusic
{
    void run()
    {
        Waitframes(5);
        int filename[] = "Boss Battle 1.ogg";
        int cmidi = Game->GetMIDI();
        Game->PlayEnhancedMusic(filename,0);
        while(Screen->NumNPCs() != 0) Waitframe();
        Game->PlayMIDI(cmidi);
    }
}




Also tagged with one or more of these keywords: Quest;, Script

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users