View unanswered posts | View active topics It is currently Thu Dec 26, 2024 4:54 pm



Reply to topic  [ 5 posts ] 
 Force AHuman not to crouch? 
Author Message

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Force AHuman not to crouch?
The vehicle I'm doing has a funny tendancy to crouch once a while, making it do flips while no one is riding it. Is there a way to cancel the AI's every attempt to crouch?

And just for the AI, since the crouch button is reserved for a function on the vehicle so I just need the AI to stop flipping the ♥♥♥♥ out.


Wed Jul 08, 2009 6:05 pm
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Force AHuman not to crouch?
maybe...

Code:
if controller:IsState(Controller.BODY_CROUCH) then
               controller:IsState(Controller.BODY_JUMP)
end


try that and see if it works.


Wed Jul 08, 2009 6:12 pm
Profile
User avatar

Joined: Sun May 11, 2008 12:50 pm
Posts: 899
Reply with quote
Post Re: Force AHuman not to crouch?
Nope, won't work because you're just checking what state (California? Washington?) he is in twice. It should be:
Code:
if controller:IsState(Controller.BODY_CROUCH) then
               controller:SetState(Controller.BODY_JUMP) //SetState, not IsState
end


Wed Jul 08, 2009 6:22 pm
Profile WWW
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1360
Location: USA
Reply with quote
Post Re: Force AHuman not to crouch?
Didn't know if there was a setstate, but obiovusly there is. Was looking around, but didn't find one in a minute, so i just used isstate. Anways, what roon said.


Wed Jul 08, 2009 6:26 pm
Profile

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: Force AHuman not to crouch?
Did a bit of looking around in Darlos' scout drone and I cooked up this:

Code:
   if self:IsPlayerControlled() == false then
      self:GetController():SetState(Controller.BODY_CROUCH, false);
   end


Works! :D


Wed Jul 08, 2009 6:42 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.073s | 13 Queries | GZIP : Off ]