Message-random-message

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Post Reply
Creamyyogurt
Posts: 0
Joined: Wed Feb 22, 2006 7:22 am

Message-random-message

Post by Creamyyogurt »

How can i make a message be sent to my empty, then have it trigger a random choice of which message it sends out of a series of messages to other empty's. This is becomeing frustrating to me. And what is the difference of use in "And" or "Or" controllers, so far out of what i have done, i cannot get a difference. I know there is but i am having trouble.

Stu_Flowers
Posts: 0
Joined: Fri Dec 08, 2006 12:23 am

Post by Stu_Flowers »

The AND controller is for linking multiple sensors together into one controller. Thus, in order for your controller to "allow" the pulse to reach the actuater(s), ALL of the sensors tied into the controller must be firing. With the OR controller, if ANY of the sensors that are tied into the controller fire, the pulse will pass to the actuator.

As far as a random message actuator, if you don't know python (and I don't), create and name an 'int' property for your empty. Add a 'random' actuator, link it to the incoming message sensor. On the actuator, change the 'Bool Constant' tab to 'Int Uniform'. Enter your property name and choose a seed. In the 'Min' text field, enter the value of '1'. In the 'Max' field, enter the number of messages that you want to send out. Create the same amount of sensors, and change them to the 'Property' type. In the 'prop' fields, enter your property name. In the 'value' fields, enter a number. For the first sensor: enter '1'. For the second: enter '2', and so on. Create your controllers and message actuators, then link them to your 'Property' sensors.

That should work. Sorry if you're way past this and I'm just insulting your knowledge!! All the best on your game!

Brian

_____________________________________________________________
It's easiest to live with a decision if it's based on an earnest sense of right and wrong

Post Reply