Request: Revive script

Hello,

I would like to request a script that does the following:

- Instead of killing the player it knocks him into unconscious state.
- Players can revive other players.

Would be greatly appreciated,

Cheers, Fractional.
 
Player2's script initiates the unconscious state on certain conditions, it doesn't affect player death at all. What will need to be done ( I think ) is to replace the point of death with an unconscious state instead. I've tried a bit but I don't really know what I'm doing :/ if anyone wants to fix my work or just take my ideas into a new direction feel free. :) Just give me credit if you don't change too much.

https://github.com/Zgreen-Spectre/Revive

What I tried to do there is replace any spawn_death with unconscious instead. I also attempted to add blood with an epinephrine so a player with 0 blood would only be unconscious, then revived with epinephrine and given blood, effectively bringing them back to life. In the fn_selfActions section under Krixes self-blood I attempted to add an option to commit suicide, so that a player who was knocked out with nobody around would be able to die, rather than lay unconscious forever. I also attempted to make it so that if a player's blood is 0 while unconscious the timer does not run down. I only tried it once, as I am very tired (which also explains any dumb mistakes I'm sure I made), and it did not work in any way. Hopefully someone who is better at this than me can come along and make this happen, I think it's a neat idea that would foster more teamwork in the bandit ridden land of DayZ. :)
 
Seems like you could just make it so you never die. Whenever your blood goes below 1, set it to 1. Perhaps even stop bleeding if this happens so it doesn't keep looping.
Being at 1 blood would in effect render the player pretty unconscious anyhow. At least he'd be passing out alot.

Would be kind of annoying though if there were alot of zombies around pestering you while you're at 1 blood, lol.
 
Here are some relevant player conditions, if someone would like to work on it. I would continue but it's time for me to sleep.
r_player_blood
player setVariable["NORRN_unconscious",true];
player setVariable["USEC_injured",false];

What I'm going to try and do is like what Innuce said,
if r_player_blood <500 (or so) then {
player setVariable["NORRN_unconscious",true];
player setVariable["USEC_injured",false];
};

Now how to implement that, idk yet :) figure it out and it's done! Oh, also need a way to add blood with epipen so that they don't just get knocked out again right after you revive them. There are some files relevant to the epipen in the github link I posted. Good luck!

edit: Oh and one last thing, also need a suicide option or a countdown timer for being unconscious on <500 blood so that a player can actually die and not just be stuck forever. I think a timer would be better, would prevent them from crying in side chat for help forever.
 
Been thinking about this. Should be a great addon if you guys can pull it off. I only wish I knew more about this scripting stuff. I only know enough to tweak things the way I want them, haha.

I like the suicide option. The idea that you cannot die outright is interesting. Now you could choose where you want to crawl to (assuming broken leg too), then die so you know where your body will be.
If you add the timer, it's pretty much the way it is already. Except dying takes painfully longer.
 
I think you aren't thinking about it the way I am Innuce. How it would go is this, say you get shot by a dmr a few times. Normally you die, but with the revive method you would get knocked out and be laying on the ground stuck at a set amount of blood for a set amount of time. Once the timer runs out, you die and you can't do anything but lay there until then. However, repeat the scenario only this time you get shot and go down and your buddy kills the guy who shot you, well now if he has an epi-pen he can revive you and bloodbag you so you are now good to go. It would give no advantage to someone playing solo, only to people with partners, which is why I love the idea.
 
I think you aren't thinking about it the way I am Innuce. How it would go is this, say you get shot by a dmr a few times. Normally you die, but with the revive method you would get knocked out and be laying on the ground stuck at a set amount of blood for a set amount of time. Once the timer runs out, you die and you can't do anything but lay there until then. However, repeat the scenario only this time you get shot and go down and your buddy kills the guy who shot you, well now if he has an epi-pen he can revive you and bloodbag you so you are now good to go. It would give no advantage to someone playing solo, only to people with partners, which is why I love the idea.


That's exactly what I am looking for. I'm running a COOP server so this will come in handy!
 
Hey, worked on the script for quite a while today and I think I'm making progress. I can get the player's health to jump back up after he dies, just not before he dies. Which is sort of good, means I'm close I think. Hopefully I'll have it for you soon, but ya never know I may just be chasing a pipe dream. I am very new to scripting and only half know what I'm doing so don't get your hopes up. Anyway, I'll keep at it.
 
Hey, worked on the script for quite a while today and I think I'm making progress. I can get the player's health to jump back up after he dies, just not before he dies. Which is sort of good, means I'm close I think. Hopefully I'll have it for you soon, but ya never know I may just be chasing a pipe dream. I am very new to scripting and only half know what I'm doing so don't get your hopes up. Anyway, I'll keep at it.


Have you made any progression my friend?
 
Alright, sorry about the wait. The script is now 100% done! Except for the epinephrine part, for which I need someone to test with. The only possible problem I can see right now is it seems that player allowdamage false or handledamage false messes it up, so when the player is unconscious I just have their blood reset to 950 constantly instead. So if they took enough damage quickly enough I think they would die from it. I'm going to continue testing and see if there are any little things I overlooked but it seems good to me.

Here's how it works right now, player falls below 1k health they get knocked out permanently with a scroll wheel option for suicide, they stop bleeding but infection persists if revived. I'm sure there is some way to do a timer instead so that if they are unconscious long enough they just outright die but all my attempts have broken the scrip thus far so it seems the suicide option will have to do, I'll go ahead and put in an on screen text explaining that as well.

Once I get the epinephrine working properly, which shouldn't take long, I'll go ahead and release it!
 
Back
Top