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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...