Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411487 Posts in 69371 Topics- by 58427 Members - Latest Member: shelton786

April 24, 2024, 11:44:22 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsGame Maker Tuts
Pages: 1 2 3 [4] 5 6 ... 24
Print
Author Topic: Game Maker Tuts  (Read 355450 times)
JasonPickering
Level 10
*****



View Profile WWW
« Reply #60 on: November 28, 2008, 10:39:23 AM »

no it was specifically in chevyrays engine, the collision objects always showed (visible was unchecked on every one) but i finally realized he was doing it through code, on the object parent. so we are all good for now.
Logged

Terry
TIGSource Editor
Level 10
******



View Profile WWW
« Reply #61 on: November 29, 2008, 01:43:38 AM »

Agh!


___________________________________________
ERROR in
action number 1
of Create Event
for object obj_menu:

Error defining an external function.


I'm trying to use the BASS for Game Maker scripts and I get this issue when I try to call bgm_Init();! I'm pretty sure the dlls are in the right place... Can anyone help?
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #62 on: November 29, 2008, 01:58:26 AM »

That happens to me with fmod too. I'm not sure what's causing it, I suspect there's some type of conflict. Sometimes I close winamp or windows media player and then it works.
Logged

JasonPickering
Level 10
*****



View Profile WWW
« Reply #63 on: November 30, 2008, 01:51:51 PM »

is it possible to change a tileset using code, like if i make two tile sets that are basically just pallette swaps of one another is it possible to swap them when a certain action takes place. in the middle of the level.
Logged

GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #64 on: November 30, 2008, 02:17:42 PM »

I've never done it, but I think it was mentioned in the "Using Game Maker Efficiently" thread.  So yeah, I'm pretty sure it's possible (and something I should look into as well).
Logged
___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #65 on: December 01, 2008, 01:59:27 AM »

Game Maker wizards,


Is it possible to take the sprite on the left and draw it as the sprite on the right?
Logged
Pishtaco
Level 10
*****


View Profile WWW
« Reply #66 on: December 01, 2008, 07:19:07 AM »

Game Maker wizards,


Is it possible to take the sprite on the left and draw it as the sprite on the right?
I'm no wizard, but I've messed around a bit with blend modes in GM. Still, wouldn't the quickest solution be to make a copy of the sprite sheet with just silhouettes?

Or you could automate this - draw the sprite sheet (or a particular sprite) onto a clear surface. Then draw an opaque red surface over it, using draw_set_blend_mode_ext(bm_dest_alpha, bm_zero). This should give the colour and alpha from the source (the red surface), multiplied by the alpha of the destination (the sprite) and then add it to zero times the destination (giving no change).

The quickest and dirtiest thing might be: draw the sprite once, tinted black; then do draw_set_blend_mode(bm_add) and draw the sprite again ten times, tinted red.

There should be various other things like this possible using the blend modes, although I'm not absolutely sure how well they work alongside transparency.
Logged

___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #67 on: December 01, 2008, 08:57:28 AM »

Game Maker wizards,


Is it possible to take the sprite on the left and draw it as the sprite on the right?
I'm no wizard, but I've messed around a bit with blend modes in GM. Still, wouldn't the quickest solution be to make a copy of the sprite sheet with just silhouettes?

Or you could automate this - draw the sprite sheet (or a particular sprite) onto a clear surface. Then draw an opaque red surface over it, using draw_set_blend_mode_ext(bm_dest_alpha, bm_zero). This should give the colour and alpha from the source (the red surface), multiplied by the alpha of the destination (the sprite) and then add it to zero times the destination (giving no change).

The quickest and dirtiest thing might be: draw the sprite once, tinted black; then do draw_set_blend_mode(bm_add) and draw the sprite again ten times, tinted red.

There should be various other things like this possible using the blend modes, although I'm not absolutely sure how well they work alongside transparency.

Yes, I can duplicate every sprite I'd ever use and make a silhouette, but I'd much rather do this at run time.  I guess I'm too tired to understand what you're saying in the 2nd paragraph around the part where it multiplies the alpha and then add it to zero times the destination... whoaa.

The quick and dirty way is something I thought about, but in game maker you're not really tinting the sprite when you draw it with an image_color, you're just affecting the channels.  Tinting it red takes out the blue and green channels, and if any pixels on the sprite don't contain red they're going to turn black and not add anything.
Logged
jwaap
Level 9
****


View Profile WWW
« Reply #68 on: December 02, 2008, 04:18:36 AM »

Thanks for the scaling ChevyRay. Smiley
Logged

Pishtaco
Level 10
*****


View Profile WWW
« Reply #69 on: December 02, 2008, 01:32:14 PM »

Yes, I can duplicate every sprite I'd ever use and make a silhouette, but I'd much rather do this at run time.  I guess I'm too tired to understand what you're saying in the 2nd paragraph around the part where it multiplies the alpha and then add it to zero times the destination... whoaa.
I just tested this and it worked okay. I made an object and put this in its create event:
Code:
effects_surface = surface_create(room_width, room_height);
    // (bigger than needed)

surface_set_target(effects_surface);
draw_clear_alpha(c_black, 0); //completely transparent

draw_set_blend_mode(bm_normal);
draw_sprite(spr_verge_guy, 0, 100, 100);

draw_set_blend_mode_ext(bm_dest_alpha, bm_zero);
    // colour after drawing source on destination will be
    //  (alpha of destination)*(colour of source) + 0 * (colour of destination)
draw_set_color(c_red);
draw_rectangle(0,0,room_width, room_height, false); //solid red rectangle

//effects surface should now contain a silhoette

draw_set_blend_mode(bm_normal);
surface_reset_target();
and this in its draw event
Code:
draw_surface(effects_surface,0,0);
You could do something like this to make the silhouettes each frame, or just process all the sprite sheets at the start of the game.
Logged

Xion
Pixelhead
Level 10
******



View Profile WWW
« Reply #70 on: December 02, 2008, 10:33:43 PM »

I thought I heard somewhere that using surfaces as large as the room is bad (if your room is fairly large), and that you should only have surfaces as large as what's in view.
I thought I heard that somewhere, could be misremembering though.
Logged

Pishtaco
Level 10
*****


View Profile WWW
« Reply #71 on: December 02, 2008, 10:39:24 PM »

I thought I heard somewhere that using surfaces as large as the room is bad (if your room is fairly large), and that you should only have surfaces as large as what's in view.
I thought I heard that somewhere, could be misremembering though.
Yes, I wouldn't recommend it. I just needed some numbers for the surface size and couldn't find straight away how to get the size of the view window. Obviously the surface doesn't really need to be any larger than the sprite.
Logged

Xion
Pixelhead
Level 10
******



View Profile WWW
« Reply #72 on: December 02, 2008, 10:42:03 PM »

Ah, sorry, totally missed that //bigger than needed comment  Embarrassed
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #73 on: December 03, 2008, 03:13:04 PM »

I have seen a technique of getting the silhouttes out of a sprite, but I don't actually remember how that technique was accomplished. I believe it used d3d fog or something. Apparently you can use GML's d3d functions even if you're not doing 3d, and they are still useful for many things.
Logged

GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #74 on: December 03, 2008, 04:04:12 PM »

You're completely right, rinku!  I actually did this by accident once while working on a 3D game that ran on a 2D plane, and I hadn't properly shifted to 3D.
Logged
___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #75 on: December 07, 2008, 04:27:56 AM »

I think this surfaces thing will work, I've been trying making the silhouette surface just the sprite width and height and that seems to be fine.
Logged
Kairos
Level 0
**


Explode


View Profile WWW
« Reply #76 on: December 07, 2008, 09:43:21 AM »

You can do that effect by using the d3d fog trick, yeah. Basically in the draw event you set the d3d fog to what color you want the silhouette, draw the sprite, then set the fog with all arguments back to 0.
Logged

JasonPickering
Level 10
*****



View Profile WWW
« Reply #77 on: December 12, 2008, 12:06:57 PM »

how would i go about saving variables when a game is closed and re-load when you start up. basically i am making a "tech demo" to learn gamemaker and i was going to have it that when you collect a coin it is collected forever. so i was going to set a variable and if the variable is 0 it is not collected if its 1 it is collected. 
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #78 on: December 12, 2008, 12:37:00 PM »

You can either use a save file (including an .ini file if you want the variables to be changeable by the user) or you can use game maker's built-in save system (which I do not recommend because adding new functions breaks old save files).
Logged

GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #79 on: December 12, 2008, 12:44:15 PM »

I actually got something similar working in a game once.  I wanted to implement my own save system (so I could choose what data I wanted saved) and it output certain info to a text file; like all my (non-current) projects, it didn't get finished, but I'd be happy to dig up the GML if you'd like to see it.

.....

OK, I'd decided to just go dig up the code now, but alas I couldn't find it; I think I may not have actually implemented the saving aspect of it yet.  I have built a working (though slightly dissimilar) save system before, so I can definitely find that if you want.  It saved which puzzles had been completed into a .txt file.
Logged
Pages: 1 2 3 [4] 5 6 ... 24
Print
Jump to:  

Theme orange-lt created by panic