07-05-2012, 11:18 AM
(07-05-2012, 10:33 AM)xmfcx Wrote: HELP!
the syntax is a little stricter now that's why the old code won't work
i have not fully grasped all the changes myself
but this version of the code you are trying works:
Code:
int ego(){
if(target.D==true){D();}
if(target.up==true){down();}
if(target.down==true){up();}
if(target.left==true&&self.state>2){right();}
else if(target.right==true&&self.state>2){left();}
else if(target.state==2&&target.facing==true){right();}
else if(target.state==2){left();}
else if(self.facing==false&&self.state==2){left();}
else if(self.state==2){right();}
if(target.facing==self.facing){
if(self.facing==true){right(1,0);}
else{left(1,0);}
}
if(target.J==true){J();}
if(target.A==true){A();}
if(target.DJA==3){DJA();}
else if(target.DuJ==3){DuJ();}
else if(target.DdJ==3){DdJ();}
else if(target.DlJ==3){DrJ();}
else if(target.DrJ==3){DlJ();}
else if(target.DuA==3){DuA();}
else if(target.DdA==3){DdA();}
else if(target.DlA==3){DrA();}
else if(target.DrA==3){DlA();}
return 1;
}
the most pressing changes are the introduction of the int ego() function and the void id() function
if you just want to add special moves and leave the basic AI intact then you will need to put your code into the ego function the way i did up there - however this mirroring script would be a better fit for the id function (basic AI - nothing but your code gets executed)
also you will always need ; after any command
and variable types are extremely strict - that's why i had to compare all the boolean ones (0 or 1) with true or false now
quite difficult compared to chai but hopefully i can update my tutorial for easy comprehension (after all this stuff still recompiles at run time so the better performance and new features really make up for the strict syntax)
favorite dcing techniques: wpoint | double key inputs | holding back | alternate basic moves