View Full Version : "random" function possible?

11-08-2008, 07:23 AM
hi everyone at LBPC. well, I have a dilemma. I want to make a boss monster for my patapon level, a giant firebreathing... dinosaur. anyways, i was wondering if it was possible to make my dino perform random attacks. i know now its possible for 1 master switch to execute a series of reactions that will result in the attack, but i dont know if its possible to create a system that would pick one of those master switches on a purely random basis. also, it shouldnt be able of performing another action until the first one is done, timed delay or whatever.

can you guys help me find this solution?

11-08-2008, 12:12 PM
I was thinking about a way to do random operations some days ago, but it's a really hard thing to do with physics, because everything is predetermined. The only way to do it is to use something which is hard to predetermine or to use something which is affected by the player.

So I think one way to get random outputs is to use "time" as a random factor. The problem with that is that you can't get random outputs at fixed intervalls. For example make an emitter drop an object if sackboy is in a position where the enemy is supposed to use an attack, using a sensor switch (one shot). The dropped object could then be dropped onto a rotating platform, which will throw the object into different directions, depending on the time the platform is hit. Place a magnetic switch at each direction, which will sense the object and activate an attack.
This method will be pointless if the player doesn't move a lot while fighting the boss, as the only moving out of and into the "sensed area" of the sensor switch will trigger an attack. You can also place the sensor switch onto a piston or something like that to make it activate multiple times though.

But really random operations are hard to do, maybe I'll come up with another way later..

11-08-2008, 09:45 PM
that might work. Sackboy will be moving around alot doing different button commands, so an emmiter and rotating platform might actually do the trick for me.

thanks for the help!