Help with game.

So I have peen posting numerous threads over the last few days, so I am going to post my problems in this thread.(If I am allowed to do that). But on from that, My first four questions are Fall damage, weapon cycle, and how to make blender not skip animations,(so a reload animation), and how to send messages through layers, (I am pretty sure that you can not do the last one).
please respond

I’m not at a Blender capable PC so I can’t make examples but:

falling damage: use a -z ray that detects the floor- if the player falls the ray can trigger a timer. Higher timer values means you are falling further, so set a threshold and set damage based on that.

objects in other layers are inactive and can only be reached by using Python (http://www.tutorialsforblender3d.com/BGE_Python/Game_Logic/Scene/Scene_objectsInactive.html)

You’re going to need to know python. Fall damage is relatively easy:


speed = own.getLinearVelocity[2] #   2 = Z axis
if speed > 50 and collision.positive:
         bge.logic.globalDict["health"] -= 50  # You should store health as a globalDict property so it can be used across scenes (in a HUD for example).
elif speed > 20 and collision.positive:
         bge.logic.globalDict["health"] -= 20

For weapon cycle, you can use logic states or python. There are some good tutorials on YouTube.

Not sure what you mean by “skip animations”. Enable restrict animation updates in the game properties. You can change the priority of the reload action.

Not sure what you mean by sending messages through layers either. As far as my understanding foes, layers that are visible are the ones which logic works (inactive). For example, if you add an object from an invisible layer, it is added as though the game just started (in its original state). If you mean scenes, you can send messages through scenes, or use globalDict properties.

EDIT: @Rubbernuke beat me to it :slight_smile:

What do you mean by weapon cycle?I could make a blend example of fall damage.Why do you need to send messages through layers?Tell me and i will try to find a simple solution.

Sorry I meant messages through scenes. :o

message scene.blend (834 KB)Press w after you press p.This uses scene overlay to transmit messages between scenes.

You can have one thread for all your issues. But you will very quickly discover that this is the same bad idea as having all logic in one place … you get a mess of confusion as less as the different topics fit together.

I suggest you do one thread with one topic (clearly mentioned in a title). So you know all discussion belong to this topic. This way it is much easier for you to be more specific, identify appropriate solutions and for us it is much easier to follow what is going on = more help for you. In addition other seekers can much better see if your solution fits to the problem they have.

To show you how confusing this thread can become - here are my suggestions and remarks:

there are no layers … use states … ensure the game has enough performance to run at 60fps all the time … check out Collision lib … look at the guide to messages in my signature

(all of them can help you … but I guess you have some more questions now ;))

Ok thanks monster:D. But 3D solar system builder, how does the blend work. I don’t get what the armature does.

(So basically I want to click “E” and for a number in the other scene to go up.)
So just sending a message through a scene with it connected to a property saying “number up” and it going up. I can do all that, but I can’t do messages through scenes. Please help:(.

Put the example I made on the first scene.Then try to control the cube with w.Then put the example I made on start scene and try control thethe cube with w.You see the difference.

Never mind, its working now.