Home   Help Search Login Register  

Author Topic: Dead legs  (Read 2082 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Dead legs
« on: 26 Dec 2008, 22:24:06 »
How do I damage enough of a character's legs via a script so that he can't walk and so that I get the damage textures to show up without shooting him myself?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re: Dead legs
« Reply #1 on: 26 Dec 2008, 23:12:23 »
Have you tried spawning a bullet or two in his legs? Back in OFP, this was how that was accomplished...
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Dead legs
« Reply #2 on: 27 Dec 2008, 00:04:33 »
Hmm, interesting theory. How would I go about that?
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Deadfast

  • Members
  • *
Re: Dead legs
« Reply #3 on: 27 Dec 2008, 13:04:40 »
There you go:

Code: [Select]
/*
killLegs.sqf
by Deadfast


Spawn a bullet at unit's legs to render it unable to walk.

SYNTAX: [unit name] execVM "killLegs.sqf"
*/

_unit = _this select 0;



if ((!canStand _unit) || (!alive _unit)) exitWith {}; //unit has damaged legs already or is dead

_i = 0;
while {(canStand _unit) && (_i < 20)} do
{
_pos = _unit ModelToWorld [0.2, -1, 0.01];
_dir = direction _unit;

_bullet = "B_556x45_SD" createVehicleLocal _pos;
_bullet setVelocity [(sin _dir*100),(cos _dir*100),0];

_i = _i + 1;
sleep 0.1;
};


A little disclaimer: script doesn't work if the unit is moving or if the unit is human and is prone (works fine with AI). I'll take a look into it.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Dead legs
« Reply #4 on: 27 Dec 2008, 15:04:43 »
How do I call an SQF? I'm used to .sqs
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Deadfast

  • Members
  • *
Re: Dead legs
« Reply #5 on: 27 Dec 2008, 17:38:55 »
It's in the script header:

Code: [Select]
[unit name] execVM "killLegs.sqf"


if you wanna call it from a trigger use something like:
Code: [Select]
killlegs = [unit name] execVM "killLegs.sqf"

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Dead legs
« Reply #6 on: 30 Dec 2008, 17:56:54 »
Excellant. However, it is killing the unit.  >:(
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Deadfast

  • Members
  • *
Re: Dead legs
« Reply #7 on: 30 Dec 2008, 21:52:41 »
Really?

It was working all fine when I tested it (BLUFOR Rifleman, both player operated and AI)...


Try to play with this line:
Code: [Select]
_pos = _unit ModelToWorld [0.2, -1, 0.01];

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Dead legs
« Reply #8 on: 31 Dec 2008, 12:19:57 »
I think it's because I'm using a community created addon units rather than a standard BIS one. I reckon these guys are weaker.
I tried using various different types of ammo but he still dies.

I'll get on to the addon maker and see what he has to say about the unit's strength.

Cheers for the script though, it works just fine.  ;)
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Dead legs
« Reply #9 on: 31 Dec 2008, 12:27:23 »
You could also try to slow the bullets down, I believe if you lower the values (both 100) on this line the bullet will travel slower:
Code: [Select]
_bullet setVelocity [(sin _dir*100),(cos _dir*100),0];
AFAIK in ArmA the impact velocity affects damage.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.