Am trying to make a random AI like it random it mighty sleep or jump or go slower. is that possible???
Yes! To do this, I have no truly effective way, but using the Timer extension to do one of those things randomly every random amount of time would be my best bet.
yes its definitely possible. make each action in its own function, then use the random math block with the parameters of how many action functions you have in on game update block, then if the result from the random math block is 1 for example, then call the first action function. if the result is 2 then call the second action function and so on. add a timer block so it has a delay before choosing another random math result or it will update your actions too quickly
I feel uncomfortable trying to read this. Well it is certainly possible, use the “random # to #” block or whatever to get that randomness.
What I like doing is using a game update block to control the enemy AI - this means that it operates on a loop thats constantly running to give it new actions.
The trick is using the % chance blocks, you can make a random event occur every cycle of the loop. You can also set a number variable for the different events and then choose a random number for your event.
Some things like completely break if you put it under a game update loop though, as itll be constantly updating so I use the timer extension to make sure events can only occur once every 100ms, or some other time. Using the game update on every x time also works. Some events are fine with being run constantly though, like setting an angle and speed.