Some Possibly Complex Questions

Okay, so I’m working on building this game. It’s a racing game with golf carts (yeah, I know - it’s for my organization as kind of an in-office thing). I have it planned, and most of the models and such.

Basically, I want to do sort of a Mario Kart type game, with power-ups and the like.

Well, here’s my list of questions. I would appreciate any help. I really want to break ground learning the game engine. I’ve been modeling and animating for nearly 6 years, and I’m ready to learn a bit more.

I have a golf cart model. I can make it move. I have an item that when run over is supposed to trigger a spin on a the “power-up wheel”. Well, getting the cart to run over the object is no problem. I can even use an overlay scene to make the power-up spins appear once the object is run over. But here’s what I’d like to know.

  1. I need the power-up spins to be random. I did make all the animations in advance (assuming I needed them), and I have stills of the power-ups once the wheel stops. But is there a way to trigger it to be random. We’re basically talking about eight wedges on the wheel which represent the individual power-ups. I need it to go like this: when I run over the item, it will trigger one of the eight animations I’ve prepared to appear in the overlay scene (unless there’s a better way to do this - I’m open to suggestions). Once the animation is found,

  2. I then need a particular still to replace the spinning wheel in the overlay scene. (The still image will need to correspond with whatever power-up animation is played.) I don’t mind using more overlay scenes. I just don’t know how to make it flow like this.

  3. Depending on which power-up is selected, I need that specific power-up to be available. I’m not sure how to approach this. Just as an example, I have an item that behaves the same way the red shells do in Mario Kart (they seek the cart immediately in front of you). I know I’ll need to configure the power-ups first. Just looking for some insight into this.

  4. I’m having a big problem with my textures in the game engine. I can go into Textured view and play the game, but the textures that are movie files (like the spinning power-up wheel) do not play. I just get a still. The texture is configured properly to display motion when rendered, but I don’t get that in the game engine. Is there something I need to do?

Finally, let me say that I am really want to do this as much as possible with logic bricks. I can probably handle python, but I have everything else thus far in logic bricks, and I’d really like to keep it that way.

I am using Blender 2.49 on a Mac (but I do have 2.59 on a Vista PC as well - only using Mac at present). The files are available to view if need be.

Thanks!

You can use the random actuator.
It gives you a random number that is placed in a property of you choice.

You can use this property to trigger other things (like spinning wheel animations).
You can do that with a property sensor.

Example:
property “choice” int =0

define 0 = no choice
define 1…8 choice

sensor <whatever senses the pickup> -> AND -> random actuator “choice” (value 1…8 [not zero!])

property sensor “choice” not equals zero -> AND -> property actutator “choice” assign 0
property sensor “choice” equals 1 -> AND -> animation A
property sensor “choice” equals 2 -> AND -> animation B
property sensor “choice” equals 3 -> AND -> animation C
property sensor “choice” equals 4 -> AND -> animation D
property sensor “choice” equals 5 -> AND -> animation E
property sensor “choice” equals 6 -> AND -> animation F
property sensor “choice” equals 7 -> AND -> animation G
property sensor “choice” equals 8 -> AND -> animation H

Do you get the idea?

You can use the Edit Object actuator in Replace Mesh Mode

You can use the Edit Object actuator in End object Mode + Edit Object actuator in Add Object Mode

Dsign:
you have

  • collectible power-ups (to be collected)
  • installed power-ups (to be used)

Method A)
You can apply the installed powerups at the beginning, just hidden to the User (e.g. invisible).
When collecting the according collectible power-up, you can show the installed one (visibility actuator) + and enable it for usage.
When the user activates the powerup - the Power up should perform whatever it is supposed to do. After finishing it should be back to its initial state (invisible, disabled)

Mathod B)

  • use the AddObject acutator to add the installed power-up object when collecting the according collectible power-up
  • activate the installed power-up on users request. The powerup should be removed (via end object actautor).

Optional:
You an introduce a third power-up:

  • activated power-up

This would allow to collect the same power up, while the current one is still active.

Method A)
Use the tile animation of the UV-editor texture
It creates an animation from the single images of one texture

Method B)
use the VideoTexture Module to project movie on a material. (Python needed)

For both methods you should find tutorials.

Thanks, but I’m not sure you’re getting what I’m saying about video textures. The video I’m using is already prepared. It’s an .mov file. It’s not a bunch of stills. I only have stills of the wedges once the wheel is spun. The animated texture is a VIDEO that is mapped to a plane. It plays through in rendering, but not in the game engine.

Also, I REALLY don’t want to mess with UV mapping at all. I personally hate it. If there’s a way to do it without it, I’d be much happier. And remember, I want to use Logic Bricks, not Python.

I’m sorry. I’m not trying to be difficult. I just have specific methods I like using and ones I dislike using.

So you are restricted to Python (VideoTexture) regarding video.

You want to make a game, so you have to live with UV. It is an essential part of the Rendering engine and therefore part of the development pipeline too. Luckily Blender makes it easy for you to work with it.

Well, that’s kind of a bummer. Fortunately, there are several tutorials on how to use Python out there. I won’t get too lost.

So knowing that I need to use UV and Python, would you stick with your answer to point one? Does using a video texture in Python change any of that? Also, can I get a little more detail on the brick layout of the property and random sensors or actuators you mentioned?

Using videotexture don’t take a big script. There’s even a example one in the doc:

http://www.blender.org/documentation/blender_python_api_2_60_6/bge.texture.html

You use script by putting it in a textblock and adding a sensor (in this case probably a always sensor set to true puls (the ‘…’ buttons)) and connect it to a python controller calling the script.

I also hate UV-unwraping black magic - but You just have to deal with it - unwraping a plane is not that hard - even I have start to get that much of the magic :slight_smile: