View unanswered posts | View active topics It is currently Fri Dec 27, 2024 10:40 pm



Reply to topic  [ 4 posts ] 
 Limitting flip of an actor 
Author Message
User avatar

Joined: Fri Jun 01, 2007 12:17 am
Posts: 106
Reply with quote
Post 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.


Sat Sep 26, 2009 7:41 am
Profile WWW
DRL Developer
DRL Developer

Joined: Tue Aug 11, 2009 5:09 am
Posts: 395
Reply with quote
Post 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.


Sat Sep 26, 2009 9:24 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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.


Sat Sep 26, 2009 4:18 pm
Profile
User avatar

Joined: Fri Jun 01, 2007 12:17 am
Posts: 106
Reply with quote
Post 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.


Sat Sep 26, 2009 6:46 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

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.016s | 15 Queries | GZIP : Off ]