Fangames > Engines

I Wanna Be the Engine KS Edition (For GMStudio)

<< < (14/25) > >>

Lothjon:

--- Quote from: klazen108 on July 07, 2015, 09:45:24 PM ---Oh, that must be something I missed. you need to put the following in the roomChanger's create event:

--- Code: ---onCollide=false;
--- End code ---
(click to show/hide)
GM8 defaults to false if not set, GMS errors if not set. I guess I forgot to add that and never tested it! But that should do it for you.

--- End quote ---

Yep now I works fine. Thanks!

Stepcore:
It doesn't seem like the physics are working for me at all. I dunno why, if someone knows a good gif program or something I can get, I can show what I mean.
Basically no align is walkoff align, 2/4block doesn't work, if I save on the ground I get stuck in the ground on load.
I really like how the engine is structured but this bug is killing it for me :<

klazen108:
That's strange to hear, Stepcore. Could you try downloading a fresh copy of the engine from the first post and opening/running that? I just did and the physics were normal for me, plus we've had a game and multiple test rooms developed in the engine so far and things seem to work fine. What you describe sounds very much like one of the earlier versions of the engine, before we fixed aligns and collisions. Also, what version of GMStudio do you have? If you're already using a clean copy of the latest version of the KS engine, maybe you need to update GMS (I'm running 1.4.1567 r36800)

klazen108:
v0.9 is out! Just a couple of minor bugfixes for this version.

1) I've fixed the roomChanger object, so you should be able to walk between rooms now if you place one at the edge. If you're using an older version of the engine, just add
--- Code: ---onCollide=true
--- End code ---
to the create event of the roomChanger object to fix.

2) Also fixed an issue where if you place a platform next a block, the player gets sucked in. This only occurs if you place the block after the platform in the room editor, if you place the blocks first it shouldn't. If you're using an older version of the engine, you can place all blocks first, then platforms, or you can replace the player's end step event code with the following:
(click to show/hide)
--- Code: ---//Check for collisions with blocks
xx=round(x)+.5;
yy=round(y);
 
var a,b;
a=-1;
o = collision_rectangle(x-5.5,y-12,x+5.5,y+8.5,block,1,1);
while (o != noone) {
    //if this is a platform, just ignore it
    if (o.object_index==platform || object_is_ancestor(o.object_index,platform)) {
        //store this object for later, and deactivate it
        a++;
        b[a]=o;
        instance_deactivate_object(o);
        o = collision_rectangle(x-5.5,y-12,x+5.5,y+8.5,block,1,1);
        continue;
    }
   
    if (o.solid) {
        x=xprevious;
        y=yprevious;
    }
   
    if (place_free(xx+hspeed,y) == false) {
        if (hspeed <= 0) { // Left | 左
            move_contact_solid(180,abs(hspeed));
        }
        if (hspeed > 0) { // Right | 右
            move_contact_solid(0,abs(hspeed));
        }
        hspeed = 0;
    }
   
    // strange bug in GM studio - keep player from turning around and getting stuck in the wall behind him
    if (!place_free(x,y)) {
        if (place_free(x-1,y)) x-=1;
        else if (place_free(x+1,y)) x+=1;
    }
   
    // Check for blocks above/below | 上下に壁がある時 
    if (place_free(x,y+vspeed) == false) {
        if (vspeed <= 0) { // Above | 上
            move_contact_solid(90,abs(vspeed));
            y=ceil(y); //shift the player down so we don't end up inside the block (prevents deaths to spikes in block)
        }
        if (vspeed > 0) { // Below | 下
            move_contact_solid(270,abs(vspeed));
            djump = true; //restore djump if standing on a block
        }
        vspeed = 0;
    }
   
    // 斜めの位置に壁がある時
    if (place_free(x+hspeed,y+vspeed) == false) {
        hspeed=0;
    }
   
    if (o.solid) {
        x+=hspeed;
        y+=vspeed;
    }
   
    //Fix for platforms - if you place a platform against a wall and run toawrds the wall while jumping up
    //the platform will attempt to shift you to the top of it, but the x=xprevious y=yprevious
    //code here will return you down, thus getting you caught in a loop and making the kid get stuck.
    if (y_offset != 0) {
        y=y_offset;
    }
   
    //store this object for later, and deactivate it
    a++;
    b[a]=o;
    instance_deactivate_object(o);
    o = collision_rectangle(x-5.5,y-12,x+5.5,y+8.5,block,1,1);
}
//reactivate all the objects we turned off during collision testing
while (a>=0) { instance_activate_object(b[a]); a--; }
 
if (place_meeting(round(x),round(y),playerKiller)) {
    killPlayer();
}
 
y_offset=0;
--- End code ---

This was my fault for only considering one block collision per frame, so it's possible this solves other issues where you can collide with multiple blocks at a time. Thanks to Lothjon and Kyir for the bug reports! Hopefully there's not much left to fix!

Stepcore:
Hm I downloaded it Sunday, but maybe I mixed it up with a previous version I already had on my drive(Recently formatted main drive, but might've been something on the other one). Will try when I get home.
I have version 1.4.1598 of GM:S I think.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version