Data Realms Fan Forums
http://45.55.195.193/

Limitting flip of an actor
http://45.55.195.193/viewtopic.php?f=73&t=16669
Page 1 of 1

Author:  AaronLee [ Sat Sep 26, 2009 7:41 am ]
Post subject:  Limitting flip of an actor

I'm working on some 'attached' turret actors for the Bethesda. Everything's working fairly well (they move with the vehicle etc.) However; they're mounted on both sides and I'm trying to get them to face only one flipped direction (left OR right.)

So far I can make them recognize their current flipped direction (through aim angle) but I don't know if there's a method I can use to then switch them over to the correct direction once I figure out they're facing the wrong way (without just inducing the thing to have a seizure.)

My code for the turret is as follows;
Code:
function Create(self)
   self.Flipped = false;
end

function Update(self)
   --limit sharpaim
   local Aim = self:GetAimAngle(true);
   --if self.Flipped==true then
      if Aim <= 1.57 then
         self:SetAimAngle(1.5);
         print(Aim);
         local Aim = self:GetAimAngle(true);
         print(Aim);
         --print("FLIP ME!!!!");
      else
         --print("DON'T FLIP ME!!!!");
      end
   --end
end

Flipped is a boolean that is used to read which direction the turret should face.

So I'm wondering if anyone has any ideas on this problem.

Author:  Abdul Alhazred [ Sat Sep 26, 2009 9:24 am ]
Post subject:  Re: Limitting flip of an actor

Try looking at the code for the Steam Fortress in the Armrobotics mod. Also, in my experience SetAimAngle stops working as soon as the player or AI use sharp aim.

Author:  Grif [ Sat Sep 26, 2009 4:18 pm ]
Post subject:  Re: Limitting flip of an actor

Just use HFlipped?

If HFlipped == false then they're facing to the right
make it true and they flip around.

Author:  AaronLee [ Sat Sep 26, 2009 6:46 pm ]
Post subject:  Re: Limitting flip of an actor

Grif wrote:
Just use HFlipped?

If HFlipped == false then they're facing to the right
make it true and they flip around.


I've tried setting HFlipped but it only flips the actor base. The turret and attachables all flip regardless of HFlipped.

But I'll have a look at the fortress, it could be telling.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/