Posted in Interface section, but maybe can get answer here

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
bill2reg
Posts: 0
Joined: Wed Feb 23, 2011 11:44 am

Posted in Interface section, but maybe can get answer here

Post by bill2reg » Wed Jun 27, 2012 9:09 pm

Trying to set up a motion somewhat like a reel on a slot machine. Using the spacebar to initiate a spin is OK, as long as I hold the spacebar down it spins. But I want to hit the spacebar once and then have the wheel spin a random number of times and stop on a face of the cylinder. I don't see how to set this up, so if anyone has a suggestion, I'd appreciate the help. Thanks.
Reply with quote

RoboticGolem
Posts: 0
Joined: Tue Oct 29, 2002 5:21 am

Re: Posted in Interface section, but maybe can get answer he

Post by RoboticGolem » Mon Jul 02, 2012 7:45 am

bill2reg wrote:Trying to set up a motion somewhat like a reel on a slot machine. Using the spacebar to initiate a spin is OK, as long as I hold the spacebar down it spins. But I want to hit the spacebar once and then have the wheel spin a random number of times and stop on a face of the cylinder. I don't see how to set this up, so if anyone has a suggestion, I'd appreciate the help. Thanks.
Reply with quote
Seeing as you have no reply, I'm going to do my best to give you an idea. I've never used the game engine (I'm assuming that's what your using)and that your writing a python script to stop your wheel?

if so, you could easily append a quick function to make your wheel stop after a random number of turns.

import random
turnstop=random.randint(x,y)

Where x is the minimum number of turns, and y is the maximum. Then just plug in the turnstop to your controller(?)

Hope this helps =/

bill2reg
Posts: 0
Joined: Wed Feb 23, 2011 11:44 am

Post by bill2reg » Mon Jul 02, 2012 2:38 pm

I am using the game engine. I am not at all familiar with Python, so I have no idea what that script is or how to use it. I had assumed that somehow the "random" actuator in the BGE might be used along with some value input to a sensor....such as =>, <= etc, but I couldn't see exactly how that might work. But thanks for the suggestion.

stiv
Posts: 0
Joined: Tue Aug 05, 2003 7:58 am
Location: 45N 86W

Post by stiv » Mon Jul 02, 2012 5:52 pm

Questions about *using* blender are best asked at the user forums on blenderartists.org .

Post Reply