![]() |
|
[Tutorial] Turrets - Printable Version +- ItsMods (https://www.itsmods.com) +-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html) +--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html) +--- Thread: [Tutorial] Turrets (/Thread-Tutorial-Turrets.html) |
Turrets - Yamato - 07-20-2011 Hello This can be also useful, a basic turret tutorial. This is how to spawn a turret, in angles set the angles, in position the position, in type of turret one of the turrets I put down in the post, in model put a model of the ones I say later: Code: Turret = spawnTurret( "misc_turret", position, "type of turret" );
Turret setModel( "model" );
Turret.angles = angles;You can also make them turn 360 degrees with this commands: Code: Turret SetRightArc(degrees);
Turret SetLeftArc(degrees);
Turret SetTopArc(degrees);
Turret SetBottomArc(degrees);To shoot them, not by using player, you can use: Code: Turret ShootTurret();Some other functions: Code: Turret LaserOn(); //put laser
Turret setTurretTeam( self.team ); //set the turrets team
Turret SetMode( "auto_nonai" ); //will allow it to target enemies, like sentry guns
Turret SetPlayerSpread( .65 ); //Spread that turret has
Turret makeTurretInoperable(); //Make it unusable by players
Turret SetDefaultDropPitch( 0 ); //The movement that does back when you leave turret, 0 is best.
Turret SetSentryOwner( self ); //Set the owner of the turret
Turret SetTurretMinimapVisible( true ); //Make it appear on minimapNow some models and types of turrets to use when spawning a turret: Types: Code: pavelow_minigun_mp //classic one, from pavelows
turret_minigun_mp //spining turrets, only work on maps like karachi,wasteland or overgrown
sentry_minigun_mp //sentry gun
minigun_littlebird_mp //not sure if it worksModels: Code: weapon_minigun //minigun
sentry_minigun //sentry gun
weapon_saw_mg_setup //M249, works in karachi, precache it in Init(), thanks to se7en, even if he has used my tutorial for finding models, lol
vehicle_little_bird_minigun_left //never tested this, dont know if it works
vehicle_little_bird_minigun_right //same as previous oneThats nearly all, basically with this, you can spawn without any problems turrets. RE: Turrets - GscGunner - 01-30-2012 little bird doesnt work some error: get aim... entity or something, but how u let the turret shoot automaticly or let it shoot whenever you are shooting? RE: Turrets - Yamato - 01-30-2012 (01-30-2012, 14:36)GscGunner Wrote: little bird doesnt work Check this mod: http://www.itsmods.com/forum/Thread-Release-Chopper-Gunner.html RE: Turrets - GscGunner - 01-30-2012 is this, what im looking for? Code: if(self AttackButtonPressed() && self.piloto2 == 1)
{
target_m = vector_Scal(anglestoforward(self getplayerangles()),1000000);
endpoint = BulletTrace(heli.origin,target_m,0,heli )["position"];
heli SetTurretTargetVec(endpoint);
heli FireWeapon("tag_flash",endpoint,(0,0,0),3);
earthquake(0.1,1,heli.origin,1000);
wait 0.05;
}or this? Code: if(self.botonpulsado["cohete"] && self.piloto == 1)
{
switch(randomInt(2))
{
case 0:
MagicBullet("stinger_mp",misiles1.origin,misiles1.origin+anglestoforward(misiles1.angles)*350-(0,0,10)-(0,0,randomInt(200)),self);
break;
case 1:
MagicBullet("stinger_mp",misiles2.origin,misiles2.origin+anglestoforward(misiles2.angles)*350-(0,0,10)-(0,0,randomInt(200)),self);
break;
}
}
if(self.botonpulsado["controlmanual"] && self.piloto == 1)
{
misil = MagicBullet("remotemissile_projectile_mp", heli.origin-(0,0,220), heli.origin+anglestoforward(heli.angles)*350, self);
misil.angles = self getPlayerAngles();
wait 0.05;
maps\mp\killstreaks\_remotemissile::MissileEyes( self, misil );
wait 3;
}NVM: got it working thnx yamato ![]() hi again ![]() i got it working but it only shoots me LoL, nobody else, im using turret.origin, self.origin i guess thats wrong but i dont know how to let it shoot enemies where he aims at, enemie.origin xD? RE: Turrets - Yamato - 01-30-2012 (01-30-2012, 14:56)GscGunner Wrote: Whatever From the last mod I worked on: Code: self FireWeapon( "tag_flash", zombi.origin, ( 0, 0, 0 ), 3 );RE: Turrets - GscGunner - 02-01-2012 well, i already had that kind of code of that, but i used magicbullet?? any diffrense? and what do i need to put in for zombi.origin?
RE: Turrets - Rendflex - 02-01-2012 (02-01-2012, 08:04)GscGunner Wrote: well, i already had that kind of code of that, *sigh* http://www.zeroy.com/script/vehicles/fireweapon.htm RE: Turrets - Yamato - 02-01-2012 (02-01-2012, 08:04)GscGunner Wrote: well, i already had that kind of code of that, In zombi.origin you have to put the position or thing that you want to shot. RE: Turrets - GscGunner - 02-01-2012 i know, not a totally noob, i guess you somewhere in your mod wrote what the "zombi" is right? well i didnt in my mod, so i guess it doesnt know the "zombie.origin" LoL and rendflex, wtf is that link lol i just dont know what to put as zombi.origin player.origin? RE: Turrets - Rendflex - 02-01-2012 (02-01-2012, 17:34)GscGunner Wrote: i know, not a totally noob, That link is the answer to all your questions. You'll add player.origin if you're going to make it shoot at the player, yes... |