Author: norrin
Author Website: http://www.xtremegamingnetwork.com.au/xdf/

Requirements: No addons required

Version: x_1.46b

Short description:

Date: 2008-03-30 12:51


Comments: (0)
Rating:



 







Revive AI-disabled
by
Norrin


*****Note*****
The "Revive AI-enabled" scripts (beta) can be found on
this page


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


Implementation:
Since version 1.22 you have to edit the r_init.sqf file in your mission directory to setup the revive scripts and include it in your init.sqf/sqs with:
nil = server execVM "r_init.sqf";

For further info please read the latest implementation notes in the included documentation.


Missions included:
A simple AI disabled example mission is included with scripts whereby all BLUFOR and independent units can revive one another. See mission briefing for more details.


Media:

This is a video made of a previous beta version of this script.



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


Known issues:
* 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 these 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.

* Follow the leader bug, occasionally units in a group will join formation on a unit other than the leader (Hopefully fixed)


Thanks:
HulkingUnicorn for his scripting advice, testing and many suggestions
Also to satexas69, MCPXXL, 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.
Finally to MCPXXL couldn’t have done this without your help, time and patience m8 – thank you.
Thanks to xeno for all his work with this script.

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.


Version:
v1.0
- first official release

v1.0b
- added some anti-water code

v1.0c
- 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.

v1.0d
- the disableUserInput code to prevent players from disconnecting while the respawn timer is counting down.
- the option of making the playable units invincible.
- Finally there’s a new look to the unconscious follow cam (its looking more like Kegetys script now but its still no where near as powerful).

v1.0e
- xxxxxxxxx

v1.0f
Fixes:
- No longer will the revive action appear when the player is next to a conscious prone unit that is not carrying weapons (more relevant for the AI_enabled script). Thanks to bravo 6 for finding this bug
- Fixed the anti-water script bug identified by vengeance1 in the AI_disabled script - I highly recommend everyone to down load the latest version for this fix. Note there is no anti-water script in the AI_enabled version so please let me know if you feel you'd like this feature implemented.

New Features
- added the follow_cam_distance variable in the init.sqf so that the mission designer can specify up to what distance the unconcious follow camera will follow friendly units as suggested by MCPXXL.
- simplified/optimised the code in the revive_player.sqf
- also changes to the camera_follow.sqs, init.sqf and improved the information inthe 2 note/implementation files.

v1.0g
- new camera incorporated

v1.0h
- xxxxx

v1.0i
- New functions:
    Added the respawn_position function so that when the revive timer runs out the mission maker now has the option to have the unit die, respawn at base_1 or respawn at the nearest friendly base to where the player died.
- Also added instructions in the init.sqf readme on how to set up a:
    1. a variable number of revives in the mission start-up screen via parameters
    2. a simple setting for an infinite number of revives.
    3. information on compatability with TJ72s transport chopper script
Fixes:
    * Esc key exploit during the unconscious camera
    * Some other bugs in the camera script.

v1.0j
- Fixed Bug inadvertently added to v1.0i

v1.0k
- Optimised code to remove redundant “call compile format” and “forEach” commands
- Added my OFPEC tag (NORRN) to the global variables to reduce the chance of conflict with other scripts
- Rewritten and reorganised readMe explaining usage of the scripts

Fixes:
- Changed revive sequence in the hope that it will fix the bug whereby the player does not regain control of his body once he is revived.
A- dded code to set group leader after units are revived in the hope it will fix the follow the leader bug.

v1.1
Completely rewritten, single instance required on each client’s PC. Removed bulk of global variables and many publicVariables which will hopefully reduce lag. Changed code for defining leader and whole method of reviving

- The big ones are hopefully a massive increase in optimisation (decrease in cpu load) and reduction in lag for JIP in long missions
- Only one instance of the script needs to be run on each client's PC (not one for each player as in previous versions). This has allowed me to greatly reduce the number of public variables being defined when players join. Importantly there will no longer be overlap between variables being publicly defined. This also results in many less looping scripts on each client which should reduce cpu strain.
- Heaps of redundant code has been removed from the revive_player script and rest lengths have been increased in loops where possible.
- I've also removed 30 odd global variables by better coding using arrays and a number of looping scripts have also been removed as they have now been incorporated into the main revive_player script.
- The method for respawning and reviving units has been changed. The respawn type is now "BASE" in the description.ext so the editor will need to define a Respawn_marker for their team as well as a Boot_Hill marker (preferably on the same island out of the action).
- The player being killed will not notice any change in the script however the other players will see a dead body for a few seconds before the unconscious player assumes the unconscious animation.
- These changes in revive method also have allowed me to permanently enable unconscious invincibility and this should no longer interfere with other scripts such as GPL2+.
- I've adapted some follow the leader code from a BIS post by ColonelSandersLite that appears to have fixed the follow-the-leader problem.
- The unconscious camera has now been enhanced and the unconscious player can now follow any friendly vehicle and switch between vehicles within the cam follow distance.
- Simplified the weapon respawn code as I discovered it was causing some null variable errors (maybe responsible for the latest one you've seen Legislator).

v1.1c
- Introduced the respawn point dialog if you have respawn points defined and you die in water.
- Fixed a bug whereby the unit would sometimes stand before falling unconscious.
- I've gone back to using the follow the leader code from ver 1j as the new code was causing the groups to disband.
- I've fixed an error in the scripts that may have caused problems when using sides other than BLUFOR
- Fixed a an error identified by Crawler in the camera script.

v1.1d
- fixed the setcaptive error legislator discovered in the latest code
- also added some code that should fix the standing when revived bug.

v1.1e
- Fixes:
1. Players no longer fall through the floors of buildings when they fall unconscious
2. Eradicated the function name error that was appearing in the arma.rpt file in almost all cases - still very very occasionally this will pop up unfortunately.

- Additions:
As I was changing the camera script anyway I added a second follow cam that can be used with the night vision toggle (good for following players not so good for vehicles)

v1.1f
- Fixed the isplayer.sqf so no more name function errors and bodies and markers disappear when unconscious players leave the server
- I've added new dialogs for JIP and "in water" as these were causing errors
- I've put some code at the start of the revive_player.sqf script so that if a player joins in progress and spawns at boot_hill or the respawn_side marker he is transported to a new marker that now must be created by the mission maker called "Mission_start".

v1.1g
- This full version of the script includes all the recent updates as well as being much smaller in size as thanks to ricki I've been able to remove the sounds folder and the sound config.cpp (from the dialogs subfolder).
- Not only does this reduce the size of the script it reduces the chance of conflict with other mission sounds you may have used. It also adds some new voices for unconscious players.

v1.22
- Parts rewritten by Xeno to get rid of some nasty bugs and make things easier to maintain.

v1.23
- Fixed FollowCam bug
- Fixed a bug in the Anti Water code
- (Hopefully) reduced the number of errors in the rpt file

v1.36
Fixes
- The unconscious body is now correctly defined as a captive and will no longer be seen as a threat by enemy units.
- Player is no longer set as a captive after using the wash ashore dialog and respawning at base
- Lots of other minor fixes over my earlier versions of the scripts

New Features
- The respawn dialog buttons now appear with the respawn markers names. As the names of these markers now appear on the respawn buttons automatically make sure they are not more than 11 lower case characters in length.
- Revives remaining now called “Lives remaining”
- New options in revive_init.sqf which are linked (_allied_side_1 = "WEST";_allied_side_2 = "RESISTANCE"; ) to the camera script and allow the players to spectate other team members and friendly sides while unconscious (a fault with previous versions). Friendly sides can be "EAST", "WEST","RESISTANCE" etc. If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST" ie do not leave these variables blank if you are using the follow cam option (//array no.7)
- New option in the revive_init.sqf (_revive_damage = 0.5; ), which allows the mission maker to set the amount of damage a player has after being revived. Make sure you disable the heal action option if you use this function.
- It is also possible to view an onscreen countdown revive timer (_visible_timer = 1 in revive_init.sqf). This works quite well for a low revive_time_limit but it loses approximately 2 seconds for every 30 seconds of time_limit eg for 60 secs revive_time_limit the visible countdown timer counts down to 4 seconds before the revive time elapses.
- If using the enemy sides options the respawn markers appear as red until captured then turn green on the in game map
- A global broadcast for who has revived the player and the name of the player revived.
- An option (_respawn_position = 2; ) that allows players to choose from available respawn points upon the revive timer elapsing.

vx_1.40
I’ve had word from my testers that this new version addresses all the remaining issues with this script (fingers crossed).

This version's based off xeno’s enhanced 1.25 code

The scriptsare 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"


Forum topic:
- BIS




Enable javascript to be able to download from Armaholic please!



Tags: No tags