PDA

View Full Version : Bending Gfx


Angel_Light
04-22-2006, 10:49 PM
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, 02:19 PM
Does anyone have any advice?

Raeiphon
04-26-2006, 04: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, 11:18 PM
ok thanks

Tyhm
04-29-2006, 10: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, 11: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, 03: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, 04:16 AM
Graal has the graphical potential, just Torque doesnt have it built in.

Angel_Light
04-30-2006, 05: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, 05:09 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?
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, 05:30 AM
oh... hmm... :/

Tyhm
04-30-2006, 10: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
05-01-2006, 12:37 AM
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:

//#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=0; this.i<32; this.i++) this.offset_z[this.i] = this.i; // sets the starting positions
timeout = .05; // begins the timeout for showimgs
}
if (timeout) {
for(this.i=0; this.i<32; this.i++) { // loops thru each pixel row of the image
for(this.j=0; this.j<32; this.j++) { // loops thru the pixel columns
showimg2 200 + this.i * 32 + this.j,block.png,this.offset_x + mousex + this.i / 16,this.offset_y + mousey + this.j / 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.i * 32 + this.j,this.i,this.j,1,1; // shows a pixel as opposed to the entire image
}
}
for(this.i=0; this.i<32; this.i++) {
if (this.offset_zmode[this.i] == 0) { // if the pixel is moving upwards
if (this.offset_z[this.i] + 1 == 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] - 1 == 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
05-01-2006, 12:52 AM
Screenshot?

Yen
05-01-2006, 02: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, 04:34 AM
This isnt what I meant. I meant like bending random parts of tiles on a level

Tyhm
05-01-2006, 10: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, 02: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, 02:25 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...
Which is what the script I posted was for.

ApothiX
05-02-2006, 03:20 PM
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, 07:18 PM
I'd feel bad for the npc server.

ApothiX
05-02-2006, 10:02 PM
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, 11:04 PM
Maybe this feature will be added to GS3 along with my "playerkills()" function. XD

ApothiX
05-03-2006, 03:23 PM
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, 10: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, 02: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, 09:33 PM
GS3 X_X?

I don't see that as happeing.

ApothiX
05-05-2006, 10:46 PM
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, 10:53 PM
(Because Mr Omega over here's trying to make a weapon, I guess)

ApothiX
05-05-2006, 10:59 PM
(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, 03:35 AM
Well tell me how in the old thread x_x

adam
05-09-2006, 06:19 AM
Screenshot?

What happened to the days when people actually posted screenshots.

Angel_Light
05-09-2006, 02:33 PM
He gave you the script. You can do it offline. -_-