Jump to content

Photo

Gonna try and combine two scripts


  • Please log in to reply
2 replies to this topic

#1 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 19 June 2017 - 04:07 AM

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



#2 Avaro

Avaro

    o_o

  • Members
  • Real Name:Robin
  • Location:Germany

Posted 19 June 2017 - 08:01 AM

Wait, are you asking us to do this for you or are you just writing and commenting your thought process of doing it?



#3 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 19 June 2017 - 03:06 PM

I'm going to try to figure it out, post my results and ask for input.
Can't predict if I'll be successful.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users