Help with making AIs, Gravity and Movable Objects!
mprincer
Member Posts: 5
Hello, I am making a Platform game for my class and it is my first time using Game Salad, so I need some help with these three things:
1) Programming an AI to follow an actor. I'm not talking about an enemy AI, but more of an companion AI. In my game, the player character will move up the stage and his companion will follow him. This means that the AI should perform certain actions when it comes in contact with certain actors, like climb a ladder or climb over a block, as they follow the player.
2) Gravity when on a ladder. The actors will need to climb ladders to reach the goal. I have accomplished getting the actors to move on the ladders by using Spawn Actor. The problem is that whenever I let go of the keys, the player is pushed down by the Gravity. I have tried turning off the gravity in the scene and applying artificial gravity only to actors I want affected by it, but not even that seems to work.
3) Movable objects. As with climbing ladders, the player needs to move and jump on blocks in order to reach the goal. I want the actor to be able to pull/push the blocks when the space bar is pressed and then jump on top of them in order to reach a goal.
Advice on any of these three problems would really be appreciated! If you need me to clarify anything, just say so.
1) Programming an AI to follow an actor. I'm not talking about an enemy AI, but more of an companion AI. In my game, the player character will move up the stage and his companion will follow him. This means that the AI should perform certain actions when it comes in contact with certain actors, like climb a ladder or climb over a block, as they follow the player.
2) Gravity when on a ladder. The actors will need to climb ladders to reach the goal. I have accomplished getting the actors to move on the ladders by using Spawn Actor. The problem is that whenever I let go of the keys, the player is pushed down by the Gravity. I have tried turning off the gravity in the scene and applying artificial gravity only to actors I want affected by it, but not even that seems to work.
3) Movable objects. As with climbing ladders, the player needs to move and jump on blocks in order to reach the goal. I want the actor to be able to pull/push the blocks when the space bar is pressed and then jump on top of them in order to reach a goal.
Advice on any of these three problems would really be appreciated! If you need me to clarify anything, just say so.
Comments
Have you tried the GameSalad Cookbook to learn the basics? We could give you the code and you learn nothing.
1) Just have him repeat your actions a step or two behind.
2) Make a rule for gravity to be active. When touching the ladder set it to false.
3) On hero touch + space bar { move object direction }
I believe I have found ways to work around with my problems, but I can really use help with programming the AI into following the player. For example, I have problems with programming the actor to only move horizontally. Even with Collisions set up, the AI ends up moving right off the screen at a very fast speed and doesn't return.
Who knows hopefully someone can help you out in time for tomorrow and do the coding for you, but is that what your professor wants to see ?
"At this point, if anyone can explain how to constrain my actor to stay on a certain point on the X-Axis"
If you want your actor to stay at a certain point on the X axis don't change its X value.
(If I understand your question correctly?)
There is a crate that the actor has to move and then after he is done moving it, he can climb on top of it to reach higher platforms. Any idea how to do this? The crate merely glitches around on the platform and even with Movable on, it cannot be moved when the player character collides with it.