Data Realms Fan Forums http://45.55.195.193/ |
|
Force AHuman not to crouch? http://45.55.195.193/viewtopic.php?f=73&t=15769 |
Page 1 of 1 |
Author: | numgun [ Wed Jul 08, 2009 6:05 pm ] |
Post subject: | 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. |
Author: | Mind [ Wed Jul 08, 2009 6:12 pm ] |
Post subject: | 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. |
Author: | Roon3 [ Wed Jul 08, 2009 6:22 pm ] |
Post subject: | 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 |
Author: | Mind [ Wed Jul 08, 2009 6:26 pm ] |
Post subject: | 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. |
Author: | numgun [ Wed Jul 08, 2009 6:42 pm ] |
Post subject: | 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! |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |