July 03, 2022, 03:43:35 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1] 2

Author Topic: [server-sent plugin] TF2 bullet  (Read 4729 times)

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
[server-sent plugin] TF2 bullet
« on: May 27, 2013, 05:29:35 am »

faster, deal more damage close up, less damage higher distance travel, no gravity
and it's hit scan, like sniper laser
about the name, make it tracershot or tracer_bullet



Code: [Select]
global.bullet2 = object_add();

object_event_add(global.bullet2, ev_create, 0, "
    depth = 1;
");

object_event_add(global.bullet2, ev_step, ev_step_end, "
    lifetime -= 1;
    image_alpha = 0.35+image_alpha*0.52;
    hitDamage *= 0.85;
    speed *= 0.9
    if (lifetime <= 0) {
instance_destroy();
exit;
    }

    var x1,y1,x2,y2,xm,ym, len;
    var hitline;
    var bulletHit;
    bulletHit = id;
    len=speed;
    x1=xprevious;
    y1=yprevious;
    x2=x;
    y2=y;
    
    while(len>1) {
        xm=(x1+x2)/2;
        ym=(y1+y2)/2;
        
        hitline = false;
        if (collision_line(x1,y1,xm,ym,Generator,true,true)>=0) {
            if !collision_line(x1,y1,xm,ym,Generator,true,true).team == owner.team
hitline = true;
        }
        if(collision_line(x1,y1,xm,ym,Obstacle,true,true)>=0) {
            hitline = true;
        } else if (collision_line(x1,y1,xm,ym,Bubble,true,true)>=0) {
   if collision_line(x1,y1,xm,ym,Bubble,true,true).owner.team != owner.team
hitline = true;
        } else if (collision_line(x1,y1,xm,ym,Character,true,true)>=0) {
   if collision_line(x1,y1,xm,ym,Character,true,true).team != owner.team
hitline = true;
        } else if (collision_line(x1,y1,xm,ym,Sentry,true,false)>=0) {
   if collision_line(x1,y1,xm,ym,Sentry,true,true).team != owner.team
hitline = true;
        } else if (collision_line(x1,y1,xm,ym,TeamGate,true,true)>=0) {
            hitline = true;
        } else if (collision_line(x1,y1,xm,ym,ControlPointSetupGate,true,true)>=0) {
            if ControlPointSetupGate.solid == true hitline = true;
        } else if (collision_line(x1,y1,xm,ym,BulletWall,true,true)>=0) {
            hitline = true;
        }
        
        if(hitline) {
            x2=xm;
            y2=ym;
     lifetime = 0;
   x=x2;
   y=y2;
        } else {
            x1=xm;
            y1=ym;
        }
        len/=2;
    }

    with(Bubble) {
        if(owner.team != other.owner.team) {
            if(collision_line(other.x,other.y,x2,y2,id,false,false)>=0) {
instance_destroy();
                exit;
            }
        }
    }

    with(Player) {
        if(id != other.ownerPlayer and team != other.owner.team and object != -1) {
            if(collision_line(other.x,other.y,x2,y2,object,true,false)>=0) && object.ubered == 0 {
                object.hp -= other.hitDamage;
                object.timeUnscathed = 0;
                if (object.lastDamageDealer != other.ownerPlayer && object.lastDamageDealer != object.player){
                    object.secondToLastDamageDealer = object.lastDamageDealer;
                    object.alarm[4] = object.alarm[3]
                }
                object.alarm[3] = ASSIST_TIME;
                object.lastDamageDealer = other.ownerPlayer;
                object.cloakAlpha = max(object.cloakAlpha, 0.3);
                object.cloakFlicker = true;
                object.alarm[7] = 3;
with (object) motion_add(bulletHit.direction, bulletHit.speed/150);
                if(global.gibLevel > 0){
                    blood = instance_create(object.x,object.y,Blood);
                    blood.direction = other.direction-180;
                }
                if (!other.owner.zoomed)
                    object.lastDamageSource = other.weapon;
                else
                    object.lastDamageSource = other.weapon;
                exit;
            }
        }
    }
    
    with(Sentry) {
        if(team != other.owner.team) {
            if(collision_line(other.x,other.y,x2,y2,id,false,false)>=0) {
                hp -= other.hitDamage;
                lastDamageDealer = other.ownerPlayer;
                if (!other.owner.zoomed)
                    lastDamageSource = other.weapon;
                else
                    lastDamageSource = other.weapon;
with instance_create(x2,y2,Impact)
   image_angle = other.direction;
                exit;
            }
        }
    }
    
    with(Generator) {
        if(team != other.owner.team) {
            if(collision_line(other.x,other.y,x2,y2,id,true,false)>=0) {
                alarm[0] = regenerationBuffer;
                isShieldRegenerating = false;
                //allow overkill to be applied directly to the target
                if (other.hitDamage > shieldHp) {
                    hp -= other.hitDamage - shieldHp;
                    hp -= shieldHp * shieldResistance;
                    shieldHp = 0;
                }
                else
                {
                    hp -= other.hitDamage * shieldResistance;
                    shieldHp -= other.hitDamage;
                }
with instance_create(x2,y2,Impact)
   image_angle = other.direction;
                exit;
            }
        }
    }
    
    if (lifetime == 0) {
with instance_create(x2,y2,Impact)
   image_angle = other.direction;
    }
");

object_event_add(global.bullet2, ev_draw, 0, "
    draw_set_alpha(image_alpha);
    draw_line_color(xprevious, yprevious, x, y, c_white, image_blend);
    draw_set_alpha(1);
");

object_event_add(Shot, ev_step, ev_step_begin, "
    var shot2;
    shot2 = (instance_create(xstart,ystart,global.bullet2));
    shot2.direction = direction;
    shot2.owner = owner;
    shot2.ownerPlayer = ownerPlayer;
    shot2.team = team;
    shot2.weapon = weapon;
    shot2.lifetime = 9*((min(1, abs(cos(degtorad(other.owner.aimDirection)))*13 / abs(cos(degtorad(other.owner.aimDirection))*13+owner.hspeed))-1)/2+1);
    shot2.hitDamage = hitDamage*1.3;
    shot2.speed = 65+random(35);
    shot2.image_blend = c_yellow;
    if (sprite_index == ShotGoldS)
image_blend = make_color_rgb(irandom(255),irandom(255),irandom(255));
    instance_destroy();
");

trog

  • member of intel's squad of garbagemen against the yakuza
  • Veteran Member
  • ******
  • Karma: 27
  • Offline Offline
  • Posts: 10080
  • i am uberdeath
Re: [server-sent plugin] TF2 bullet
« Reply #1 on: May 27, 2013, 05:41:38 am »

it must be hitscan
we will accept no less
Logged

PM me your apps for my clan

92% of people who see this will not
have the guts to repost it. When Goku
died in the explosion Cell tied to destroy Earth with, he did it for you and me. If you're not ashamed to love Goku, post this as your status and show everyone. Thank you, Goku. I lifted up my arms for the spirit bomb every time you asked for my energy.

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1740
  • Personal Text
Re: [server-sent plugin] TF2 bullet
« Reply #2 on: May 27, 2013, 09:02:20 am »

Right now it looks kinda dumb, just make it the currect bullet in a lighetr, yellow color.

These "beams" shouldn't be there until it is really hitscan.
Logged

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [server-sent plugin] TF2 bullet
« Reply #3 on: May 27, 2013, 02:19:07 pm »

Right now it looks kinda dumb, just make it the currect bullet in a lighetr, yellow color.
make it lighter?
These "beams" shouldn't be there until it is really hitscan.
I don't get what you're saying, it's hitscan already
it must be hitscan
we will accept no less
It is hitscan, try to run it and you will see
It's like sniper hitscan

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1740
  • Personal Text
Re: [server-sent plugin] TF2 bullet
« Reply #4 on: May 27, 2013, 03:48:13 pm »

Oh it is already hitscan. It only said "faster" so you could just have doubled the speed or something. Well then, it's alright to me, maybe remove the small grey bullet sprites (I think those are bulletsprites in the picture) so you only got the "tracers" like in TF2.


Oh, also what is the "keyword" for the .ini, so hosts can run it?
« Last Edit: May 27, 2013, 03:51:39 pm by Nova »
Logged

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [server-sent plugin] TF2 bullet
« Reply #5 on: May 27, 2013, 04:15:14 pm »

Oh it is already hitscan. It only said "faster" so you could just have doubled the speed or something. Well then, it's alright to me, maybe remove the small grey bullet sprites (I think those are bulletsprites in the picture) so you only got the "tracers" like in TF2.


Oh, also what is the "keyword" for the .ini, so hosts can run it?
yeah the default bullet is replaced by this so you won't see it in game
and keyword? I don't know, tracer_bullet maybe?
also if you want to change the way the tracer work then tell me, it's okay-looking in game though
and I need suggestion about the damage too

bullets (obviously)

  • Seasoned Member
  • *****
  • Karma: 40
  • Offline Offline
  • Posts: 1962
Re: [server-sent plugin] TF2 bullet
« Reply #6 on: May 27, 2013, 04:34:32 pm »

I think you'll have to get ajf to put it on ganggarrison.com/plugins/ for it to work as a serversent.
Logged

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [server-sent plugin] TF2 bullet
« Reply #7 on: May 29, 2013, 08:51:12 pm »

I think you'll have to get ajf to put it on ganggarrison.com/plugins/ for it to work as a serversent.
I'm waiting

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: [server-sent plugin] TF2 bullet
« Reply #8 on: May 29, 2013, 09:17:56 pm »

Get it on the plugin page before making the thread lol.
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

Nova

  • Seasoned Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1740
  • Personal Text
Re: [server-sent plugin] TF2 bullet
« Reply #9 on: June 01, 2013, 01:31:40 pm »

ajf notice it please.
Logged

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: [server-sent plugin] TF2 bullet
« Reply #10 on: June 01, 2013, 02:22:23 pm »

ajf notice it please.
ill tell him over steam
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

MTK5012

  • 2011 Haxxy Finalist
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 773
  • if (ping <= 150) jaw.y += 100;
Re: [server-sent plugin] TF2 bullet
« Reply #11 on: June 01, 2013, 04:36:10 pm »

ajf notice it please.
ill tell him over steam
sent him a message days ago...
and this is not a "big" plugin either, I just did this for some non serious servers (including mine)

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: [server-sent plugin] TF2 bullet
« Reply #12 on: June 01, 2013, 10:08:18 pm »

lol mine wasnt a big plugin either
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

ajf

  • (Ex-?)Developer and forum/web admin
  • *****
  • Karma: 7
  • Offline Offline
  • Posts: 3492
  • she's never quite as dead as you think
Re: [server-sent plugin] TF2 bullet
« Reply #13 on: July 22, 2013, 10:43:24 pm »

guys if you want me to put a plugin up send me a fucking PM

it's not difficult
Logged
aka Andrea.

did you know that spinning stars work like this???

I've seen things you people wouldn't believe. execute_strings on fire off the shoulder of Overmars. I watched object-beams glitter in the dark near the room_goto_fix. All those moments will be lost in time, like tears...in...rain. Time to die.

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4904
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: [server-sent plugin] TF2 bullet
« Reply #14 on: July 22, 2013, 11:48:08 pm »

i did tell you to add it over steam. i just figured you were too lazy
Logged
[1:37:51 PM] Derpduck: arctic u need to quote ppl that make shit posts in case they edit them
[4:20:15 PM] Rubeus Hashgrid: i cant discover anything fuck you imageshack

Pages: [1] 2
 

Page created in 0.034 seconds with 36 queries.