Description: The article is about bge login. This is a tutorial on how to set up command line for your game. The author shows us how to make a command line with logic bricks for your games,this can be used for spawning objects in or activating events in game.
I will teach you how to set up this command line for your game. We can click enter,if it’s not the command,nothing’s going to happen. But if you write in the creat commands which you set up,you can have multiple of them get cube. In this example,you can see that if you click enter,something is going to happen. But if you don’t click in the right one,nothing is going to happen. Let’s get into it and let’s learn how to do this.
I have a camera sitting here in an amp,we will ramble in the game,we’re in teaching mode. We’re going to come into our camera view,you don’t have to be in the camera view. I’m going to scale this down and move it into the corner.
This is our text object,we will go to the game logic. We will back into camera view and go into text mode,I am going to press play. It’s not interesting. What we need to do is that we need to toggle this,we need to let it tied in here. We’re going to type into it. You can try blender as a command or get cube,it would run a command. What we’re going to do is that we’re going to add a text property.
You can change it to a string. It is holding this data. You can see it,you can’t access it. You can type it in here. You have to type it in here,you can change this in game. We want to be able to type something. If we add a keyboard sensor,we can call this key log because it’s going to log all the keys. If we were to select it,their target could be text. If we press play,nothing is happening.
We’re going to add something into this log toggle. What we’re going to do is that we are going to add a game property. It’s a boolean,we’ll call this on or off. If we set this to true,we can type something. Let’s move on. What we need to do is that we need to type in something. When we are playing the game,we don’t want to walk around. You’re going to use it,you don’t need to type all that.
You have to get rid of it,what we’re going to do is that we’re going to add a keyboard and we’re going to call this tab. I think this is the key tab. The tab is going to be my key. This is a little chat command window. If you want to call it,you can use whatever you like,but this is what we use. I’m going to add a property actuator. This is going to be a toggled height.
We’re going to snow mitt toggle,you don’t have to name these,it makes a lot easier to see,we’re going to use on /off because that’s what we are going to talk. I’m going to connect this. We should be able to click tab. It is toggling off. What we’re going to do is that we are going to type in a command and then click enter.
What we need to do is that we need to add a keyboard,we need to add another keyboard,this is going to be in time,it will return for Mac users. This is what goes in blender,I’m going to call this return. I am going to close this,we can see that.
What we’re going to do is that I’m going to connect this to control. First,we’re going to connect that up and going to clean it up to a property. We’re going to connect this up,we’re going to assign this to text and this is going to be speech marks. Those little things tell me what they called. If they’re not speech marks,I’m going to cool it a little bit. We can type something and click enter and it clears it.
We had to put those two little things. If you were to put nothing here,it doesn’t do anything. It’s coding,it allows it to be a string. You can click enter,it pops up. You can see that we have a big problem. It is looking for our variable amounts.
What we need to do is that I’m going to put two of those and leave it blank. What we need to do is that we need to make a command run. We can type get cube in our chat,we want something to shot. What we’re going to do is that when I come over here,we’re going to add a property,this is going to get cube.
You can go to something else,but I feel like that this is going to be disease for now. We we’re going to test for,text is equal to get. We are going to click return. We are going to send a message. This message is important.
The subject is going to be get cube,you can send it to an object,you can broadcast to all the objects. I’m going to broadcast that all objects,you can leave this blank. I’m going to quickly add in a cube,I’m going to rotate it by double-tapping iron.
These are going to come up here to the physic panel,we can make it invisible,this part isn’t important,but it’s a way to visually see how it’s working. We’re going to add a message sensor to this. I’m going to say get cube. If we get the message,we are going to have visibility,we’re going to run a visibility actuator,we’re going to make it a visible to people.
You can see the cube there. If you want to add more stuff,it’d be easy. All you’re going to do is to add another property. If text is equal,we can send a message,that’s very easy. That’s how you add more,you can add more as you like.