OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: pexmo on 13 Dec 2004, 08:14:44
-
In my exploration of possibilities for "rescue" of a wounded team mate in my coop campaign i now have a new question:
As i have found and been given nice scripts from you aces here at the forum that allows a player to be incapacitated when wounded i have a follow up question on that. Is there a script to be made that can make players become wounded eaven when they should have been killed?
I tried things like thoughdude script to give the players more health thus making them take alot more wounds before they die. The problem is that the soldiers keeps popping up to standing etc with that script.
If anyone have a solution to this OR have a new idea on adding the sens of saving downed (eaven something to do with the dead that FEELS like attending to a wounded) player would be sooooooooo great :)
-
There are some "superman" scripts in the Ed Depot that might help.
You can edit the game config or something to make units stronger.
With pure scripting, it's difficult. You can easily make an invincibility script and mine is posted below. You can amend it as you like, you'll probably want to change
_x setDammage 0
to
_x setDammage ((getDammage _x) - 0.5)
or something. Syntax very ropey. However, in certain circumstances you will still be killed. If you do use/amend it please mention where you got it from somewhere in the credits.
; this script is for beta testing and review purposes only
; you can call it from the top of init.sqs
; it makes the player's group unkillable
; units sometimes get killed and are resurrected
; if you get killed that's it, you are dead
; even with this script running you still have to play tactically... if you just run around like you really are invincible you will die
; sn1 is the player
"_x addEventHandler [{Hit}, {_this select 0 setDammage 0}]" forEach units sn
; it looks fine on paper but in practice the killed EH doesn't help
; when your loons die they get resurrected but not in your group
;"_x addEventHandler [{Killed}, {_this select 0 setDammage 0}]" forEach units sn
~2
hint "Invincibility script on"
#loop
; if you don't put your loons in the setdammage loop they can get killed
; sn1 setDammage 0
;"_x setDammage 0" forEach units sn
"_x setDammage 0" forEach [sn1, sn2, sn3, sn4, sn5]
; uncomment the setCaptive line if you want the enemy not to shoot at you
; it's in the loop because the squad is setCaptive true/false during cutscenes
sn1 setCaptive true
;"_x setCaptive true" forEach units sn
~1
goto "loop"
exit
-
I dont understand your explanation completely,but I think U are looking for a way to have your soldiers harder to kill?
If this is correct,a possible way is using a cheated soldier.
You can create one (Createunit) or hack the mission .sqm and edit the next line in an already placed unit:vehicle="SoldierESaboteurCheat" (or SoldierWSaboteurCheat for West,and there are more of them)
You could do the same trick for having units changing sides during a mission,now he will change from mortal to immortal ;)
-
well what i realy want to do is have soldiers reach wounded status but not further. They can reach .5 i health but not 1 (dead). This is because i use a wouded script that sets players out of the action until healed at .5 health.
Macguba: thx alot i will try your script out it might do the trick. And rest asured i will not realease anything using your script, it will stay in our internal coop campaign that me and my friends are playing. But ill still set a line with your name on it in the script file.
-
I think what pexmo is looking for is a way to have the character wounded and on the ground and immobile if I am reading correctly. Basically he wants a soldier to be down, wounded and incapacitated until a medic can get to him and heal him to get him out of there. Is that correct pexmo?
-
ur using kmaks show wound script right.
well i know its hard w/ that because AI will shoot the guys even if there incapacitated so just make a script that detects when there at .5 health and set captives them
-
Penguinman: Yah thats the script im using.
Yeah i will try to make a setcaptive script today, hopefully i get it to work... im realy green on scripting.
Echo: Yeah thats about what im looking for.