Jump to content

Photo

DMap MIDI Change

FFC

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

#1 Kite

Kite

  • Members
  • Gender:Male

Posted 18 March 2013 - 04:35 PM

DMap MIDI Change


Description

This will change the DMap MIDI of the specified DMap. This is probably temporary and won't save between game sessions. This also won't work with the built-in MIDIs due to how it uses variables.

This was made in response to a script request by James24: http://www.purezc.co...showtopic=53970

Screenshots and Demo

N/A.

Code

import "std.zh"

// This script will change the DMap midi of a dmap.
// This is probably temporary and won't carry between game sessions.
// This doesn't work with the built-in Zelda 1 midis (sort of) due to laziness...
// d0 = The dmap midi to change. If less than 0 (-1 for example), it will pick the current dmap.
// d1 = The midi to change the dmap midi to. If less than 0 (-1 for example), it will pick the currently playing midi.
// d2 = Should the currently playing midi be changed? 0 = No. 1 = Yes.

ffc script dmapMIDIChange
{
	void run(int dmap, int midi, bool changePlaying)
	{
		Waitframe(); // Delay detection...
		while(true)
		{
			// Wait for screen to scroll in...
			while(Link->Action == LA_SCROLLING)
				Waitframe();
			
			// Set up the automatic stuff...
			if(this->InitD[1] < 0)
				midi = Game->GetMIDI();
			if(this->InitD[0] < 0)
				dmap = Game->GetCurDMap();
			
			if(Game->DMapMIDI[dmap] != midi)
				Game->DMapMIDI[dmap] = midi; // Set the midi for the dmap
				
			if(changePlaying && Game->GetMIDI() != midi)
				Game->PlayMIDI(midi); // Change currently playing midi
			
			Waitframe();
		}//!End while(true)
	}//!End void run()
}//!End dmapMIDIChange

Setup

This is an FFC script, so attach it to an FFC.

d0 = The dmap midi to change. If less than 0 (-1 for example), it will pick the current dmap.
d1 = The midi to change the dmap midi to. If less than 0 (-1 for example), it will pick the currently playing midi.
d2 = Should the currently playing midi be changed? 0 = No. 1 = Yes.

Resources

Requires std.zh
  • Avataro likes this

#2 James24

James24

    Apprentice

  • Members
  • Real Name:James
  • Gender:Male
  • Location:Australia

Posted 25 January 2014 - 04:42 AM

A belated thank you Nick.  I figured most of it out already for my quest but thanks anyway.



#3 Alucard648

Alucard648

    Adept

  • Members
  • Gender:Male
  • Location:castle Dracula

Posted 22 February 2014 - 10:19 PM

I would like to have an option to make Dmap MIDI change truly temporary, so music will change back to original MIDI when Link exits Dmap by any way or dies.



#4 MoscowModder

MoscowModder

    Still fighting the inevitable

  • Members
  • Gender:Male
  • Location:Wisconsin (WHAT)

Posted 23 February 2014 - 01:31 AM

You mean you want it to only change the music the first time you enter the DMap and never again?



#5 Alucard648

Alucard648

    Adept

  • Members
  • Gender:Male
  • Location:castle Dracula

Posted 23 February 2014 - 03:12 AM

You mean you want it to only change the music the first time you enter the DMap and never again?

I mean Dmap Midi changing back to original MIDI when Link exits and reenters that Dmap or F6/death -> Continue.



#6 MoscowModder

MoscowModder

    Still fighting the inevitable

  • Members
  • Gender:Male
  • Location:Wisconsin (WHAT)

Posted 23 February 2014 - 10:48 AM

How is that different from what I said?





Also tagged with one or more of these keywords: FFC

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users