Home   Help Search Login Register  

Author Topic: Invincibility  (Read 1279 times)

0 Members and 1 Guest are viewing this topic.

shadow99

  • Guest
Invincibility
« on: 31 Oct 2004, 10:13:38 »
Yup. I've discussed it before and it went on, and on, and on, and now I'm here to do it again.  :)

At the end of the last thread, I think I came to the trigger:

Condition: not alive officer1
On Activaition: officer1 setDamage 0

In the rare case where officer1 is pummeled with so many hits that he DOES in fact die, a trigger to end the mission will not work. This is what I used, to ensure that if by some chance officer1 did die, the mission would end:

First Trigger:

Condition: not alive officer1
On Activation: check=true

Second Trigger:
Timer: 1 sec
Type: End #2
Text: check
Condition: not alive officer1 and check

And, it doesn't work. :-\

So, what I want now is one of two things:

If I could have a way to make officer1 invincible period. Even if he were to go through ten explosion all within one second whilst being shot in the head with twenty M60 Machine Guns simultaneously, all of this occurring under water, officer1 WOULD NOT DIE.

Possible... ?

Or:

If I could have a way for the game to run End #2 after the rare event of officer1 not getting up again after being killed. Keep in mind that officer1 is killed frequently, and 9 times out of 10 switchMoves to his initial behavior and is in full health. Also remember that I gave a failed solution above, so don't use it...  :-\

This is driving me nuts. I can't wait until I kill off this character.

If you don't understand any of this, just say the word and I'll try again.
 

Offline C0LDSt33L

  • Members
  • *
  • Member of the SotM Team
Re:Invincibility
« Reply #1 on: 31 Oct 2004, 10:44:15 »
You could write a script to keep him alive. Something like:

#Loop

officer setdammage 0

~0.1

goto "Loop"

If you were going to use your triggers couldn't you just have the condition check for the second one as we know the officer is already dead. Perhaps that may work.
« Last Edit: 31 Oct 2004, 10:46:55 by C0LDSt33L »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Invincibility
« Reply #2 on: 31 Oct 2004, 12:26:53 »
It's surprisingly hard to make a unit invincible.   In fact you can't, although you can make him come back to life if he gets killed, if he is AI controlled.   Human controlled is more tricky.

The tools in your invincibility kit start with, as COLDSt33L suggests, a setdammage 0 loop.  In my experience a delay of ~1 is fast enough.

The other tools are setCaptive true, where appropriate, and a hit EH

loon1 addEventHandler [{Hit}, {_this select 0 setDammage 0}]

The killed EH is actually unhelpful in this case.
Plenty of reviewed ArmA missions for you to play

Bart

  • Guest
Re:Invincibility
« Reply #3 on: 31 Oct 2004, 12:33:32 »
lol i've had this issue:
put instant respawn at timer 0
and the previous command line in a script
then throw a grenade in front of you (so you die)
and you'll be duplicated  ;D ;D ;D

greetz

Offline Maddmatt

  • Members
  • *
Re:Invincibility
« Reply #4 on: 31 Oct 2004, 14:17:46 »
As I said in the "I will be the one" topic, you can easily make a unit invincible with the following in the init field:
Code: [Select]

This addeventhandler ["hit",{(_this select 0) setdammage 0}]; This addeventhandler ["dammaged",{(_this select 0) setdammage 0}]

After this he shouldn't die from anything.
« Last Edit: 31 Oct 2004, 14:18:48 by Maddmatt »
http://bushfires.org/
African Conflict Mod
Mission editor and scripter

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Invincibility
« Reply #5 on: 31 Oct 2004, 22:38:43 »
Actually I've always just used the first line, and it worked. I don't think you need the dammaged EH, just the "hit" one:

This addeventhandler ["hit",{(_this select 0) setdammage 0}];

The only time I've ever been killed with this on me is when I pumped up the time accelleration to x4 and blew up a bunch of pipebombs.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:Invincibility
« Reply #6 on: 01 Nov 2004, 01:34:13 »
I actually made a kevlar armored man once. Using .cpp and made a homemade addon. Wasn't really kevlar though. Couldn't even kill him with a Laser Guided Bomb.

I can attach the file if anyone wants it. Not very big. Uses the existing BIS soldier as the model.

-Tyger
"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

shadow99

  • Guest
Re:Invincibility
« Reply #7 on: 01 Nov 2004, 03:37:09 »
Wow, nice responses and great suggestions guys. You have a big thanks from me to all of you.

I think I'll go with Maddmatt's solution and use that full code, just to be in the safe.

We're not talking about the player here either, this is an NPC.

DEAD RABBIT

  • Guest
Re:Invincibility
« Reply #8 on: 02 Nov 2004, 19:07:44 »
I suggest everyone to use the eventhandler described above.

I made once a invincibility script, it worked in essence. I could be shot over and over and over, but at one moment the screen went black and you would get the standard fade out death sequence.
The weird thing of that was the soldier I was playing, was still alive (?!). It was very weird. I was dead, while my body was still standing.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Invincibility
« Reply #9 on: 03 Nov 2004, 02:33:50 »
Invincibility on the player unit is virtually impossible without a custom onPlayerKilled script that puts you back into the mission.    Otherwise, as you say, you get the Death sequence with your unit still alive in the mission, which looks and feels a bit odd.   With AI its much easier, they just come back to life before anybody has noticed they are dead.
Plenty of reviewed ArmA missions for you to play