Author Topic: AI Players.  (Read 1324 times)

How do you make them jump? i tried setImageTrigger(x,1); but any number i tried didn't make them jump and is there a function that's called when they're unStuck like onStuck?

MrPickel, Please remember to put the problem in the topic name so people know what you need help with. I don't remember how to make them jump, but I'm sure if you fix the topic name, someone else will.

In the Zombies mod, the code %col.applyimpulse("0 0 0","0 0 700"); is used when a bot collides with anything - apply a short upwards impulse about the height of a jump.

setImageTrigger(2,1); might do it, but I think they need something mounted in Slot 2.

I tried setImageTrigger(2,1); but not with something mounted in slot 2, i'll try that when i get home.

Code: [Select]
function serverCmdPatrol(%client){
%client.markerNum++;
%pos = %client.player.getPosition();
%client.patrol[%client.markerNum] = %pos;
messageclient(%client,"","\c6Marker " @ %client.markerNum @  " set at:\c0 " @ %pos @ "\c6.");
}

function Armor::onReachDestination(%this,%obj){
   if(%obj.isPBot){
   %client = %obj.client;
   for(%i=0;%i<%client.markerNum;%i++){
if(vectorDist(%obj.getMoveDestination(),%client.patrol[%i]) < 2){
%obj.setMoveDestination(%client.patrol[%i++], 0);
if(vectorDist(%obj.getPosition(), %client.patrol[%client.markerNum]) < 2){
%obj.setMoveDestination(%client.patrol[1], 0);
}
}
}
}
}

Why's this not making them loop?


Nevermind, I've fixed it:

Code: [Select]
function Armor::onReachDestination(%this,%obj){
   if(%obj.isPBot){
   %client = %obj.client;
   for(%i=0;%i<%client.markerNum;%i++){
if(vectorDist(%obj.getPosition(), %client.patrol[%client.markerNum]) < 2){
%obj.setMoveDestination(%client.patrol[1], 0);
} else if(vectorDist(%obj.getMoveDestination(),%client.patrol[%i]) < 2){
%obj.setMoveDestination(%client.patrol[%i++], 0);
}
}
}
}