Jump to content

Recommended Posts

How would you implement this into the exsisting warfare map for OA. I'm not figuring that out. I'm trying to follow your instructions in the Read me Norrin, but I must be missing something.

I'm sooo confused. :pet5:

Share this post


Link to post
Share on other sites

Hi NORRIN,

Say should the Medic Supply look like this for OA in 049? I added MASH_EP1 and HMMWV_Ambulance_DES_EP1 and US_WarfareBFieldhHospital_Base_EP1.

//Medic resupply script

if (_medpacks == 1) then

{

if (count (nearestObjects [_name, ["M113Ambul","BMP2Ambul","MASH","MASH_EP1","HMMWV_Ambulance_DES_EP1","US_WarfareBFieldhHospital_Base_EP1"], 5]) > 0) then

Edited by vengeance1

Share this post


Link to post
Share on other sites

Thanks a lot norrin for the help, its good to know that is a diferent version that your revive.

If got it to work thanks to the help of members of mi clan they know a bit more scripting than me.

The only thing that happens is that it dosent confirm the location of the mobile spawn and then tells you do you want to respawn here (with a view of the map) it just makes you respawn there even if the hq is not deployed, but were working on it.

Thx again for the help :bounce3:

Share this post


Link to post
Share on other sites

@DarkEclip - mate no at this stage you can't load dead AI onto vehicles using the current revive but it is something I want to add in the future, its just a matter of finding the time to do it.

Thanx you Sir. :)

Share this post


Link to post
Share on other sites

we are using 0.49 with no interface and were wondering... when you load a dead member into the chopper the camera view is stuck at the spot on the ground. So you don't enjoy the flight back... Are we doing something wrong ? or missing feature.. thanks..

Edited by gonk

Share this post


Link to post
Share on other sites

Revive Update 0.49b

Requires

Combined Operations or Operation Arrowhead Standalone

Download

http://home.iprimus.com.au/simonnsl/revive/revive_049bOA.rar

Fixes

* Corrected and expanded the list of Medical facilities from which you can obtain medical supplies (Thanks to Vengeance1 for identifying this issue)

Lists now includes

_medVclArray = ["M113Ambul_TK_EP1","M113Ambul_UN_EP1",
               "HMMWV_Ambulance","HMMWV_Ambulance_CZ_DES_EP1","HMMWV_Ambulance_DES_EP1",
               "BASE_WarfareBFieldhHospital",
               "MASH","MASH_EP1",
               "BMP2_Ambul_Base",
               "GAZ_Vodnik_MedEvac",
               "Mi17_medevac_base",
               "TK_WarfareBFieldhHospital_Base_EP1","TK_WarfareBFieldhHospital_EP1",
               "US_WarfareBFieldhHospital_Base_EP1","US_WarfareBFieldhHospital_EP1",
               "UH60M_MEV_EP1"];

* Fixed a bug so that you can now use bleeding/bandages even if the Medpacks options is turned off.

In other news

* I'm on holidays for 2 weeks (back around the 4th October) so I won't be able to answer questions until then but please continue to post bugs if you come across them

* I've had to use my alternate upload site as my normal one's gone bananas so I hope there are no problems with getting access to the update.

* As always if you're updating just copy over the existing revive_sqf in your mission folder with the one in the archive

@gonk - sounds like a bug I'll fix it when I get back mate

Edited by norrin

Share this post


Link to post
Share on other sites
Revive Update 0.49b

@gonk - sounds like a bug I'll fix it when I get back mate

no worries mate... happy holidays...:bounce3:

Share this post


Link to post
Share on other sites

This bug has caused me a lot of headache.

If your units is not named, (eg. you use playableUnits) then the syntax with calls to formatted strings get messed up, because it is translated into group id, which ruins the syntax or something like that:

'if(!isNull B |#|1-1-A:1 (Muzzleflash) && B 1-1-A:1 (Muzz...'
Error Missing )

If this is not a bug, then make it more obvious, and write in guide that units should be named.

EDIT-------------------------

After having edited my units to have a name and succefully respawned I got an error, something about "weapon holder".

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

Norrin, what changes did you make when you added support to backpacks when respawning (as in, when you respawn you have the gear you died with instead of stock or nothing)? I can't seem to get all of your new stuff into Domination, so I want to at LEAST get the back pack support in there.

Share this post


Link to post
Share on other sites

I have a problem getting the revive to work on our server in a mission. If we run the mission on my computer it works great. But when loaded up on our server at AOWC it crashes the server.

Here is my Description, Init, and Revive files. Can somebody see if anything is wrong for me?

Description.ext

// Mission Header
class Header
{
 gameType = Coop;
 minPlayers = 1;
 maxPlayers = 10;
};

onLoadMission = "ESCORT";
OnLoadMissionTime = FALSE;

// description.ext settings for revive
///////////////////////////////////////////////////////////////////////////////////////////
respawn = "BASE";
respawndelay = 4;
disabledAI = 0;

#include "revive_sqf\dialogs\config.cpp"
#include "revive_sqf\dialogs\define.hpp"
#include "revive_sqf\dialogs\rev_cam_dialog.hpp"
#include "revive_sqf\dialogs\respawn_button_1.hpp"
#include "revive_sqf\dialogs\respawn_button_2.hpp"
#include "revive_sqf\dialogs\respawn_button_3.hpp"
#include "revive_sqf\dialogs\respawn_button_4.hpp"
#include "revive_sqf\dialogs\respawn_button_1b.hpp"
#include "revive_sqf\dialogs\respawn_button_1c.hpp"
#include "revive_sqf\dialogs\respawn_button_2b.hpp"
#include "revive_sqf\dialogs\respawn_button_3b.hpp"
#include "revive_sqf\dialogs\respawn_button_4b.hpp"
#include "revive_sqf\dialogs\respawn_button_1map.hpp"
#include "revive_sqf\dialogs\respawn_button_2map.hpp"
#include "revive_sqf\dialogs\respawn_button_3map.hpp"
#include "revive_sqf\dialogs\respawn_button_4map.hpp"
#include "revive_sqf\dialogs\OK_map.hpp"
#include "revive_sqf\dialogs\dead_cam_dialog.hpp"
#include "revive_sqf\dialogs\rev_cam_dialog_blank.hpp"

///////////////////////////////////////////////////////////////////////////////////////////
class Params
{
       class DayTime
       {
	//paramsArray[0]
               title = "Time Of Day";
               values[] = {-6, 0, 8, 13};
               texts[] = {"Morning", "Clear day", "Sundown", "Night"};
               default = 0;
	};
       class Revive
       {
	// paramsArray[1]
               title = "Number of Revives:";
               values[] = {2000,1000,20,10,7,5};
               texts[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7  - Hard","5  - Extreme"};
               default = 10;
       };
};

Init.sqf:

//begin init.sqf

//Initialise revive script (this next line is needed for revive script)
server execVM "revive_init.sqf";

//Mission parameters
skiptime (paramsArray select 0);

execVM "briefing.sqf";

if(true) exitWith {}; 

//helo evac init.sqf

[slick1] execVM "scripts\heloGoTo\heloGoTo_init.sqf";

// For extraction action at start-up
player setVariable ["NORRN_taxiHeli", slick1, true];

//NORRN_aerialTaxiRespawnOff = true;
NORRN_noAerialTaxiAtStart = true;

execVM "scripts\billowing.sqf";
execVM "scripts\billowing2.sqf";

trigger1 setVariable ["murk_spawn",false,false];
trigger2 setVariable ["murk_spawn",false,false];
trigger3 setVariable ["murk_spawn",false,false];
trigger4 setVariable ["murk_spawn",false,false];
trigger5 setVariable ["murk_spawn",false,false];
trigger6 setVariable ["murk_spawn",false,false];
trigger7 setVariable ["murk_spawn",false,false];
trigger8 setVariable ["murk_spawn",false,false];
trigger9 setVariable ["murk_spawn",false,false];
trigger10 setVariable ["murk_spawn",false,false];
trigger11 setVariable ["murk_spawn",false,false];
trigger12 setVariable ["murk_spawn",false,false];
trigger13 setVariable ["murk_spawn",false,false];
trigger14 setVariable ["murk_spawn",false,false];
trigger15 setVariable ["murk_spawn",false,false];
trigger16 setVariable ["murk_spawn",false,false];

revive.init.sqf:

/*
 CO & OA REVIVE SCRIPT

 © SEPTEMBER 2010 - norrin (simonnsl@iprimus.com.au)

 Version:  0.49 ArmA2	
*******************************************************************************************************
 See release notes for details on contributors and instructions for incorporating revive scripts into your  own missions
************************************************************************************
Start revive_init.sqf
*/
// =====================================================================================================================
// DO NOT MODIFY THIS CODE
// =====================================================================================================================
// sickboy's code modified by _xeno
T_INIT 	= false;
T_Server 	= false; 
T_Client 	= false; 
T_JIP 	= false;

T_MP = (if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then {true} else {false});

if (isServer) then 
{
T_Server = true;
if (!isNull player) then {T_Client = true};
T_INIT = true;
} else {
T_Client = true;
if (isNull player) then 
{
	T_JIP = true;
	[] spawn {waitUntil {!isNull player};T_INIT = true};
} else {
	T_INIT = true;
};
};
waitUntil {T_INIT};
// =====================================================================================================================
// THE FOLLOWING CODE CAN BE MODIFIED
// =====================================================================================================================
// GENERAL REVIVE OPTIONS  (Off = 0, On = 1)
_mission_end_function 			= 0;				//array no.0  - mission ends when all players are unconscious
_call_out_function 				= 1;				//array no.6  - whether a unit calls out while unconscious
_water_dialog 					= 1;				//array no.45 - whether a dialog appears when a unit dies in water so that it can auto wash ashore 
_unconscious_drag 				= 1;				//array no.39 - whether a unit can drag the bodies of unconscious players 
_load_wounded					= 1;				//array no.61 - allows you to load unconscious units on vehicles
_altUnc_animation 				= 1;				//array no.54 - use alternate revive animation
_JIP_spawn_dialog 				= 0;				//array no.2  - whether a dialog appears when a player JIP so that he can be transported to a spawn point near the action 
_time_b4_JIP_spawn_dialog 		= 10000;			//array no.17 - time before the respawn dialog appears for JIP players 
_perpetual_server				= 0;				//array no.62 - NOT IMPLEMENTED
_ACE_mod						= 0;				//array no.102 - NOT IMPLEMENTED - Currently a place holder for possible future functionality 
// ==================================================================
// LIST OF PLAYABLE UNITS
//NORRN_player_units = playableUNits;
NORRN_player_units = [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10];
// ==================================================================
// WELCOME SCREEN
//titleText ["Joining the Revive Test Mission\n\n(Make sure you check the mission notes for details on how the scripts work\nand the revive_readMe in the attached pdf file for the full notes on implementing \nthe scripts in your own missions and the options available)", "BLACK FADED", 0.6]; 	// This next line can be commented out or removed if it interferes with intro movies  
// ==================================================================
// REVIVE OPTIONS
_max_respawns 					= (paramsArray select 1);			//array no.38 - Number of lives per unit
_JIP_respawns					= [2,30];			//array no.63 - 0 - off or the number of lives players receive when they join in progress , JIP time after the mission starts 
_revive_timer 					= 1;	 			//array no.7  - Whether you want to limit the amount of timer a player has while unconscious
_revive_time_limit 				= 300;				//array no.27 - Amount of time a player remains unconscious before respawning or dying
_revive_damage 					= 0;				//array no.37 - Unit's level of damage following revive
_unconscious_markers 			= 1;				//array no. 4 - Whether a marker appears on the game map at the location of the unconscious unit
_caseVAC						= [1, ["MASH","HMMWV_Base"]];	//array no.64 - Allows units to be taken to a hospital etc to be revived
_mediVAC						= [];				//array no.65 - NOT IMPLEMENTED
_chance_ofDeath					= [0,0];			//array no.66 - Two parameters in the array the first switches off/on (0/1) chance of death when shot, increases dues to hit location and number of times revived and the second parameter switches on/off the decreasing respawn timer based on how many times you have been revived, if using set respawn-time to at least 300 seconds.
_dualTimer						= 0;				//array no.67 - NOT IMPLEMENTED - normal units can only revive for eg 30 seconds whereas medics can heal players up to 120 secs - array - [0/1 - off/on, revive timer for normal unit, timer for medic] 
_deadSpectator_cam 				= 1;				//array no.92 - leave as 0 - whether a unit can spectate other friendly units when it has run out of lives
// ==================================================================
// RESPAWN OPTIONS
_no_respawn_points 				= 2;				//array no.12 - no of respawn points (Max number 4)  
_Base_1 						= "Mobile";			//array no.13 - spawn position names  
_Base_2 						= "Start";			//array no.14
_Base_3 						= "";				//array no.15
_Base_4 						= "";				//array no.16 
_Base_free_respawn 				= [1,1,0,0];		//array no.36 - select whether to allow respawning at spawn points even if enemy troops are present (options OFF = 0, ON = 1) 
_respawn_at_base_addWeapons 	= 0;				//array no.11 - unit respawns with weapons it commenced the mission with  
_respawn_at_base_magazines 		= [];				//array no.34 - If using the respawn_at_base_addWeapons option then place the magazine and weapon 
_respawn_at_base_weapons 		= [];				//array no.35   types in the following arrays, if left blank respawns with weapons from mission start
_respawn_position 				= 2;				//array no.28 - 0 - respawn at base_1; 1 -  the closest enemy free respawn point; 2 - players choice; and 3 -  dies
_respawnAtBaseWait				= [0,0];			//array no.68 - Two parameters: 1st if = 1 makes players that respawn at base wait for (parameter 2) seconds before being able to see surroundings   
_objectiveBasedRP				= []; 				//array no.69 - NOT IMPLEMENTED
// Mobile Spawn Settings
_mobile_spawn 					= 1;				//array no.51 - set to 1 if you want to use mobile spawn	
//_mobile_base_start 				= "Insertion";			//array no.52 - NO LONGER NEEDED, REDUNDANT VARIABLE
_mobile_base2_start 			= "";				//array no.70 - NOT IMPLEMENTED
_mobile_type 					= 1;				//array no.60 - set as 0 - for vehicle and 1 for man
_mobile_man 					= s1;  				//array no.53 - place name of unit here or if not used make sure set as objNull
_mobile_man2					= objNull;			//array no.71 - NOT IMPLEMENTED
// ==================================================================
// UNITS THAT CAN REVIVE/UNITS THAT CAN BE REVIVED
_can_revive 					= "soldierWB";		//array no.18 
_can_revive_2 					= "";				//array no.19
_can_revive_3					= "";				//array no.72 - NOT IMPLEMENTED
_can_revive_4					= "";				//array no.73 - NOT IMPLEMENTED
_can_be_revived 				= "soldierWB";		//array no.20  
_can_be_revived_2 				= "";				//array no.21 
_can_be_revived_3				= "";				//array no.74 - NOT IMPLEMENTED 
_can_be_revived_4 				= "";				//array no.75 - NOT IMPLEMENTED
_medic_1						= "USMC_Soldier_Medic";	//array no.76 - Used in conjunction with medpacks and bleeding	
_medic_2						= "";				//array no.77 - Used in conjunction with medpacks and bleeding
_medic_3						= "";				//array no.78 - NOT IMPLEMENTED	
_medic_4						= "";				//array no.79 - NOT IMPLEMENTED	
//========================================================
// MEDPACK AND BLEEDING OPTIONS
_medpacks						= 0;				//array no.80 - Whether you want to give the units a limited number of revive kits 0/1 - no/yes
_stabilisation					= 0;				//array no.81 - NOT IMPLEMENTED
_bleeding 						= 1;				//array no.82 - Make units bleed and require bandages
_medic_medpacks 				= 5;				//array no.83 - No of medpacks for units specified in the _medic variables - they are required for reviving units		
_unit_medpacks 					= 3;				//array no.84 - No of medpacks for units specified in the _can_revive variables - they are required for reviving units			
_medic_bandages 				= 5;				//array no.85 - Bandages stop bleeding		
_unit_bandages 					= 3;				//array no.86 - 
_medic_stable					= 0;				//array no.100 - NOT IMPLEMENTED
_unit_stable					= 0;				//array no.101 - NOT IMPLEMENTED
_stabTime_tillDeath				= 0;				//array no.87 - NOT IMPLEMENTED //Time until death following revive without stabilisation
// ==================================================================
// ENEMY SIDE TO PLAYABLE UNITS
_no_enemy_sides 				= 1;				//array no.22 - No of Enemy sides (0, 1 or 2). 
_enemy_side_1 					= "EAST";			//array no.23 - Enemy sides can be "EAST", "WEST", "GUER" etc  
_enemy_side_2 					= "";				//array no.24 
_enemy_side_3 					= "";				//array no.88 - NOT IMPLEMENTED
_enemy_side_4 					= "";				//array no.89 - NOT IMPLEMENTED
// ==================================================================
// FRIENDLY SIDE TO PLAYABLE UNITS
_allied_side_1 					= "WEST";			//array no.42 - Friendly sides can be "EAST", "WEST","RESISTANCE" etc.  
_allied_side_2 					= "WEST";			//array no.43 - If all players are from the same side make sure you set the same side for both variables eg "WEST", "WEST"
_allied_side_3 					= "";				//array no.90 - NOT IMPLEMENTED
_allied_side_4 					= "";				//array no.91 - NOT IMPLEMENTED
// ==================================================================
// UNCONSCIOUS CAMERA OPTIONS
_follow_cam 					= 1;				//array no.5  - option to allow viewing of friendly units while unconscious
_follow_cam_distance			= 250;				//array no.32 - the range that unconscious players can spectate friendly units
_follow_cam_team	   			= 0;				//array no.44 - set to 1 if you wish unconscious players only to spectate players within NORRN_player_units array
_top_view_height 	   			= 70;				//array no.55 - allows you to set the top down camera height 
_visible_timer 					= 1;				//array no.41 - view a cound-down timer while unconscious
_unconscious_music 				= 0;				//array no.46 - music must appear as unc_theme in music.hpp
// ==================================================================
// RESPAWN DIALOG OPTIONS
_nearest_teammate_dialog 		= 0;				//array no.3  - whether a respawn dialog appears when there are no players within this distance  
_all_dead_dialog 				= 0;				//array no.1  - whether a respawn dialog appears when all players are unconscious (_all_dead_player = 1)  
_respawn_button_timer 			= 0;				//array no.25 - Time until respawn button appears (0 = approx. 12 seconds), NB: Set to a high number like 100000 seconds if you do not want
_distance_to_friend 			= 250;				//array no.26 - If the closest friendly unit is further than this distance away trigger respawn dialog 
_all_dead_player 				= 0;				//array no.56
_all_dead_distance 				= 10000;			//array no.57 - whether a respawn dialog appears when all players within a specified distance are unconscious (_all_dead_player = 1)
// ==================================================================
// Bonus life for aiding team mates function
_reward_function 				= 1; 				//array no.96 - specify whether a unit receives bonus lives for reviving other players
_revives_required 				= 1;				//array no.97 - Number of revives required before recieving a bonus life
// ==================================================================
// Team kill function
_team_kill_function 			= 1;    			//array no.98 - specify whether a unit loses a life for killing team mates
_no_team_kills 					= 1;				//array no.99 - Number of teamkills before punishment
// ==================================================================
// CONFIGURABLE OPTIONS FOR HEAL YOURSELF FUNCTION
_heal_yourself 					= 1;				//array no.8  - whether a unit can heal damage to itself
_no_of_heals 					= 1;				//array no.29 - Number of heals that each player gets during a mission  
_lower_bound_heal 				= 0.1;				//array no.30 - The damage level range between which the heal action becomes available 
_upper_bound_heal 				= 0.8;				//array no.31
// ==================================================================
// AI REVIVE BEHAVIOUR OPTIONS
_goto_revive 					= 0;				//array no. 9  - closest AI automatically moves to revive a downed team mate
_AI_smoke 						= 0;				//array no. 40 - if available reviving AI throws smoke on downed AI position
_AI_aware 						= 1;				//array no. 49 - AI will clear an enemy units it is aware of before auto reviving
_AI_cover 						= 1;				//array no. 50 - second AI unit moves with AI reviver to give cover
_AI_dismount 					= 0;				//array no. 58 - toggles ability of reviving AI units to dismount vehicles (1 = dismount)
_call_for_AI_help 				= 1;				//array no. 59 - allows AI units to call for help 
_goto_revive_distance 			= 500;				//array no. 33 - distance AI units will move to revive a downed team mate


// ==================================================================
// OPTIONS FOR PLAYER'S DEAD BODIES AND EQUIPMENT - Additional revive functions with many thanks to alef (0 - off, 1 - on except for _bury_timeout)
_drop_weapons 					= 1; 				//array no.93  - should the respawned player drop his weapons where he died?
_cadaver 						= 0; 				//array no.94 - should the respawned player's body remain there?
_bury_timeout 					= 12;				//array no.95 - if drop weapons OR player body, how long before the body is buried?
												// 0=maximum (1200s) , n=seconds up to 1200s (hard coded)
// ==================================================================
// USER CODE - eg. NORRNCustonexec1="execvm ""myscript.sqf"";hint ""myoutput"";"
NORRNCustomExec1				=""; 				// Exec1 occurs following being revived
NORRNCustomExec2				="";  				// Exec2 occurs when you team kill
NORRNCustomExec3				="";  				// Exec3 occurs when you spawn at base
NORRNCustomExec4				="";  				// Exec4 occurs when you try and spawn at base but it is still occupied
NORRNCustomExec5				="";  				// Must use variables: MAP_r_rejoin (false - first time, 
												// true - rejoining the server, and 
												// MAP_r_no_lives - number of lives if you rejoin server) 
// =====================================================================================================================
// DO NOT MODIFY THE FOLLOWING CODE
// =====================================================================================================================
NORRN_revive_array = [];
NORRN_revive_array = [_mission_end_function,_all_dead_dialog,_JIP_spawn_dialog,_nearest_teammate_dialog,_unconscious_markers,_follow_cam,_call_out_function,_revive_timer,
_heal_yourself,_goto_revive,_unconscious_invincibility,_respawn_at_base_addWeapons,_no_respawn_points,_Base_1,_Base_2,_Base_3,_Base_4,_time_b4_JIP_spawn_dialog,
_can_revive,_can_revive_2,_can_be_revived,_can_be_revived_2,_no_enemy_sides,_enemy_side_1,_enemy_side_2,_respawn_button_timer,_distance_to_friend,
_revive_time_limit,_respawn_position,_no_of_heals,_lower_bound_heal,_upper_bound_heal,_follow_cam_distance,_goto_revive_distance,_respawn_at_base_magazines,
_respawn_at_base_weapons, _Base_free_respawn, _revive_damage, _max_respawns, _unconscious_drag,_AI_smoke,_visible_timer,_allied_side_1,_allied_side_2,_follow_cam_team,
_water_dialog, _unconscious_music, _enemy_units_1, _enemy_units_2, _AI_aware,_AI_cover,_mobile_spawn,_mobile_base_start,_mobile_man,_altUnc_animation,_top_view_height,
_all_dead_player,_all_dead_distance,_AI_dismount,_call_for_AI_help,_mobile_type,_load_wounded,_perpetual_server,_JIP_respawns,_caseVAC,_mediVAC,_chance_ofDeath,_dualTimer,
_respawnAtBaseWait,_objectiveBasedRP,_mobile_base2_start,_mobile_man2,_can_revive_3,_can_revive_4,_can_be_revived_3,_can_be_revived_4,_medic_1,_medic_2,_medic_3,_medic_4,
_medpacks,_stabilisation,_bleeding,_medic_medpacks,_unit_medpacks,_medic_bandages,_unit_bandages,_stabTime_tillDeath,_enemy_side_3,_enemy_side_4,
_allied_side_3,_allied_side_4,_deadSpectator_cam,_drop_weapons,_cadaver,_bury_timeout,_reward_function,_revives_required,_team_kill_function,_no_team_kills,_medic_stable, _unit_stable,
_ACE_mod];

// start related revive functions
[] execVM "revive_sqf\init_related_scripts.sqf";

if (true) exitWith {};	
//Last edited 17/08/09

//if (_name == player) then {[_name] execVM 'revive_sqf\rPrn.sqf'}


Share this post


Link to post
Share on other sites

A couple bugs in this version:

1. Medium

Getting hundreds of these errors: Bad conversion: scalar, due to:

revive_sqf\revive_player.sqf: line 200

_name addEventHandler ["HandleDamage", {_this execVM "revive_sqf\damageEH\handleDamage.sqf"}];

Syntax is wrong. It must return the damage value to the EH. Either change execVM to call compile preprocessfile, then modify the script to return a value or return 0 or "_this select 2" (which is the damage value) at the end, depending on what you want it to do.

_name addEventHandler ["HandleDamage", {_this execVM "revive_sqf\damageEH\handleDamage.sqf"; 0}];

2. Medium

revive_sqf\body_damage.sqf: line 2. EOL has comma instead of semi-colon. It only works, cause you accidently used "exec" on the sqf.

_unit = _this select 0,

3. Medium

revive_sqf\revive_player.sqf: line 306

_name addEventHandler ["dammaged", {_this exec "revive_sqf\COD\body_damage.sqf"}];

should be execVM, not exec.

4. Minor

revive_sqf\onConnect.sqf: line 49. EOL has comma instead of semi-colon.

if (true) exitWith {},

5. Minor

Is it deliberate that when you revive a person, that all nearby people get revived too?

Any chance of fixing the black top/bottom borders in the revive dialog, so there are not gaps everywhere. You should be using safeZone* values not hard-coded literal numbers. So something like:

x = safeZoneX; y = safeZoneY;

w = safeZoneW; h = 0.28*safeZoneH;

x = safeZoneX; y = safeZoneY+0.89*safeZoneH;

w = safeZoneW; h = 0.25*safeZoneH;

pluse the sizeEx statements & other control heights should be scaled by safeZoneH, as in:

sizeEx = 0.04*safeZoneH;

@McSpuds: you've got the following line half way through your init.sqf. Surprised it works at all in SP.

if (true) exitWith {};

Edited by Dr_Eyeball

Share this post


Link to post
Share on other sites

Is the Takastani base class SoldierEB? as in i want to edit this

"// UNITS THAT CAN REVIVE/UNITS THAT CAN BE REVIVED"

_can_revive = "soldierEB";

Share this post


Link to post
Share on other sites

I have been using revive now. Working good, Now if I try to use it with Murklor's respawn scrip that respawns AI off of triggers, the respawn fails to work.

Both scripts work independently, just not together.

Any suggestions?

Murklor's script:

//    File: murk_spawn.sqf
//	Function: To allow for simple trigger based spawning using editor placed units and waypoints.
//		    The script deletes all units when the mission start and the recreate them on command.
//    Parameters: 
//			_this select 0: OBJECT - unit name (this) 
//			_this select 1: OBJECT - trigger name
//			_this select 2: STRING - spawn type ("once","repeated","wave" and "reset")
//			_this select 3 (optional): NUMBER - spawn lives (the amount of time the unit respawns, or wave number)
//			_this select 4 (optional): NUMBER - spawn delay
//			_this select 5 (optional): STRING - init string called for the leader of the group
//			_this select 6 (optional): NUMBER - delay before body removal
//	
//	Usage: 
//		Example trigger: Anybody Once (or whatever you want), onActivation: this setVariable ["murk_spawn",true,true];
//		Unit (leader of group):	nul = [this,triggername,"once"] exec "murk_spawn.sqf"; 
//		init.sqf: triggername setVariable ["murk_spawn",false,false]; 
//
// V5
// - Change: Removed group and function scripts, everything done in a single file
// - Change: Spawn trigger variable is now a setVariable of the trigger instead of a global variable
// - Add: Option to enable removal of dead units, eventhandler attached to everyone spawning
// - Fix: Should now work in multiplayer on a dedicated server (only tested on a local dedicated/join setup however)
// - Fix: Performance issues with helos from V4 resolved, was a mistake on the example mission and not the script
// - Fix: Some minor bugs with the optional parameters
// - Fix: Now properly support crews in turrets-on-turrets (had to bring in some BIS made functions)
// V4
// - Change: No longer requires the BIS functions module
// - Add (again): Like V2, it saves the weapons and magazines and restore them
// - Fix: squad leader init is now fired after the creation of the entire group, can manipulate squad members with init
// - Change: Removed the external paradrop script, its down with a [] spawn in the waypoint. Just trying out different things :)
// V3
// - See older versions

// This script is serverside
if(!isServer) exitWith {};

// -------------------  Init  ----------------------- //
_bodyRemovalTime = 400;
_bodyRemoval = false;
_spawnLives = 1;
_spawnDelay = 0.1;
_waitingPeriod = 10; // Change this for the default waiting period
_resetPeriod = 20; // Change this for the reset mode paus
_initString = "";
_countThis = count _this;

// ----------------  Parameters  -------------------- //
_unit = _this select 0;
_trigger = _this select 1;
_spawntype = _this select 2;
if (_countThis >= 4) then { _spawnlives = _this select 3; }; // Optional
if (_countThis >= 5) then { _spawndelay = _this select 4; }; // Optional
if (_countThis >= 6) then { _initString = _this select 5; }; // Optional
if (_countThis >= 7) then { _bodyRemovalTime = _this select 6; _bodyRemoval = true; }; // Optional

// --  Delete the unit (this is always done ASAP)  -- //

// Check if its a vehicle
_vehicle = false;
if (_unit isKindOf "LandVehicle" OR _unit isKindOf "Air") then { _vehicle = true; };

// Unit information arrays
_unitPosArray = [];
_unitTypeArray = [];
_unitSkillArray = [];
_unitNameArray = [];
_unitRankArray = [];
_unitMagArray = [];
_unitWeaponArray = [];
_unitCrew = [];
_unitsInGroupAdd = [];
_unitGroup = group _unit;
_unitsInGroup = units _unitGroup;
_unitOrigDir = getDir _unit;

// Save the vehicle types, positions and skills for the group
if (_vehicle) then { 
{
	_vcl = vehicle _x;
	if (!(_vcl in _unitsInGroupAdd) AND (typeOf _vcl != "")) then {
		_crew = crew _vcl;
		_unitCrewTemp = [];
		{ _unitCrewTemp = _unitCrewTemp + [typeOf _x]; } forEach _crew;
		_unitCrew = _unitCrew + [_unitCrewTemp];
		_unitTypeArray = _unitTypeArray + [typeOf _vcl]; 
		_unitPosArray = _unitPosArray + [getPos _vcl];
		_unitSkillArray = _unitSkillArray + [skill _vcl];
		_unitNameArray = _unitNameArray + [vehiclevarName _vcl];
		_unitRankArray = _unitRankArray + [rank _vcl];
		_unitsInGroupAdd = _unitsInGroupAdd + [_vcl];
		_unitMagArray = _unitMagArray + [magazines _vcl];
		_unitWeaponArray = _unitWeaponArray + [weapons _vcl];
		{ // Delete the crew and vehicle
			deleteVehicle _x;
		} forEach _crew;
		deleteVehicle _vcl;
	};
	sleep 0.01; // Need this or it all f**k up
} forEach _unitsInGroup;
}
// Save the infantry types, etc
else { 
{
	_unitTypeArray = _unitTypeArray + [typeOf _x]; 
	_unitPosArray = _unitPosArray + [getPos _x];
	_unitSkillArray = _unitSkillArray + [skill _x];
	_unitNameArray = _unitNameArray + [vehiclevarName _x];
	_unitRankArray = _unitRankArray + [rank _x];
	_unitMagArray = _unitMagArray + [magazines _x];
	_unitWeaponArray = _unitWeaponArray + [weapons _x];
	deleteVehicle _x;
	sleep 0.01; // Same as with vehicles
} forEach _unitsInGroup;
};

// -----------------  Functions  -------------------- //

// *WARNING* BIS FUNCTION RIPOFF - Taken from fn_returnConfigEntry as its needed for turrets and shortened a bit
_fnc_returnConfigEntry = {
private ["_config", "_entryName","_entry", "_value"];
_config = _this select 0;
_entryName = _this select 1;
_entry = _config >> _entryName;

//If the entry is not found and we are not yet at the config root, explore the class' parent.
if (((configName (_config >> _entryName)) == "") && (!((configName _config) in ["CfgVehicles", "CfgWeapons", ""]))) then {
	[inheritsFrom _config, _entryName] call _fnc_returnConfigEntry;
}
else { if (isNumber _entry) then { _value = getNumber _entry; } else { if (isText _entry) then { _value = getText _entry; }; }; };
//Make sure returning 'nil' works.
if (isNil "_value") exitWith {nil};
_value;
};

// *WARNING* BIS FUNCTION RIPOFF - Taken from fn_fnc_returnVehicleTurrets and shortened a bit
_fnc_returnVehicleTurrets = {
private ["_entry","_turrets", "_turretIndex"];
_entry = _this select 0;
_turrets = [];
_turretIndex = 0;

//Explore all turrets and sub-turrets recursively.
for "_i" from 0 to ((count _entry) - 1) do {
	private ["_subEntry"];
	_subEntry = _entry select _i;

	if (isClass _subEntry) then {
		private ["_hasGunner"];
		_hasGunner = [_subEntry, "hasGunner"] call _fnc_returnConfigEntry;
		//Make sure the entry was found.
		if (!(isNil "_hasGunner")) then {
			if (_hasGunner == 1) then {
				_turrets = _turrets + [_turretIndex];		
				//Include sub-turrets, if present.
				if (isClass (_subEntry >> "Turrets")) then { _turrets = _turrets + [[_subEntry >> "Turrets"] call _fnc_returnVehicleTurrets]; } 
				else { _turrets = _turrets + [[]]; };
			};
		};
		_turretIndex = _turretIndex + 1;
	};
};
_turrets;
};

// Eventhandler for removal of dead units
_fnc_removeBodyEH = { 
(_this select 0) addEventHandler ["killed", {
	[_this select 0] spawn { 
		_unit = _this select 0;
		_origPos = getPos _unit;
		_z = _origPos select 2;
		_desiredPosZ = (_origPos select 2) - 3;
		if (_unit iskindOf "Man") then { _desiredPosZ = (_origPos select 2) - 0.6; }; // Dont need to sink so far if its infantry
		_sleep = _unit getVariable "murk_bodyremovaltime";
		sleep _sleep; 
		if ( vehicle _unit == _unit) then {
			_unit enableSimulation false;
			while { _z > _desiredPosZ } do { 
				_z = _z - 0.01;
				_unit setPos [_origPos select 0, _origPos select 1, _z];
				sleep 0.1;
			};
		};
		deleteVehicle _unit; 
	};
} ]; };

// This is spawned as an independant function if wave or reset mode is used
_fnc_deleteGroup = {

_group = _this select 0;
_unitsGroup = units _group; 
while { ({alive _x} count _unitsGroup) > 0 } do { sleep 5; };
deleteGroup _group;
};

// This function spawns/respawns the unit
_fnc_spawnUnit = {

// We need to pass the old group so we can copy waypoints from it, the rest we already know
_oldGroup = _this select 0;

_newGroup = createGroup (side _oldGroup);
_newGroup copyWaypoints _oldGroup;

// Since "wave" and "reset" mode may still have the old unit alive, we cannot delete their group directly
if (_spawnType == "once" OR _spawnType == "repeated") then { deleteGroup _oldGroup; }
else { [_oldGroup] spawn _fnc_deleteGroup; };

if (_vehicle) then {

	for [{ _loop = 0 },{ _loop < count _unitTypeArray},{ _loop = _loop + 1}] do {
		_spawnUnit = Object;
		if ((_unitPosArray select _loop) select 2 >= 10) then { 
			_spawnUnit = createVehicle [(_unitTypeArray select _loop),(_unitPosArray select _loop), [], 0, "FLY"]; 

			//Set a good velocity in the correct direction (taken from BIS functions)
			_spawnUnit setVelocity [50 * (sin _unitOrigDir), 50 * (cos _unitOrigDir), 0];
		}
		else { _spawnUnit = (_unitTypeArray select _loop) createVehicle (_unitPosArray select _loop); }; 
		_spawnUnit setDir _unitOrigdir;
		_seatLoop = 0;

		// Need a little sleep or units may spawn on top of the vehicle
		sleep 0.1;

      	_crew = [];

      	// Create the entire crew
      	{ _unit = _newGroup createUnit [_x,(_unitPosArray select _loop), [], 0, "NONE"]; _crew = _crew + [_unit]; } forEach (_unitCrew select _loop);

      	// We assume that all vehicles have a driver, the first one of the crew
      	(_crew select 0) moveInDriver _spawnUnit; _currentCrewMember = 1;

    	      	// Count the turrets	      	
      	_entry = configFile >> "CfgVehicles" >> (_unitTypeArray select _loop);
      	_turrets = [_entry >> "turrets"] call _fnc_returnVehicleTurrets;

      	// Move the rest of the crew into turrets
      	_funcMoveInTurrets = {	
      		private ["_turrets","_path","_i"];
			_turrets = _this select 0;
			_path = _this select 1;
      		_i = 0;

      		while {_i < (count _turrets)} do { 
      			_turretIndex = _turrets select _i;
				_thisTurret = _path + [_turretIndex];
				//Move unit into turret, if empty.
				if (isNull (_spawnUnit turretUnit _thisTurret)) then { 
					(_crew select _currentCrewMember) moveInTurret [_spawnUnit, _thisTurret]; _currentCrewMember = _currentCrewMember + 1;
				};
				//Spawn units into subturrets.
				[_turrets select (_i + 1), _thisTurret] call _funcMoveInTurrets;
				_i = _i + 2;
			};
		};

		[_turrets, []] call _funcMoveInTurrets;

	     	_newGroup addVehicle _spawnUnit;

		_spawnUnit setSkill (_unitSkillArray select _loop);
		_spawnUnit setUnitRank (_unitRankArray select _loop);

		// Set the unit name
		if (_spawntype == "once" OR _spawntype == "repeated") then { 
			_spawnUnit setVehicleVarName (_unitNameArray select _loop);
			if (vehiclevarname _spawnUnit != "") then { _spawnUnit setVehicleInit format["%1=this;",_unitNameArray select _loop]; processInitCommands; };
		};

		// Add dead body removal eventhandler
		if (_bodyRemoval) then { 
			_spawnUnit setVariable ["murk_bodyRemovalTime", _bodyRemovalTime, false]; nul = [_spawnUnit] call _fnc_removeBodyEH;
			{ _x setVariable ["murk_bodyRemovalTime", _bodyRemovalTime, false]; nul = [_x] call _fnc_removeBodyEH; } forEach _crew;
		};
	};
}
else {	
	for [{ _loop = 0 },{ _loop < count _unitTypeArray},{ _loop = _loop + 1}] do {
		(_unitTypeArray select _loop) createUnit [_unitPosArray select _loop,_newGroup];

		_unitsGroup = units _newGroup;
		_spawnUnit = (_unitsGroup select _loop); // We know that the current unit being worked on is the latest unit added to the group
		if (_spawnUnit == leader _newGroup) then { _spawnUnit setDir _unitOrigDir };
		_spawnUnit setSkill (_unitSkillArray select _loop);
		_spawnUnit setRank (_unitRankArray select _loop);
		removeAllWeapons _spawnUnit;
		{_spawnUnit removeMagazine _x} forEach magazines _spawnUnit;
		removeAllItems _spawnUnit;
		{_spawnUnit addMagazine _x} forEach (_unitMagArray select _loop);
		{_spawnUnit addWeapon _x} forEach (_unitWeaponArray select _loop);
		_spawnUnit selectWeapon (primaryWeapon _spawnUnit);
		sleep 0.1;

		// Set the unit name
		if (_spawntype == "once" OR _spawntype == "repeated") then { 
			_spawnUnit setVehicleVarName (_unitNameArray select _loop);
			if (vehiclevarname _spawnUnit != "") then { _spawnUnit setVehicleInit format["%1=this;",_unitNameArray select _loop]; processInitCommands; };
		};

		// Add dead body removal eventhandler
		if (_bodyRemoval) then { _spawnUnit setVariable ["murk_bodyRemovalTime", _bodyRemovalTime, false]; nul = [_spawnUnit] call _fnc_removeBodyEH; };
	};
};

// setting the leaders init
(vehicle (leader _newGroup)) setVehicleInit _initString; processInitCommands;

// Have to return the new group
_newGroup;
}; 

// --------------  Waiting period  ------------------ //
while { !(_trigger getVariable "murk_spawn") } do { sleep _waitingPeriod; };

// ---------------  Spawn Modes  ------------------- //
// REPEAT MODE, ie basic respawn based on lives
if (_spawntype == "repeated") then {
while { _spawnlives > 0 } do {
	_unitGroup = [_unitGroup] call _fnc_spawnUnit;
	_spawnLives = _spawnLives - 1;
	_unitsGroup = units _unitGroup;	
	while { ({alive _x} count _unitsGroup) > 0 } do { sleep 2; };
	sleep _spawndelay;
};
};

// WAVE MODE, this is fairly simple, just sleep a while then respawn. Spawnlives in this case is number of waves
if (_spawntype == "wave") then {
while { _spawnlives > 0 } do {
	_unitGroup = [_unitGroup] call _fnc_spawnUnit;
	_spawnLives = _spawnLives - 1;
	sleep _spawndelay;
};
};

// RESET MODE, sleep a while then set the variable to false (even if you set it like 50 times over). Spawn lives is used to tick how many times its possible to reset.
if (_spawntype == "reset") then {
while { _spawnlives > 0 } do {
	_unitGroup = [_unitGroup] call _fnc_spawnUnit;
	_spawnLives = _spawnLives - 1;
	sleep _resetPeriod;
	_trigger setVariable ["murk_spawn",false,false];
	while { !(_trigger getVariable "murk_spawn") } do { sleep _waitingPeriod; };
};
};

// ONCE MODE
if (_spawntype == "once") then { _unitGroup = [_unitGroup] call _fnc_spawnUnit; };

Share this post


Link to post
Share on other sites

hello norrin, im using your script for a mission in a vietnam mod and i would like to disable the ammocrate wich gets spawned with the mobile spawn but i couldnt find an entry, can you give me a hint how to disable the spawnng ammocrate?

Share this post


Link to post
Share on other sites

the reive doesnt work for me AGAIN always respawn at respawn_west can you make a version that work alwys not only with BETA.

do i have to put in ervery soldier like s1 s2 etc?

Edited by Konrad1

Share this post


Link to post
Share on other sites

Hello,

Your SCRIPT for revive respawn... just i search has change activation of script that is just for group player (AI). I wants remove its ???

In my map i have 9 players none group and for the script it must a group

Share this post


Link to post
Share on other sites
the reive doesnt work for me AGAIN always respawn at respawn_west can you make a version that work alwys not only with BETA.

do i have to put in ervery soldier like s1 s2 etc?

You have to specify all playable units. If you follow the readme closely you should be fine.

@j4ck3ss: erm....not sure what you want. I don't think you have to group the playable units for it to work if that's what you mean..

Share this post


Link to post
Share on other sites
the reive doesnt work for me AGAIN always respawn at respawn_west can you make a version that work alwys not only with BETA.

do i have to put in ervery soldier like s1 s2 etc?

Even though you can use stuff like playableUnits in revive_init.sqf you still have to name your units in the editor. It doesn't matter what just use s1 or s1_1 or something. That did it for me. Check my post on page 66.

Share this post


Link to post
Share on other sites

I would like the script works without grouping

Even though you can use stuff like playableUnits in revive_init.sqf you still have to name your units in the editor. It doesn't matter what just use s1 or s1_1 or something. That did it for me. Check my post on page 66.

everything works I just want to use without grouping

Share this post


Link to post
Share on other sites

Actually my post was mostly to konrad1.

I don't know that the problem is you are having. I have some missions with 3 groups, 2 of size 7 and 1 og size 1 (one unit) and no problems here.

Share this post


Link to post
Share on other sites

I have 9 players and group none and I want the script works on everyone the revive

i passed ~ 5 hours for change test

In grouping this is ok, i use not of group in my version

Share this post


Link to post
Share on other sites

Anyone know if there is an option for an ammo cache with the mobile_man option?

I know the mobile vehicle has one, but my mission is working off the SL being able to deploy the mobile spawn point. Ammo cache would also be a custom loaded one.

Share this post


Link to post
Share on other sites

Made a little fix on the interface, now I think it should work fine with all interface sizes.

Before (with very small interface size):

f8fb73c7-46a4-4770-90a5-8f31ba6aeb28.jpg

After (still with very small interface size):

fb26d8e6-3fdc-42db-a640-b99a1e2b1386.jpg

If you are interrested, just replace all the files into your "\revive_sqf\dialogs\" folder by the files in this archive:

http://94.23.41.117/arma/scripts/dialogs.zip

Edited by Le_CuLtO

Share this post


Link to post
Share on other sites

just wondering how i get a 'medic only' revive?

i thought i tweaked the script properly but didn't work as intended so i switched back to everyone being able to revive which is not what i want really.

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

×