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
  #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 03:52 AM.


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