Lots of questions pt. 2

Well, here are the next generation of my questions:

How do I give my planes an alpha layer? For example if I used a tree texture, and everything else except the tree, I want to be invisible?

How do I implement a score, like in zody the slug?

How do I make it so that when I press the forward button, it plays the walk animation?

When making an object, I can make it destructable by doing a collision>delete mesh,
with a few empties adding debris, right?

And last, how do I make glowing objects in the GE, like buttons, and weapons, and lights, and such?

Hi there.

You can give an image a transparent background in Photoshop or Gimp. Save it as a .png file and it will retain the alpha layer when you load it into Blender. When you UV-map the image to your plane, you then need to set the face to Alpha mode. Make sure you’re in Edit Mode, then in the Editing window (F9), click the Texture Face panel, and click Alpha.

Scoring is done with an integer property. Simple. The hard part is displaying that property’s value in the game. You need to search for a game text tutorial if you don’t already know how to use text in the game engine. Once the text plane is created, make the “Text” property an integer. Then setup the logic to add to this number. Something like when the goal senses property “soccer ball”, send message “Player 1 score”, and when the text plane receives that message, add 1 to property “Text”. I can explain that better if you don’t get it.

The bricks that make up the Great Wall of Blender! Logic bricks are extremely useful for simple things like this. Keyboard sensor for up arrow (true pulse mode), connected to AND controller, connected to your actuator. Which actuator do you use? You have a few options. If you’re character is made up of shapes parented to eachother and you just moved them around for the animation, you need an ipo actuator. If you used an armature to animate it, you need an action actuator. In either case, set the start and end frame of the animation in the actuator, and set to loop stop, where it will keep playing as long as you hold the key. Another method that I recently adopted, is using property actuators to change an integer property through the animation frames, then have another line of logic bricks starting with an Always sensor set to play the action or ipo by property, rather than loop. This gives you greater control. For instance… if you’re making an rpg, and you want the players footspeed to increase over time, have a slow walk cycle to start out with, and then just increase the rate that the property changes, so that you’re playing the same animation faster, instead of recording several animations of varying speeds. I suggest you don’t use this last method if you’re not comfortable with properties.

Technically, it’s Collision>End Object, but yes.

Glowing objects? There’s probably some special way to do it with GLSL, I don’t know. But you can fake a glow. Think back to the alpha-layered plane. Make a glow image, this time with a black background. It doesn’t have to be .png. When you map it to a plane, set it to Add instead of Alpha. This will “add” the color values as extra light, so the black will turn invisible.

Just let me know if I need to clear anything up for you. Later.

Aaaaahhhh. Thank you, once again, Magnum Opus. You’re blending knowledge has; once again, proved useful. This ought to really help me out. I only have one question, with the scoring, does that mean i have to make all the numbers that could pop up, like if my scoring is 1-10, will i have to put a one, two, three, four, five, etc.? or do i just pick the starting integer and blender will make the other numbers automatically?

EDIT: I have another question, what is GLSL? i know that its supposed to make a game look better, but exactly is it? is it a tab in blender, or some sort of thing you install on your computer? and what does it do?

Let me explain, its not a Blender thing… its a graphics thing. Every new Graphics card and most other graphics cards will be able to see/use GLSL.

Before 2.48, Blender didnt have GLSL compatability, so you had to use python scripts to use GLSL… but thats besides the point because 2.48 is out.

GLSL is just much better graphics than non GLSL, It enables you to use Normal Maps, Emmisive maps (They make things glow), Specular maps and also allows you to have other cool feature such as reflection in the BGE… i don’t know about the reflection though, and not good with emmisive maps.

But GLSL is really worth it.

To turn it on, click Game on the top menu and select GLSL materials.

Unfortunately, your computer’s graphics card has to be compatible with OpenGL in order to use these effects. My current computer isn’t, so I don’t even bother with it. You should find out if your graphics card supports it or not.

On the scoring, all you need to do is make it start at 0, and increase by 1 after whatever event makes you score.

Okay. Im pretty sure my computer supports GLSL. I
ll check tho. And with the scoring, I knew that, but do i have to add the bitmap for the one, or just the one for the zero?

EDIT: and here’s my next question, how do i do a time delay on my guns? Like, i don’t want my rifle or pistol or whatever to shoot as fast as, say an AK47. How do i set something like that? And my next one, which may be answered in the other question, is with grenades, i want it to wait like 3 seconds on the ground before exploding how do i do that?

Add a delay sensor for the grenade connected to an and controller then an edit object actuator.

Hey, this Tutorialsforblender really helps you understand about logic ticks, pulses and delays… http://www.tutorialsforblender3d.com/GameDoc/LogicBricks/Sensors_2.html

read about the True and false level triggering… and the Trigger delay.

The trigger delay bit is what you need for the guns automatic firing to be the right speed… change the value so it changes how fast it goes. Remember, 60 = 1 second.

Edit: and as Minifig said, use a Delay sensor to delay for 3 seconds. (which means the delay number will be 180)

go to http://bgetutorials.wordpress.com/2007/11/07/how-to-get-realtime-text-in-blender/ to find out how to use text in realtime.(it’s a little outdated, simply select the face(s) and use the u key in edit mode and click unwrap instead of face select mode which doesn’t exist no more)

as for the timing, use a timer property: when something get triggered, make the timer get back 0, change the and controller that’s connected to the trigger and the actuator to expression and type “(name of the timer) > (how much delay in seconds)”.

as for the grenades, you can use a timer: when it gets to a certain number, delete the object (edit actuator), add some “particles” to show an explosion etc. this only works if the grenades are on another layer…

Surely thats the very outdated way of timing and delays in blender now.

Now we have delay actuators and states it makes that process much simpler to handle.
Although…that method is still useful.

Okay thanks guys. This is very helpful. If i think of anything else, I’ll let you guys know.