Home   Help Search Login Register  

Author Topic: RUG_BodyArmor v.1.1 (ACCEPTED)  (Read 19429 times)

0 Members and 1 Guest are viewing this topic.

Offline Rommel92

  • Members
  • *
Re: RUG_BodyArmor v.1.1 (review please?)
« Reply #15 on: 03 Apr 2008, 04:36:51 »
Hey Wolfrug, I been thinking bout what you said, perhaps if you triggered the Hit first (which made sure you have a handshit in there to make sure its a proper hit), initiate the knockdown from the concussion, and seeing as the damaged runs after it as you said, check if the wound is lethal or not (bodyarmour hit or not), and if it is lethal perhaps kill them while they're knockeddown, and if its not lethal, its a win win situation.

Reckon that would work? I'm going to start on it now, but maybe it could help you? :scratch:
« Last Edit: 03 Apr 2008, 04:39:03 by rommel92 »

Offline Ironman

  • Former Staff
  • ****
    • {GSF} Home Page
Re: RUG_BodyArmor v.1.1 (review please?)
« Reply #16 on: 09 Apr 2008, 09:09:14 »
good luck with this.... I just did a quick read up on it. Is anyone working on this for Small scale MP missions?
TS3 IP: tor.zebgames.com:9992

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: RUG_BodyArmor v.1.1 (review please?)
« Reply #17 on: 09 Apr 2008, 13:28:07 »
Ahhh, the plague of MP once again :D

Anyway : since vehicle variables are local by default, these scripts won't be easy to implement in a large-scale, JIP-supported type of mission. However, since all AI soldiers are local to a player squad leader, as long as the player squadleader doesn't JIP, disconnect or otherwise confuse things, it should be possible to have the script working for singular PC-led squads. I guess. :)

Once again : MP is not SP. In MP, you hopefully have a squad of REAL people under your command/in your squad, and these people should have no problem staying in cover, advancing tactically and generally kicking a lot more ass than the AI. This script is mostly meant for SP, to enhance your squad's chance of survival, and even if someone does go down you have a shot at "saving" them. Say for instance a campaign game where you have a squad of mercenaries under your command, and every time one of the AI bumbles over a hill or stands up into the gunfire it doesn't mean automatic retry/restart :)

Or hey - if it's too unrealistic for you, add some visual effects, remove the "knocked down" bit, and call it an energy shield!  :good:

Arrrh, MP...  :no:

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline snafu

  • Members
  • *
Re: RUG_BodyArmor v.1.1 (READY)
« Reply #18 on: 20 Apr 2008, 18:49:01 »
I am wanting to add this into my mission but I couldn't get my head around all that code.

How do I implement it for the players group?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: RUG_BodyArmor v.1.1 (READY)
« Reply #19 on: 20 Apr 2008, 19:15:08 »
There should be a description in the script header...one moment.

Quote
//RUG_BodyArmor by Wolfrug (www.ofpec.com)
//
//Calling: [UnitName, Mode, MaxDam] execVM "RUG_BodyArmor.sqf"
//UnitName : Name of unit, can be 'this' in the init field, or _x if used with foreach
//Mode : 0, 1, 2 or 3.
//0 = Once armor is depleted, it can never be recharged (except by calling the script again).
//1 = Armor returns fully after each revival
//2 = Armor returns fully once unit has been fully healed after revival
//3 = Armor is never depleted: unit can be knocked down but not killed (except by scripting)
//MaxDam : Must be a number less than 0: determines total body armor. -1 = 3 total, -2 = 6 total etc.
//Note : due to the usage of eventhandlers, you should avoid calling this script more than once on any unit!
//Enjoy! - Wolfrug

For the "medevac" mode (=has to be fully healed to recharge bodyarmor) which is my favourite, you'd do this on the player's group (just add the code to the player for instance, or any group member) Remember to have the rug_bodyarmor.sqf file in your main mission folder!

Code: [Select]
{[_x, 2, -1] execvm "rug_bodyarmor.sqf"} forEach units group this;

The _x is the unit in the foreach loop, the 2 is the mode, the 1 is the relative amount of bodyarmor.

Hope that helps, and I'm looking forward to seeing it in action in your mission!  :clap:

Wolfrug out.
« Last Edit: 12 May 2008, 05:30:07 by Wolfrug »
"When 900 years YOU reach, look as good you will not!"

Offline snafu

  • Members
  • *
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #20 on: 11 May 2008, 23:00:57 »
Wolfrug. I have just put up the new version of my mission (in the mission beta area) that contains this script of yours. It really is an awesome script that added a new aspect of the mission. It made up for the lack of numbers in my squad and it was fun dashing around giving first aid to all my knocked out squad members.

Nice work.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #21 on: 12 May 2008, 05:29:51 »
Sweet! I'd love to check it out but, alas, I'm nowhere close to an ArmA-capable computer and won't be for some time! But I'll be sure to check it out when I get back :)

Oh, and as a note for posterity: the syntax above has a slight error in it : it should be -1, not 1 (if you make it >0, the unit will start knocked out and remain unhealable!). I will modify my post above to fix it.  :whistle:

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline USM-CPT.Dyson

  • Members
  • *
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #22 on: 28 Jun 2008, 19:38:58 »
I sort of skimmed this and I was wondering... I want all unit to fall down and become unconscious after 1 round for between 30-120 seconds. I would also like the body armor to only cover the chest area (and part of the head, 9mm rounds would knock the player out for a long time, anything bigger would kill). Currently, in your demo mission, after 2 shots to the face the unit is still alive.
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #23 on: 29 Jun 2008, 11:59:48 »
@USM-CPT.Dyson

If you'd read through the thread, you'd find you're not the first to wish for a proper, localized body armor. However as the thread will reveal, that's not practicable due to limitations to the ArmA "dammaged" eventhandler, as well as due to the way ArmA in general handles "being dead" (irreversible, basically). So the whole "headshot" thing is not too likely to happen, sadly. If someone figures out a work-around, that'd be great! As I said in this thread, this script is not really meant for your enemies, since, well, shooting them in the head is supposed to kill them! But for your own teammates or people one in general does not want to bloody die. :D

However it is possible to make something like what you want (people falling over unconscious after one round). Either you make the body armor in the current script very little: (instead of -1, make it something like -0.025) and they will be sure to be falling unconscious every round - although they can still be revived, of course, and depending on mode, the armor would or would not be regenerated. You can change the amount of time spent sleeping in the little sub-script (caller _timer, I believe) which determines how long the knockout lasts. Either that or you simply create your own script based on your own parameters, since in my version you could still be revived ahead of time by your mates. :)

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline USM-CPT.Dyson

  • Members
  • *
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #24 on: 29 Jun 2008, 17:02:20 »
Yeah sorry I had been reading so many posts yesterday I could only stand to skim things.  :D Well that's too bad, and I can't script to save my life.
CTI SectorLink
Version: Beta 7
http://hosted.filefront.com/Spyder001/

Offline hank_officer

  • Members
  • *
  • Hank Officer
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #25 on: 30 Jun 2008, 08:39:27 »
is there a invincible mode without knocking down and it can be disable after a time  ???
I need it for my mission :P

thank you!

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #26 on: 30 Jun 2008, 17:42:16 »
If you just want your unit to be invincible, simply add this to its init field:

Code: [Select]
this setdamage -500; this addeventhandler["hit", {_this select 0 setDamage -500}];
And then when you want him to stop being invincible, simply do something like:

Code: [Select]
unitName removeeventhandler ["fired", 0];
(unitName being the name of the unit - this also assumes this fired eventhandler is the first one attached to the unit in question)

Good luck!

Wolfrug out.

"When 900 years YOU reach, look as good you will not!"

Offline hank_officer

  • Members
  • *
  • Hank Officer
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #27 on: 04 Jul 2008, 16:41:46 »
Thank you :clap:
Now my mission may avoids spawnkill :D

Offline Luke

  • Members
  • *
  • Thank God! The OFPEC Staff are here!
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #28 on: 23 Aug 2008, 00:26:58 »

Code: [Select]
this addeventhandler ["dammaged", {_this select 0 setDamage -5}];
And one unit with this in his init field:

Code: [Select]
this addeventhandler ["hit", {_this select 0 setdamage -5}];
The latter one will survive your barrage of bullets, whereas the former won't.

I know this thread is older than Yoda, (that's 900 years + a long time ago!  :P)
and I did not see a solution to the headshot bug,

so...

here's my two bits (:flips_a_quarter:)

Anyway when the script init-s, in addition to the hit event handler, you add a dammaged one as well so that,
when hit in the head you could have:
Code: [Select]
this addeventhandler["Dammaged", {(_this ) exec "headcheck.sqs"]
headcheck.sqs:
Code: [Select]
? _this select 1=="hlava":(_this select 0) setdammage 1or alternatively:
Code: [Select]
? _this select 1=="hlava":_hlava_head_shot=true;
exit

where in the body armour script, if (_hlava_head_shot) then {removebodyarmour;unit setdammage 1}
or something like that.

that way if they don't get headshotted then they still have their armour, but if they do they die despite it.

Luke

P.S. if this problem has been solved, then
a) Hi!  :P
b) Thanx for letting me exercise my fingertips/get my typing practice in.
« Last Edit: 23 Aug 2008, 01:23:35 by Luke »
Pesky Human!!
Wort Wort Wort.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: RUG_BodyArmor v.1.1 (ACCEPTED)
« Reply #29 on: 23 Aug 2008, 01:17:14 »
The "hit" eventhandler does not return body parts (like the "dammaged" eventhandler does). Also, if you try to have both a dammaged and a hit eventhandler working at the same time (i.e., one to check for location, one to reset damage), the dammaged will never fire as the hit always works before it -> thus healing any damage and making the dammaged eventhandler think nothing has happened. Adding for instance a delay to the hit eventhandler means insta-kills will start happening again, which is not something we want. :)

Believe me, I tested and tried all possible ways of making this more "realistic" to no avail. Apparently ArmA II will have built-in revives though, which should be fun (and should make the creation of a body-armor script that much easier).

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"