Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Human shield, How?  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Human shield, How?
« 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:
SCREWBY!!!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Human shield, How?
« Reply #1 on: 05 Jan 2008, 18:07:45 »
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.
« Last Edit: 08 Jan 2008, 04:12:13 by Mandoble »

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re: Human shield, How?
« Reply #2 on: 06 Jan 2008, 01:36:45 »
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:
SCREWBY!!!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Human shield, How?
« Reply #3 on: 06 Jan 2008, 02:48:56 »
Hopefuly I'll have time to fully test it before Tuesday.

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re: Human shield, How?
« Reply #4 on: 07 Jan 2008, 01:32:50 »
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:
SCREWBY!!!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Human shield, How?
« Reply #5 on: 08 Jan 2008, 04:13:13 »
See the example mission above, I didnt have much time to experiment with better animations for the captive ...

Offline @cero

  • Members
  • *
  • Yeah! Get some!!
Re: Human shield, How?
« Reply #6 on: 08 Jan 2008, 15:12:27 »
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:

Quote
      _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.
SCREWBY!!!

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Human shield, How?
« Reply #7 on: 08 Jan 2008, 19:10:55 »
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. 


El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...