While similar to my other thread, this is a different goal.
I have this script (different messages for each of the 4 Heart Pieces):
//Old version: supports only 4-piece heart containers //Messages can be set automatically or manually //D0 = First message //D1-3 = Second-fourth messages; default to strings after D0 item script heartPieceMessageOld{ void run (int m1, int m2, int m3, int m4){ //Set m2-4 to follow m1 if not set explicitly if ( m2 == 0 ) m2 = m1+1; if ( m3 == 0 ) m3 = m1+2; if ( m4 == 0 ) m4 = m1+3; //Play the appropriate message if ( Game->Generic[GEN_HEARTPIECES] == 0 ) Screen->Message(m1); if ( Game->Generic[GEN_HEARTPIECES] == 1 ) Screen->Message(m2); if ( Game->Generic[GEN_HEARTPIECES] == 2 ) Screen->Message(m3); if ( Game->Generic[GEN_HEARTPIECES] == 3 ) Screen->Message(m4); } }
But I want to add this to it:
//////////////////////////////////////////////////////////////// // AdvPickUpMessage by // // Joe123, MoscowModder, Isdrakthül, // // cavthena, Coolgamer012345, Cukeman // // // // Displays Message D0 or D1 (identical Strings with // // different [Y] height values) based on Link's screen // // position. Used to prevent Message Strings from covering // // Link's sprite when he picks up the item. Also, if Link // // already has item D2, no message will be displayed. // //////////////////////////////////////////////////////////////// //D0: Number of Message String to display if Link is near the bottom of the screen //D1: Number of Message String to display if Link is near the top of the screen //D2: ID of Item that prevents Message String from being displayed item script AdvPickUpMessage { void run(int stringA, int stringB, int stringPreventItemID) { if(!Link->Item[stringPreventItemID]) { if(Link->Y > 88) { Screen->Message(stringA); } else { Screen->Message(stringB); } } } }
So let's see what I can do...
D0 = 1st Heart Container Message String (when Link is near the bottom of the screen)
D1 = 1st Heart Container Message String (when Link is near the top of the screen)
D2 = 2nd Heart Container Message String (when Link is near the bottom of the screen)
D3 = 2nd Heart Container Message String (when Link is near the top of the screen)
D4 = 3rd Heart Container Message String (when Link is near the bottom of the screen)
D5 = 3rd Heart Container Message String (when Link is near the top of the screen)
D6 = 4th Heart Container Message String (when Link is near the bottom of the screen)
D7 = 4th Heart Container Message String (when Link is near the top of the screen)
...I'll be eliminating argument D2 from the second script...
[start putting new code here]
...crap it's 2AM, I'll work more on this post later