Ledge grabbing

Posted By: Creepinbox

Ledge grabbing - 04/29/07 18:20

Is there any one that has a ledge grabbing code snippet i could learn from ?
so i could understand how to do it my self.
Posted By: molotov

Re: Ledge grabbing - 05/01/07 07:41

Check out the Axys Minigame Bonanza in the Resources section.
Posted By: Creepinbox

Re: Ledge grabbing - 05/07/07 18:15

Yeah, but the code is to tied up to the rest of the script.. making it hard to understand anything ..
Posted By: Creepinbox

Re: Ledge grabbing - 05/07/07 22:20

yeeah .. so any one have any ideas ? why aint there anyone in this froum that has made a ledge grabbing code ? wicked .. maby i should't push my own thread..
Posted By: quasarchangel

Re: Ledge grabbing - 05/07/07 22:38

Maybe its because it is not very easy to program without integrating it into the rest of the program.
Posted By: tompo

Re: Ledge grabbing - 05/08/07 09:29

Maybe some invisible box (ledge_box) along a ladge and check if players hand (vec_for_vertex) is in passable && you == ladge_box then grab? But its only sugestion, I've never used this.
Posted By: Creepinbox

Re: Ledge grabbing - 05/08/07 13:15

yeah . . . thats a little bit extream .. why cant i just trace a little bit over my head and to the wall or something .. haven't anyone done this before exept david ?
Posted By: tompo

Re: Ledge grabbing - 05/08/07 15:11

but when you use invisible box the player will be able to grab only in those places where You want to
Posted By: Creepinbox

Re: Ledge grabbing - 05/08/07 15:30

and if my level is huge ... im gonna place the boxes .. yeah no..
Posted By: quasarchangel

Re: Ledge grabbing - 05/08/07 19:59

Are you trying to immitate the Axys Minigame Bonanza? It looks to me like it was done with invisible ledge boxes. For the many blocks they are just not invisible. Just an idea, could be wrong.
Posted By: nipx

Re: Ledge grabbing - 05/08/07 20:12

I just got an idea that could work... but didnt test anything



concept:




Whenever you want to grab the edge you trace forward (TRACE 1) to check if you are standing at a wall.
If not trace downwards (TRACE 2) from where you traced to before, to check if there is a edge at all.
If so, then play your animation....


just a little hint, didnt test



nipx
Posted By: molotov

Re: Ledge grabbing - 05/09/07 08:43

Hey, maybe I can help. Because I spend some time understanding the Axys Minigame Bonanza code, and created my own ledge hanging based on it. At first the Axys Minigame Bonanza doesn't use invisible boxes of any kind, it uses trace like Nipx says. Secondly the Axys Minigame Bonanza code isn't really tied up in the rest, it just looks that way. Check out the section in Axys code that starts with;
IF (movement_mode == 10){
this section is the code that makes the ledge work, only thing you have to ad is the activation code part, you can find that by searching for "movement_mode = 10;"

But it is really important that you learn to read the codes. Hope this helps.
Have a nice day, Molotov.
Posted By: Creepinbox

Re: Ledge grabbing - 05/09/07 11:30

hey thanks ill check it out.
Posted By: Creepinbox

Re: Ledge grabbing - 05/09/07 11:37

umm .. there is no movment_mode = 10;
Posted By: molotov

Re: Ledge grabbing - 05/09/07 11:54

That's strange because there is in my downloaded version of Axys Minigame Bonanza.
Posted By: DavidLancaster

Re: Ledge grabbing - 05/09/07 14:09

It might be another number for movement_code. It's complex but it's in there. And there is no easy way to do it. Axys code is not user friendly. You just need to set up a movement state, a normal moving mode and a ledge grabbing movement mode, what one is selected is based on a variable like 'movement_mode'.

And if you don't have the experience with coding implementing something like this is kinda tricky. You have to do several trace instructions to get it to work correctly in every position without giving you bugs. I would do those traces, keep tracing in front of the players head until you hit something, once you hit something you then need to do a few more traces to make sure there is a ledge above you. Use the original hit point of your original trace, trace say 150 quants above it down to the same z position, but a little more forward from where it hit, if that trace returns a good sized number you know it's a ledge.

I then, in the same frame, place the player at that position and do a gravity trace with use_box to make sure the player isn't stuck in anything, I then return the player to it's original position and change the movement mode accordingly.

It's easy to set up something basic, it's hard to get something to work without bugs and works consistently in all situations. It's even harder to sync an animation with ledge grabbing. Once animations are involved and you need to sync it with the movement, it gets tougher...
Posted By: DavidLancaster

Re: Ledge grabbing - 05/09/07 14:10

This code isn't the easiest to read. Check it out if you're interested. It's on Acknex Resource:

http://www.coniserver.net/coni_users/web_users/pirvu/au/scripts/zeldacode.zip
Posted By: Creepinbox

Re: Ledge grabbing - 05/09/07 16:29

tell me david.. do you write your code that clean from the start or do you have to clean it up when all works well ?
Posted By: DavidLancaster

Re: Ledge grabbing - 05/10/07 03:31

Clean code? What code are you referring to? I never thought my code was clean I'm getting better at writing cleaner code, I still end up doing it messily when I start working on things before I think about the bigger picture.
© 2024 lite-C Forums