I would do it based on the players animation, this means making a traced box
in from of the player at about the point where the player could make a grab,
if the player is jumping and a solid is detected, make the grab. Now
dynamically detecting a grabable surface would be hard imo, and would
require a lot of thinking into the matter. But the easiest thing to code
could be brush entities that define the surface of a wall and the player
would do the grab animation at the base of the brush and the orientation of
the grab would be defined in the brush entity itself.

On Thu, Nov 26, 2009 at 7:38 AM, Mandibull <mandib...@gmail.com> wrote:

> On Tue, Nov 24, 2009 at 21:56, Matt Hoffman <lord.matt.hoff...@gmail.com
> >wrote:
>
> > I'm trying to go about figuring out what an efficient way of creating
> > 'ledge
> > movement' for Source would be.
> >
> > What I'm trying to accomplish is similar to Mirrors Edge and Assassins
> > Creed
> > where you can jump and hang onto a ledge and move left/right and climb
> up.
> >
> > Ideally I'd like it to work on both static brushes, moving brushes, and
> > models.
> >
> >
> > What would the ideal way of doing this be? My interpretation would be as
> > follows:
> >
> > 1: Trace out to the wall
> > 2: Find the edges of the brush using GetBrushesInAABB and GetBrushInfo
> > 3: Compare the distance of the player to the top edge. If it's less than
> X
> > amount, move them to the edge
> > 4: Constrain movement to left/right
> >
> > However, this would be a very constrained movement would probably only
> work
> > on a flat surface wall, and nothing like cylinders or something with a
> > ledge.
> >
> > Has anyone ever tried implementing this kind of movement in source, or
> have
> > any ideas?
> >
> > Thanks.
> >
> >
> This has been done in the Dystopia mod in ClipVelocity() using
> UTIL_TraceRay() with MASK_PLAYERSOLID and COLLISION_GROUP_PLAYER_MOVEMENT
> masks. You also got to check the angle between the player's eyes and the
> surface's normal among other things.
>
> Once you grabbed the ledge you can hook your movement code into
> PlayerMove().
>
> I can't tell if it's the best way to do it but it works. It might also
> requires some work with animations and prediction.
>
> --
> Mandibull
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


-- 
~Ryan ( skidz )
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to