Pages: 1
Topic closed
I have problem about seting actions for my cpu.
here is part of my script.
if distance to player < 40
set action to pick random 1 to 4
end if
=============================
action 1 move away from the player
action 2 walk toward the player
action 3 punch
action 4 kick
==============================
How do my make the cpu have 10% chance to do action 1 , 10% chance to do action 2
, 40% chance to do action 3 and 40% chance to do action 4 ?
Offline
Do something like this:
set action to pick random 1-10 if action=1 do action 1 end if if action=2 do action 2 end if if action>2 and action<7 do action 3 end if if action>6 and action<11 do action 4 end if
It should work
Offline
Topic closed
Pages: 1