lol....well thanks
what i ment for controlling one of my characters is this:
key_w=0
key_s=0
key_a=0
key_d=0
key_space=0
key_enter=0
key_upattack=0
key_downattack=0
key_block=0
key_run=0
these variables are zeroed every sync and for every character...
now for my character if im controlling him with a keyboard it looks something like this:
//keyboard input
usingkeyboard=0
if ctrldevice=0 or ctrldevice=1 and getkeyboardexists()=1
key_w=getrawkeystate(87) //up
key_s=getrawkeystate(83) //down
key_a=getrawkeystate(65) //left
key_d=getrawkeystate(68) //right
key_space=getrawkeystate(32) //jump
key_enter=getrawkeystate(13) //attack
key_upattack=getrawkeystate(38) //up stab
key_downattack=getrawkeystate(40) //down attack
key_block=getrawkeystate(222) //block
key_run=getrawkeystate(16) //run
if key_w=1 then usingkeyboard=1
if key_s=1 then usingkeyboard=1
if key_a=1 then usingkeyboard=1
if key_d=1 then usingkeyboard=1
if key_space=1 then usingkeyboard=1
if key_enter=1 then usingkeyboard=1
if key_upattack=1 then usingkeyboard=1
if key_downattack=1 then usingkeyboard=1
if key_block=1 then usingkeyboard=1
if key_run=1 then usingkeyboard=1
endif
i have it checking keyboard for input incase player had a joystick plugged in but was not using it.
now the ai.... pulls it in like this:
ctrldevice=players#[id,15]
if ctrldevice=3 then grab_ai(id) //not human controlled
//computer ai??
if ctrldevice=>3
key_w=players#[id,20] //up
key_s=players#[id,21] //down
key_a=players#[id,22] //left
key_d=players#[id,23] //right
key_space=players#[id,24] //jump
key_enter=players#[id,25] //attack
key_upattack=players#[id,26] //up stab
key_downattack=players#[id,27] //down attack
key_block=players#[id,28] //block
key_run=players#[id,29] //run
endif
in my function grab_ai(id) is where it decides what the player should be doing verses what hes doing then saves the input values for the loop to read how to control that character.
i have a another enemy drawn now....elfs...lol but they look like santas elfs which is funny. I did some testing and this is very cool. its not limited to 2 teams... their can be plenty of teams and they will all battle eachother.
www.sheldonscreations.com
