random

man!!! the random sensor really sux! has anybody make a random script that really works?please share! LOL :smiley:

Whatā€™s so bad about the random acuator? Just make one, go to int uniform and then set the seed value really high.

Iā€™m not exactly sure how to sue the random sensor though.

Pooba

Iā€™m seriously playing around with the random actuator! It rocks! Sure, all it does is make random properties, but Iā€™m playing with stuff like making AI actually look like itsā€™ choosing to do things. One idea:

For a deathmatch, who wants AI that always shoots you in the chest or head? Make it aim for other places like your torso or your leg!

They need to add the other two properties (strings and timers) and need something cooler, but itā€™s fine the way it is!

did i say ramdom actuator? iā€™m really sure i said SENSOR.SENSOR,controller and actuator.the random SENSOR is not any good,you make it a very high number and itā€™s supposed to make things random,but instead it makes things always.there is no diference between the always SENSOR and the random SENSOR.thatā€™s why iā€™m asking if there is a script for random.iā€™m sure it will work right with a script. :wink: :smiley:

Put this on the object:


from math import*

CON = GameLogic.getCurrentController()
us = CON.getOwner()

us.???? = int(GameLogic.getRandomFloat()* 100)

ā€œ???ā€ is the name of whatever property you want to be random on that object. The number will be between 0-100
Was that what you wanted?

thanx Lagan,iā€™ll try it later and i will tell you if it worked. :smiley:

wellā€¦that was not what i was looking for.i donā€™t want blender to choose a random property.i want something like:

random(sensor)-------and------------add object,move left,send a message,go to another scene etc. etc.

in other words events to happen randomly. :smiley:

you can use the random acuator to do this. Heres an example:
http://www.gratisweb.com/pooba/move%20randomly.jpg

Pooba

ugghhhh! all that trouble to make a random thing? then why is there a random SENSOR on blender?it could be easier if the random SENSOR works.after all,if itā€™s there is for something. :wink: :smiley:

ps: iā€™m not lazy,what bothers me is that the random SENSOR doesnā€™t work.anyway,thanx pooba :smiley:

Itā€™s not hard, that took me like a minute!

Pooba