1 registered members (TipmyPip),
18,606
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How do I make my character go up a staircase?
[Re: crazycoder]
#81008
07/11/06 13:56
07/11/06 13:56
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
Senior Expert
|
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
The best way that I know of is to make the stairs themselves (and not railings on the side) as passable then include an invisible surface with the same slope angle as the stairs but have it as invisible. It's the simplest method.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: How do I make my character go up a staircase?
[Re: Orange Brat]
#81013
08/22/06 05:05
08/22/06 05:05
|
Joined: Jul 2005
Posts: 366
eleroux
Senior Member
|
Senior Member
Joined: Jul 2005
Posts: 366
|
Quote:
It's ridiculous, but this tried and true method doesn't work anymore. You can no longer use invisible level geometry for a collision hull. To achieve the same effect with c_instructions, you have to take your invisible shape and make it a map entity and then import into the level and use it that way. Then it should work.
I agree. C_collision may be better in some aspects, but currently the OBB method puts together TWO complications.
First: with USE_BOX< collision between entities and level is made using ellipsoids. So, surface normal is taken from the ellipsoid at the collision point, and not from the surface. To illustrate this better I made this image:

This causes that the surface normal read from stairs (when the entity is gliding up) constantly changes, depending on where the ellipsoid is hitting the steps. For this reason, it's very hard to code something that really allows entity to go up stairs while preventing to glide up slopes, and vice-versa. For instance, if we set the var move_min_z to 0.5, we prevent entities to go up very steep slopes, but it would not be able to go up quite mild stairs (as some of the 'normals' obtained at the stairs are read as even stepper than from the slopes).
So, now, more than ever, the 'invisible ramp' trick is necessary, and it would solve most issues. But.. here comes the second problem.
Second: Invisible level blocks are not detected by TRACE! Now, this is something I have to understand. Why would I need an invisible block that is also passable, and doesn't cast shadows, and does nothing? If there's a specific flag for Passable blocks, why make invisible blocks also passable? Of course there may be internal engine details I don't know, but I can only speak from my point of view.
These two problems narrow the options we have. In the best of cases, we have to write an unnecessarily complex script to handle this.
The manual doesn't help. Although it tries:
Quote:
Block Properties: Invisible invisible obstacles. Note that invisible blocks are also not detected by trace() instructions. If a block should be invisible, but detected by trace() , use the None texture flag instead.
Two errors here. First, the manual says 'invisible obstacles', but then, if they aren't detected, how could these blocks be obstacles? Second, the None texture tip doesn't work, as none-textured obstacles aren't really invisible: they will produce non rendered holes in the intersecting blocks, and also lose lighting information from the ground. And - produce shadows.
Quote:
c_collision... For these reasons the GameStudio Template Scripts use two c_move calls instead. One to handle gravity, the second to handle the forces acting on the player. This is a more flexible solution that allows for more control but is slower than a single c_move call.
When looking thru the templates, what I see is some failed attempts to prevent the Biped from going up slopes, and also allowing it to go up stairs, using move_min_z. I don't see dual c_move calls, but I'd like to see more clearly how could I use these 2 calls to make things work.
I don't know what is possible to do or not. But if it depended on me, I'd let C_trace and C_move detect invisible blocks just for start. Maybe we could ask Conitec for this?
Currently, I am using invisible SPRITES (set as polygon collision) as obstacles and ramps.
|Emilio|
|
|
|
Re: How do I make my character go up a staircase?
[Re: delinkx]
#282837
08/04/09 07:52
08/04/09 07:52
|
Joined: Aug 2008
Posts: 482
bart_the_13th
Senior Member
|
Senior Member
Joined: Aug 2008
Posts: 482
|
How about this:
...
c_move(me,vector(speed.x,speed.y,0),nullvector,GLIDE);// so it can glide along walls
c_move(me,nullvector,vector(0,0,speed.y),0);// so it doesnt glide here and there in slopped floor
...
This way, you can use invisible block as stair... Oh, BTW, why does c_trace doesnt detect invisible block you may ask? Just my opinion, I think it doesnt detect invisible blocks so it can be used by bullets, I guess...
Last edited by bart_the_13th; 08/04/09 07:54.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|