so i have added pushable blocks using a cutdown version of the player code
.... however this script/function "update_slope_object(o_player, 0, 32)" seems to be affecting the player and the block whenever i go near a ramp with a block.
is it because of this line in the function?
position.z_height = lerp(_z1, _z2, _ds)
and both the player and block are using "position" ?
simply trying _player.position.z_height = lerp(_z1, _z2, _ds) just breaks most of the collisions.
are you trying to push a block up a ramp? "_player.position.z_height = lerp(_z1, _z2, _ds)" is going to change the collission cross section of the player. If you want I can extend the tutorial this weekend for pushable blocks. Just let me know what you are looking for and I can try to address it specifically.
1.25 onwards i tried the fix of _player.position.z_height but this only seems to make the collisions break.
At 2.29 i am trying to show that the player and the block have new Positions so they should not be effected by each other ? i wonder if you can replicate this at all on your end ?
I have added some code to the player so that you can increase/decrease your max speed from 0 to 12 by clicking the left/right mouse buttons.
I have made some ramps and placed blocks next to them. At a slow speed the player can go up and down the ramps and continue along the blocks fine.
However when the player goes up the ramp in a faster speed, the player will collide/bump with the next block and stop, before continuing again.
The work around I found to stop the collision/bump, was to increase the z_step.
" if instance_place(x,y,o_ramp_LR) or instance_place(x,y,o_ramp_RL){ position.z_step = 16;}else{position.z_step = 4;} " without posting a video or the full code/project here.
You might want to make z step equal to the absolute value of speed + 1 (speed on x/y axis only). Then, the further (i.e. faster) you step into the slope, the higher the step the player can take. Keep in mind that this could allow the player to climb on anything if their speed exceeds the height of the object.
Thank you for your reply.
I have created a hierarchy o_blocks_parent with, o_blocks and o_ramps as the children. And updated all the collision code with o_blocks_parent. And cleaned up my previous code in the above comment with; if instance_place(x,y,o_ramps){ position.z_step = 4 + abs(speed+1)}else{position.z_step = 4} this way i cant "climb" on anything and it works buttery smooth.
I am unable to do most paid work since I don't have a lot of time to get involved in projects that will require copious amounts of development. My work as an Embedded Systems Programmer is a demanding task, so this is more of a hobby for me at this point.
← Return to asset pack
Comments
Log in with itch.io to leave a comment.
Can anyone help with this!
so i have added pushable blocks using a cutdown version of the player code
.... however this script/function "update_slope_object(o_player, 0, 32)" seems to be affecting the player and the block whenever i go near a ramp with a block.
is it because of this line in the function?
position.z_height = lerp(_z1, _z2, _ds)
simply trying _player.position.z_height = lerp(_z1, _z2, _ds) just breaks most of the collisions.and both the player and block are using "position" ?
Frothzon Help!
are you trying to push a block up a ramp? "_player.position.z_height = lerp(_z1, _z2, _ds)" is going to change the collission cross section of the player. If you want I can extend the tutorial this weekend for pushable blocks. Just let me know what you are looking for and I can try to address it specifically.
If you would extend the tutorial that would be totally awesome :D
I'm looking at adding the push/pull blocks so that the player can push them off ledges and fill gaps in walls to reach new areas.
And possibly build a path of them to reach a small island in the water.
I dont know if this helps at all?
1.25 onwards i tried the fix of _player.position.z_height but this only seems to make the collisions break.
At 2.29 i am trying to show that the player and the block have new Positions so they should not be effected by each other ? i wonder if you can replicate this at all on your end ?
I see, I will add in another tutorial for this. I will need to change the collision system to make things like this easier to implement.
Thank you very much for this tutorial series!!!
I have added some code to the player so that you can increase/decrease your max speed from 0 to 12 by clicking the left/right mouse buttons.
I have made some ramps and placed blocks next to them. At a slow speed the player can go up and down the ramps and continue along the blocks fine.
However when the player goes up the ramp in a faster speed, the player will collide/bump with the next block and stop, before continuing again. The work around I found to stop the collision/bump, was to increase the z_step.
"
if instance_place(x,y,o_ramp_LR) or instance_place(x,y,o_ramp_RL){
position.z_step = 16;}else{position.z_step = 4;}
"
without posting a video or the full code/project here.
Is this correct?
You might want to make z step equal to the absolute value of speed + 1 (speed on x/y axis only). Then, the further (i.e. faster) you step into the slope, the higher the step the player can take. Keep in mind that this could allow the player to climb on anything if their speed exceeds the height of the object.
Thank you for your reply.
I have created a hierarchy o_blocks_parent with, o_blocks and o_ramps as the children. And updated all the collision code with o_blocks_parent. And cleaned up my previous code in the above comment with; if instance_place(x,y,o_ramps){ position.z_step = 4 + abs(speed+1)}else{position.z_step = 4} this way i cant "climb" on anything and it works buttery smooth.
You will be named in the credits.
I just donated $15 to this project. Between 1-4, slopes and the water I’ve been trying to figure this out for a year.
at this point I could probably add stuff like ladders and wall jumps, myself, but ideas to add for version 5
Thanks, I appreciate it. When I have some time I will add tutorial #5.
This is really awesome stuff. Do you ever do paid work in gml?
I am unable to do most paid work since I don't have a lot of time to get involved in projects that will require copious amounts of development. My work as an Embedded Systems Programmer is a demanding task, so this is more of a hobby for me at this point.