Jump to content

Jubot: A Marginally Improved Ai


Recommended Posts

  • Replies 96
  • Created
  • Last Reply

Top Posters In This Topic

I noticed it getting rinsed rather, yeah. We'll have to talk closer to the time on its inclusion and whether you want me to be able to add it to the SVN version or not and so on.

In other news, I'm working on a nassssty new military base strategy for the AI to use (the current ones are "full assault" of about 30 guys, a cavalry-only raid, and a generic infantry attack which is pretty useless but annoying). :)

Link to comment
Share on other sites

Committed in theory; can anyone confirm this?

Seems to work, but I get a few warnings:


WARNING: JavaScript warning: simulation/ai/jubot/military.js line 180 anonymous function does not always return a value
WARNING: JavaScript warning: simulation/ai/jubot/military.js line 205 anonymous function does not always return a value
WARNING: JavaScript warning: simulation/ai/jubot/military.js line 229 anonymous function does not always return a value
WARNING: JavaScript warning: simulation/ai/jubot/military.js line 253 anonymous function does not always return a value

Link to comment
Share on other sites

Seems to work, but I get a few warnings:


WARNING: JavaScript warning: simulation/ai/jubot/military.js line 180 anonymous function does not always return a value
WARNING: JavaScript warning: simulation/ai/jubot/military.js line 205 anonymous function does not always return a value
WARNING: JavaScript warning: simulation/ai/jubot/military.js line 229 anonymous function does not always return a value
WARNING: JavaScript warning: simulation/ai/jubot/military.js line 253 anonymous function does not always return a value

In such cases:


if (foeposition){
var dist = VectorDistance(foeposition, currentPosition);
return (ent.isEnemy() && ent.owner()!= 0 && dist < 50);
}

it is probably better to add the line:


return false;

at the end.

Edit:

or store return value in some variable:


var isTarget = false;
if (foeposition){
var dist = VectorDistance(foeposition, currentPosition);
isTarget = (ent.isEnemy() && ent.owner()!= 0 && dist < 50);
}
return isTarget;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...