Jump to content


Photo
- - - - -

Advanced Shockwave/glass-effects For Gm 6+


  • Please log in to reply
37 replies to this topic

#21 LarQ

LarQ

    GMC Member

  • New Member
  • 12 posts

Posted 25 November 2008 - 04:47 PM

Hi, thank you for the example! :)
But I have a question many here have: the view compability...
I understand the whole script, I know it doesnt matter what the room size is,
but when my view goes out of the range of the room_width and room_height it goes sort of black.
My room is 700x4500 (it scrolls upside down with view 700x500)
So Ive put in the code of the surface: (room_width,500) //room width doesnt matter, xview always the same.
But when the view_yview goes above the 500, you get the black wave thingy...
Please help me!

PS: sorry for mispelling ^_^

Edited by LarQ, 25 November 2008 - 05:00 PM.

  • 0

#22 Ezion

Ezion

    GMC Member

  • New Member
  • 38 posts

Posted 22 December 2008 - 08:19 PM

I've been beating my head against the wall for the last several hours based on the same "black texture" problem the previous few posters are having. I've tried setting the global.surface variable that holds the screen at my current view position, and I've tried freeing and remaking the surface every step (in hopes that surfaces are set to the origin of your current view. Tiling the surface doesn't appear to work, and manually setting the surface size to 2048 by 2048 also yields no results (seems to make no difference than the default room_width and room_height arguments). I've tried screen_refresh() as opposed to the script's screen_redraw(). I've also tried getting a sprite of the screen and then drawing that to the surface (I was running out of ideas). In short, my script-fu is not strong enough.

So...anyone know how to make these scripts work outside of my default 1024x768 view (room size is 2048x2048)? Is it possible to set surfaces to have an x and y they follow (I assume this is the problem?)

*Edit: Concise description of problem:
The wave effects are created using textured primitives. The primitives get their texture from the global.srf surface, which takes a screenshot of the room every step. The problem is that the surface doesn't appear to extend past my view of 1024x768, and the room is much larger than the view. When the primitives are drawn outside of the surface (and thus, the texture), they are merely filled with a half-transparent black color, as opposed to the texture they are supposed to possess. I believe this is a problem of either the screen_redraw() function only drawing the first 1024x768 pixels of the room onto the surface or more likely, the surface is not drawn over the entire room, and I cannot find a way to move the surface with the view.

Edit2: In case my description of the problem is incorrect, I'll try to detail how the wave script functions.
1. Surface called global.srf is created. It is supposed to have the same dimensions of the room, but appears to have set dimensions at the first 1024x768 pixels of the room.
2. Screen_redraw() is called while target is set to global.srf to get a screenshot of the room.
3. In its drawing step, obj_wave invokes "draw_wave_off(x,y,global.srf,radius-10,200,-(-radius+200)/5,20,0,0)"
4. The draw_wave_off script creates a texture based off of the global.srf surface.
5. The draw_wave_off script creates a primitive textured ring at the passed arguments x,y on the texture
-> The ring is as wide as your specified width and the script tiles that ring outwards to reach the desired radius of your ripple's circle. The ring is also offset by argument5 to create the ripple effect.
6. The script draws the textures primitives on the default drawing plane in GM.

(I'm not 100% sure on how the vertices are created for the textured primitives in #5.)

Edited by Ezion, 22 December 2008 - 11:57 PM.

  • 0

#23 Nexer

Nexer

    GMC Member

  • New Member
  • 18 posts

Posted 25 December 2008 - 03:58 PM

Hi...

This example is really awesome. I didn't imagine that it was possible to make such sweet effects with GM..

Danish: Det styrer virkeligt grumt det her Nils.

I think I'll use one of your effects in my topdown shooter. And ofcourse I'll credit you as you kindly requests.

Good Job ;)
  • 0

#24 ultim8p00

ultim8p00

    GMC Member

  • GMC Member
  • 282 posts

Posted 28 December 2008 - 06:16 PM

Your link is down again. Megaupload isn't working.

EDIT: nvm, it's up now, but I suggest you add another mirror. The effect looks pretty sweet btw.

Edited by ultim8p00, 28 December 2008 - 06:20 PM.

  • 0

#25 FiLkAtA

FiLkAtA

    GMC Member

  • GMC Member
  • 511 posts
  • Version:GM:Studio

Posted 28 December 2008 - 08:26 PM

Really impressive. And works fast enough if it isn't overused.

~FiLkAtA
  • 0

#26 ultim8p00

ultim8p00

    GMC Member

  • GMC Member
  • 282 posts

Posted 28 December 2008 - 11:10 PM

Yeah, as a few posters have pointed out this does not work very well with views
  • 0

#27 funlerz

funlerz

    GMC Member

  • New Member
  • 113 posts

Posted 04 May 2009 - 01:48 PM

hmm seems like it would be neat, but I don't really need it and I hate waiting for megaupload to let you download the file, maybe I will download this later.
  • 0

#28 FireProof Games

FireProof Games

    GMC Member

  • GMC Member
  • 107 posts
  • Version:GM8

Posted 07 December 2009 - 07:07 AM

Awesome effects!
Is there any chance to use them in a huge room? Like, 8000x8000.
I tried that, but after going away from the x=1000 or y=900, the surface started to turn black and weird, showing waves purely black.
Best regards!

I have the same issue! Would changing the variables for width from room to view and updating every step fix it? Or would it just slow everything down?
  • 0

#29 fhd

fhd

    GMC Member

  • GMC Member
  • 126 posts
  • Version:GM:Studio

Posted 09 May 2010 - 07:59 AM

I've been beating my head against the wall for the last several hours based on the same "black texture" problem the previous few posters are having. I've tried setting the global.surface variable that holds the screen at my current view position, and I've tried freeing and remaking the surface every step (in hopes that surfaces are set to the origin of your current view. Tiling the surface doesn't appear to work, and manually setting the surface size to 2048 by 2048 also yields no results (seems to make no difference than the default room_width and room_height arguments). I've tried screen_refresh() as opposed to the script's screen_redraw(). I've also tried getting a sprite of the screen and then drawing that to the surface (I was running out of ideas). In short, my script-fu is not strong enough.

So...anyone know how to make these scripts work outside of my default 1024x768 view (room size is 2048x2048)? Is it possible to set surfaces to have an x and y they follow (I assume this is the problem?)

*Edit: Concise description of problem:
The wave effects are created using textured primitives. The primitives get their texture from the global.srf surface, which takes a screenshot of the room every step. The problem is that the surface doesn't appear to extend past my view of 1024x768, and the room is much larger than the view. When the primitives are drawn outside of the surface (and thus, the texture), they are merely filled with a half-transparent black color, as opposed to the texture they are supposed to possess. I believe this is a problem of either the screen_redraw() function only drawing the first 1024x768 pixels of the room onto the surface or more likely, the surface is not drawn over the entire room, and I cannot find a way to move the surface with the view.

Edit2: In case my description of the problem is incorrect, I'll try to detail how the wave script functions.
1. Surface called global.srf is created. It is supposed to have the same dimensions of the room, but appears to have set dimensions at the first 1024x768 pixels of the room.
2. Screen_redraw() is called while target is set to global.srf to get a screenshot of the room.
3. In its drawing step, obj_wave invokes "draw_wave_off(x,y,global.srf,radius-10,200,-(-radius+200)/5,20,0,0)"
4. The draw_wave_off script creates a texture based off of the global.srf surface.
5. The draw_wave_off script creates a primitive textured ring at the passed arguments x,y on the texture
-> The ring is as wide as your specified width and the script tiles that ring outwards to reach the desired radius of your ripple's circle. The ring is also offset by argument5 to create the ripple effect.
6. The script draws the textures primitives on the default drawing plane in GM.

(I'm not 100% sure on how the vertices are created for the textured primitives in #5.)


Dear thenoller
please Answer us,we all have the same issue with larger rooms,please.
  • 0

#30 gmwiz2010

gmwiz2010

    GMC Member

  • New Member
  • 28 posts

Posted 09 May 2010 - 08:48 AM

Looks cool! nice work.
  • 0

#31 fhd

fhd

    GMC Member

  • GMC Member
  • 126 posts
  • Version:GM:Studio

Posted 02 June 2010 - 07:01 PM

Good News,I solved the first problem with the black ring,now you can use bigger rooms with no black ring,BUT
Still there is a problem,download the gmk file :
Click Here
sorry for my codes,I was in hurry,no time for clean up.
the second problem that I hope you guys take a step forward as me to solve the final problem is
the tiled texture that is drawing in the ring loose its position,
we need to use texture tile in advance.
please anyone who could help us with this more are most welcome.

thanks

Use Arrow Keys for moving
Use <SpaceBar> for a random position
Size of room : 4000x8000

Edited by fhd, 02 June 2010 - 07:07 PM.

  • 0

#32 beeproductions

beeproductions

    Helping gmc users

  • GMC Member
  • 1132 posts
  • Version:GM:Studio

Posted 07 June 2010 - 12:46 PM

Nice.Maybe you can put some reflection examples:)..
  • 0

#33 A saurus1

A saurus1

    GMC Member

  • Sandbox Moderators
  • 1593 posts
  • Version:GM8.1

Posted 08 June 2010 - 09:48 AM

Just disable the view (view_enabled=false) before you redraw the screen, and re-enable it after.
  • 0

#34 fhd

fhd

    GMC Member

  • GMC Member
  • 126 posts
  • Version:GM:Studio

Posted 20 June 2010 - 08:43 AM

Just disable the view (view_enabled=false) before you redraw the screen, and re-enable it after.


NO,this is not working.
please try to download the file ,I fixed the blocked password and it is public now for your download.
need helps.
  • 0

#35 fhd

fhd

    GMC Member

  • GMC Member
  • 126 posts
  • Version:GM:Studio

Posted 29 July 2010 - 05:56 PM

Just bumping,
Really sorry but need helps.
  • 0

#36 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16839 posts
  • Version:GM:Studio

Posted 12 August 2011 - 06:01 AM

This is a fantastic effect and really well done... Staff Pick!
  • 0

#37 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14397 posts
  • Version:GM:Studio

Posted 30 December 2011 - 12:02 AM

Please fix the download link (server not found) (moved from staff choice)
  • 0

#38 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14397 posts
  • Version:GM:Studio

Posted 22 January 2012 - 07:36 AM

Back to staff choice ya precious little gem
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users