Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-19-2008, 08:00 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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.
Reply With Quote
  #2  
Old 08-19-2008, 08:28 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Is playerlook == false in the TShowImg?

And it would be much more helpful if you could post the actual code.
__________________
Reply With Quote
  #3  
Old 08-19-2008, 08:32 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
This is a horrible thread title
Reply With Quote
  #4  
Old 08-19-2008, 08:42 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
actor.alpha=.5;
Reply With Quote
  #5  
Old 08-19-2008, 08:55 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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);

Reply With Quote
  #6  
Old 08-19-2008, 09:02 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by DustyPorViva View Post
actor.alpha=.5;
Was going to say this. Tshowimg.actor.prop
__________________
Reply With Quote
  #7  
Old 08-19-2008, 09:04 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
saw HR's IM first, added actor.alpha = .3;

works now, thanks a bunch
Reply With Quote
  #8  
Old 08-20-2008, 07:00 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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
Reply With Quote
  #9  
Old 08-20-2008, 07:01 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Mark Sir Link View Post
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.
__________________
Reply With Quote
  #10  
Old 08-20-2008, 07:04 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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
Reply With Quote
  #11  
Old 08-20-2008, 07:04 AM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
Quote:
Originally Posted by cbk1994 View Post
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...
Reply With Quote
  #12  
Old 08-20-2008, 07:07 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by TheStan View Post
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.
Reply With Quote
  #13  
Old 08-20-2008, 07:09 AM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
Quote:
Originally Posted by DustyPorViva View Post
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.
Reply With Quote
  #14  
Old 08-20-2008, 07:15 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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.
Reply With Quote
  #15  
Old 08-20-2008, 08:02 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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
Reply With Quote
  #16  
Old 08-20-2008, 08:04 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by TheStan View Post
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();

__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”

Last edited by Tigairius; 08-20-2008 at 08:28 AM..
Reply With Quote
  #17  
Old 08-20-2008, 08:06 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
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...
Reply With Quote
  #18  
Old 08-20-2008, 08:12 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Mark Sir Link View Post
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.
Reply With Quote
  #19  
Old 08-20-2008, 07:27 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
You can use negative zoom to flip a gani.
__________________
Reply With Quote
  #20  
Old 08-20-2008, 07:30 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by Inverness View Post
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
__________________
Reply With Quote
  #21  
Old 08-20-2008, 07:55 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Kristi View Post
you could reverse the directions but not all heads have identical left and right views
Good point.
__________________
Reply With Quote
  #22  
Old 08-20-2008, 08:03 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
UH OH, I think Inverness just released Stan's friends super mega secret that'll be life changing for all scripters!!!11!11!eleven
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #23  
Old 08-20-2008, 09:11 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Changing the zoom to -1 just rotates it 180 degrees. The players shield is on the wrong side, for example.
Reply With Quote
  #24  
Old 08-20-2008, 11:01 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by DustyPorViva View Post
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...
__________________
Reply With Quote
  #25  
Old 08-20-2008, 11:07 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Kristi View Post
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.
Reply With Quote
  #26  
Old 08-21-2008, 02:53 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by DustyPorViva View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:40 AM.


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