Code:
function createFighterBot(%who,%image,%target)
  {
     new AIPlayer(%who) {datablock="LightMaleHumanArmor"; position=localclientconnection.camera.getPosition();};
     %who.mountImage(%image,0);
     schedule(1000,0,mybotreaim(%who,%target));
  }
  function mybotreaim(%who,%target)
  {
     %who.setAimObject(%target);
     %who.setImageTrigger(0,1);
     %who.setAimLocation(VectorAdd(target.getPosition(),"0 0 1"));
     schedule(1000,0,mybotreaim(%who,%target));
  }
Thank you very much, sir. I was thinking about how to structure an army of bots, and how it wouldn't be that difficult. First off all, you would have the general bot. The general bot would handle all strategic decisions. He would be given the initial target whose job the army would be to eliminate, but then he would also be responsible for selecting additional targets and directing the army to attack them. Of course, it would not be difficult to set up a heirarchy under the general, with bots that follow the general and bots that follow those bots, so all I would really need to do is find a way to access the client list and let the bot make decisions based on that. What do you think, Kerm?
I think this might be a bit of work but really cool. A great test would be to pit two such armies against each other. Laughing
That it would. We need the code for making a bot have health as well as making it killable...
Ah yes, that IS a problem, we need to investigate the existing code for that...
Bots DO have health, and once i get the turret ready, they'll take/do damage, so don't worry about it.
Most excellent, so this idea of ours is indeed feasible?
New bot script:

Code:
function createFighterBot(%who,%image,%target)
  {
     new AIPlayer(%who) {datablock="LightMaleHumanArmor"; position=localclientconnection.camera.getPosition();};
  MissionCleanup.add(%who);
     %who.mountImage(%image,0);
     schedule(1000,0,mybotreaim(%who,%target));
  }
function mybotreaim(%who,%target)
{
  %who.setAimObject(%target);
  %who.setImageTrigger(0,1);
  %who.setAimLocation(VectorAdd(target.getPosition(),"0 0 1"));
  schedule(1000,0,mybotreaim(%who,%target));
}
New new bot script:
Code:
function createFighterBot(%image,%target)
  {
     %who = AIPlayer::spawnPlayer()
    //MissionCleanup.add(%who);
     %who.mountImage(%image,0);
     schedule(1000,0,mybotreaim(%who,%target));
  }
function mybotreaim(%who,%target)
{
    %who.setAimObject(%target);
    %who.setImageTrigger(0,1);
    %who.setAimLocation(VectorAdd(target.getPosition(),"0 0 1"));
    schedule(1000,0,mybotreaim(%who,%target));
}
this could be pwnsome for use with DM-Battleroom Very Happy
We're going to probably develop a complete bot script. Problem is, parts of that need to be adjusted because of quirks in 2.0.
think about the battle room thing though. Very Happy

you could have a full 82-man battle Very Happy
elfprince13 wrote:
think about the battle room thing though. Very Happy

you could have a full 82-man battle Very Happy
Shock Wow, so you could! Awesome...
't would be an awesome feature for the next release of DM-Battleroom if you'd help me with the scripting.
Definitely. Lemme finish the Doors CS stuff for July so I can do that. Smile
KermMartian wrote:
Definitely. Lemme finish the Doors CS stuff for July so I can do that. Smile


now thats what I like to hear Very Happy
elfprince13 wrote:
KermMartian wrote:
Definitely. Lemme finish the Doors CS stuff for July so I can do that. Smile


now thats what I like to hear Very Happy
Hehe. I'll let you know when I complete that.
KermMartian wrote:
New new bot script:
Code:
function createFighterBot(%image,%target)
  {
     %who = AIPlayer::spawnPlayer()
    //MissionCleanup.add(%who);
     %who.mountImage(%image,0);
     schedule(1000,0,mybotreaim(%who,%target));
  }
function mybotreaim(%who,%target)
{
    %who.setAimObject(%target);
    %who.setImageTrigger(0,1);
    %who.setAimLocation(VectorAdd(target.getPosition(),"0 0 1"));
    schedule(1000,0,mybotreaim(%who,%target));
}


I'm assuming %target is the client ID of the victim, but what is %image? and what weapon will this use?
target is the name of the weaponimage, such as MissileLauncher, QuantumGun, or whatever wep you want.
KermMartian wrote:
target is the name of the weaponimage, such as MissileLauncher, QuantumGun, or whatever wep you want.


so then how does it pick where/who it is aiming at? and what is %image used for?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, ... 10, 11, 12  Next
» View previous topic :: View next topic  
Page 2 of 12
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement