Joined: Sun Jun 13, 2010 5:40 am Posts: 1059 Location: I chose my fate, do not pity me.
Re: Tank project (1st prototype)
oooooh, i like the shorter barrel, reminds me of metal slug .
Fri May 06, 2011 9:32 am
Mehman
Joined: Tue Nov 17, 2009 7:38 pm Posts: 909 Location: France
Re: Tank project (2nd prototype)
Here comes the second prototype: it is now equipped with a self regenerating energy shield, an automatic self repair system, and a defensive anti infantry grenade launcher(press 0 or num 0, can stock up to three grenades, reloads over time), I also improved the effects and balanced it a bit.
Thanks for this great new sprite Kettenkrad, I'll include it in the next version.
Asklar wrote:
I'm just curious, is this tank going to form part of the Triclon Empire or it is a separate project? Because I read in the description that it is a medium tank, so does that mean that there will be heavy and light variants?
Excuse me, but it is really an interesting project.
It is separate from the Triclon Empire, but I'll reuse everything that I learned by making them in this project. When I am satisfied with this one, and if I have the time, I may make a light and/or heavy variant(s).
Kettenkrad wrote:
May I also suggest that the main gun use a variable velocity system, so that HE rounds are fired at a low velocity, as a bombardment weapon, as apposed to the super-sonic AP rounds?
This is a good idea, I'll try to code it.
Kettenkrad wrote:
The gun seems a tad big for the rounds that it fires, are you planning to make the rounds bigger or should I do the barrel shorter / thinner?
The sprite used for the rounds is a placeholder, I'll replace it by the ones you made.
Fri May 06, 2011 8:12 pm
Kettenkrad
Joined: Mon Oct 25, 2010 5:51 am Posts: 1198 Location: Sydney
Re: Tank project (2nd prototype)
FINISHED! I'm quite happy with how it turned out! Anything that it needs? Any requests?
Joined: Mon Oct 25, 2010 5:51 am Posts: 1198 Location: Sydney
Re: Tank project (2nd prototype)
lolthx
Sat May 07, 2011 6:00 am
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
Re: Tank project (2nd prototype)
You could probably integrate the outlines better, but yes, it looks good.
Sat May 07, 2011 6:16 am
Fail Flail
Joined: Sun Jun 13, 2010 5:40 am Posts: 1059 Location: I chose my fate, do not pity me.
Re: Tank project (2nd prototype)
I like the really defined lines, it makes everything more... defined? (theres a better word for what i think, im sure of it) Bah, regardless, i like it.
Sat May 07, 2011 11:50 am
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
Re: Tank project (2nd prototype)
Looks a bit too much like shapes just slapped together atm, might want to make it flow a bit better.
Sat May 07, 2011 11:55 am
Kettenkrad
Joined: Mon Oct 25, 2010 5:51 am Posts: 1198 Location: Sydney
Re: Tank project (2nd prototype)
Ok, I'll come back to it when I've learnt more.
Sat May 07, 2011 1:42 pm
Morbo513
Joined: Tue Apr 26, 2011 8:15 pm Posts: 7
Re: Tank project (2nd prototype)
I really liked the first sprite you made, if you were to make it that shape but a bit shorter (Not truncated and boxy) and combine it with the detail on the latest one, it'd look awesome.
Sat May 07, 2011 1:54 pm
Morbo513
Joined: Tue Apr 26, 2011 8:15 pm Posts: 7
Re: Tank project (2nd prototype)
I cannibalised parts of the latest sprite and used them to modify the first one you did. Couldn't be bothered texturing the whole thing but I think it just looks more realistic this way. The generator slots in between the engine with the wing covering, both as attachables
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
Re: Tank project (2nd prototype)
Xron wrote:
The tank shells don't hit people.
I was just about to say that.
I've had another problem with the tank like twice, but it's very wierd. Sometimes when I use the grenade, the main cannon doesn't fire, it just makes the muzzle flash and the sounds, and decreases the ammo on the clip, but it doesn't fire. And when I throw a grenade again, it works.
But it was really wierd. I wasn't doing anything strange, anyway, I just ordered the tank on Zombie Cave to complete the mission with the tank.
Sat May 07, 2011 9:04 pm
Xery
Joined: Sat Feb 26, 2011 10:29 am Posts: 163
Re: Tank project (2nd prototype)
Xron wrote:
The tank shells don't hit people.
viewtopic.php?f=1&t=22561 Let's sovle this problem together...or I need some more detailed explanations why this happens and how to fix the AtomGroup.
Sun May 08, 2011 6:56 am
Mehman
Joined: Tue Nov 17, 2009 7:38 pm Posts: 909 Location: France
Re: Tank project (2nd prototype)
I just finished the code, now I just need to include the new sprite and maybe make some minor adjustments and it will be ok, I'll do that tomorrow.
Btw this is the longest non-mission lua code I've ever written:
self.timer = Timer(); self.Shield = 100; --do not edit this
-----------Variables you can edit:-----------
self.healtime = 2000 --the actor will regenerate 1% of his health every self.healtime ms. self.ShieldPower = 7500; --this you can edit: a higher number will make the shield more powerful, a lower number less powerful self.ShieldRegen = 0.10; --the % of the shield that will be regenerated in 1 tick (60 ticks in a second if you haven't modified your DeltaTime) 1.25 <-> 1.25% / tick <-> 75% / sec. self.ShowRealShieldValue = false; --activating this will show you the real power of the shield instead of a %.
if MovableMan:ValidMO(self.i) then ToTDExplosive(self.i).ToDelete = true; end if MovableMan:ValidMO(self.altsensor1) then ToTDExplosive(self.altsensor1).ToDelete = true; end if MovableMan:ValidMO(self.altsensor2) then ToTDExplosive(self.altsensor2).ToDelete = true; end
end
function Update(self)
--propulsion, stabilisation
self.alt = self:GetAltitude(0,1);
if self.alt < self.setalt and self.Vel.Y > -10 then self.Vel.Y = self.Vel.Y - 0.5; end
if self.Vel.Y < -4.5 then self.Vel.Y = self.Vel.Y + 1.5; elseif self.Vel.Y > 4.5 then self.Vel.Y = self.Vel.Y - 1.5; end
if self.RotAngle ~= 0 then if self.RotAngle < 0 then if math.abs(self.AngularVel) < 10 then self.AngularVel = self.AngularVel + 0.75; end elseif self.RotAngle > 0 then if math.abs(self.AngularVel) < 10 then self.AngularVel = self.AngularVel - 0.75; end end end
if self.Vel.X < 8 and self.c:IsState(3) then self.Vel.X = self.Vel.X + 1; elseif self.Vel.X > -8 and self.c:IsState(4) then self.Vel.X = self.Vel.X - 1; end
if self.setalt < 150 and self.c:IsState(5) then self.setalt = self.setalt + 0.75; elseif self.setalt > 25 and self.c:IsState(6) then self.setalt = self.setalt - 0.75; end
if self.Health <= 0 then self:GibThis(); end
--grenade launcher
if self:IsPlayerControlled() == true and (UInputMan:KeyPressed(37) or UInputMan:KeyPressed(27)) and self.Grenade>0 then local Gre = CreateAEmitter("Incendiary Tank Grenade","Tank.rte"); if self.HFlipped then Gre.Pos = Vector(self.Pos.X+10,self.Pos.Y-45); else Gre.Pos = Vector(self.Pos.X-10,self.Pos.Y-45); end Gre.Vel = Vector(self.Vel.X,self.Vel.Y-15); MovableMan:AddMO(Gre); self.Grenade = self.Grenade - 1; end
--terrain detection and automatic orientation
if MovableMan:ValidMO(self.altsensor1) and MovableMan:ValidMO(self.altsensor2) then if self.altsensor1.PresetName ~= "Entity" and self.altsensor2.PresetName ~= "Entity" then
if self.alt1 < self.alt2 and self.RotAngle < (math.pi/12) then local acc = (0.10*math.abs(self.alt1-self.alt2)); if acc > 1 then acc = 1; end self.AngularVel = self.AngularVel + acc; elseif self.alt2 < self.alt1 and self.RotAngle > -(math.pi/12) then local acc = (0.10*math.abs(self.alt1-self.alt2)); if acc > 1 then acc = 1; end self.AngularVel = self.AngularVel - acc; end
self.altsensor1:Activate(); self.altsensor2:Activate(); end
--energy shield
if self.timer:IsPastSimMS(self.healtime) and self.Health > 0 then if self.Health < 100 then self.Health = self.Health + 1; end if self.Grenade < 3 then self.Grenade = self.Grenade + 1; end self.timer:Reset(); end
if self.Shield < 100 then self.Shield = self.Shield + self.ShieldRegen; end if self.Shield > 100 then self.Shield = 100; end
for particle in MovableMan.Particles do if (particle.Vel.Magnitude - self.Vel.Magnitude) > 20 then
local dist = SceneMan:ShortestDistance(self.Pos, particle.Pos, true); local power = (0.5*particle.Mass*((particle.Vel.Magnitude - self.Vel.Magnitude)^2)*particle.Sharpness)/(self.ShieldPower);
if particle.ClassName == "AEmitter" then power = (0.5*particle.Mass*((particle.Vel.Magnitude - self.Vel.Magnitude)^2))/(0.075*self.ShieldPower); end
if dist.Magnitude < 125 and particle.Age > 35 and (particle.Vel.Magnitude - self.Vel.Magnitude) > 30 and (self.Shield) > power and particle.PresetName ~= "Mehman Frag 4" and particle.PresetName ~= "AP Shell" and particle.PresetName ~= "Particle AT" then
self.Shield = self.Shield - power;
local Glow = CreateMOPixel("Little Shield Glow","Tank.rte"); Glow.Pos = particle.Pos; MovableMan:AddMO(Glow);
if particle.ClassName == "AEmitter" then particle.Vel.X = - particle.Vel.X; particle.Vel.Y = - particle.Vel.Y; else particle.ToDelete = true; end
end end
end
if MovableMan:ValidMO(self.i) then if self.i.PresetName ~= "Entity" then if self.ShowRealShieldValue == false then self.i.PresetName = math.ceil(self.Shield).."%"; else self.i.PresetName = math.ceil( (self.Shield/100)*self.ShieldPower )..""; end self.i.Pos = self.AboveHUDPos + Vector(0,-5); self.i.Vel = self.Vel; if self.Health <= 0 or self.Status == 4 then self.i:Activate(); end end elseif self.Age > 250 then self.i = CreateTDExplosive("Null Device","Tank.rte"); self.i.Pos = self.AboveHUDPos + Vector(0,-5); self.i.Vel = self.Vel; MovableMan:AddMO(self.i); self.i.PresetName = math.ceil(self.Shield).."%"; end
--coaxial flamer
if ( self:IsPlayerControlled() == true and (UInputMan:KeyHeld(38) or UInputMan:KeyHeld(34)) ) then
local rand = math.random(0,100); if rand > 10 then local fl = CreateAEmitter("Particle TankF","Tank.rte");
if ( self:IsPlayerControlled() == true and (UInputMan:KeyPressed(39) or UInputMan:KeyPressed(35)) ) then
if self.Mass > 1250 then self.Mass = 1249; else self.Mass = 1251; end
end
--MG
if MovableMan:ValidMO(self.MG) then if self.MG.PresetName ~= "Entity" then
if self.HFlipped then self.MG.Pos = self.Pos + Vector(math.cos(self.RotAngle-0.2521198)*-42.45,math.sin(self.RotAngle-0.2521198)*42.45); self.MG.HFlipped = false; else self.MG.Pos = self.Pos + Vector(math.cos(self.RotAngle+0.2521198)*42.45,-math.sin(self.RotAngle+0.2521198)*42.45); self.MG.HFlipped = true; end
local MGAngle = (self.MG.RotAngle % (2*math.pi)) - math.pi;
if self.HFlipped then if MGAngle < -self.MGAim then self.MG.AngularVel = 1.5; elseif MGAngle > -self.MGAim then self.MG.AngularVel = -1.5; end else if MGAngle < self.MGAim then self.MG.AngularVel = 1.5; elseif MGAngle > self.MGAim then self.MG.AngularVel = -1.5; end end
self.MG.Vel = self.Vel;
if self:IsPlayerControlled() == true and UInputMan:MouseWheelMoved() == -1 then if self.MGAim > -0.75 then self.MGAim = self.MGAim - 0.05; end elseif self:IsPlayerControlled() == true and UInputMan:MouseWheelMoved() == 1 then if self.MGAim < 0.75 then self.MGAim = self.MGAim + 0.05; end end
if ( self:IsPlayerControlled() == true and (UInputMan:KeyHeld(40) or UInputMan:KeyHeld(36)) and self.reload >= 6 ) then local rand = math.random(0,100); if rand < 75 then local bullet = CreateAEmitter("Particle Tank MG","Tank.rte"); if self.HFlipped then bullet.Pos = self.MG.Pos + Vector(math.cos(self.MG.RotAngle)*16,math.sin(self.MG.RotAngle)*-16); bullet.Vel = Vector(math.cos(self.MG.RotAngle)*16,math.sin(self.MG.RotAngle)*-16); else bullet.Pos = self.MG.Pos + Vector(math.cos(self.MG.RotAngle)*-16,math.sin(self.MG.RotAngle)*16); bullet.Vel = Vector(math.cos(self.MG.RotAngle)*-16,math.sin(self.MG.RotAngle)*16); end MovableMan:AddMO(bullet); else local bullet = CreateAEmitter("Particle Tank MGT","Tank.rte"); if self.HFlipped then bullet.Pos = self.MG.Pos + Vector(math.cos(self.MG.RotAngle)*16,math.sin(self.MG.RotAngle)*-16); bullet.Vel = Vector(math.cos(self.MG.RotAngle)*16,math.sin(self.MG.RotAngle)*-16); else bullet.Pos = self.MG.Pos + Vector(math.cos(self.MG.RotAngle)*-16,math.sin(self.MG.RotAngle)*16); bullet.Vel = Vector(math.cos(self.MG.RotAngle)*-16,math.sin(self.MG.RotAngle)*16); end MovableMan:AddMO(bullet); end
self.reload = 0; end
end elseif self.Age > 250 then self.MG = CreateTDExplosive("MG Turret","Tank.rte"); if self.HFlipped then self.MG.Pos = self.Pos + Vector(math.cos(self.RotAngle+0.2421198)*-42.45,math.sin(self.RotAngle+0.2421198)*42.45); else self.MG.Pos = self.Pos + Vector(math.cos(self.RotAngle+0.2421198)*42.45,-math.sin(self.RotAngle+0.2421198)*42.45); end self.MG.Vel = self.Vel; MovableMan:AddMO(self.MG); self.MG:Activate(); end
if self.reload <6 then self.reload = self.reload + 1; end
end
379 lines in only one script
Edit: and I corrected the non-hitting shells, I did it by setting the atomgroup resolution to 1 and the depth to 0.
Edit-2:This is my third prototype, everything is now functionnal, please report any bug you find, if they aren't any I'll release it. Download: download/file.php?id=37113
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 post attachments in this forum