Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,606 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How do I make my character go up a staircase? #81007
07/11/06 13:51
07/11/06 13:51
Joined: Aug 2005
Posts: 57
crazycoder Offline OP
Junior Member
crazycoder  Offline OP
Junior Member

Joined: Aug 2005
Posts: 57
Hi everyone,

How do I make my character go up a staircase?

For example, I have a character with a walk animation, and all is fine when the character is walking on flat ground.

However, when the character finds a staircase, how do I make it so that the character goes up the staircase?

Do I need to script it? How do I tell the character that that's a staircase and the animation should not be the standard walk animation?

How do I make the character able to go up the steps? The dimensions of the steps of the staircase may or may not allow the character to be able to go up the staircase.

If I have many staircases in my game, and they have different step heights, how do I handle that?

I hope you see my problem. Any suggestions?

Thanks!

CrazyCoder

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 Offline
Senior Expert
ulillillia  Offline
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: ulillillia] #81009
08/13/06 22:21
08/13/06 22:21
Joined: Jul 2005
Posts: 366
eleroux Offline
Senior Member
eleroux  Offline
Senior Member

Joined: Jul 2005
Posts: 366
Just came by while looking for some code to smooth climbing stairs.

I just tried the method you describe, but it happens that Invisible blocks are also ignored by c_trace. I tried also assigning None textures to all sides of the slope block, but it kinda creates holes in the staircase steps textures.

Do you have any idea of the flags I should set or not for the stair steps and the slope block?

Sorry for hijacking this thread...

Emilio

Re: How do I make my character go up a staircase? [Re: eleroux] #81010
08/13/06 23:37
08/13/06 23:37
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
The origin of your model has to be higher (relative to lower end of model) than the stair height to make the stair climable.

It will probably not look very good, but this can be adjusted by playing around with gravity values of the move routine.

Playing a different animation for staircases is not as eassy. You could however use a special stait case floor texture and then valuate its texture name using c_trace and then switch your animation code depending on the texture name. This is the easiest way I can think of...

Re: How do I make my character go up a staircase? [Re: FBL] #81011
08/19/06 19:44
08/19/06 19:44
Joined: Jul 2005
Posts: 366
eleroux Offline
Senior Member
eleroux  Offline
Senior Member

Joined: Jul 2005
Posts: 366
Yeah, that is with the A5 template (non c_collide instructions, or at least no OBB).

Maybe I'm wrong but I think A6 templates use the new OBB collision, so the origin doesn't affect the ability to go up stairs.

now, using C_move with glide is enough to go up stairs. The problem is stopping the entity from going up slopes.

Re: How do I make my character go up a staircase? [Re: ulillillia] #81012
08/20/06 00:45
08/20/06 00:45
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
Quote:

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.




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.


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
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 Offline
Senior Member
eleroux  Offline
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: eleroux] #282831
08/04/09 05:56
08/04/09 05:56
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
does anyone has a working solution for stairs climbing to share ??


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
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
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
How about this:
Code:
...
   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.

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1