Ladder Revisited....need some guidance
Hi,
For the past week I have been trying to get my actor to climb a ladder. I have been trying every method I can think of, I even bought a Ladders template to see how it was scripted. But I have still had no luck getting my character to correctly climb a ladder.
Right now I have him climbing the ladder, but he automatically moves down when the up button is released. He also get stuck in his climb 1st animation frame when get gets off the ladder (not always but sometimes)
Below is a link to my ladder test page, can someone take a look at it and tell me where I am going wrong. It would make my weekend if I could finally get this to work so I can move on and create my game. Right now the character is set up with touch and keyboard controls... he also jumps, shoots left and right and ducks.
Again here is the url to the file.
https://dropbox.com/s/8s62x44k5q0hyvu/ladder-v12.zip?dl=0
Thanks in advance
Comments
@quinn221 The problem is with your down button , this is what you did:
Rule
if touch is inside
change attribute Game.move to down
otherwise Game.move to nill
Now it should be like this
If touch is inside OR if key down arrow is down
change attribute game.down to true
otherwise change attribute game.down to false
make sure you choose game.down not game.move , and make sure the rule is set to "any" not all, and make sure it is set to true or false not down or nill .
(( The game.ladder attribute could be a self.ladder attribute in the hero actor , instead of making it a game attribute , cause only the hero is affected by it))
Goodluck
@Icebox1910 Thank you so much! Something so simple sucked up so much time! Now my only issue is that my character gets stuck in the 1st frame of the animation when he get off the ladder... he snaps out of it once the jump button is hit... and ideas how to fix it?
@quinn221 this isnt the first frame , its the idle image which is there but you dont really use it at all , do you want that image to display anywhere?
@Icebox1910 No, I want the Character just animate when going up and down the ladder, the reset back to the normal state when off the ladder. How do I get rid of the idle image...I don't see it anywhere expect for in the animation. Thanks again for all your help!!!!
@quinn221 Im sorry this took a while cause you have many change image behaviors that trigger all and contradict each other , so i had to search for them and remove them , here they are.
1-New shoot rules / otherwise / remove the change image
2-Jumping move rules / otherwise / remove the change image
3-Ladder down rule / remove the ladder animation & everything in the otherwise section
4-Ladder up rule / remove the ladder animation
5-Duck Rule / remove the Rule-crouching / and only remove the change image in the otherwise section
6- add a condition to the duck rule , if linear velocity x is equal to 0 (( this replaces the crouching rule that we deleted ))
(this rule will make sure the image is always set to standing image when he is on ground )
Create a rule if
actor overlaps with TAG platform and
game.duck is false (this is so that the duck image triggers and does not contradict) and
self.motion.linear.velocity x = 0 and
self.motion.linear.velocity y = 0
then change your image to your standing image , which is moe-walk1
((this rule will make sure the actor animates if its moving on the ladder))
Create a rule if
game.ladder is true and
self.motion.linear.velocity y is NOT EQUAL to 0
then animate (( climbing animation )) and remove the tick at the (( restore actor image when done)).
by removing the tick from ((restore actor image when done)) youll make sure that the image is set to the climbing image on the ladder even if nothing is pressed.
I hope it works now
@Icebox1910 Again thank you so much... I will make the changes and let you know!
It would be benefit you to review all the changes he made and understand the mistakes you made. Most of them seem to be based on rushing and not being through. Remember this is logic so you have to be sure that your logic doesn't contradict itself. These types of mistakes are avoid by being more methodical in your approach. This is a great chance to learn and grow as a game developer. Keep at it!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@Icebox1910 It works!!! Thank you so much for all your help
@quinn221 I'm glad to hear that , your welcome
I agree, I think I was trying to many different ways to make my character move, and in the process my logic went down hill.
I have learned a lot over the past month from several several people, you guys are great!