Glide and z limitation

Posted By: Logitek

Glide and z limitation - 03/09/16 20:15

Hello. Is there any other chance to limit z Glide?

I know disable_z_glide. But z glide is needed, so this is no option.
Also move_min_z is no solution. It does not really help.

I had the idea to limit z with this example:

c_move ............. GLIDE

If (my.z > 10) {my.z = 10)

So z 10 should never be exceeded.

But as far as I know Glide is checking the area 6 times.

So it seems that the my.z = 10 instruction does not really work. Only some frames later.
I saw that the model was exceeding this limit.

Is there any other idea to limit z?

Why is glide needed?

For example: Because some parts are a little bit higher than the base line. The enemy must walk over it with Glide. And im this example no part is higher than 9. So 10 would be a good limit. The problem are the walls. So it is possible that the enemy is gliding along a wall and is jumping on the top of it and back for a frame or more. And this should not happen.

Maybe there is a chance to limit z directly in the c_move, also with glide???


Posted By: 3run

Re: Glide and z limitation - 03/09/16 20:26

I couldn't really understand what are you asking for, but you could use 2 c_move calls, one for XY movement with GLIDE flag set on and the other one for Z movement only but without GLIDE flag.

If you need to set something like 'max climbable step' for entity (so it doesn't step over it), I have some bad news for you, it will be pretty tricky to get one out of the box. You could take a look at the movement contribution that I've made, I used two models for the movement, one for Z only and the second one for XY movement, it allows you to adjust the 'max step' thing.

Take a look at this thread:
Movement code + AutoJumping

But anyway, if we are talking about enemies, this solution is going to be too performance eating. So I would suggest you just to place some invisible walls around places where enemies can't go (passable for player's movement, but not for enemies - this could be done easity with 'c_ignore' and groups).


Best regards!
Posted By: Logitek

Re: Glide and z limitation - 03/09/16 21:35

Hi, thanks. I will have a look at it.
Posted By: Realspawn

Re: Glide and z limitation - 03/10/16 15:38

you can use clamp to set its max and min z laugh

for example : my.z = clamp(my.z,800,1800);

800 = minimum z
1800 - max z
Posted By: Logitek

Re: Glide and z limitation - 03/10/16 19:48

I think this will have the same result as the

if my.z > 10 then my.z = 10

instruction.

It will not prevent GLIDE to exceed it.

The problem is also that it happens only rarely. So it is difficult to test things. Possible that it does not happen for days. And then it happens again. But I will continue to test different solutions.

Anyway, thank you.
Posted By: 3run

Re: Glide and z limitation - 03/10/16 21:59

Originally Posted By: Logitek
I think this will have the same result as the

if my.z > 10 then my.z = 10

instruction.

It will not prevent GLIDE to exceed it.

The problem is also that it happens only rarely. So it is difficult to test things. Possible that it does not happen for days. And then it happens again. But I will continue to test different solutions.

Anyway, thank you.
First of all, you have to understand why this happens (in order to fix the problem), to fully understand that, you have to know how collision system works, at least some basics of it. If you could post here some images showing your problem, it might be easier for us to help you, cause from what you've wrote above I didn't understand what exactly are you trying to do. Why you are trying to lock Z position and why it has anything to do with Z gliding. Please show us some screens/images explaining your problem.


Best regards!
Posted By: Logitek

Re: Glide and z limitation - 03/15/16 12:06

Hi, it doesn't matter anymore. I solved it with invisible high walls around that specific places, as you have said. And it is working fine.
© 2024 lite-C Forums