Jump to content
Sign in to follow this  
norrin

SQF revive script

Recommended Posts

Either way, I don't think it would be very logical for a soldier to survive being blown up with an armor piercing RPG round while inside a vehicle, as i'm not sure that there would be much left to heal. I think it would be better served if it worked sortof like Battlefield 2. Headshots kill everytime while body/arm shots... It depends.

Awesome script BTW, I could never do anything like that. I look forward to trying it out upon purchase of my new computer.

Unfortunately Kvaccian I'm not at that level of sophistication at the moment.  Essentially no matter where the unit was hit or how much damage was caused and the type of unit that caused the damage is not considered by the script and no matter how you were killed you are still revivable.  That being said I've been thinking about it and if some one could give me an animation for dragging bodies (I seem to remember there was something like this for SLX) I don't think that it would be hard to set this up using the current script as a basis.    

First off though I'd like to get the script set up with MCPXXL's current set of ideas (I'm starting work on it tonight) and if that's successful release the script as a final stage 1.

After that's done I could start working on stage 2 and incorporate the sort of thing you're talking about.  If we need to wait for the animation I could jut leave the dragging part out to start with.

Share this post


Link to post
Share on other sites

I remember there is (or was) something on Ofpec that somehow makes paramedics carry the dead away between them as if on a stretcher... I'm not sure how this would work, and I can't test it because I'm getting a computer that can play ArmA.

...

Yep, it's Units & Groups of the Editor's Depot. Look somewhere near the middle-bottom.

http://ofpec.com/ed_depot/resource_list.php?type=sc&cat=ug

Share this post


Link to post
Share on other sites

HI

@Kvaccian

Where is the difference between animation for dragging and then dying as dying while healing ?

It is a good idea but i think your teammates have to clear the place before they heal a teammate.Or the teammate has to wait the long tmie to get the Resp Buttons witout bringing his teammates into deadly sittuations.

We played last night 260 Minutes in a Mission with 5 Players and had to choose 5 times RESP at BASE with all of us.

If i do not understand you question excuse me because only 3 hours sleep.

@Norrin

I hope i had the RPT not on Read Only because some of us get once a message get nearest... i will have to check it "wich" one of the thousends scripts was the bad noy

wink_o.gif

Share this post


Link to post
Share on other sites

@Norrin

Quote[/b] ]{call compile format ["if(animationState %1 == ""AmovPpneMstpSnonWnonDnon"")then {_e = _e + 1}", _x]}forEach player_units

_nearest_friend = count (nearestObjects [_Object,[_can_revive], distance_to_friend])

Error in Expression in Camera.sqf semms to be produce the Error

Share this post


Link to post
Share on other sites

Thanks m8 I'll look into it further. I just need a little more info, are you saying the error only triggered once and you were able to keep playing? Did the error message disappear?

Share this post


Link to post
Share on other sites

Hey norrin,

just one question:

I'm using a script with several Event Handlers, after i'm dead and used the revive one of the "HIT" event handlers do not work any longer.

Do you know any solution for this. I saw your using EH and remove EH in the revive too.

Share this post


Link to post
Share on other sites

I think what's happening is that your hit eventhandler is being defined on your unit when it first spawns.  When the unit dies my revive script is then adding a second hit eventhandler to make the unit invincible while unconcious.  

When the unit is revived my script removes the first eventhandler given to the unit (to take away its invincibility) but because your hit EH is defined first (index 0) it takes away yours rather than mine.  

So unless there is another way of defining eventhandlers other than the way I'm currently using eg <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_name addeventhandler ["hit", {_this select 0 setdamage 0}]; (and I don't know much about this) it may be best for the time being to try changing lines 236 and 274 of the revive_player.sqf from <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_name removeEventHandler ["hit", 0]; to <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_name removeEventHandler ["hit", 1]; as your hit EH is index 0.

Are the units harder to kill once they have been revived as they may still have my hit EH protecting them?

Share this post


Link to post
Share on other sites

you should perhaps change your add and remove to...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">format["%1_hit", _name] = _name addeventhandler ["hit", {_this select 0 setdamage 0}];

and

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_name removeEventHandler ["hit", (format["%1_hit", _name])];

Or something similar... then you should never have a problem with event index clashing

Share this post


Link to post
Share on other sites
you should perhaps change your add and remove to...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">format["%1_hit", _name] = _name addeventhandler ["hit", {_this select 0 setdamage 0}];

and

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_name removeEventHandler ["hit", (format["%1_hit", _name])];

Or something similar... then you should never have a problem with event index clashing

Will do m8 thanks.  I saw how to name the eventhandler in the wiki just didn't know you could use that instead of the index no. to remove it.  Cheers norrin smile_o.gif

Share this post


Link to post
Share on other sites

So this should fix my problem? smile_o.gif

Well i guess sound's like yes. AWESOME!! thumbs-up.gif

Share this post


Link to post
Share on other sites

Yeah it should help the compatibility of my revive scripts with a heap of other scripts.  I'm hoping to have a revised script together around this time tomorrow night with Sy's fix and also the options to switch off the follow cam and the unconcious markers.  

I have also got the unconcious player calling out implemented I'm just not happy with the sound quality of my recorded messages so I need to work on that a bit more.

If anybody wants to record 8 or 10 short "oops I'm hurt" messages that I could include as alternate sound packs please go ahead and then send me the results.

Share this post


Link to post
Share on other sites

Thats what i sayed:

We have a lot of them in Gl2 Plus and also in my actionhud (ofp)

But using it with Gl2 seems the best way atm.

Sounds are in there named inj01 - inj20

Or ECP sounds in hit01 - hit30

should be in if U use GL2 Plus from SNKMAN :-)

Share this post


Link to post
Share on other sites

AI_disabled revive scripts

New versions of the AI-disabled revive scripts are available from here (28th June ‘07)

I've now set-up the follow camera and the unconscious markers as optional functions which can be toggled on/off in the init.sqf. If you disable the camera it focuses on your downed body while unconscious. I’ve also added an alpha version of the call_out function that MCPXXL was after. This has meant that a new folder “sound†has been added with 11 call_outs that are randomly chosen while the player is unconscious.

I must warn you some of these statements are a little blue so if you’re easily offended I’d steer clear of this function – I might add these sound bites are just taken from the standard game files. The sounds folder is large and adds to the size of the script significantly so if you don’t want to use this feature then don’t copy across this folder also make sure you have call_out_function = 0 in the init.sqf. I’m hoping to find a better way to include these sounds in future and if so I can offer a hell of a lot more call_out statements.

There’s one weird quirk with the call_out function. If a single player is unconscious he will call out once every 15secs + random 20 secs. If two or more units are unconscious the same thing happens however if you heal all the units except for the first one it starts calling out the same statement 2-3 times for every call_out cycle (with 4 people on a server). If another player is then shot and falls unconscious then the original unconscious player goes back to calling out once per cycle. Go figure.

I think this quirk is related to how many instances of the revive script a player has running on his client PC for a single unit. I’ve tried to reduce this as much as possible but you still get multiple call_outs.

Unfortunately after trying it about a dozen ways I couldn’t get Sy’s suggestion to work for the eventhandlers. It seems when you remove them it needs an index number and the name of the handler will not suffice. This may change with new versions down the track but for the time being I’ve removed the addeventhandlers for hit and killed so the units are no longer immortal while they are unconcious.

Instead I’ve used a setDammage 0 code instead which doesn’t protect the unconcious from larger ordanance such as grenade strikes but it does from small arms fire. The units, while unconscious, also have “setCaptive true†so hopefully they won’t get shot at anyway. If you die while unconscious its not a big deal as the revive counter is not incremented and you just play through the falling unconscious routine again. I did this essentially to increase the compatability of the revive scripts with other players scripts.

As always please check the implementation notes and init.sqf readme.

Share this post


Link to post
Share on other sites

I've been thinking about it more and if you want I could always enable the 'hit' and 'damaged' addeventhandlers as optional so if you are not using them in other scripts or in the mission editor then you can use them in the revive script. Any thoughts?

I also may have thought of a way to reduce the multi call-out bug described above, I just need to make a couple of changes to the connected script.

EDIT: I almost forgot to thank SNKMAN for letting me steal a few lines from his Group Link II Plus code. Thanks again m8. smile_o.gif

Share this post


Link to post
Share on other sites

Would be fine to add own sounds to the calloutscript like

I have aroud 60 different sounds so it would be fine to give it a var + index

_calloutaddvar = HITSND

_calloutsaddnumbers = 60

So we would have:

_commentsBrian = _commentsBrian = + HITSND1-60

actual we would have:

_message_no = 11 + 60

Seems to be easer to have a shortname with index

instead of _commentsBrian = ["RES_Firstaid","RES_mandownscream","RES_Mandownscream_alt",

Share this post


Link to post
Share on other sites
Would be fine to add own sounds to the calloutscript like

I have aroud 60 different sounds so it would be fine to give it a var + index

_calloutaddvar = HITSND

_calloutsaddnumbers = 60

So we would have:

_commentsBrian = _commentsBrian = + HITSND1-60

actual we would have:

_message_no = 11 + 60

Seems to be easer to have a shortname with index

instead of _commentsBrian = ["RES_Firstaid","RES_mandownscream","RES_Mandownscream_alt",

MC I'll try and catch up with you over the weekend on MSN as I'd like to discuss this with you further.

Share this post


Link to post
Share on other sites

hello, im a fan and i admire the revive script for MP missions.

I want to use the revive script in my future missions because i think its really gives some nice touch to the coop missions, instead of using simple respawns.

I want to use one but i didn't found what i wanted. I come here to ask for help. Hope some one hear my request.

Im looking for a revive script that contains these steps:

<ul>[*] When a player (in any existing groups, alpha, bravo, charlie etc, and not just 1 team) "dies" he would enter in "coma", waiting to be revived.

Right after the "coma" a marker appears in the map giving its position (i have this working), also the body could be changed by a default ArmA bodybag.(some times doesn't work)

[*] While the player is in "coma" he will be able to specate other players with the latest or the old spectator.

[*] When a player gets near to the "coma"/ bodybag, that reviver player would have a new option "revive" if pressed it would bring back the "coma" player to live, ie, the coma player would get out of the spectator and would replace the bodybag object, continuing with the coop mission.

[*] Mission would end when all players enter in coma or dies.

ps- with a simple possibility enabling the AIs to revive or not.

i have the script running but i have some problems transforming the "coma player" into a bodybag and also sometimes when i go to the spectator after some defined time i respawn in an island (where i have the marker and triggers)

hope i have some help, thanks in advanced.

Share this post


Link to post
Share on other sites

Hi bravo,

Have you tried the latest versions of the revive script discussed in this thread (28th June 07 for AI-disabled missions and 22nd June 2007 for AI enabled missions) as they essentially do everything you ask and alot more. The only real difference being is that when the player is killed he takes the unconcious animation rather than being replaced by a body bag.

norrin

Share this post


Link to post
Share on other sites
Hi bravo,

Have you tried the latest versions of the revive script discussed in this thread (28th June 07 for AI-disabled missions and 22nd June 2007 for AI enabled missions) as they essentially do everything you ask and alot more. The only real difference being is that when the player is killed he takes the unconcious animation rather than being replaced by a body bag.

norrin

hello norrin,

i have tryed both your new version, but they don't act exactly as i desire.

when the player or ai get hit it immediately runs the "coma" animation, sometimes the player don't have time to have a natural fall into the ground, it automaticly appears in the ground in that coma animation, to be honest i don't like that animation.

I prefer using a bodybag as some already used, would be better imo because the player would not move while in "coma", and players would know it would need help.

Also the camera in both versions is not selective, ie, i can't move arround to other players to spectate then, it will be kinda boring after a while. I don't want to use the respawns locations as an option you gave. (i think i can easyly remove those options with your permission).

When i 1st posted on this thread i did tryed your latest versions.

Can you please do something about them or giving other version with my requests? If you kindly do this ill give any info available i have for it.

Share this post


Link to post
Share on other sites
Hi bravo,

Have you tried the latest versions of the revive script discussed in this thread (28th June 07 for AI-disabled missions and 22nd June 2007 for AI enabled missions) as they essentially do everything you ask and alot more.  The only real difference being is that when the player is killed he takes the unconcious animation rather than being replaced by a body bag.  

norrin

hello norrin,

i have tryed both your new version, but they don't act exactly as i desire.

when the player or ai get hit it immediately runs the "coma" animation, sometimes the player don't have time to have a natural fall into the ground, it automaticly appears in the ground in that coma animation, to be honest i don't like that animation.

I prefer using a bodybag as some already used, would be better imo because the player would not move while in "coma", and players would know it would need help.

Also the camera in both versions is not selective, ie, i can't move arround to other players to spectate then, it will be kinda boring after a while. I don't want to use the respawns locations as an option you gave. (i think i can easyly remove those options with your permission).

When i 1st posted on this thread i did tryed your latest versions.

Can you please do something about them or giving other version with my requests? If you kindly do this ill give any info available i have for it.

M8 I'm really sorry you don't like it.  Horses for courses I guess.  Everything you are asking is possible and I've got an earlier version you may be able to adapt with Kegetys spectating script if you want to work on it but I kept running into problems like you've described with the camera appearing on the player at the spawn point when some one new joins or JIP players spawning in the ocean etc etc.

By the way there is another ArmA revive script thats more like what you're after that, I think, was most recently revised by [APS]Gnat based upon PRiMeS original OFP revive script that you may want to hunt down.

Share this post


Link to post
Share on other sites

yeah its Gnat's, ill try to have a look in hes recent version or something..

I not saying i don't like all your script.

I just think it needs some fixes. Per example, we always have the revive option present. It should only appear when you revive revive someone and when you are close to it.

thoug ill keep an eye on this thread. it capted my attention wink_o.gif

keep up the good work. The script should be as simple as it could be, with no extra "things".

Share this post


Link to post
Share on other sites
I don't want to use the respawns locations as an option you gave.

I've had a couple of people ask me about this now and if you don't want use the respawn dialogs its pretty easy to set up just change the code in the init.sqf to look like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> // no of respawn points, spawn position names for respawn and the time before the respawn dialog appears for JIP players

no_respawn_points = 0;

Base_1 = "";

Base_2 = "";

Base_3 = "";

Base_4 = "";

You shouldn't need to change anything else.

Per example, we always have the revive option present. It should only appear when you revive someone and when you are close to it.

I've never had a problem with it always being present in the action menu but I can see your point. It shouldn't be too difficult to change but the coding is a little more complex than what I'm currently using - I'll try it out over the next couple of days and see if it works reliably.

The script should be as simple as it could be, with no extra "things".

I've tried to make this script as configurable as possible so you can easily add or remove any options and additional functions that you don't want so with a little configuration you can run a very basic revive script.

I have deliberately kept away from Kegetys fantastic spectating script as I feel it may allow unconcious players an unfair advantage as it may allow them, while spectating, to locate all the enemy units on the map and it would take alot of the tension and immersion out of the mission.

Share this post


Link to post
Share on other sites

AI_disabled_revive_update

Hi guys,

Sorry its taken me so long with an update but I've been working on a mission that uses a lot of my scripts and plenty of new ones to boot and I've been a bit distracted.

Its a simple update this time and all it does is makes it so the revive action only appears when you are within a few metres of an unconcious player. The action disappears again if you move out of the reviving range (currently set to 3 metres) or when the player is healed.

To make it work all you need to do is unzip the down loaded file and copy over the revive_player.sqf in your revive_sqf folder in your mission directory.

You can get the updated revive_player.sqf from here.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×