OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: @cero on 05 Jan 2008, 17:44:43
-
Hi there.
I been looking for a way to make players or even AI to use a civilian AI as a human shield, ider while is taking the civilian as hostage or to avoid getting shot by draging the civilian in front of him.
I take it that I´m gonna have to use "getpos" or something like that to get the civilian in front of the player on a very close distance, and also give the player the choice of draging this civilian with him or let go when it suits the player.
I made a very simple script to kip a triger moving with a unit, by constantly looping this triger on the player, and I could do that with a Civilian instead of a triger, but the civilian is not going to stay facing the right direction and is not guarantied that is going to be in front of the player.
Can anybody give me some ideas on how to start scripting this please?
I wan´t to make this MP by the way.
Thanks, and I hope I posted in the right forum. :whistle:
-
Example mission attached below.
The "captive" will follow you, keeping in front of you while you are on foot or getting as cargo in your vehicle.
-
Mandoble, you are the man!
Thanks mate.
I´ll try this tuesday cos right now I´m in Spain with my family, but I´m reading this book that is giving me lots of ideas to implement in this mission I´m building, so I wouldn´t be surprissed if I come back here before tuesday with more ideas.
Thanks again, oh, and if it don´t work chances are I´ll be able to work it out till it do, I just needed this to get my self the right way.
Thanks mate. :good:
-
Hopefuly I'll have time to fully test it before Tuesday.
-
Thanks mate, it would be nice, this way I just need to lay back and watch :D LOL No, serious now, you´ll save me a lot a lot of time, because to work nit out by my self I would probably take days... If I work it out at all. :blink:
-
See the example mission above, I didnt have much time to experiment with better animations for the captive ...
-
Hi.
I been playing around with this script just now, I only been back from Spain for an hour, lol.
I been messing about with some values trying to improve the distance, but all ends in disaster. For some reason the civilian unit makes the player unit to slide on the ground depending in what angle the players weapon is facing, but this only happans if I change the values in the line below:
_civ setPos [(getPos _unit select 0)+2.1*sin(_dir),(getPos _unit select 1)+2.2*cos(_dir), 0];
As it is now, the way you made it, works good, I just wish that BIS made an animation to have the kidnaper with one hand around the civy's neck and the other one to fire the weapon around the side of the civy ::) Maybe I can sugest that for the next generation game. :confused:
I'll have a go at trying with different animations.
I wonder if I can force the player to walk slow when this script is activated, because surely, there must be an animation to walk sideways for the kidnaped AI.
I know, I'm starting to sound confusing, I can't help it. :blink:
Thanks Mandoble.
-
Other than setpos, another option would be to set up a loop that tracks the player's velocity and direction every 1/2 second or so. You then switchmove/playmove an animation on the hostage that would move him in the proper direction (forward, back, left, right). Depending on speed of player, you can use the faster or slower animations.
Animations would look more natural than setpos, but its tricky timing wise.