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



Reply to topic  [ 6 posts ] 
 Making soldiers behave right 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Making soldiers behave right
I'm making a campaign, and it has a small guard outpost in it. The problem is, some of them won't exactly stay in their posts...
Attachment:
File comment: Idiots.
Picture 7.png
Picture 7.png [ 140.78 KiB | Viewed 2117 times ]
The one in the middle of the base falls over as he tries to get up, over and over, and slowly moves to the left. The one at the gun window slowly falls backwards and doesn't stay near the window. And although this doesn't bother me as much, I wish they wouldn't do the sentry sweep all in union like they're being controlled by some hive mind...

How can I fix these?


Thu Aug 19, 2010 7:26 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Making soldiers behave right
If you want it pretty: Forget it.

If you want it to work: Pin the actors. They won't move (pinning affects the chest) but the legs will still go through their animation cycle and it'll be pretty ugly.


Thu Aug 19, 2010 11:54 pm
Profile
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: Making soldiers behave right
But I got the ones on the roof to stand somehow...


Fri Aug 20, 2010 3:08 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Making soldiers behave right
Ignore what Grif said.
Code:
   for actor in MovableMan.Actors do
    if actor:IsPlayerControlled() == false and actor.AIMode == Actor.AIMODE_SENTRY then
   actor:GetController():SetState(Controller.BODY_CROUCH,false);
   actor:GetController():SetState(Controller.MOVE_LEFT,false);
   actor:GetController():SetState(Controller.MOVE_RIGHT,false);
    end
   end

Stuff that somewhere in your mission update function.


Fri Aug 20, 2010 4:39 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Making soldiers behave right
That will basically stop them from crouching or walking while in sentry mode.


Fri Aug 20, 2010 8:16 am
Profile WWW
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post Re: Making soldiers behave right
CaveCricket48 wrote:
Ignore what Grif said.
Code:
   for actor in MovableMan.Actors do
    if actor:IsPlayerControlled() == false and actor.AIMode == Actor.AIMODE_SENTRY then
   actor:GetController():SetState(Controller.BODY_CROUCH,false);
   actor:GetController():SetState(Controller.MOVE_LEFT,false);
   actor:GetController():SetState(Controller.MOVE_RIGHT,false);
    end
   end

Stuff that somewhere in your mission update function.

Thank you! I would've done that, but I thought they were falling over, not moving. Thank you so much... You've saved the mission I'm making!


Fri Aug 20, 2010 3:09 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.305s | 15 Queries | GZIP : Off ]