Tankbuster 1747 Posted June 23, 2007 This has been bugging me for a few days now. I'm about to give up. I want to have a group of civilians being held hostage by OPFOR. BLUFOR is to rescue them. This is multiplayer, by the way. So far, I've gone this route; I used Mongoose_84's civilians addon. I They are on the independent side and I made them setcaptive (or OPFOR shoots them). I have an OPFOR (actually FSRA - Terrorists by gi.Zmol.ia) and they are guarding the hostages. Now, all I want to do is have the hostages sit down or lie down and keep still (generally behave submissive and hostage like), but they ignore everything, until they see the guard, when they go prone. I think the problem lies with the civilians addon. They aren't true civilians. They really are soldiers in civvy clothes with no guns and maybe this is why they won't do as I ask. I've tried all the action sitdown and playmove Amov etc and even switchmove, but they just don't do it. I've put setbehaviour safe in there too, as most of the advice relating to sitdown also uses safe. I have tested the setcaptive stuff. I can trigger the hostages to setcaptive false, and the opfor guards kills them all, which is functionality I will need in the mission, but the rest of the stuff to do with these civ/hostages has me stumped. Help and guidance gratefully received. Tanky -Paul- Share this post Link to post Share on other sites
Tankbuster 1747 Posted June 23, 2007 Just thought to add; I used the civilian addon because it's easy to make OPFOR attack them if BLUFOR bungle the rescue attempt. Maybe I should be going about this differently? Share this post Link to post Share on other sites
UNN 0 Posted June 23, 2007 This works, it locks the animation in place: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (Local CIV01) Then     {     CIV01 SetUnitPos "Down";     Sleep 3;     CIV01 DisableAI "Anim";     }; To release the unit, call this. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">If (Local CIV01) Then     {     CIV01 EnableAI "Anim";     CIV01 SetUnitPos "Up";     }; Share this post Link to post Share on other sites
Tankbuster 1747 Posted June 23, 2007 UNN, Thanks for that. Are those .sqs thingies that I can call from a trigger etc? Tanky -Paul Share this post Link to post Share on other sites
UNN 0 Posted June 24, 2007 Quote[/b] ]Are those .sqs thingies that I can call from a trigger etc? Yeah, a trigger is fine as it calls the script on all clients and server. But as long as you make sure it's being called on the computer thats local to the unit, then you should be ok to. If the captives are AI, then you could run the script from the server only. One thing to watch out for though, is running the script from an objects init field in the mission editor. For example if you add this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">pScript=[This] ExecVM "SetUnitCaptive.sqs" Then you would need a small delay in your script. SetUnitCaptive.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Unit=_This Select 0; Sleep 1; If (Local _Unit) Then    {    _Unit SetUnitPos "Down";    Sleep 3;    _Unit DisableAI "Anim";    }; Share this post Link to post Share on other sites
Tankbuster 1747 Posted June 24, 2007 Quote[/b] ]Are those .sqs thingies that I can call from a trigger etc? Yeah, a trigger is fine as it calls the script on all clients and server. But as long as you make sure it's being called on the computer thats local to the unit, then you should be ok to. If the captives are AI, then you could run the script from the server only. One thing to watch out for though, is running the script from an objects init field in the mission editor. For example if you add this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[This] ExecVM "SetUnitCaptive.sqs" Then you would need a small delay in your script. SetUnitCaptive.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Unit=_This Select 0; Sleep 1; If (Local _Unit) Then { _Unit SetUnitPos "Down"; Sleep 3; _Unit DisableAI "Anim"; }; Whoa. I understand the local/client/server relationship, but how does it impact what I'm doing here and how do I make sure I get it right? I could call the first one, to freeze them with an init, but the unfreeze one would be trigger. The captives will be AI. Share this post Link to post Share on other sites
UNN 0 Posted June 24, 2007 Quote[/b] ]I could call the first one, to freeze them with an init, but the unfreeze one would be trigger. The captives will be AI. If you called your captives CAP01,CAP02 e.t.c In the mission editor. Then your trigger would just need: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">pScript=[CAP01,CAP02,CAP03] ExecVM "SetUnitFree.sqs" SetUnitFree.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Captives=_This; { If (Local _x) Then    {    _x EnableAI "Anim";    _x SetUnitPos "Up";    }; } ForEach _Captives; Share this post Link to post Share on other sites
Tankbuster 1747 Posted June 24, 2007 That's great, thanks mate. All the talk of local/remote/client had me running for the hills for a minute there. PS & OT; Do you remember it was me who did some testing with the big Antonov with you back on old OFP? Share this post Link to post Share on other sites
UNN 0 Posted June 26, 2007 Quote[/b] ]All the talk of local/remote/client had me running for the hills for a minute there. Lol Quote[/b] ]PS & OT; Do you remember it was me who did some testing with the big Antonov with you back on old OFP? Yeah, I spotted your posts in the new Antonov / Arma thread. Funny how things come around. I'm back doing a similar thing, only this time it's not with any specific addon. Anyway, hope thats help sort your problem. Share this post Link to post Share on other sites