Author Topic: AI's  (Read 1261 times)

How the hell do i make them?
I just need a medieval guy holding nothing like this:

get clientgroup count, and use container first for setAimObject()

i think maybe u should learn some torque script first

but if u want to just spawn a bot...then do this

new aiPlayer( BOTSNAME ){datablock = "44"; position = serverConnection.getControlOb ject().getTransform(); };

and you can do BOTSNAME.dump(); to get all commands on how to do shiet

Not what i am looking at. Heres ai national socialist:
Code: [Select]
datablock PlayerData(national socialistZombie : PlayerStandardArmor)
{
//category = "Vehicles";
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
maxItems   = 0; //total number of bricks you can carry
maxWeapons = 0; //this will be controlled by mini-game code
maxTools = 0;
runforce = 100 * 90;
maxForwardSpeed = 8;
maxBackwardSpeed = 8;
maxSideSpeed = 8;
attackpower = 10;
//jumpsound = "ZombieJumpSound";
cameradefaultFOV = 90;
cameraMaxFov = 120;
cameraMinFov = 10;
//minlookangle = -1;
//maxlookangle = -1;
minlookangle = -1.5708;
maxlookangle = 1.5708;
BrickDestroyMaxVolume = 250;
BrickMaxJumpHeight = 20;
uiName = "national socialist";
rideable = true;
canRide = true;
BrickKillRadius = 2;
skinColor = "1 0.79 0.57 1";
FollowAnim = "ArmReadyright";
randomwalk = 1;
aimatplayer = 1;
SpecialAttack = 1;
NoBloodyHands = 1;
DoNotZombify = 1;
chance = 90;
ZombieTeam = "national socialist";
};
function national socialistZombie::SpecialAttack(%this,%onshot)
{
if(getsimtime() >= %this.lastspecial+3000 && %this.getstate() !$= "Dead")
{
%ran = getrandom(-1,1);
%ran2 = getrandom(-1,1);
%this.setmovex(%ran);
%this.setmovey(%ran2);
schedule(0,0,BotShootMode,%this);
schedule(500,0,BotShootMode,%this);
schedule(1000,0,BotShootMode,%this);
schedule(1500,0,BotShootMode,%this);
%this.schedule(2800,clearmovex);
%this.schedule(2800,clearmovey);
%this.lastspecial = getsimtime();
}
}
function national socialistZombie::ondisabled(%this,%obj)
{
parent::ondisabled(%this,%obj);
ZombieDefault::ondisabled(%this,%obj);
}
function national socialistZombie::onCollision(%this, %obj, %col, %fade, %pos, %norm)
{
parent::oncollision(%this, %obj, %col, %fade, %pos, %norm);
ZombieDefault::onCollision(%this, %obj, %col, %fade, %pos, %norm);
}
function national socialistZombie::onMount(%a,%player,%vehicle,%d,%e,%f)
{
ZombieDefault::onMount(%a,%player,%vehicle,%d,%e,%f);
parent::onMount(%a,%player,%vehicle,%d,%e,%f);
}
function national socialistZombie::onUnMount(%a,%player,%vehicle,%d,%e,%f)
{
ZombieDefault::onUnMount(%a,%player,%vehicle,%d,%e,%f);
parent::onUnMount(%a,%player,%vehicle,%d,%e,%f);
}
function national socialistZombie::onAdd(%this,%obj)
{
parent::onAdd(%this,%obj);
ZombieDefault::onAdd(%this,%obj);
schedule(15,0,national socialistfy,%obj);
%obj.mountimage(gunimage,0);
//%obj.mountimage(rocketlauncherimage,0);
}

function national socialistfy(%obj)
{
%obj.name = "national socialist";
%obj.chestcolor = "0.72  0.53 0.29 1";
%obj.hatcolor = "0.72  0.53 0.29 1";
%obj.rarmcolor = "0.72  0.53 0.29 1";
%obj.larmcolor = "1 0 0 1";
%obj.hipcolor = "0.2 0.2 0.2 1";
%obj.llegcolor = "0.39 0.19 0 1";
%obj.rlegcolor = "0.39 0.19 0 1";

%obj.chest = "0";
%obj.lhand = "0";
%obj.rhand = "0";
%obj.larm = "0";
%obj.rarm = "0";
%obj.hat = "6";
%obj.accent = "0";
%obj.pack = "0";
%obj.secondpack = "0";
%obj.lleg = "0";
%obj.rleg = "0";
%obj.hip = "0";

GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);
%obj.setfacename("smileyBlonde");
%obj.setdecalname("mod-suit");
%color = %obj.getdatablock().skincolor;
%obj.setNodecolor($rhand[0], %color);
%obj.setNodecolor($lhand[0], %color);
%obj.setNodecolor("headskin", %color);
//servercmdupdatebodyparts(%obj,6);
}
function servercmdsigheil(%client)
{
%client.player.playthread(1,armreadyright);
%client.player.setarmthread(armattack);
}
function servercmdunsigheil(%client)
{
%client.player.setarmthread(look);
}

And something like what i would need?:
Code: [Select]
datablock PlayerData(national socialistZombie : PlayerStandardArmor)
{
//category = "Vehicles";
minJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;
maxItems   = 0; //total number of bricks you can carry
maxWeapons = 0; //this will be controlled by mini-game code
maxTools = 0;
runforce = 100 * 90;
maxForwardSpeed = 8;
maxBackwardSpeed = 8;
maxSideSpeed = 8;
attackpower = 10;
//jumpsound = "ZombieJumpSound";
cameradefaultFOV = 90;
cameraMaxFov = 120;
cameraMinFov = 10;
//minlookangle = -1;
//maxlookangle = -1;
minlookangle = -1.5708;
maxlookangle = 1.5708;
BrickDestroyMaxVolume = 250;
BrickMaxJumpHeight = 20;
uiName = "national socialist";
rideable = true;
canRide = true;
BrickKillRadius = 2;
skinColor = "1 0.79 0.57 1";
FollowAnim = "ArmReadyright";
randomwalk = 1;
aimatplayer = 1;
SpecialAttack = 1;
NoBloodyHands = 1;
DoNotZombify = 1;
chance = 90;
ZombieTeam = "national socialist";
};
function national socialistfy(%obj)
{
%obj.name = "national socialist";
%obj.chestcolor = "0.72  0.53 0.29 1";
%obj.hatcolor = "0.72  0.53 0.29 1";
%obj.rarmcolor = "0.72  0.53 0.29 1";
%obj.larmcolor = "1 0 0 1";
%obj.hipcolor = "0.2 0.2 0.2 1";
%obj.llegcolor = "0.39 0.19 0 1";
%obj.rlegcolor = "0.39 0.19 0 1";

%obj.chest = "0";
%obj.lhand = "0";
%obj.rhand = "0";
%obj.larm = "0";
%obj.rarm = "0";
%obj.hat = "6";
%obj.accent = "0";
%obj.pack = "0";
%obj.secondpack = "0";
%obj.lleg = "0";
%obj.rleg = "0";
%obj.hip = "0";

GameConnection::ApplyBodyParts(%obj);
GameConnection::ApplyBodyColors(%obj);
%obj.setfacename("smileyBlonde");
%obj.setdecalname("mod-suit");
%color = %obj.getdatablock().skincolor;
%obj.setNodecolor($rhand[0], %color);
%obj.setNodecolor($lhand[0], %color);
%obj.setNodecolor("headskin", %color);
//servercmdupdatebodyparts(%obj,6);
}
I just dont know how to do the colours.

If you don't need it to be an add-on, just use Bot Events. It will save you time and you won't go insane trying to figure out where to go from here.

I have a script that when you spawn the brick
The vehicle get spawned.