October 22, 2019, 02:06:10 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.
Chat with us online! (or @irc.esper.net/#gg2)
Come Mumble with us!

Pages: 1 [2]

Author Topic: Who might be interested in helping to make a GG2 singleplayer campaign?  (Read 2855 times)

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 11006
  • Dust in a box under a table

Rebel got vertical elevators working.
Might work better in singleplayer, where's there's no lag.

Orpheon

  • 2011 Haxxy Award Winner
  • *
  • Karma: 15
  • Offline Offline
  • Posts: 6439
  • Developer

Hmm...Is the source of the latest INSmod available? I don't see it, only old sources.
Logged

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 11006
  • Dust in a box under a table

Uh I got a newer one, lemme see if I can find the code for the elevators at least.

Collision Code for the Elevators from Character:
Code: [Select]
if((bbox_bottom - (y-yprevious) - 1) < (other.bbox_top - (other.y-other.yprevious)))
        {
        while(place_meeting(x,y,other.id))
        {
        y-=.1;
        }
        vspeed=other.vspeed;
        }
else if((bbox_top - (y-yprevious) - 1) > (other.bbox_bottom - (other.y-other.yprevious)))
{
while(place_meeting(x,y,other.id))
{
y+=.1;
}
vspeed=other.vspeed;
}
else if((bbox_left - (x-xprevious) + 1) > (other.bbox_right - (other.x-other.xprevious)))
{
while(place_meeting(x,y,other.id))
{
if place_free(x+.1,y) x+=.1;
else break;
}
hspeed=0;
}
else if((bbox_right - (x-xprevious) - 1) < (other.bbox_left - (other.x-other.xprevious)))
{
while(place_meeting(x,y,other.id))
{
if place_free(x-.1,y) x-=.1;
else break;
}
hspeed=0;
}
Then the End Step Code for the elevator to reset double jumps I guess
Code: [Select]
if !(collision_rectangle(x-sprite_get_bbox_left(0),y-sprite_get_bbox_top(0)-8,
x+sprite_get_bbox_right(0),x+sprite_get_bbox_bottom(0),Character,true,true))<0{
    var char;
    char = instance_nearest(x,y,Character);
    char.doublejumpUsed=0;
}
« Last Edit: July 18, 2012, 05:06:38 am by Dusty »
Logged

RebelINS

  • Martial Expert
  • *
  • Karma: 400
  • Offline Offline
  • Posts: 6865
  • I am a rising contender, confident to win.

horizontal moving platforms are just as easy to code; arguably easier than elevators because you won't get stuck as often. just change the vspeed to hspeed when you're on top of it. no moving solids involved.

if you leave it bare, touching the sides of the platform won't do anything. you can add a code to either make it crush you if you're against a wall, or make it switch directions when it collides with you.

here's some more code for 'platforms that move you' (like a conveyor belt)
create event in MovePlatform object
Code: [Select]
// -1 = left
// 1 = right
moveDirection=1
moveSpeed=1;
begin step of Character object
Code: [Select]
if place_meeting(x,y+1,MovePlatform){
    var movePlat;
    movePlat = instance_nearest(x,y,MovePlatform)
        hspeed+=movePlat.moveDirection*movePlat.moveSpeed;
    }
collision with MovePlatfrom in Character object
It's pretty much the same shit as the collision with player walls, except I added an incremental step thing, because the sprite masks might be smaller than usual. (I did this because of a map I'm working on in my mod).
(click to show/hide)
After that, you can create any object with any sprite and parent it to MovePlatform and then place them in a room.


Luigibro

  • Full Member
  • ***
  • Karma: 2
  • Offline Offline
  • Posts: 590
  • Est. 2011

I can try my hand at making a map or art 'n' such.
Logged
Stop fighting, it's just a game  :smiley16:
It's practically a war game, so fighting is necessary.
Quote from:  Tibbles, IRC
[15:58] <Tibbles> Lag is weaknes leaving the ethernet cable

Catman

  • The Argumental
  • Veteran Member
  • ******
  • Karma: 18
  • Offline Offline
  • Posts: 4411
  • Take on me
    • Yuki Yuki Yuki

Red
Infiltrator
in the base

Find it and kill it.
Logged
My style is the best...
...so I challenge you!

Orpheon

  • 2011 Haxxy Award Winner
  • *
  • Karma: 15
  • Offline Offline
  • Posts: 6439
  • Developer

Ah, sorry guys. Killercrusher and I just had a pretty good idea of something else, I think I'm doing that. Thank you anyways for your time and code samples and offers.
They'll probably come in handy someday, since a campaign would be a good idea for afterwards too.
« Last Edit: July 19, 2012, 01:29:44 pm by Orpheon »
Logged

notarctic

  • just arctic, what gives?
  • ******
  • Karma: 8
  • Offline Offline
  • Posts: 4940
  • 👎👀 bad aim ba̷̶ ԁ aIm 👎 thats❌ some bad 👎👎aim
    • arcticland
Re: Who might be interested in helping to make a GG2 singleplayer campaign?
« Reply #22 on: August 09, 2012, 11:30:47 am »

well what would the story be just the red team and their efforts to defeat blu team? sounds like what happens during multiplayer. single player bot mode would be nice though
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.044 seconds with 36 queries.