Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[2.2]Programmable AI via scripting
#3
not yet azzy but after id specific chais are done its on the todo list like many other parameters

heres a very simple general AI i just wrote to test everything a little:

Code:
//D>A long ranged
if ((target_y - self_y)*(target_y - self_y) < 100) {
if ((self_x - target_x) > 100) {
if ((self_x - target_x) < 600) {
    DlA()
}}
if ((target_x - self_x) > 100) {
if ((target_x - self_x) < 600) {
    DrA()
}}}

//D>J and DJA mid ranged
if ((target_y - self_y)*(target_y - self_y) < 81) {
if ((self_x - target_x) > 50) {
if ((self_x - target_x) < 300) {
    DlJ()
}}
if ((target_x - self_x) > 50) {
if ((target_x - self_x) < 300) {
    DrJ()
}}
if ((self_x - target_x) > 100) {
if ((self_x - target_x) < 400) {
    DlJ()
}}
if ((target_x - self_x) > 100) {
if ((target_x - self_x) < 400) {
    DrJ()
}}}

//DvJ low health
if (self_hp < 250) {
DdJ()
}
//D^J high health
if (self_hp > 250) {
DuJ()
}

//DvA and D^A short ranged
if ((target_y - self_y)*(target_y - self_y) < 64) {
if ((target_x - self_x) < 50) {
if ((target_x - self_x) > 0) {
if (self_facing == 0) {
DdA()
}}}
if ((self_x - target_x) < 50) {
if ((self_x - target_x) > 0) {
if (self_facing == 1) {
DdA()
}}}
if ((target_x - self_x) < 50) {
if ((target_x - self_x) > 0) {
if (self_facing == 0) {
DuA()
}}}
if ((self_x - target_x) < 50) {
if ((self_x - target_x) > 0) {
if (self_facing == 1) {
DuA()
}}}}

owns me pretty badly with many chars

edit: facing might not work in the first download yet but its already fixed
and there is also D() A() J() but i cannot confirm them to be working yet
and left() right() up() down() still need to be fixed
Reply
Thanks given by:


Messages In This Thread
[2.2]Programmable AI via scripting - by Boop - 06-08-2012, 06:31 PM
RE: Programmable AI via scripting (and ddraw hooking) - by YinYin - 06-08-2012, 11:05 PM
RE: [2.0]Programmable AI via scripting - by Boop - 06-30-2012, 01:54 PM
RE: [2.1]Programmable AI via scripting - by mfc - 07-05-2012, 10:33 AM
RE: [2.1]Programmable AI via scripting - by Boop - 07-05-2012, 11:53 AM
RE: [2.1]Programmable AI via scripting - by A-Man - 07-05-2012, 12:18 PM
RE: [2.2]Programmable AI via scripting - by A-Man - 07-19-2012, 03:08 PM
RE: [2.2]Programmable AI via scripting - by Boop - 07-19-2012, 03:15 PM
RE: [2.2]Programmable AI via scripting - by Kevin - 07-22-2012, 08:20 AM
RE: [2.2]Programmable AI via scripting - by Boop - 07-27-2012, 04:41 PM
RE: [2.2]Programmable AI via scripting - by A-Man - 09-15-2012, 05:23 PM
RE: [2.2]Programmable AI via scripting - by Boop - 05-05-2013, 04:44 PM
RE: [2.2]Programmable AI via scripting - by zort - 06-12-2013, 05:45 PM
RE: [2.2]Programmable AI via scripting - by zort - 06-15-2013, 01:44 AM
RE: [2.2]Programmable AI via scripting - by zort - 06-14-2013, 07:21 PM
RE: [2.2]Programmable AI via scripting - by A-Man - 03-29-2016, 01:59 PM
RE: [2.2]Programmable AI via scripting - by Boop - 03-30-2016, 10:26 PM
RE: [2.2]Programmable AI via scripting - by Gad - 02-10-2017, 06:58 PM



Users browsing this thread: 11 Guest(s)