Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Changing TShowImg gani colors (formally TShowImg) (https://forums.graalonline.com/forums/showthread.php?t=81344)

Mark Sir Link 08-19-2008 08:00 PM

Changing TShowImg gani colors (formally TShowImg)
 
I'm using a gani for a showimg and trying to manipulate the alpha, r,g, and b values.

However, this seems to have no effect on the gani.

Is it supposed to look like that or am I doing something wrong.

Inverness 08-19-2008 08:28 PM

Is playerlook == false in the TShowImg?

And it would be much more helpful if you could post the actual code.

Loriel 08-19-2008 08:32 PM

This is a horrible thread title

DustyPorViva 08-19-2008 08:42 PM

actor.alpha=.5;

Mark Sir Link 08-19-2008 08:55 PM

PHP Code:

//#CLIENTSIDE

function onCreated()
{
  
with(findimg(333))
  {
    
player.1;
    
player.1;
    
ani player.ani;
    
layer 3;
    
playerlook true;
    
attachtoowner true;
    
rotation pi;
    
red 1;
    
blue .1;
    
green .2;
    
alpha .3;
    
dir player.dir;
  }
setTimer(.05);
}
function 
onTimeout()
{
  
with(findimg(333))
  {
    
ani player.ani;
    
rotation pi;
    
dir player.dir;
  }
  
setTimer(.05);



Kristi 08-19-2008 09:02 PM

Quote:

Originally Posted by DustyPorViva (Post 1415873)
actor.alpha=.5;

Was going to say this. Tshowimg.actor.prop

Mark Sir Link 08-19-2008 09:04 PM

saw HR's IM first, added actor.alpha = .3;

works now, thanks a bunch

Mark Sir Link 08-20-2008 07:00 AM

another question, is it possible to flip the ani rather than rotate it?

Trying to make a reflection of the player but it's currently impossible for any direction other than up/down

cbk1994 08-20-2008 07:01 AM

Quote:

Originally Posted by Mark Sir Link (Post 1415962)
another question, is it possible to flip the ani rather than rotate it?

Trying to make a reflection of the player but it's currently impossible for any direction other than up/down

Unfortunately, no. It's been suggested many times.

DustyPorViva 08-20-2008 07:04 AM

Stefan said flipping will be possible in the next version.

BTW, it sounds like you're trying to do the same thing I was :P

TheStan 08-20-2008 07:04 AM

Quote:

Originally Posted by cbk1994 (Post 1415963)
Unfortunately, no. It's been suggested many times.

Well, actually it's not impossible...there's someone who devs on Graal who knows how to do it...

DustyPorViva 08-20-2008 07:07 AM

Quote:

Originally Posted by TheStan (Post 1415966)
Well, actually it's not impossible...there's someone who devs on Graal who knows how to do it...

And where was this done? I have never seen it done and I have tried before to do it. You can rotate, but you can't flip vertically/horizontally.

TheStan 08-20-2008 07:09 AM

Quote:

Originally Posted by DustyPorViva (Post 1415967)
And where was this done? I have never seen it done and I have tried before to do it. You can rotate, but you can't flip vertically/horizontally.

I'd have to tell you on AIM because I'm not allowed to put it out there like that.

DustyPorViva 08-20-2008 07:15 AM

Well, I'd say dismiss the possibility of a workaround. I think anything more than one line to pull this off would be way too much effort for something that could easily be supported. Any work around would probably involve loops and/or multiple images for one image.

Mark Sir Link 08-20-2008 08:02 AM

the only potential workaround I was able to think of was making the height negative, but I'm fairly certain that TShowImg has no height field anyway

@ Dusty: The idea was concocted by Ziplock for use in levels with ice, and I'm fairly certain he lifted the idea off of Zelda: Twilight Princess

Tigairius 08-20-2008 08:04 AM

Quote:

Originally Posted by TheStan (Post 1415968)
I'd have to tell you on AIM because I'm not allowed to put it out there like that.

I've made a function that flips images, but I'd rather have on built in.. It's also pretty inefficient and stuff.

Rescripted it in about 10 minutes... woohoo for highly inefficient & laggy workaround scripts!
PHP Code:

// NPC made by Tig
//#CLIENTSIDE
function onCreated() {
  
this.image "door.png";
  
flipHorizontal();
}

function 
flipHorizontal() {
  
this.null;
  for (
temp.0temp.getimgwidth(this.image); temp.++) {
    for (
temp.0temp.getimgheight(this.image); temp.++) {
      
showimg(200 this.ithis.image- (1/16), + (1/16));
      
changeimgvis(200 this.i3);
      
changeimgpart(200 this.iwh11);
      
this.++;
    }
  }
  
hide();
}

function 
flipVerticle() {
  
this.null;
  for (
temp.0temp.getimgwidth(this.image); temp.++) {
    for (
temp.0temp.getimgheight(this.image); temp.++) {
      
showimg(200 this.ithis.image+ (1/16), - (1/16));
      
changeimgvis(200 this.i3);
      
changeimgpart(200 this.iwh11);
      
this.++;
    }
  }
  
hide();
}

function 
flipBoth() {
  
this.null;
  for (
temp.0temp.getimgwidth(this.image); temp.++) {
    for (
temp.0temp.getimgheight(this.image); temp.++) {
      
showimg(200 this.ithis.image- (1/16), - (1/16));
      
changeimgvis(200 this.i3);
      
changeimgpart(200 this.iwh11);
      
this.++;
    }
  }
  
hide();



Mark Sir Link 08-20-2008 08:06 AM

Care to share?

EDIT:

Well, I think I can slightly envision it now...

several showimgparts that would put 0,0, at max.x, max.y, work your way in...

DustyPorViva 08-20-2008 08:12 AM

Quote:

Originally Posted by Mark Sir Link (Post 1415981)
the only potential workaround I was able to think of was making the height negative, but I'm fairly certain that TShowImg has no height field anyway

@ Dusty: The idea was concocted by Ziplock for use in levels with ice, and I'm fairly certain he lifted the idea off of Zelda: Twilight Princess

My idea was layers + showani under layer = pretty cool reflection effect, which would be very similar to the effect in Pokemon.

Stefan apparently is using my idea, which would allow you to apply a negative value to stretchx/y, which would 'stretch' them in the opposite direction -- flipped.

As for how to flip manually, it would most likely involve a loop the size of the image width(or height, depending on what you're flipping) in pixels, and then cropping the image every 1 pixel and displacing each row of pixels yourself. It has been done before Graal even had rotation and such, but it's not very efficient. I don't even think it can be done with ganis.

Inverness 08-20-2008 07:27 PM

You can use negative zoom to flip a gani.

Kristi 08-20-2008 07:30 PM

Quote:

Originally Posted by Inverness (Post 1416045)
You can use negative zoom to flip a gani.

but that would make you face the opposite direction instead of the same.

you could reverse the directions but not all heads have identical left and right views

Inverness 08-20-2008 07:55 PM

Quote:

Originally Posted by Kristi (Post 1416046)
you could reverse the directions but not all heads have identical left and right views

Good point.

xXziroXx 08-20-2008 08:03 PM

UH OH, I think Inverness just released Stan's friends super mega secret that'll be life changing for all scripters!!!11!11!eleven

DustyPorViva 08-20-2008 09:11 PM

Changing the zoom to -1 just rotates it 180 degrees. The players shield is on the wrong side, for example.

Kristi 08-20-2008 11:01 PM

Quote:

Originally Posted by DustyPorViva (Post 1416064)
Changing the zoom to -1 just rotates it 180 degrees. The players shield is on the wrong side, for example.

I totally didn't just say that, oh wait...

DustyPorViva 08-20-2008 11:07 PM

Quote:

Originally Posted by Kristi (Post 1416092)
I totally didn't just say that, oh wait...

OH NO!!! SIMILAR THINGS WERE POSTED!!!

I'm so sorry, I didn't mean to waste such precious bandwidth.

WhiteDragon 08-21-2008 02:53 AM

Quote:

Originally Posted by DustyPorViva (Post 1416093)
OH NO!!! SIMILAR THINGS WERE POSTED!!!

I'm so sorry, I didn't mean to waste such precious bandwidth.

That'll be 200 dollars.

-The Administration
Not affiliated with Cyberjouers.


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

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