The Gang Garrison 2 Forum
June 19, 2013, 01:52:26 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Chat with us on IRC: http://ganggarrison.com/irc.html
Server: irc.esper.net, Channel: #gg2
 
   Home   Help Search Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
  Print  
Author Topic: City of Scrap| Alpha 1.11 - More things to kill!  (Read 5797 times)
MTK5012
2011 Haxxy Finalist
*
Offline Offline

Posts: 763


I was Gangsterman


« Reply #105 on: November 12, 2011, 09:27:07 pm »

nice!
how did you do that?
use surface stuff?
Logged
Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #106 on: November 12, 2011, 09:28:02 pm »

yep.
Logged


MTK5012
2011 Haxxy Finalist
*
Offline Offline

Posts: 763


I was Gangsterman


« Reply #107 on: November 12, 2011, 09:32:14 pm »

i never use surface thing before,is it complicated as multiplayer?
and does it cause lag?
Logged
Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #108 on: November 12, 2011, 09:42:12 pm »

Never expirenced lag with it, and it's kinda easy-ish
Code: (Object Create)
light_surf_none=surface_create(room_width,room_height);
surface_set_target(light_surf_none);
surface_reset_target();
draw_clear_alpha(c_black,1);
temp_light_mod = 0
alarm[0] = 10
Code: (Object Step)
if(!instance_exists(PlayerObj)){
    instance_destroy()
}
   
            if surface_exists(light_surf_none){
            surface_set_target(light_surf_none);
            draw_set_blend_mode(bm_subtract);
            draw_clear_alpha(c_black,(global.lightingLevel-temp_light_mod)/100);
            with (PlayerObj){
                if(flashlight) draw_sprite_ext(LightConeS,0,x,y,1,1,aimDir,c_white,1)
                if(tempType = BALLISTIC_TYPE && gun_image > 0){
                    //draw_sprite_ext(LightCircleS,0,x+lengthdir_x(35,aimDir),y+lengthdir_y(35,aimDir)-4,2.57,2,aimDir,c_white,1)
                    if(other.temp_light_mod < 50){
                        other.temp_light_mod = 50
                        other.alarm[0] = 2
                    }
                }
            }
            with (FlameO){
                draw_sprite_ext(LightCircleS,0,x,y,image_xscale/2.5+((random(10)/100)-.05),image_yscale/2.5+((random(10)/100)-.05),0,c_white,1)
            }
            with (FalseFireO){
                draw_sprite_ext(LightCircleS,0,x,y,image_xscale/2.5+((random(10)/100)-.05),image_yscale/2.5+((random(10)/100)-.05),0,c_white,1)
            }
            with (ElectricField){
                draw_sprite_ext(LightCircleS,0,x,y,1.5+((random(100)/100)-.5),1.5+((random(100)/100)-.5),random(360),c_white,1)
                if(other.temp_light_mod < random(25)+25){
                    other.temp_light_mod = random(25)+25
                    other.alarm[0] = 2
                }
            }
            with (Gib){
                if(lighted) draw_sprite_ext(LightCircleS,0,x,y,.5,.5,0,c_white,1)
            }
            with (LightObj){
                draw_sprite_ext(type,0,x,y,x_size,y_size,rot,c_white,1)
            }
            with (Storefront){
                if(goto_room != -1){
                    draw_sprite_ext(LightCircleS,0,x-43,y+14,.75,.75,0,c_white,1)
                    draw_sprite_ext(LightCircleS,0,x+43,y+14,.75,.75,0,c_white,1)
                    draw_sprite_ext(LightCircleS,0,x,y+20,1,1,0,c_white,1)
                }
            }
            with (HolidayStorefront){
                if(goto_room != -1){
                    draw_sprite_ext(LightCircleS,0,x-43,y+14,.75,.75,0,c_white,1)
                    draw_sprite_ext(LightCircleS,0,x+43,y+14,.75,.75,0,c_white,1)
                    draw_sprite_ext(LightCircleS,0,x,y+20,1,1,0,c_white,1)
                }
            }
            draw_set_blend_mode(bm_normal);
            surface_reset_target();
    }
   
Code: (Object Draw)
    if (surface_exists(light_surf_none)){
        draw_surface_ext(light_surf_none,0,0,1,1,0,c_white,1)
    }

The alarm[0] is just to make the temporary light set back to 0
Logged


MTK5012
2011 Haxxy Finalist
*
Offline Offline

Posts: 763


I was Gangsterman


« Reply #109 on: November 12, 2011, 09:50:08 pm »

i understand 50% of it D:
but it look pretty easy to learn
Logged
Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #110 on: November 12, 2011, 10:05:05 pm »

this is what if mostly boils down to.
Code:
if surface_exists(light_surf_none){
            surface_set_target(light_surf_none);
            draw_set_blend_mode(bm_subtract);
            draw_clear_alpha(c_black,<How Dark You Want It>);
            with (<any object>){
                <draw a sprite to represent light, needs to be greyscale>
            }
            draw_set_blend_mode(bm_normal);
            surface_reset_target();
    }
also make sure that this code is run ONCE, and ONLY ONCE, for each sprite that you'll use for light:
sprite_set_alpha_from_sprite(spritename,spritename)
Logged


MTK5012
2011 Haxxy Finalist
*
Offline Offline

Posts: 763


I was Gangsterman


« Reply #111 on: November 12, 2011, 10:16:39 pm »

ok, i understand most of them now
but i need to do example to fully understand it first
anyway,thanks for your help
Logged
Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #112 on: November 14, 2011, 01:50:21 pm »

exploding corpse worms, y/y?
Logged


Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #113 on: November 16, 2011, 10:47:33 am »

Hm, why won't these books burn?
Logged


Machidro
Hero Member
*****
Offline Offline

Posts: 1916


Gardicolo time is over.


« Reply #114 on: November 16, 2011, 06:22:22 pm »

Hm, why won't these books burn?

I have a fix:
Code:
burnable=1;

If you want to get fancy:
Code:
if burnable=0
burnable=1;

Logged

A CHALLENGER HAS ARRIVED.
Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #115 on: November 16, 2011, 07:21:18 pm »

No, I fixed it. it turns out they were burning, but the flames weren't appearing.
Logged


Lemonade
Apprenticecrastinator
Hero Member
*****
Offline Offline

Posts: 2492



« Reply #116 on: November 17, 2011, 03:09:20 am »

Next build : Build f451
Logged

i already have a pet that follows me around 24/7

it's called  z4

you may have seen it
MTK5012
2011 Haxxy Finalist
*
Offline Offline

Posts: 763


I was Gangsterman


« Reply #117 on: November 17, 2011, 06:50:45 am »

you should make a menu
Logged
Dusty
Hero Member
*****
Offline Offline

Posts: 10737


Dust in a box under a table


« Reply #118 on: November 17, 2011, 09:20:20 am »

Already did.
Logged


MTK5012
2011 Haxxy Finalist
*
Offline Offline

Posts: 763


I was Gangsterman


« Reply #119 on: November 17, 2011, 09:25:41 am »

a story mode then
Logged
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.111 seconds with 19 queries.