Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Image layer stuff (https://forums.graalonline.com/forums/showthread.php?t=134256480)

DustyPorViva 10-14-2009 07:03 PM

Image layer stuff
 
Can anyone think of some manipulative and creative way to make a showimg draw under the player, but over objects that draw over the player(trees, drawoverplayer()...)?

I've been messing with the whole z+5/y+5 thing and couldn't figure anything out, but I figure I'd ask here before I finally give up.

Crow 10-14-2009 07:11 PM

Untested guess:
PHP Code:

drawOverPlayer();
this.z = -1;
this.y -= 1; 


DustyPorViva 10-14-2009 07:35 PM

Nope. An example:

I am in a level, I have a tree that draws over the player. I have a weapon... a remote control plane or something(a showimg). I want the plane to draw OVER the tree(fly over it), but UNDER the player.

This would be so useful for me, so I offer so many cookies to whomever helps me resolve this.

Crow 10-14-2009 07:58 PM

If that doesn't work, no idea. I'd go as far and say it's impossible.

Switch 10-14-2009 09:28 PM

Couldn't you do something like
PHP Code:

with(findimg(200)) {
  
this.layer = 2;
  
drawunderplayer();
} 

Unless I'm completely confused by this.layer

oo_jazz_oo 10-14-2009 09:54 PM

I don't think its possible?

What if your standing behind the tree that draws over you, and your showimg goes over the tree.

How can it show over the tree and under you at the same time?

DustyPorViva 10-14-2009 09:55 PM

Quote:

Originally Posted by oo_jazz_oo (Post 1530396)
I don't think its possible?

What if your standing behind the tree that draws over you, and your showimg goes over the tree.

How can it show over the tree and under you at the same time?

Exactly what I want, actually. I dunno how, I was just hoping there was a creative solution to it.

oo_jazz_oo 10-14-2009 10:08 PM

How is that what you want? XD

You cant have an image draw over and under an image at the same time...

Is this going to be used for something? Or just something you want to do?

DustyPorViva 10-14-2009 10:12 PM

Quote:

Originally Posted by oo_jazz_oo (Post 1530404)
How is that what you want? XD

You cant have an image draw over and under an image at the same time...

Is this going to be used for something? Or just something you want to do?

I hope to use it for something. As for the logistics... well it might not seem like it makes sense, but that's where the whole creative/hackish things comes in.

LoneAngelIbesu 10-14-2009 11:39 PM

Quote:

Originally Posted by DustyPorViva (Post 1530406)
I hope to use it for something. As for the logistics... well it might not seem like it makes sense, but that's where the whole creative/hackish things comes in.

There's no creative/hackish way to make one thing be in two places at the same time?

oo_jazz_oo 10-15-2009 12:20 AM

The only way you could do it is if it was on layer x above the objects, and once in the area of the player, set it to layer y under him.

But it would still draw under the tree.

The only way I can see this happening is doing the method I just stated, but checking if the player is in the area of an object with a layer above his own.

PHP Code:

temp.new_layer = 3;

if (
plane_x in |player.x, player.x+3| && plane_y in |player.y, player.y+4|)
{
  
temp.draw_over = false;
  
  for(
np:npcs)
  {
    if (
np.layer > player.layer)
    {
      if (
player.x+1.5 in |np.x, np.x+(getimgwidth(np.image)/16)| && player.y+2 in |np.y, np.y+(getimgheight(np.image)/16)|)
        
temp.draw_over = true;
    }
  }
  if (!
draw_over)
    
temp.new_layer = 0;
}

showimg(200, "plane.png", plane_x, plane_y).layer = new_layer; 

I just wrote that up quickly in notepad. lol

But...you get my point.

DustyPorViva 10-15-2009 12:31 AM

Quote:

Originally Posted by LoneAngelIbesu (Post 1530431)
There's no creative/hackish way to make one thing be in two places at the same time?

People have done creative and totally unexpected things with Graal. I gave up for a reason, but I didn't want to just throw it away as I wanted to do something cool with this, so I thought I'd see if anyone else could come up with anything.

LoneAngelIbesu 10-15-2009 01:12 AM

Quote:

Originally Posted by DustyPorViva (Post 1530450)
People have done creative and totally unexpected things with Graal. I gave up for a reason, but I didn't want to just throw it away as I wanted to do something cool with this, so I thought I'd see if anyone else could come up with anything.

Well, I mean... it's impossible. Well, I guess you could create a special case, for when the player is below an NPC (wouldn't know how to go about that...), and make it so that it only shows above the tree, rather than trying to show it above and below the player.

oo_jazz_oo 10-15-2009 01:15 AM

Quote:

Originally Posted by LoneAngelIbesu (Post 1530455)
Well, I mean... it's impossible. Well, I guess you could create a special case, for when the player is below an NPC (wouldn't know how to go about that...), and make it so that it only shows above the tree, rather than trying to show it above and below the player.

You mean exactly what I said in my example? ._.

LoneAngelIbesu 10-15-2009 04:36 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1530456)
You mean exactly what I said in my example? ._.

Didn't read, because English > GS2. :)

coreys 10-16-2009 03:57 AM

drawunderplayer(); sets it's rendering layer to under that of the player, so I would think that this would be impossible.

DustyPorViva 10-16-2009 04:08 AM

Oh well.


All times are GMT +2. The time now is 10:57 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.