Platforming slope help

So I was working on this, and I encountered an annoyance that I can’t debug. Everything works fine, EXCEPT when you go from a 2:1 slope to a 45degree angle slope. When I do so, I end up dislodged slightly into the ground, which screws things up.

Anyone think they can help? Just please ignore the shitty scripting as I am just scripting as I go, throwing in whatever checks and numbers are needed at whatever point.

BTW, script is the bottom-most NPC.

eh?
Doesn’t matter though, I think. I’ve changed my method and I’m using NPCs for the slopes and just detecting walls, and using transparency in the NPCs to get perfect slopes.

I think I went way over myself when I tried doing this(I’ve tried it before and this is the closest I’ve ever got… closest being all my other attempts were never even usable).

I just threw together a quick script:
[php]if (created) {
addtiledef2 platformertiles.png,platformer,1440,64;
disabledefmovement;
playerx=x;
playery=y;

this.speed = 1;

timeout=0.05;
}

if (timeout) {
if (keydown(1)) {
playerdir = 1;
playerx-=this.speed;
}
if (keydown(3)) {
playerdir = 3;
playerx+=this.speed;
}
if (onwall2(playerx+1.5,playery+3,1,1)) {
for (i=0;i<1;i+=1/16) {
if (!onwall(playerx+1.5,playery+3-i)) break;
}
playery-=i;
}
if (!onwall(playerx+1.5,playery+3)) {
setplayerprop #c,test;
i=1/16;
while(!onwall(playerx+1.5,playery+3+i)) {
i+=1/16;
}
playery+=i;
}

timeout=0.05;
}[/php]
That does the exact same thing with very little script. I mean I’m probably skipping on a learning experience or something here, but I’m not really getting what’s going on error-wise, and the script was poor anyways.

Also when a tile is checked at a co-ord;
Its not checked inbetween pixels or the like, it checks at bottomright.

And being at the bottom end of a slope, technically would put you a pixel under it.

Edit: I made platforms popular again. Oo

This is one I made in GS2 a while ago(though I started in GS1 and then converted it).

I get what you’re saying now though. Coordinates I were using and the checks meant it was registering twice. But like I said, I went to something simpler and I’m glad I did. Only downside is levelling and NPC count.

What did everyone do for slopes? Diagional lines would be useful for lots of other things. Did most ppl just use images of diagonals and then do multiple onwall checks to see if the angle was changing vs a right angle? or actually script a shoddy sloped block?

I posted my script that I’m using right now above. I’m using NPC images for the slopes, and because NPC images walls are determined by the shape of the image, all I simply have to do is detect the wall under the player and close the distance.

Current build. No variable jumping yet. Far from perfect(quite a few bugs) but meh, just having some fun with it.

The system I use doesn’t use onwall at all;
However with the slopes, I do not get transparencies behind the tiles :frowning:

I cheat “slightly” by having a gani loaded with more “shapely” slopes for sprites, then I have an NPC in the level do a quick scan of valid slope tiles, then it spits out the gani with the sprite index as a param. Keeps the slopes from looking “as rigid”.

Edit: Also with the video, everyone now knows your name, your email, and that you like guys who like to take pictures of their nipples in poor lighting. o_o