Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no AI fusion
#1
! 
finally (?) proof that computer characters cannot fuse:

    7CHAI-Code:
{
 for (var i = 0; i < 400; ++i){
  loadTarget(i)
  if (target.team == self.team && target.id == 8){
   break
  }
 }
 if (self.hp<100 && target.hp<100){
  if (target.z>self.z){down()}
  else if (target.z<self.z){up()}
  if (target.x>self.x && self.state<2){right()}
  else if (target.x<self.x && self.state<2){left()}
 }
 return 1
}
    8CHAI-Code:
{
 for (var i = 0; i < 400; ++i){
  loadTarget(i)
  if (target.team == self.team && target.id == 7){
   break
  }
 }
 if (self.hp<100 && target.hp<100){
  if (target.z>self.z){down()}
  else if (target.z<self.z){up()}
  if (target.x>self.x && self.state<2){right()}
  else if (target.x<self.x && self.state<2){left()}
 }
 return 1
}


):
Reply
Thanks given by:
#2
(06-18-2012, 06:53 PM)YinYin Wrote:  finally (?) proof that computer characters cannot fuse:

    7CHAI-Code:
{
 for (var i = 0; i < 400; ++i){
  loadTarget(i)
  if (target.team == self.team && target.id == 8){
   break
  }
 }
 if (self.hp<100 && target.hp<100){
  if (target.z>self.z){down()}
  else if (target.z<self.z){up()}
  if (target.x>self.x && self.state<2){right()}
  else if (target.x<self.x && self.state<2){left()}
 }
 return 1
}
    8CHAI-Code:
{
 for (var i = 0; i < 400; ++i){
  loadTarget(i)
  if (target.team == self.team && target.id == 7){
   break
  }
 }
 if (self.hp<100 && target.hp<100){
  if (target.z>self.z){down()}
  else if (target.z<self.z){up()}
  if (target.x>self.x && self.state<2){right()}
  else if (target.x<self.x && self.state<2){left()}
 }
 return 1
}


):
Oh, too bad. I mean even if they run toward each other with an hp less than 100??
    CHAI-Code:
if (target.x>self.x && self.state<2)

when u wrote self.state < 2, does this mean that if the state is either 1 or 0 (less than 2), or is it another thing? cuz I think its suppose to be self_state (with an underscore).
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by:
#3
(06-19-2012, 04:58 AM)A-MAN Wrote:  when u wrote self.state < 2, does this mean that if the state is either 1 or 0 (less than 2)
correct

(06-19-2012, 04:58 AM)A-MAN Wrote:  I think its suppose to be self_state (with an underscore).
the api just changed in the latest release. "self" and "target" are now objects, and "state" is a field within "self", so self.state gets the state



Azriel~
Reply
Thanks given by: A-Man




Users browsing this thread: 1 Guest(s)