Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Bending Gfx (https://forums.graalonline.com/forums/showthread.php?t=65588)

Angel_Light 04-22-2006 09:49 PM

Bending Gfx
 
Is there anyway to bend gfx? I mean like tiles in the level. If you ever played Metroid Prime 2 and used the Annihiltor Beam at full power, thats what I mean. Is there way?

Angel_Light 04-26-2006 01:19 PM

Does anyone have any advice?

Raeiphon 04-26-2006 03:54 PM

I know what you mean, and i'm entirely sure that the Graal engine lacks the graphical support for that sort of thing.

Angel_Light 04-26-2006 10:18 PM

ok thanks

Tyhm 04-29-2006 09:32 PM

/yet/.
If there were a way to read the RGBA of a single point, there would be a way to display it offset with the emitter...

Angel_Light 04-29-2006 10:07 PM

there is no way.. I think you might be able to change the RGBA but not read it

ZeLpH_MyStiK 04-30-2006 02:59 AM

i'm not sure if we're talking about the same thing but you can showimgs and use changeimgpart to show every pixel of that image and then take it from there.

Warcaptain 04-30-2006 03:16 AM

Graal has the graphical potential, just Torque doesnt have it built in.

Angel_Light 04-30-2006 04:02 AM

Wait I just though of something. On GK they can bend the terrain and stuff. Can we just do that to gfxs? I suppose so since a tileset is a gfx, But, how?

ZeLpH_MyStiK 04-30-2006 04:09 AM

Quote:

Originally Posted by Angel_Light
Wait I just though of something. On GK they can bend the terrain and stuff. Can we just do that to gfxs? I suppose so since a tileset is a gfx, But, how?

It's not bending the terrain, it's adding another dimension to it. It's supposed to be 3D-ish using the z-axis, but in this case Graal z is like another y. =\

Angel_Light 04-30-2006 04:30 AM

oh... hmm... :/

Tyhm 04-30-2006 09:35 AM

Altering the Z of a portion of an image is no different than bending an image around that portion, really...but I doubt we'd see that.

ZeLpH_MyStiK 04-30-2006 11:37 PM

Edit: Didn't see this in the GS2 forums, so the script is in GS1. But it can be easily converted using the same idea.

Alright, this is an extremely poor method of creating this illusion, but I created a simple script in demonstrating it. There could be errors as I made this in about 5 minutes, but here goes anyways:
PHP Code:

//#CLIENTSIDE
if (created) {
  
this.offset_x 1;  // offsets the image 16 pixels to the right so the mouse doesn't block it
  
this.offset_y 1;  // offsets 16 pixels down for the same reason
  
this.width imgwidth(block.png);  // the width of the image i'm using block.png
  
setarray this.offset_z,this.width;  // controls the z-coor of each row of pixels
  
setarray this.offset_zmode,this.width;  // controls whether the z-coors should go up or down
  
for(this.i=0this.i<32this.i++) this.offset_z[this.i] = this.i;  // sets the starting positions
  
timeout .05;  // begins the timeout for showimgs
}
if (
timeout) {
  for(
this.i=0this.i<32this.i++) {  // loops thru each pixel row of the image
    
for(this.j=0this.j<32this.j++) {  // loops thru the pixel columns
      
showimg2 200 this.32 this.j,block.png,this.offset_x mousex this.16,this.offset_y mousey this.16,this.offset_z[this.i] / 16;  // shows every pixels of the image at its original location with the exception of the z-coors which are decided by the arrays
      
changeimgpart 200 this.32 this.j,this.i,this.j,1,1;  // shows a pixel as opposed to the entire image
    
}
  }
  for(
this.i=0this.i<32this.i++) {
    if (
this.offset_zmode[this.i] == 0) {  // if the pixel is moving upwards
      
if (this.offset_z[this.i] + == 32) {  // if the pixel reaches the top
        
this.offset_zmode[this.i] = 1;  // changes mode
      
}else this.offset_z[this.i]++;  // otherwise continue upwards movement
    
}else{  // if the pixels are moving downwards
      
if (this.offset_z[this.i] - == 16) {  // as the pixels reach halfway down
        
this.offset_zmode[this.i] = 0;  // change modes
      
}else this.offset_z[this.i]--;  // otherwise continue downwards movement
    
}
  }
  
timeout .05;  // continues loop


Once again very poor method. Also this will lag with giant images.

Admins 04-30-2006 11:52 PM

Screenshot?

Yen 05-01-2006 01:02 AM

There's a stretchx and stretchy variable; it stretches the image like the zoom variable does, but only on one axis.
I'm not sure, but I don't see why you wouldn't be able to stretch an image and then rotate it. You could make, for example, a lightning effect this way. Stretch the lightning image to be the distance from one player to the other, then rotate it so that it goes in the direction of the other player.

I've used stretchx and stretchy to make some nice effects. :)

Angel_Light 05-01-2006 03:34 AM

This isnt what I meant. I meant like bending random parts of tiles on a level

Tyhm 05-01-2006 09:28 AM

Right, which could be done by rapidly changing the Z of that tile (somehow) then updating the board locally. Then setting it back when you're done. Trouble is, that'd just bend the tiles, not the NPC Image of a sign, or a door, or a tree, or a shopkeeper, or a beer...

Angel_Light 05-02-2006 01:20 AM

well we could set each img (though it would take forever to do) with certain script to change with tiles. :/

ZeLpH_MyStiK 05-02-2006 01:25 AM

Quote:

Originally Posted by Tyhm
Right, which could be done by rapidly changing the Z of that tile (somehow) then updating the board locally. Then setting it back when you're done. Trouble is, that'd just bend the tiles, not the NPC Image of a sign, or a door, or a tree, or a shopkeeper, or a beer...

Which is what the script I posted was for.

ApothiX 05-02-2006 02:20 PM

Quote:

Originally Posted by Tyhm
Right, which could be done by rapidly changing the Z of that tile (somehow) then updating the board locally. Then setting it back when you're done. Trouble is, that'd just bend the tiles, not the NPC Image of a sign, or a door, or a tree, or a shopkeeper, or a beer...

It causes a lot of lag when you are attempting to update the terrain using scripts. If you're trying to do it 'rapidly', it will never happen.

KuJi 05-02-2006 06:18 PM

I'd feel bad for the npc server.

ApothiX 05-02-2006 09:02 PM

Quote:

Originally Posted by KuJi
I'd feel bad for the npc server.

I tried to make a wave effect for my server by modifying the waterheight variable and updating the terrain every so often, and it lagged horribly :(

Angel_Light 05-02-2006 10:04 PM

Maybe this feature will be added to GS3 along with my "playerkills()" function. XD

ApothiX 05-03-2006 02:23 PM

Quote:

Originally Posted by Angel_Light
Maybe this feature will be added to GS3 along with my "playerkills()" function. XD

What 'feature'? People have given you code examples on how to do it already.

Tyhm 05-04-2006 09:39 AM

pixeldata(x,y,minlayer,maxlayer) - returns the pixel (array of floats, length 4: r,g,b,a) at the specified location, between the layers listed (works like the showimg layers, 0 to 4)

With such a function it would be possible to re-draw a section of the board "stretched".
Even better:
getimage(x,y,x0,y0,minlayer,maxlayer) - returns an image (just as if it was an actual png) of the data from x to x0 and y to y0, so you can warp this temporary clientside-only screenshotlet. Take a picture of the level and warp that.

Angel_Light 05-05-2006 01:33 PM

it seems that lags players if there 6 or players watching and Okie, nonething works on that. There no way to read who just killed who.

Warcaptain 05-05-2006 08:33 PM

GS3 X_X?

I don't see that as happeing.

ApothiX 05-05-2006 09:46 PM

Quote:

Originally Posted by Angel_Light
There no way to read who just killed who.

I don't really see how that is relevant to this thread?

Tyhm 05-05-2006 09:53 PM

(Because Mr Omega over here's trying to make a weapon, I guess)

ApothiX 05-05-2006 09:59 PM

Quote:

Originally Posted by Tyhm
(Because Mr Omega over here's trying to make a weapon, I guess)

No, he was talking about this in an older thread. He wants to know who killed who using the default attack system. Using a custom system would make such detection easy to implement.

Angel_Light 05-06-2006 02:35 AM

Well tell me how in the old thread x_x

adam 05-09-2006 05:19 AM

Quote:

Originally Posted by Stefan
Screenshot?

What happened to the days when people actually posted screenshots.

Angel_Light 05-09-2006 01:33 PM

He gave you the script. You can do it offline. -_-


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

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