OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Resources Beta Testing & Submission => Topic started by: norrin on 01 Mar 2007, 05:44:57

Title: SQF revive script (ACCEPTED)
Post by: norrin on 01 Mar 2007, 05:44:57
SQF Revive Scripts

AI_disabled revive script release version x_1.52

(http://i18.photobucket.com/albums/b134/norrin1/revive_5.jpg)

There are two versions one for ArmA ver 1.14 + and the other for ArmA 1.08 (make sure you get the version that you want)

1. Version x_1.52 AI_disabled revive for ArmA 1.14 is available from here (http://www.norrin.org/downloads/Revive_release/AI_disabled_x_152c.Intro.rar) (14th October 2008 - readMe contained in rar file)
NB: this script can be used with either standard ArmA or Queens Gambit by making a simple change in the revive_init.sqf file (see ReadMe for more details)

2. Version x_1.46 AI_disabled revive for ArmA 1.08 is available from here (http://home.iprimus.com.au/simonnsl/norrinsArmA/AI_disabled_x_1.46b_1.08b.zip) (29th March 2008)

Description
Creates playable units that fall unconcious when killed which can then be revived - designed for use with AI-disabled CO-OP missions

Features and Options
• max_no_respawns - can specify how many times a player can be revived before he dies outright
• can_revive - can specify what sort of units can revive other players, for instance all ground troops or medics only
• mission_end_function - end the mission when all player units are unconscious or dead.
• reward_function - the number of revives of other players required to earn the reviving player an extra life.
• team_kill_function - the number of team kills a player can commit before he is penalised one life.
• Respawn dialogs - from 0 - 4 respawn points can be placed on the map at which unconscious units can respawn giving the units the option of revive or respawn.  These respawn points can be set-up so that they only become accessible if all enemy units surrounding the respawn points are killed or destroyed.  They spawn point markers are also colour coded so that they appear red when they are not accessible and green when they are.
Respawn Dialog sub options
a. all_dead_dialog -  allows the automatic appearance of the respawn dialog if all units are unconscious.
b. JIP_spawn_dialog - the mission maker can now set the amount of time before JIP players can access the respawn dialog when they first join the mission.
c. nearest_teammate_dialog - measures the distance between the unconscious unit and the nearest friendly unit if the set a distance is exceeded the respawn dialog automatically appears
d. Option of specifying up to 2 enemy sides.  If units from these enemy sides are within 50 metres of the spawn point the option to spawn at that point is not available
• unconscious_markers - create markers on the map showing where the unconscious units are.
• unconscious camera - while the player is unconscious it switches to a camera that either (a) focuses on the unconscious player's body or (b) you can switch between following friendly units. 
• call_out function - causes the unconscious player to call out at random intervals (between 15 and 35 seconds) to help you find his body and revive him.  There is also an option to view an on screen revive timer count-down
• the amount of post-revive damage a player has can be set
• revive timer option. - revive time limit - if the time runs out the player respawns at base, has choice of respawn points or is declared dead.  A visible respawn timer count down can be enabled.
• heal_yourself_option  Adds an action to the player to heal himself.
• kegetys_spectator_script option for dead players to use kegetys script
• Players are revived with the weapons they died with.
• Can be set up easily for use with any side eg BLUFOR (default), OPFOR and RACS
• Incorporates anti-water code
• No addons needed but is compatible with other addons
Several other sub-options are present but read the notes in the zip file for more info on these.

Changes from previous version
*The damaged player upon revive feature. 
*A fix for the the unconscious unit not being set captive properly.
*A global broadcast for who has revived the player and the name of the player revived.
*An option that allows players to choose respawn point upon the revive timer elapsing.
*A color change for the markers to show which respawn points have been captured and are available for respawn.
*A timer showing the amount of revive time left.
* A number of other tweaks and fixes.

Implementation
Please read the latest readme before using the new scripts

Missions included
Test mission and version of the script for BLUFOR forces

Bugs
Occasionally when using the revive timer option a dead player's body will disappear

There are potentially some problems with Kegetys script if you use this option but I've hopefully sorted most of them out.  For instance, if you are following a unit that is killed your view will change to the ocean and you'll need to select the next unit in the view menu.  Also if using the mission_end_function players will get the message that the mission has failed but will not return to the debriefing screen until they press escape. 

Tested
On version 1.08/1.09 on both dedicated and local servers.  Works with JIP.

Based Upon
Concepts by PRiMe, toadlife, [APS]Gnat and Mongoose_84. 

Special Thanks to
HulkingUnicorn and MCPXXL for their scripting advice, testing and many suggestions
Also to satexas69, SNKMAN, sickboy, vengeance1 (JAAF), Legislator, Xeno and Raedor for all their suggestions, advice and support and to all at the BIS forums.
Last but by no means least to Foxhound and ArmAholic for their great support and providing mirrors for all my scripts

Other Scripts Used
Some of the voice arrray stuff stolen with the permission of SNKMAN from ArmA Group Link II Plus!  As well as the general layout for this readMe
And of course thanks to Kegetys for his amazing spectating script and to ViperMaul for his script fix
Chris'OFP editor.

Additional Comments
This version's based off xeno's enhanced 1.25 code and you may notice the x in the version number, this is to acknowledge his enormous contribution in helping rewrite these scripts late last year and his good grace in allowing me to take over their development again.  Thanks m8 it is truly appreciated :)

The scripts are set up in exactly the same way as the last version and the revive_init is almost identical however there is a new option _HULK_rProne = 1.  This option switches on a fantastic script by HulkingUnicorn that stops the player from standing after he has been revived until he's been properly healed by a medic.  This option must be used in conjunction with the revive with damage option and the revive damage must be set to greater than equal to 0.8.

If this version is stable then I just want to add a couple more changes including HulkingUnicorn's set up recommendations and we should be close to a final release.

Finally to MCPXXL couldn't have done this without your help, time and patience m8 - thank you. :)

Good luck,

norrin :)

Latest version of the AI_enabled revive beta (Version 0.61 beta, 22nd Feb 2009)

Download from the link at the end of the post.

Latest changes:
* Optimistaions to scripts to reduce cpu overhead
* Call for help button
* Many new unconscious camera features including a free cam mode

Many thanks to hoz for his help with the latest version.

Bugs
If you spawn into an unconscious group leader when you are revived you may be armed with your secondary weapon. However, when you shoot the rifle on your back fires.  The only way I've found to resolve this bug is to respawn and be revived.

Additional bugs identified by SNKMAN
*In my first test i got a lot of "Empty Vehicles" in the Spectating name select list after i was killed but i think it was solved after i put "gw1 = group this" into the init of the group leaders.
*After i was revived by a AI i alwasy have to put ESC to return from the Spectating View to the player view.
*Sometimes the Action "Revive" will not be delete from my Action Menu after i had Revived a Ai unit.

Most importantly please make sure you check out the readMe in the zip file before using these scripts.

In action
For a short vid of the AI_enabled script in action from different player perspectives click here (http://www.youtube.com/watch?v=0zdcLWKcM5w)

Database of Revive Missions

tomcat_ from Reality Friends has set up a database of AI_disabled revive missions here: http://www.realityfriends.com/forum/viewforum.php?f=45 (http://www.realityfriends.com/forum/viewforum.php?f=45)

These missions have either been designed from the outset to use revive or have been converted.  In the converted missions you have a choice of revives at mission start-up, no respawn, everyone can revive everyone, AI-disabled and a revive timer of 4 minutes before you are dead outright. The guys at the site are testing the missions as they can and we are fixing any bugs where possible.

If you have any missions you'd like added to this list or want help converting your missions please contact me or add your missions to this thread: http://www.flashpoint1985.com/cgi-bin....1166915 (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=67;t=69024;st=0;�entry1166915) and tomcat_ will see that they get added to the list.

OFPEC Download  AI_en_revive_test_61e.sara.rar (http://www.ofpec.com/ed_depot/index.php?action=details&id=357)
OFPEC Download  AI_disabled_x_152c.Intro.rar (http://www.ofpec.com/ed_depot/index.php?action=details&id=356)
Title: Re: SQF revive script
Post by: IGWedge on 03 Mar 2007, 08:53:09
Good job mate

Will test this tonight

Wedge
Title: Re: SQF revive script
Post by: Fangschuss on 03 Mar 2007, 09:49:01
moin moin

any update to this fine script ?

greetings
Title: Re: SQF revive script
Post by: norrin on 04 Mar 2007, 10:15:37
@ Fangschuss  I've been a little distacted with some other scripts I've been working on over the last few days and other than quickly checking that it seems to be working OK in ver 1.05 I haven't looked at it but thanks for the encouragement.

I should start working on it again over the next couple of days first by adding the Spectator script and the fade to black while unconcious and then I'll start working on the AI coming to the rescue bit.
Title: Re: SQF revive script
Post by: Fangschuss on 05 Mar 2007, 00:25:41
No hecticness  made  :good:

So far it work's realy great in my missions  :yes:


Quote
I should start working on it again over the next couple of days first by adding the Spectator script and the fade to black while unconcious and then I'll start working on the AI coming to the rescue bit

Sound's great ...can't wait  ;)
Title: Re: SQF revive script
Post by: pexmo on 08 Mar 2007, 08:31:09
Downloaded the mission but cant get it unpbo:ed..... just get a empty forlder when i do. Where can i get the scripts etc?
Title: Re: SQF revive script
Post by: norrin on 08 Mar 2007, 10:46:19
You can download a rar containing the mission files and the scripts from here (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_ver29.intro.rar)
Title: Re: SQF revive script
Post by: pexmo on 08 Mar 2007, 14:58:59
Super thanks mate!
Title: Re: SQF revive script
Post by: norrin on 13 Mar 2007, 01:39:13
Here (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_follow_cam_6.Intro.pbo) is a new version of my revive script.

The new version (revive_follow_cam_6.Intro.pbo (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_follow_cam_6.Intro.pbo)) has a camera that at first focuses on the downed player's body and then moves to a behind/follow view of the nearest friendly foot unit.  If the camera targeted unit dies the view returns back to the player's body before finding the next closest friendly unit.

There are a couple of exceptions for instance if the closest friendly unit is more than 50 metres away the camera focuses on the players body.  However, if a friendly unit moves to within the 50 meter radius of the body the camera attaches itself to this friendly unit.

In addition, the closest friendly AI unit will now move to the downed player if there is not a player unit closer and revive.  The downed player must be no more than 50 metres away for this to occur however.
 
This is the best I can do so far as I although I can get the Kegetys' spectator script running for the downed unit I can't switch it off when the player is revived.  For some reason the terminate script command does not seem to be working.

Bugs:
1. Although, JIP in progress does work there can be some problem with the player joining becoming a member of the correct group. 

2. If a player leaves the mission while a corpse his body is left on the map and this can cause problems for both AI and playable units. The closest AI if within 50 metres will move to the body even though it won't revive and playable units that get to within the 5 metre revive distance will automatically attempt to revive.  In either case you'll quickly work out that its an empty corpse and will not revive and you can move away or order the AI unit away.  Not sure how to remove this body so any suggestions would be greatly appreciated.

Future work:
Still like to Kegetys spectator script working but if not possible I'll also set it up so that the camera will follow a vehicle if it contains the closest friendly unit.
 
Despite the bugs the script seems to be working well.
Title: Re: SQF revive script
Post by: norrin on 14 Mar 2007, 13:15:20
Just posted this on the BI forums this new version of the script allows you to specify the number of times the units are revived.

The latest version 17 can be downloaded from here (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_follow_cam_17.Intro.pbo)

OK, I've managed to fix almost all of the join in progress problems in the previous "limited number of revives" version of the script and it's now as stable as any of the previous versions so you may as well use this version now. ���

I've removed Kegetys spectating script and replaced it with my own simpler camera follow script discussed in the previous posts.

I've managed to trick the game into thinking the players are permanently dead when their revive limit is reached so that if someone leaves and then joins in this slot they are transported to the start point of the mission and not the Respawn_west marker on the island.

The only annoying thing about this is that the text that the player is dead keeps coming up in the left hand bottom corner of the screen until the player gets sick of spectating and leaves. ��� So if anybody knows how to get rid of this text could they please let me know.

There is also a message displayed telling you how many revives you have remaining each time you are revived

Instructions for use

1. unPBO the mission file

2. Place this in your init.sqs
Code: [Select]
_units =[alpha_1,alpha_2,alpha_3,alpha_4];
{if(isplayer _x)then {s = [this, _x, alpha] execVM "revive.sqf"};} forEach _units;
{if(!isplayer _x)then {[_x, alpha] exec "Revive_AI_heal.sqs"};} forEach _units;

The playable units in my test mission are called alpha_1, alpha_2 etc so change these to match the names you are using.

Alpha is the name of the group that these units belong to so you will need to change the alpha in the execVM "revive.sqf" line to whatever the group name is for your units.

3. Then copy across the following files to your mission directory:

Description.ext
Revive_AI_heal.sqs
Revive.sqf
Camera_follow.sqs

4. In the Revive.sqf script 20 lines from the top, including blank lines, there is the following code
Code: [Select]
_max_respawns = 2;
Just set this to the number of revives you want for each player.


Bugs
If players quit while they are a corpse when players join in their slot they are transported to the island respawn point, which has been a problem for all versions to date. ��� I've just thought of a way to fix this bug but it'll have to wait until tomorrow.

The annoying text prob discussed above

EDIT: Just been told that there is another bug with the script when using it on a local server (ie. hosting and client at the same time) that is the hosting player cannot revive other players.�  Many thanks to HulkingUnicorn for testing this script for me.�  A new version of the script will hopefully be released in the next couple of days.

EDIT (27th March 07) The latest version of this script is available from here (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_beta.intro.rar) (Beta version 27th March 2007) updated initial post.
Title: Re: SQF revive script
Post by: shameless on 23 Apr 2007, 20:43:39
Hi norrin,

I have manged to get the revive script working, although when i tested it on our dedi server with another member... I shot him and then he got shot by the AI. After that, the mission never ended even though both of us are dead. There are no AI to bring us back aswell.

I have 3 squads... alpha, bravo and delta.

Any ideas?
Title: Re: SQF revive script
Post by: norrin on 01 May 2007, 02:53:13
Revive SQF

Sorry m8 I've been away and only just seen your post.

Firstly there's a new version available:
revive_010507.intro.zip (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_010507.intro.zip)

Description:
This latest version uses a single script for both players and playable AI units and therefore playable AI units will revive downed team mates if within a four metre radius and if unconscious can be revived as well.

I’ve simplified things by removing the respawn counter that allowed mission builders to specify how many times each unit could be revived as it was causing too many JIP problems.  I’ve also used HAILO’s JIP script to ensure the revive script is run on each joining player.

In addition, I’ve changed the implementation of the revive action so that its always available to the player but it is in the action list (default middle mouse) and will only heal someone if you are within a radius of 4 metres.

If you join on an unconscious player you now join the mission unconscious and will require reviving before you can join the action.  The latest version also allows the joining player to get all the other units states (ie either conscious or unconscious) so there are, as far as I can tell, no desync problems when someone joins.

There is also a short black-out period prior to a player joining a mission with the message “joining mission”.  This allows the JIP player to get all the surrounding units states so he does not witness the unconscious players and himself lying down.  It also activates the camera so if a player joins in an unconscious unit slot they cannot fire and they get a message that they are waiting to be revived.

To implement:
You no longer need the start markers but you still need to place a Respawn_west marker on an island away from the action.  Then just copy across the code from the init.sqf (this includes the code to execute HAILO’s JIP script, you’ll also need to change the playable units names here) and the description.ext.  Then copy across the three folders: revive_sqf, events and scripts (the last two for JIP) to your mission folder.  You’ll also need to change the unit names in the _units array in the onPlayerConnected.sqf file (which you can find in the events folder).

You'll also need to define two arrays at the start of the revive_player.sqf (where it is commented - one with the playable unit names in quotation marks and the other without.

In my example mission the two arrays defined at the start of the revive script look like this:

Code: [Select]
_units = [alpha_1,alpha_2,alpha_3,beta_1,beta_2,beta_3,gamma_1,gamma_2,gamma_3];
_unit_names = ["alpha_1","alpha_2","alpha_3","beta_1","beta_2","beta_3","gamma_1","gamma_2","gamma_3"];

Tested on version 1.05 with JIP

Bugs:

Now for the bugs, for some reason occasionally the "joining mission" screen doesn’t appear when a player joins so if the unit is unconscious the camera doesn’t fire up and he doesn’t get the message he is unconscious and may find himself lying on the ground when he joins. 

I'm still having some problems with players joining on units while the respawn timer is counting down, this has been decreased to 4 seconds to reduce the likelihood of this happening but its still a possibility.  It seems if you join under these conditions there is desync between the exisiting players and the one who joins.  Everyone sees the joining player as unconcious whereas he sees himself as alive. The joining player also gets a null object error if he joins on a dead unit, the only time I've seen it in the current version, so if this happens just go back to the unit selection menu and reselect the same unit and everything will go back into sync again.

If a player joins on an unconscious group leader and is then revived the player draws the units pistol but still shoots out the primary weapon on its back.  I seem to remember reading about this somewhere on the forums but a way around it is once revived respawn and revive again and you should be able to choose the primary weapon properly.

Now to finally answer your question :)

At the moment I haven't got the script set up to end the mission when all the playable units are unconscious. If I get a chance over the next few days I'll try and put something together and post it with the latest version of the script.

EDIT:
Another update with changes to the init.sqf code, camera_follow.sqs, revive_player.sqf, a new trigger placed in the mission editor and a new script "mission_end.sqf".

This new script in combination with the other changes keeps track of the number of concious players and ends the mission if all the players are unconcious.

It can be switched on or off by commenting out the line
Code: [Select]
call{[_units] execVM "revive_sqf\mission_end.sqf"}; in the init.sqf file by placing // at the start of the line ie.
Code: [Select]
//  call{[_units] execVM "revive_sqf\mission_end.sqf"};
The trigger that needs to be added in the editor looks like this in the example mission
Code: [Select]
class Item0
{
position[]={2955.998779,21.107906,2461.976563};
a=1.000000;
b=1.000000;
activationBy="LOGIC";
timeoutMin=10.000000;
timeoutMid=10.000000;
timeoutMax=10.000000;
interruptable=0;
type="END1";
age="UNKNOWN";
expCond="mission_Over";
class Effects
{
track="ATrack8";
titleType="TEXT";
title="Mission Failed - all players are unconcious ";
};

You can get the new version here (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_010507.intro.zip) (ver 010507) or from the link earlier in this post

Title: Re: SQF revive script
Post by: norrin on 02 May 2007, 06:46:27
Revive.SQF

Firstly sorry about the double post mods but the last one was getting pretty long winded (even for me :)) and I didn't want the new instructions lost in all the verbage.

New version available: ver 020507 (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_020507.intro.zip)

Description
A revive/respawn script in sqf format that allows all playable units to revive other playable units and be revived.  While unconscious a camera is activated that follows the closest alive friendly unit if it is within 100 metres.  In addition, the mission maker has the option of running an additional script that forces the mission to end if all the human players are unconscious.  If you join the mission on a playable unit that is unconscious in game it triggers the camera when you join and you start the mission unconscious and will require reviving before you can move about.   

Changes
I’ve moved from using HAILO’s JIP script (which wasn’t always activating for the joining player) to a variation on a trigger method described by Przemek_kondor to execute the revive_script and the “joining mission” screen when a player joins.  As far as I can tell this new method always works. :)

Now if you join on a unit while its respawn timer is counting down you get the correct message which is “Unit selected is dead please press escape, return to the unit selection menu and choose the same or another playable unit" and as long as you follow these instructions you shouldn’t run into any problems – lol, famous last words :).

I’ve also simplified the implementation of these scripts so now you only need to define the _unit array (ie the playable unit names in quotation marks) in the init.sqf and the onConnect.sqf files.

There also improvements to the follow-cam and I have managed to remove almost all of the null object errors thanks to suggestions from HulkingUnicorn (only one in 3 hours of intensive testing - yippee).

To implement the latest version in your missions.
1. Copy across the text from the init.sqf and the description.ext files into your init.sqf and description.ext files.

2. Copy the folder revive_sqf across to your mission directory.

3. Update the _unit array in the init.sqf and the onConnect.sqf (which you can find in the revive_sqf folder) files where commented to reflect the playable unit names used in your mission (remember to put them in quotation marks like in the example mission).

4.  Create a marker on the map called Respawn_west away from the action – preferably on an island.

5. Create a gamelogic called Server

6. Create two triggers
   For the 1st put -
   Activation: Game Logic – Once
   Timeout: min 10 max 10 med 10
   Type: End #1
   Condition: mission_Over

   For the 2nd put -
   Activation: Game Logic – Repeatedly
   Countdown: min 0 max 0 med 0
   Type: None
   Condition: onConnect
   On Act: call{[] execVM "revive_sqf\onConnect.sqf"};

7. You can toggle the mission_Over.sqf script (which ends the mission if all players are unconscious) on and off by commenting out its activation (ie. using //) in the init.sqf file.

Tested
On version 1.05 on both dedicated and local servers.  Works with JIP.

Bugs
Still occasional problem if you join on an unconscious group leader – you have the pistol in hand but shoot from the rifle on your back, just respawn and get someone to revive you and the bug disappears.
Title: Re: SQF revive script
Post by: 170th on 04 May 2007, 13:18:28
Is there a way that only the Medic can reviwe the other Players? And the whole script doesnt work on 1.05 beta full of script failures.
Title: Re: SQF revive script
Post by: norrin on 05 May 2007, 02:18:29
This was a feature of an earlier version but with all the changes made I've taken it out.  I've now spent an hour trying to reimplement it and its seems there are a few problems.  If I set it up for both human players and playable AI using the "typeOf" command it breaks the ability of Ai to revive other units but as an alternative I can set it up so that all playable AI, no matter what class can revive, but only human players that are medics can revive if you want.

I'm also having some trouble if I use the "isKindOf" command which works well for both playable AI and human players on a local server but for whatever reason doesn't work on a dedicated server (we might have to wait for the next patch and see if this is fixed).

Anyway if you want me to post any of these options let me know.

# removed unnecessary quote - bedges
Title: Re: SQF revive script
Post by: 170th on 05 May 2007, 14:14:14
Ok, in coop mission i only play with human players and for me i dont need the ai to revive... but with the other probs better wait for patch. thanks anyway  greets sgt.ace
Title: Re: SQF revive script
Post by: norrin on 05 May 2007, 15:38:21
Seeing I've already made the script I thought I'd post it just in case you wanted to use it until the "isKindOf" command is fixed.  In this version all playable AI can revive other units but only human players that are medics can revive.

You can get it here: Medic Revive Only script (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_medic_only.intro.zip)

A couple of guys over at the BI forums have discovered another bug and that is this script gives a scalar error if the playable Ai are disabled either in the briefing screen or the description.ext so make sure you don't do this.  I've also noticed that the forced end of mission if all human players are unconcious doesn't always trigger.  Any way let me know how it goes if you decide to use this version of the script.

 

Title: Re: SQF revive script
Post by: 170th on 05 May 2007, 16:31:39
Great! When the AI enabled then it works perfect without the scalar bool... prob. But one error while playing on dedi: (http://img96.imageshack.us/img96/2968/clipboard02dl5.jpg)
Title: Re: SQF revive script
Post by: norrin on 05 May 2007, 16:52:37
Haven't seen that error in a long time, is it a once off error or does it keep recurring, if does keep happening can you post a link to your mission so I can take a look at it.


# removed unnecessary quote - h-
Title: Re: SQF revive script
Post by: 170th on 05 May 2007, 17:07:26
It was in your mission  but we killed friendly ai. I think in a normal mission without killing friendlys it works.
Title: Re: SQF revive script
Post by: norrin on 06 May 2007, 13:45:36
SQF_REVIVE for disabled AI

OK, I think I’ve got the disabled AI error sorted. 

Updated on 7th May 2007

These two versions (revive_player_AI_disabled.intro and revive_player_AI_disabled_medic.intro) of the script are only for use when playable AI is disabled on a dedicated server, if you are planning on using playable AI or a local server you’ll need to get the previous version of the script (ver 020507).

Changes
There's two additional scripts (“connected.sqf” and isplayer.sqf), a new trigger and quite a few changes to the existing scripts.

Additional notes for implementation
1. Just follow the same routine as for the previous version (ver 020507).
2. In addition you’ll also need to define the _unit array in the connected.sqf which you can find in the revive_sqf folder
3.  Finally you’ll need a new trigger placed in the editor

Activation: Game Logic – Repeatedly
Countdown: min 0 max 0 med 0
 Type: None
Condition: connected
On Act: call{[] execVM "revive_sqf\connected.sqf"};

The two scripts are available here:
All players can revive (ver revive_player_AI_disabled.intro)  (http://home.iprimus.com.au/simonnsl/norrinsArmA/ revive_player_AI_disabled.intro.zip)
and
Only players who are medics can revive (ver revive_player_AI_disabled_medic.intro) (http://home.iprimus.com.au/simonnsl/norrinsArmA/ revive_player_AI_disabled_medic.intro.zip)

Bugs
1. If you respawn, then quickly disconnect from the server (all within 2 seconds) you can cause a null variable error for all continuing players.  This is unlikely to happen in practice unless you really go out of your way to do it.
2. If you hit respawn while unconcious then you are transported to Respawn_west, if this happens disconnect and rejoin in the same slot and you will rejoin concious at the mission start point.

EDIT:  Updated both zip files which contain code optimisation and bug fixes
Title: Re: SQF revive script
Post by: norrin on 18 May 2007, 06:49:23
Here's the links for the latest versions of the AI-enabled revive script (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_AI_enabled_290507.zip)

and AI-disabled revive script (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_AI_disabled.zip) (with respawn counter and medic only version).

The zip files also contain notes for implementation of the scripts and example missions.

Changes
A respawn counter has been added to the AI disabled script (see notes in zip file for details) and a few minor changes to the AI-enabled scripts to ease their implementation and use with other sides.
Title: Re: SQF revive script
Post by: norrin on 29 May 2007, 02:52:21
Here are the most recent versions (29th May 2007) of the AI-enabled revive script (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_AI_enabled_290507.zip) and AI-disabled revive script (http://home.iprimus.com.au/simonnsl/norrinsArmA/revive_AI_disabled.zip) (with respawn counter).

Changes:
Several bug fixes including disappearing AI in the AI_enabled and some null variable errors in both.

EDIT:  Got bored last night and made a short vid of the AI_enabled script in action from different player perspectives you can see it here (http://www.youtube.com/watch?v=0zdcLWKcM5w)
Title: Re: SQF revive script
Post by: norrin on 24 Jul 2007, 16:10:23
SQF Revive Script

AI_disabled revive script release version 1.0

(http://i18.photobucket.com/albums/b134/norrin1/revive_5.jpg)

Version 1.0 is available from here (http://home.iprimus.com.au/simonnsl/norrinsArmA/AI_disable_revive_version_1.0.zip) (23rd July 2007) :)

Description
Creates playable units that fall unconcious when killed which can then be revived – designed for use with AI-disabled CO-OP missions

Features and Options
•    max_no_respawns - can specify how many times a player can be revived before he dies outright
•    can_revive - can specify what sort of units can revive other players, for instance all ground troops or medics only   
•   mission_end_function – option of ending the mission when all player units are unconscious or dead.
•   reward_function – allows the mission designer to configure the number of revives of other players required to earn the reviving player an extra life.
•   team_kill_function – allows the mission designer to specify the number of team kills a player can commit before he is penalised one life.
•   Respawn dialogs – from 0 - 4 respawn points can be placed on the map at which unconscious units can respawn
   Respawn Dialog sub options
a.   all_dead_dialog -  allows the automatic appearance of the respawn dialog if all units are unconscious.
b.    JIP_spawn_dialog - the mission maker can now set the amount of time before JIP players can access the respawn dialog when they first join the mission.
c.    nearest_teammate_dialog - measures the distance between the unconscious unit and the nearest friendly unit if the set a distance is exceeded the respawn dialog automatically appears
d.   Option of specifying up to 2 enemy sides.  If units from these enemy sides are within 50 metres of the spawn point the option to spawn at that point is not available
•   unconscious_markers – option to create markers on all player’s maps (including JIP players) showing where the unconscious units are.
•   unconscious camera – while the player is unconscious it switches to a camera that either (a) focuses on the unconscious player’s body or (b) follows the nearest friendly alive unit within 100 metres, with preference for players over AI.
•   call_out function - causes the unconscious player to call out at random intervals (between 15 and 35 seconds) to help you find his body and revive him.  Can be used as an alternative to the unconscious markers for locating downed players or in addition for added immersion.
•   revive timer option. This option allows mission makers to specify a revive time limit and if the time runs out the player respawns at base or is declared dead.  
•   heal_yourself_option  Adds an action to the player to heal himself if damage is within a range specifiable by the mission maker (eg. damage 0.1 – 0.5).  The number of times this option is available per revive is also settable.  Designed to allow players to heal minor damage but to still rely on medics for more serious injuries.
•   kegetys_spectator_script option for dead players to use kegetys script
•   Players are revived with the weapons they died with.
•   Can be set up easily for use with any side eg BLUFOR (default), OPFOR and RACS
•   No addons needed but is compatible with other addons

Several other sub-options are present but read the notes in the zip file for more info on these.

Changes from previous version
•   incorporated the heal_yourself function
•   incorporated an option to use kegetys spectating script when dead
•   ViperMaul’s fix for kegetys spectating script
•   Updated the mission end function, now only creates the trigger if this function is used and uses “END6” to reduce the risk of incompatibility with user designed missions
•   Option to make it possible to respawn at Base_1 even if enemy forces are within a 50 metre radius.
•   incorporated new unconscious follow cam discussed a few posts back.

Implementation
Please read the latest implementation notes and init.sqf readme in the zip file before using the new scripts

Missions included
AI_disabled_revive_230707 - test mission and version of the script for BLUFOR forces

Bugs
If you do not get the joining mission message upon starting the mission then return to the unit selection screen and try again (I’ve only seen this a couple of times in many hours of testing so you may not ever experience it).

Occasionally when using the revive timer option a dead player’s body will disappear

There are potentially some problems with Kegetys script if you use this option but I've hopefully sorted most of them out.  For instance, if you are following a unit that is killed your view will change to the ocean and you’ll need to select the next unit in the view menu.  Also if using the mission_end_function players will get the message that the mission has failed but will not return to the debriefing screen until they press escape.  

Tested
On version 1.08 on both dedicated and local servers.  Works with JIP.

Thanks
Special thanks to HulkingUnicorn for his scripting advice, testing and many suggestions
Many thanks also to satexas69, MCPXXL, SNKMAN and sickboy for all their suggestions, advice and support and to all at the BIS forums
Based on concepts by PRiMe, toadlife and Mongoose_84.  Also thanks to Chris'OFP editor.
Some of the voice arrray stuff stolen with the permission of SNKMAN from ArmA Group Link II Plus!
And of course thanks to Kegetys for his amazing spectating script and to ViperMaul for his script fix

Good luck,

norrin :)

Latest version of the AI_enabled revive beta

Here's (http://home.iprimus.com.au/simonnsl/norrinsArmA/Al_enabled_revive_150707.zip) a long overdue update to the AI_enabled revive scripts (dated 150707).

Here's the changes:
1. Removed the addEventhandlers to improve compatibility with other scripts
2. Removed the blackIn from the onConnect script as it has been interrupting some mission makers intro movies.
Also added the following options to the init.sqf
3. The JIP players now get all unconscious markers placed on their maps when they join.  Only if the unconscious_markers options is toggled on of course.
4. Camera options so that it can either focus on the unconscious player or the nearest friendly.
5. Call_out function from the AI_disabled script now implemented
6. Option to toggle on or off the markers showing where the unconscious players are located.
7. Revive action only appears when you are within reviving radius of an unconscious player.

Bugs
Sometimes the AI units don't revive when sent to unconscious bodies, I'm not sure why this is but sending a second AI-unit to the unconscious unit may trigger the revive action.

If you spawn into an unconscious group leader when you are revived you may be armed with your secondary weapon.  However, when you shoot the rifle on your back fires.  The only way I've found to resolve this bug is to respawn and be revived.

Most importantly please make sure you check out the implementation notes and init file readMe in the zip file before using these scripts.

In action
For a short vid of the AI_enabled script in action from different player perspectives click here (http://www.youtube.com/watch?v=0zdcLWKcM5w)
Title: Re: SQF revive script
Post by: Fmrfox on 26 Aug 2007, 00:25:34
Sorry to bump an old thread but I have tried to PM Norrin and it wont send for some reason, I don't understand why.

Norrin your revive script is absolutely amazing, thanks for making it! :)

I have a little problem though. I am using the BAS framework and 6th sense AI manager (which incorporates GL2) so I had some initial conflicts with the call out and spectator parts of your script. I seem to have resolved those by disabling the call out function and commenting out #include "spect\spectating.hpp". I don't have the AI disabled but I'm still getting the scalar error.
Title: Re: SQF revive script
Post by: norrin on 30 Aug 2007, 05:01:16
Hi Fmrfox,

Sorry I haven't been checking this thread as often as I should recently.  Firstly there are new versions of the both the AI_enabled and AI disabled scripts available.

Get the latest version of the AI_disabled script here (http://home.iprimus.com.au/simonnsl/norrinsArmA/AI_disabled_1g_230807b.zip) (230807)
 and the latetst version of the AI_enabled script here (http://home.iprimus.com.au/simonnsl/norrinsArmA/AI_enabled_290807.zip) (290807).

The latest versions of these scripts contain new features and many bug fixes as well as updated implementation and init.sqf notes that will hopefully help you fix any problems you have encountered.  The AI_enabled script the most recently updated also contains notes on compatability fixes for other scripts.

All that being said, you may run into problems if you remove the revive spect folder and replace it with the Bas-f spect - it would be better to disable the spectate function through the BAS-f framework and implement it through the revive init.sqf options as I've made some minor changes to Kegetys' spectator script so that it functions with my revive script. 

I think the reason for the scalar error is that to use the AI_disabled script you must disable the playable AI in the description.ext.  If you want to have the playable AI enabled then you must use the AI_enabled script (see link in this post for latest version).

I'm going to be away for a couple of weeks and will not be able to check the internet so if its still not working send your mission to norrin@iprimus.com.au and I take a look at it when I get back (I'll be back on board around the 20th Sept). :)

norrin



# removed unnecessary quote - h-
Title: Re: SQF revive script (ACEPTED)
Post by: Mandoble on 01 Sep 2007, 14:16:04
The script suite has been accepted and added to the ED Depot ArmA scripts section.
Title: Re: SQF revive script (ACEPTED)
Post by: Seven on 20 Sep 2007, 17:22:06
The script suite has been accepted and added to the ED Depot ArmA scripts section.

Both AI_Disabled & AI_Enabled zipfiles at the depot contain the same stuff: AI_disabled script (AI_disabled_1g_230807b)  :blink:
Could you plz check & upload the AI_Enabled script?

Thx a lot!
Title: Re: SQF revive script (ACCEPTED)
Post by: Mandoble on 20 Sep 2007, 17:49:45
Fixed.
Title: Re: SQF revive script (ACCEPTED)
Post by: Seven on 21 Sep 2007, 11:21:52
Script works nice! Thx a lot  :clap:

I do get an error though
ah noobishly forgot the gamelogic!
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 22 Sep 2007, 02:24:12
[AI_enabled_revive and AI_disabled_revive Updates

The latest versions (v0.19) of the AI_enabled scripts are available from here (21st September 2007)

The latest versions (v1.0h) of the AI_disabled scripts are available from here (16th September 2007)

These revised scripts include many improvements, bug fixes and optimisations.  Make sure you check out the implementation notes and the init.sqf readme in the zip files for more info on the revive options available and using these scripts.

For the most up-to-date info on these scripts please see: http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=f6ec59a7ec61f653594556c558e2e467&act=ST&f=71&t=58490&st=0&%EF%BF%BDentry101135

Player Vs Player AI_disabled revive script alpha (19th September 2007)

Here�s an alpha version of the PvP AI_disabled revive scripts.

Tested
The scripts have been tested in ver 1.08 with 3 players and work well with little strain on cpu resources but I need some one to stress test the PvP scripts with a larger number of players. 

In the past we�ve used the normal revive scripts on an average spec server with about 20 co-op players and they seems to run OK beyond that I�m not really sure.  The thing to remember is that each player needs an instance of the script running locally on their PC for each other player both friendly and enemy for the scripts to stay in synch � so you can see why I�m worried about how they�ll perform for large PvP battles.

Features
The scripts include almost all of the functions of the co-op AI_disabled  scripts including the following:

* revive reward_function
* team_kill_function
* all_dead_dialog
* nearest_teammate_dialog
* unconcious_markers
* follow_cam
* call_out_function
* revive_timer
* heal_yourself
* kegetys_spectator
* unconscious_invincibility
* visible_timer
* anti-water script

The visible timer is new and it allows you to display the revive timer countdown while you�re unconscious.  The timer�s not perfect and loses approx 1 sec over the course of a 45 second revive time. Its designed mainly for short revive times that are more appropriate for PvP � dare I say it more like BF2.  Once the timers up the mission designer has the choice of allowing you to respawn at your base camp or die outright in which case you can watch the ensuing proceedings using Kegetys Spectating script.

The respawn points are also a little different in the PvP version with the designer only being allowed to define a single point for each side - which really should be placed at the sides start point, however the respawn dialog can be set up to work in the same way as the co-op scripts.

If you decide to use the Unconscious markers they will only appear on the maps of the players on the same side.

The scripts are also set up so you can have two sides eg BLUFOR and Independent as friendlies and one side eg OPFOR as enemies and vice versa.  You can also specify if you only want medics to revive.

Bugs
One problem is the heal function doesn�t seem to be working reliably so you may want to disable it other than that haven�t come across any thing other than the occasional glitch that we've seen in the past with the co-op versions of the scripts.

In Future
For the time being if you use the call-out function the unconscious players will call-out in English no matter which side you are on.  If the scripts work well with a large number of players I�ll change this so that the BLUFOR call out in English and the OPFORs call out in Russian.  I'll also implement more respawn points, but the current version could be used with progressive or mobile respawn points if the mission designers up to it.

Test Mission
In the very simple mission included grab a couple of mates and move towards the smoke and slug it out.
Title: Re: SQF revive script (ACCEPTED)
Post by: Mandoble on 22 Sep 2007, 14:33:36
Thanks for the update Norrin, I'll update your current scripts in the ED asap.
About "For the most up-to-date info on these scripts please see: ... ", we'll use what is here as the most updated version and info wanted to be tested in OFPEC and added to the OFPEC ED as long as we are not talking about final releases.
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 05 Feb 2008, 01:44:17
Updated first post with latest versions and information about these scripts.
Title: Re: SQF revive script (ACCEPTED)
Post by: Ironman on 09 Apr 2008, 03:39:11
is there going to be other releases for the new beta versions, more importantly for me would be 1.12.... I am sure others would want 1.11 also though
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 11 Apr 2008, 02:54:48
A new version of the AI_disabled script that it is compatible with ArmA versions 1.09+ was released yesterday on the BIS forums which fixes a couple of problems with the latest features/options: 1. mobile respawn and 2. rejoin punish.  Full details on what the latest version of the script does are contained in the readMe in the attached zip file.

Once the final 1.12 and 1.12 Linux server are released the code will be re-optimised and will use the new scripting commands that became available in the arma 1.09 beta.
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 30 Jun 2008, 02:24:51
A new version of the AI_disabled revive script (version 1.49) is now available that includes a number of bug fixes and optimisations as well as some new features (see readMe contained in rar file for full details on implementation and features). 

You can get it here: http://home.iprimus.com.au/simonnsl/Revive/AI_disabled_x_1.49h.Intro.rar

EDIT: This version (1.49h) should be compatible with Spooner's SPON Map package - Thanks to Spooner for this fix.
Title: Re: SQF revive script (ACCEPTED)
Post by: Shadow.D. ^BOB^ on 03 Jul 2008, 19:54:22
Hey, i wonder if anyone can help (or come across the same issue).   I have implemented the script into a couple of my missions.. As far as i can tell correctly.

The problem is that although the script works fine for me and most of the guys i play with, there is one guy who the script just wont work for.  Basically when he dies, he just dies.  No unconcious cam and no option to revive in game.  Thing is it seems to work fine for everyone else.  He has tried reinstalls of the game but to no avail.  Has anyone come across this problem at all?  Or could there be something im doing wrong (if so i cant figure it out, wih it working for others).

Also if i have the respawns set to 0 in the revive_init, do i need to have the Respawn_west1, Mobile listed in the marker names if im not using them?

Thanks in advance for any help.

Update: After a bit more testing, it seems that the example mission that comes with the script works on for him (which would again believe me o think im doing something wrong) I made i simple mission just a couple of ai in town to clear with the script in and it didnt work.  Thing is it worked for everyone else lol.

Update 2:  After a bit more playing, it looks like the script works fine if he is blown up (grenade, charge) but not when shot.  Just keeps getting weirder...

Im lost here, cant figure it out.
Title: Re: SQF revive script (ACCEPTED)
Post by: hoz on 23 Dec 2008, 16:41:32
Norrin,

what is the visibility_timer option used for? I wasn't able to find this in any of the doco...

After just recently installing the .52 with AI respawn, I wondered if it was necessary to have the editor create the GL server... isn't this something you could create in the init or replace with isServer?

lastly... all my guys seem to stand at the respawn_west while waiting for revive. I've created the boot_hill marker but it doesn't seem to make a difference then all are in wait position at the respawn_west marker.
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 24 Dec 2008, 00:24:32
Sorry mate but the brain's only barely functioning this morning as I'm suffering some post Christmas Partyitis today so hopefully this response won't just be garbled nonsense.

what is the visibility_timer option used for? I wasn't able to find this in any of the doco...
The _visible_timer option is a bit of a redundant feature but when you are using the revive time limit option it allows you to hide the onscreen timer revive count-down so players don't know how much time they have left before they respawn or die.
After just recently installing the .52 with AI respawn, I wondered if it was necessary to have the editor create the GL server... isn't this something you could create in the init or replace with isServer?
In the earlier versions of ArmA (around 1.02 I think) using an editor placed GL was the only way I could ensure that the revive scripts would initialise on JIP players.  It's a bit hazy but more recently I think I may have tried what you are suggesting and wasn't happy with the result so stuck with the method that always worked.  Other than there being the added hassle of adding the GL to your mission can you see a problem with setting it up this way?
lastly... all my guys seem to stand at the respawn_west while waiting for revive. I've created the boot_hill marker but it doesn't seem to make a difference then all are in wait position at the respawn_west marker.
Units are only transported to the boot_hill marker when they are dead outright ie. they have no revives left or the revive timer has elapsed depending on the settings you're using.  By contrast, when players are unconscious the player's avatar stays at the respawn marker until their unconscious body double is revived.  There's a chance with the latest versions of the script that the whole boot_hill marker may be pretty much unnecessary but the scripts would need couple of lines of code changed if I was to do this.  Maybe with the next update (if someone finds a killer bug) I'll look into this. 

There is without question a multitude of ways that the scripts could be improved, more efficient use of code for instance, but the thought of rewriting the things from scratch and then trouble shooting all the new bugs I'd no doubt introduce makes my eyes water so I've been a bit of the opinion (and I know its lazy) that if it works don't touch it.   Having said that if there's anything that you think needs changing or could be improved please let me know.

Finally, I wish everyone at OFPEC a Merry Christmas.

Very best wishes,

norrin
Title: Re: SQF revive script (ACCEPTED)
Post by: hoz on 24 Dec 2008, 00:47:32
Quote
Other than there being the added hassle of adding the GL to your mission can you see a problem with setting it up this way?

Well you could create this GL in the init scripts then it avoids one more step a n00b type scripting person would have to do. Just comes down to simplicity.

Quote
By contrast, when players are unconscious the player's avatar stays at the respawn marker until their unconscious body double is revived.
Ok, it would be better if they were at boot hill and then transported or hiding them until they respawn.

A nice to have maybe when your viewing an AI you get some display  as to which unit hes going to revive.(Intended revive target).

another thing that bugs me is when the AI respawn then sometimes seem to ferget what they were doing.

The only other option I would like is a way to disable the fading camera menu. It could be as easy as a toogle check box the player has an option to set on the next revive.


Quote
There is without question a multitude of ways that the scripts could be improved, more efficient use of code for instance, but the thought of rewriting the things from scratch and then trouble shooting all the new bugs I'd no doubt introduce makes my eyes water so I've been a bit of the opinion (and I know its lazy) that if it works don't touch it.

If you do let us know I have other suggestions too. :)

Title: Re: SQF revive script (ACCEPTED)
Post by: Garcia on 01 Jan 2009, 22:54:17
Sorry if this have been answered somewhere earlier, but...

If a player disconnects and you have disabled AI, will the AI left behind from the disconnected player be deleted?

Where is the part where disconnections are being handled?

Also, is there a way to force a unit to need reviving? Preferably without killing him :)

My idea basically is this...you have a player, lets say Player A. A loses connection, but rejoins after a minute or so...I don't want him to start at some other place...I want the body left after he disconnects to fall unconsious and stay that way in say 5 minutes...if he rejoins within those 5 minutes, he gets placed at the position where he was when he lost connection, gets forced into revive state...then his mates can revive him...

Also, while at it...where is the timeout death handled? :D I don't want the player to have any other option to respawn than revive, and I also want a timeout on it. However, when the time runs out, I don't want him to die, I want to catch that and let him respawn...but I want to customize it a bit...

I know you have the option built in that he respawns at a certain location after the time runs out, but as I understand it, enabling that option also enables him to choose to respawn there instead of revive?

Cheers
Title: Re: SQF revive script (ACCEPTED)
Post by: hoz on 02 Jan 2009, 16:31:49
Is it me or is the revive working differently now with the new patch? It seems when we revive someone the body continues to stick around after the unit is revived. I can't remember now if the body remained after revive in 1.14.
Title: Re: SQF revive script (ACCEPTED)
Post by: Garcia on 02 Jan 2009, 17:23:27
Think there is a option if you want the body to remain or not...not sure, just stared editing for ArmA :D
Title: Re: SQF revive script (ACCEPTED)
Post by: hoz on 02 Jan 2009, 17:32:10
I must of turned that option on somewhere. :)  funny thing is I don't recall doing so and I was playing one of ironmans missions the other day had a similar problem.
Title: Re: SQF revive script (ACCEPTED)
Post by: Garcia on 02 Jan 2009, 17:49:42
Uh oh...after looking through the options...there are no such option ::)

Guess I mixed it with some other script :whistle:
Title: Re: SQF revive script (ACCEPTED)
Post by: Ironman on 03 Jan 2009, 06:48:48
Well I am not designing my mission to be compatible with a beta version... if at some point patch 1.15 becomes the real deal then I will but I will be building my missions in 1.14.

Also, the dead body in 1.14 always disapears. The gear can remain though, that is the option you might be getting confused with?
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 04 Jan 2009, 11:31:29
Sorry guys only got back from a couple of weeks holiday and back online today. 

@Garcia do you still need help or are you after Hulk's revive script?  As far as I can understand a lot if not all of what you are asking is possible with the AI_enabled revive script.

@ hoz - I've only just checked the test mission with the AI_enabled revive and as far as I can tell it seems to be working fine with ArmA ver 1.15 when units are revived ie. the unconscious body is removed and replaced with the player's body doing the unconscious animation prior to the player regaining control of his avatar.   If you are still running into probs can you email me your mission or send me a picture of the problem and I will try and replicate and fix it - thanks mate.
Title: Re: SQF revive script (ACCEPTED)
Post by: Garcia on 04 Jan 2009, 15:03:30
Hmm, that might be...I just went for the one without AI because I don't want them :whistle: But seeing that I want to control what happens once a player disconnects and leaves an AI behind, I guess I could just use the one with AI enabled ;)
Title: Re: SQF revive script (ACCEPTED)
Post by: desrat on 19 Jan 2009, 02:14:01
sorry if this is a n00b question but how would I go about re-enabling the contents of a unit's init line when it gets respawned/revived currently once the unit respawns/revives it loses the function assigned to it..

BTW Im using AI-Enabled if that makes a difference.
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 19 Jan 2009, 13:03:42
You could run a separate script through the unit's init line which you would call like this:
Code: [Select]
nul = [unitseditorname] execVM "initline.sqf";
Then make a new script called initline.sqf in your mission folder and put this in the script:
Code: [Select]

//initline.sqf

_unit = _this select 0;
_name = call compile format["%1",_unit];

if(!local _name) exitWith {};


while {true} do
{
waitUntil {!alive _name};
waitUntil{alive call compile format["%1",_unit]};
_name = call compile format["%1",_unit];
_name setVehicleInit "your init line code";
processInitCommands;
sleep 1;
};

Just put your init line code in the setVehicleInit line and barring any syntax errors this should work.

EDIT: Changed code to call script as I accidentally used nil rather than nul.



Title: Re: SQF revive script (ACCEPTED)
Post by: desrat on 20 Jan 2009, 11:48:59
thx norrin I'll give it a try at the weekend won't have time till then

**EDIT**
Actually decided to take the day off work (naughty me :)) so tryed it out with an error on line 15 specifically the following

Code: [Select]
_name setVehicleInit "nul = [BLU_1Plt_RF1, "Mobile1"] spawn compile preprocessFileLineNumbers "setPosMarker.sqf"";
unit init line as follows at mission start
Code: [Select]
GrpBLU_1Plt_PltHQ = group this; nul = ["rifleman",this] execVM "f\common\@ShackTac_assignGear.sqf";nul = [BLU_1Plt_RF1] execVM "initline.sqf";
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 20 Jan 2009, 23:30:08
First off, I've checked the initline.sqf script and its working fine.  The problem you are running into, I think, is a syntax error.  If you are surrounding code with "" then any code that requires "" within this statement must use double "" "" or you can use '' instead, as each ' is the same as "".

So your code in the initline script needs to look like this:
Code: [Select]
_name setVehicleInit "nul = [BLU_1Plt_RF1, 'Mobile1'] spawn compile preprocessFileLineNumbers 'setPosMarker.sqf'";
Title: Re: SQF revive script (ACCEPTED)
Post by: desrat on 22 Jan 2009, 00:33:32
ok got it :)

All working as necsassary, and if case anyone was wondering what I was actually trying to achieve here it's basically to attach markers to my squad leaders so they can be used as mobile spawn points in the revive scripts..however once the unit died the marker stoped updating..
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 22 Feb 2009, 11:24:55
AI_enabled Revive Update 0.61 beta

See the first post in the thread for latest version of the script.

Changes in 0.61
•   Script optimisations- Removed a great deal of unnecessary code from the core revive_player script and introduced a number of pre-processed functions to reduce the CPU overhead of the scripts.

•   Call for help option - When enabled allows an unconscious player to call for help from surrounding AI and players by pushing a button or the "H" key while unconscious.  Called AI will automatically move to the downed player unless they are already helping someone else.  Players will receive a hint that another player is calling for help.  This system works great if the automatic AI goto revive option is disabled as the group leader (the player) can specify when his AI should move to and heal a downed player (rather than them trying to heal someone in the middle of a fire fight), then if he is shot himself he can call for help.

•   Toggle dialog fade- Another new button in the unconscious dialog or the "B" key allows you to turn off the annoying dialog fade during the unconscious camera. The default setting is dialog fade off.

•   Other improvements to the unconscious camera - The camera no longer resets to the player's 3rd person view when a new dialog appears.  Automatically uses respwn point names when respawning at base rather than eg "base 1"

•   New information in unconscious camera- In connection with the other new features a lot more information is now displayed while units are unconscious such as who the current reviver is and there distance from the unconscious player, list of units that have been notified that you need help etc.

•   Free camera- Thanks to some code kindly provided by OFPEC (thankyou Hoz and Mandoble) there's now a free camera mode attached to the follow/free camera option - depress the right mouse button to move the camera and the mouse wheel zooms in and out.

Many thanks to Hoz at OFPEC for his testing of the latest versions and his many suggestions and improvements to both the script and readMe file.

Finally, check the last page of the readMe for some tips on enabling these scripts with ACE.

EDIT: I've added a new version of the AI_enabled revive (0.61e) to the first post in the thread, no major changes just a slight change in the timing of the scripts to reduce the risk of spawning at respawn west when you fall unconscious (26/02/09).
Title: Re: SQF revive script (ACCEPTED)
Post by: hoz on 26 Feb 2009, 05:36:54
I updated the OFPEC resource for ya.  :good:
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 26 Feb 2009, 05:57:06
OFPEC AI_enabled Revive Tutorial

Ok then, without further ado, and with copius thanks to hoz for making this possible, I give you the OFPEC AI Enabled Revive Tutorial.

You can find it here (http://www.ofpec.com/tutorials/index.php?action=show&id=125)   

This tutorial describes the various features and functions available in the script in detail and provides a step by step guide on setting-up and configuring the latest (0.61 version) of the AI _enabled revive scripts.
Title: Re: SQF revive script (ACCEPTED)
Post by: desrat on 01 Mar 2009, 12:04:08
that link just goes to the FAQ for me..
Title: Re: SQF revive script (ACCEPTED)
Post by: hoz on 01 Mar 2009, 14:54:14
fixed  :whistle:
Title: Re: SQF revive script (ACCEPTED)
Post by: fleepee on 09 Mar 2009, 21:38:51
I found those errors, with a mission with independant side players, but I don't know in which script it is...
Title: Re: SQF revive script (ACCEPTED)
Post by: norrin on 10 Mar 2009, 01:27:08
Hi mate,

The problems are in the cam_follow.sqf and the LeaderFix.sqf, would you mind sending me your mission and links to any addons you've used to norrin@iinet.net.au so I can check your mission set-up and to see whether the 2 problems are related.

Thanks mate,

norrin