j-man 0 Posted December 10, 2003 I know it possible but I dont know how to do it . But is there a way to simulate using a human shield . Like when the player came within a certain distance from behind another soldier it could start a script that placed the victim 2 meters infront of the player. And is it possible to make it so that the victim would always face the same direction as the player? I tried putting in a script with something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_hostage = _this select 0 #loop _hostage setpos [(getpos player select 0), Â 2,(getpos player select 1)] goto "loop" But hte victim ended up on the other side of the island insted of 2 meters infront of the player. Any suggestion ? Share this post Link to post Share on other sites
Harkonin 0 Posted December 10, 2003 try something like this _unit = _this select 0 _obj = nearestObject _unit ?("man" countType [_obj] > 0 AND _obj != player AND _obj distance player < 5 AND alive _obj): player AddAction ["Grab","Hostage.sqs"] then for your "grabbing script - _pos = _this _dir = getdir player _hostage = nearestobject _pos #loop _hostage setdir _dir _hostage setpos [(getpos player select 0) + 2,(getpos player select 1), ,(getpos player select 2)] ?!(alive _hostage):Exit goto "loop" syntax may be off but you get the idea. Share this post Link to post Share on other sites
MrZig 0 Posted December 10, 2003 Actually, if you constantly want it in front of you, use this line of script. <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 _unit2 = _this select 1 #loop _dir = getdir _unit _sin = sin (_dir) *1 _cos = cos (_dir) *1 _posX = (getpos _unit select 0) _posY = (getpos _unit select 1) ;the rest of the script WILL work just get the + thing to work! _Xpos = (_posX)+(_sin) _Ypos = (_posY)+(_cos) ;the rest of the script WILL work just get the + thing to work! _unit2 setpos [_Xpos,_Ypos,0] _unit2 setdir getdir _unit ~0.005 goto "loop" That will put _unit2 1 metre in front of _unit1 So exec the script with [evilman,hostage] exec "script.sqs" Share this post Link to post Share on other sites
Harkonin 0 Posted December 10, 2003 Yep that'll work but hell also be stuck in front of you without an option to drop him. Be pretty funny having a corpse in front of you the whole game. Share this post Link to post Share on other sites
MrZig 0 Posted December 10, 2003 Hmm.. Good point ahahah Share this post Link to post Share on other sites
MrZig 0 Posted December 10, 2003 Could always add a function like.. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?(getdammage _unit2) == 1 : exit Right underneath loop, so that he would drop when dead, as for the action.. Hmm.. Share this post Link to post Share on other sites
Harkonin 0 Posted December 10, 2003 Also need an option to release him if wanted. Thus the nearestobject and "man". ?("man" countType [_unit2] > 0 AND _unit2 != player AND _unit2 distance player < 2 AND alive _unit2): player AddAction ["Release","howeveryouwantitdone"] and use the ?!(alive _unit2):exit Share this post Link to post Share on other sites
j-man 0 Posted December 11, 2003 Thnx all great scripts Now my mission is gona kick some a** Share this post Link to post Share on other sites