Author Topic: I need help with my bots.  (Read 578 times)

I'm trying to make it so that the bots get randomised weapons each time they spawn, and I'm using VCE, so can someone help?

Doing it with VCE will mean a lot of events.
It would be better to get someone to make a randomizer event or something.

But if you want to do it with events, you could do something like this.
In my example I will have 5 different guns.

First list all the weapons with a 100ms delay and uncheck the events:
Code: [Select]
☐ 100 onBotSpawn > bot > setWeapon Gun
☐ 100 onBotSpawn > bot > setWeapon Rocket Launcher
☐ 100 onBotSpawn > bot > setWeapon Spear
☐ 100 onBotSpawn > bot > setWeapon Bow
☐ 100 onBotSpawn > bot > setWeapon Guns Akimbo

Then you let VCE pick a random number between 1 and 5
Code: [Select]
☒ 0 onBotSpawn > self > modVariable : brick "Weapon" set 5
☒ 1 onBotSpawn > self > modVariable : brick "Weapon" random 1

Then you check that number 5 times and enable the correct weapon event.
Don't forget to adjust the event numbers to the ones you need.
Code: [Select]
☒ 2 onBotSpawn > self > ifVariable "Weapon" = 1 [8 10]
☒ 0 onVariableTrue > self > setEventEnabled "0" ☒
☒ 0 onVariableTrue > self > setEventEnabled "1 2 3 4" ☐
☒ 0 onVariableFalse > self > ifVariable "Weapon" = 2 [11 13]
☒ 0 onVariableTrue > self > setEventEnabled "1" ☒
☒ 0 onVariableTrue > self > setEventEnabled "0 2 3 4" ☐
☒ 0 onVariableFalse > self > ifVariable "Weapon" = 3 [14 16]
☒ 0 onVariableTrue > self > setEventEnabled "2" ☒
☒ 0 onVariableTrue > self > setEventEnabled "0 1 3 4" ☐
☒ 0 onVariableFalse > self > ifVariable "Weapon" = 4 [17 20]
☒ 0 onVariableTrue > self > setEventEnabled "3" ☒
☒ 0 onVariableTrue > self > setEventEnabled "0 1 2 4" ☐
☒ 0 onVariableFalse > self > setEventEnabled "4" ☒
☒ 0 onVariableFalse > self > setEventEnabled "0 1 2 3" ☐

Wow! Thanks honytawk!