Jump to content

Photo

layer appears while holding Ex1-button


  • Please log in to reply
9 replies to this topic

#1 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 12 November 2017 - 06:44 AM

Heyho :)

 

 

I'm using the aaa2s Ocarina-script and added 8 playable songs to the script. The problem is, I'm sure that some players are not able to remember the notes and there is no way, to use a "portable notebook".

 

Is it possible to show layer 6 (of a specific screen), while holding the Ex1-button (or layer 6 appears, when pushing the button and disappears after pushing the button again)?

If yes, could anybody do that for me please? :)

I think, the rest (combining etc.) should be no problem, but I have no idea, how to script with layers.

 

Or does anybody have a better idea or maybe solved that problem in the past?

 

 

Thank you for helping me. :D


Edited by Rastael, 12 November 2017 - 06:46 AM.


#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 12 November 2017 - 05:10 PM

Is this only supposed to work on a few specific screens? Or should this same layer show up and look the same no matter where you are?

If the latter, I'd recommend drawing a pre-made block of tiles to the screen rather than showing a screen layer (which itself may be more difficult than just flipping a visibility flag).


  • Rastael likes this

#3 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 12 November 2017 - 05:18 PM

That should appear on every screen. :)

 

Other possibilitys would be, that the layer (or the tiles) only appear, when the ocarina is used or at the subscreen-menu.

It's not important to me, how it is done, as long as the players of my quest can check the notes for a specific ocarina-song in the middle of a dungeon or whereever they are. ^^



#4 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 12 November 2017 - 05:29 PM

Drawing the layers is actually pretty easy. You just need to use the drawtile or drawcombo commands.

void DrawTile(int layer, int x, int y, int tile, int blockw, int blockh, int cset, int xscale, int yscale, int rx, int ry, int rangle, int flip, bool transparency, int opacity);
void DrawCombo(int layer, int x, int y, int combo, int w, int h, int cset, int xscale, int yscale, int rx, int ry, int rangle, int frame, int flip, bool transparency, int opacity);
So, as an example, let's say I go into the tile editor and draw my "song book", so to speak. Here's a lazy mockup:
K8yCFHf.png

I've got song 1 and 2, and the arrows they need to press. So now I want this to be draw to layer six whenever Ex1 is pressed. So, it should be drawn to layer six. We should start with tile 26000. The block of tiles I want to draw is 8 long and 3 tall. And I don't need to do anything fancy to rotate. Let's just draw it at the top left corner of the screen cuz I'm lazy. So here we go.

void Songbook(){
	if(Link->InputEx1){
		Screen->DrawTile(6, 0, 0, 26000, 8, 3, 8, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE);
	}
}
And that's all there is to it. Throw that in your global loop and it'll draw that block of tiles whenever you're pressing Ex1.
  • Rastael and MoscowModder like this

#5 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 12 November 2017 - 08:35 PM

there is no way, to use a "portable notebook".

 

 

Why's that? I made one in The Forbidden City. It's just an item that does whatever you'd have Ex1 do when you activate it.


  • Rastael likes this

#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 12 November 2017 - 09:03 PM

To answer the original question: You can use DrawLayer() to draw the layer of a specific screen to a destination, on a desired layer. Some palette changes may occur using this, which I suspect is why other members are advising that you use DrawTile().
  • Rastael likes this

#7 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 15 November 2017 - 03:23 AM

Thank you very much for helping me, those are very useful informatios. :D

 

 

 

@Russ:

That's easier, than I thought. Thank you for taking the time to explain it that detailed. ^^

 

 

@Jamian:

I meant "there is no way without scripting skills". Doing this with an additional item is another great idea, but there's no more space left in my subscreen for such an item. XD

 

 

@ZoraRPG:

I see, why doing this with tile is more advantageous, than using Combos. Thx for the advice. :)


Edited by Rastael, 15 November 2017 - 03:24 AM.


#8 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 11 February 2018 - 06:13 PM

Heyho :)

 

I know, I'm late with trying this, but I was very busy.

 

I tried to set up the script like this:

//Input constants Ocarina Notebook

void DrawTile(int layer, int x, int y, int tile, int blockw, int blockh, int cset, int xscale, int yscale, int rx, int ry, int rangle, int flip, bool transparency, int opacity);


...
...
...


global script Slot_2{

    void run(){


...
...
...


        while(true){


...
...
...


//Call Ocarina Notebook functions
		void Songbook(){
			if(Link->Item[176]){
				if(Link->InputEx1){
					Screen->DrawTile(6, 0, 0, 10920, 16, 13, 1, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE);
				}
			}

		}


...
...
...


Waitdraw();


...
...
...


Waitframe();


...
...
...


        }               //end while(true)

    }                   //end voidrun

 }                      //end script

But I get this error, after compiling the script:

 

 

 

2018-02-12_000644.jpg

 

 

 

 

 

 

Where did I go wrong?

The error occurs on this line:

void DrawTile(int layer, int x, int y, int tile, int blockw, int blockh, int cset, int xscale, int yscale, int rx, int ry, int rangle, int flip, bool transparency, int opacity);

Edited by Rastael, 11 February 2018 - 06:14 PM.


#9 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 13 February 2018 - 01:40 AM

That's because that line is copied straight from std.zh; it's instructions on how to use the DrawTile function, basically, showed what numbers to plug into it. Just delete it.
  • Rastael likes this

#10 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 13 February 2018 - 03:36 AM

Oh my god, I'm stupid, thx a lot! :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users