View unanswered posts | View active topics It is currently Wed Jan 15, 2025 5:32 pm



Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
 [Mod Contest Entry: Auto-Defense System] GS Defenses 
Author Message
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post Re: [Mod Contest Entry: Auto-Defense System] GS Defenses
thesoupiest wrote:
If I knew -how- to make a one-directional turret, I would.
I recently found out that it is possible to override the actor's sharp aim by constantly setting AnalogAim (found in the Controller class), but I'm not 100% sure this works under AI control.

Code:
function Create(self)
   self.Ctrl = self:GetController()
end

-- limit aim to the first quadrant (up-right)
function Update(self)
   if self.Ctrl.AnalogAim.AbsRadAngle > 0.2 then
      self.Ctrl.AnalogAim = Vector(1,0):RadRotate(0.2)
   elseif self.Ctrl.AnalogAim.AbsRadAngle > 1.5 then
      self.Ctrl.AnalogAim = Vector(1,0):RadRotate(1.5)
   end
end

-- limit aim to the second quadrant (up-left)
function Update(self)
   if self.Ctrl.AnalogAim.AbsRadAngle < 1.6 then
      self.Ctrl.AnalogAim = Vector(1,0):RadRotate(1.6)
   elseif self.Ctrl.AnalogAim.AbsRadAngle > 3 then
      self.Ctrl.AnalogAim = Vector(1,0):RadRotate(3)
   end
end
The if-statements will be a little bit more complicated if you want to be able to aim in both first and fourth quadrant.


Thu Jun 23, 2011 11:09 am
Profile
User avatar

Joined: Thu Dec 16, 2010 11:06 pm
Posts: 276
Reply with quote
Post Re: [Mod Contest Entry: Auto-Defense System] GS Defenses
The voting for this contest has already begun! Show your support by voting!


Sat Jun 25, 2011 1:20 am
Profile
User avatar

Joined: Wed Jan 26, 2011 4:44 pm
Posts: 104
Location: Not sure. It's Dark in here.
Reply with quote
Post Re: [Mod Contest Entry: Auto-Defense System] GS Defenses
Not enough bullet drop. I shot it on a looping map on a slightly upward angle and it just kept looping gradually upwards until it went off screen. XD Other than that its awesome!


Mon Jul 04, 2011 4:07 pm
Profile WWW
User avatar

Joined: Thu Dec 16, 2010 11:06 pm
Posts: 276
Reply with quote
Post Re: [Mod Contest Entry: Auto-Defense System] GS Defenses
Any more and it would be silly.
My suggestion is not to play on equally silly looping maps.


Mon Jul 04, 2011 9:31 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 19 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.089s | 14 Queries | GZIP : Off ]