Jump to content
Sign in to follow this  
norrin

Revive Script

Recommended Posts

It was the ACE Special Forces Medic I was using for actual "Revive" function, and some of the Special Forces that had basic "Heal" function.

ACE_SF_FR_Corpsman - Medic

and because my Sniper team had to be self sufficient in a PvP I made the Marksman a Medic too

ACE_SF_FR_Marksman - Marksman

I couldn't place what the problem was, but when I revert back to the BIS USMC Medics and replaced the ACE classnames with BIS, it works fine.

Switch it to ACE or other modpacks it seems to not want to use the functions properly. Could be something daft my end, but if it works BIS I made the assumption that its to do with ACE classnames.

Share this post


Link to post
Share on other sites

I am at work so I can't test for myself but looking at the ACE class list wiki: (http://browser.dev-heaven.net/classlists/vehicles) and then by clicking on the ACE_SF_FR_Corpsman entry (http://browser.dev-heaven.net/configclasses/show/12807) it says that the ACE unit inherits from (ie. is a subclass of) FR_Corpsman so it may be worth while trying "FR_Corpsman" for the ACE unit.

Similarly, the ACE_SF_FR_Marksman inherits from the FR_Marksman class so maybe try "FR_Marksman" as well.

Share this post


Link to post
Share on other sites

I have no doubt that would work, it explains why it wasn't noticing the classnames. Much thanks Norrin!

Share this post


Link to post
Share on other sites

Hi norrin.

Is there a way to make it possible to drag / carry people without the one who carries having a gun?

I made some tests and had the following results:

When I (as player) am completely unarmed and choose to drag an injured person, the injured one is normally attached to me after the normal lifting animation but I can't move. I can turn around (and with me the attached injured) but I can't move at all.

Then when I choose to carry the injured unit, my unit plays the lifting up to shoulder animation normally but again, movement is not possible.

However when I have a pistol (no rifle) and choose to drag the injured, the moving stangely works. But you have to press "Drag body" option twice because of some weird gun changing animations... After that the dragging process works normally.

Changing to "Carry Person" and moving around works fine having the pistol in the gear.

Something that may hopefully help you in finding the bug is that even though there is no gun visible while dragging or carrying (your hands are empty), the pistol is yes armed. That means that if you click to shoot, a shot will come out of your empty hand and you also see your finger pressing the gun trigger.

Is there a way to solve this?

Maybe adding something like a invisible gun to the unarmed when he chooses to drag? No idea...

Thanks for your help!

Edited by Undeceived

Share this post


Link to post
Share on other sites

Without having looked into the latest version...

Is it possible to give a player points for reviving? (for the scoreboard).

I know it would be an easy task to implement myself, but do you have any pointers to a good place to add it to the revive scripts?

Share this post


Link to post
Share on other sites

I believe it has a line where scripts are executed upon certain events, perhaps throw the code in there. (In the revive_init.sqf)

Share this post


Link to post
Share on other sites

@Tophe - if you scroll down the revive_init.sqf you'll find a line that looks like this:

NORRNCustomExec1 =""; 	// Exec1 occurs following being revived

Any code you put in here will run the moment a unit is revived. The variable that identifies the unit that is doing the reviving is _reviver

@Undecieved - Sorry its taken me so long to get back to you about this. I've taken a quick look and what you describe is definitely happening, however I'm not sure if its a limitation of the animations that I'm using and therefore I'm not sure if there's much I can do about it. I'll try to take a closer look but no promises on when that will be.

Share this post


Link to post
Share on other sites

Thank you Norrin. I solved with an earlier post from you about the same problem.

Share this post


Link to post
Share on other sites

Hi Norrin!

In two different missions, I changed the "class" of playable units by editing the mission SQM, so I can have resistance guys dressed like US marines or russian spetsnaz (in the second mission).

Everything works fine with the revive script except one:

After their first death and revive, players use the language of the "class" unit, so it turns from chernarussian to english or russian (in the second mission), and it's not the case with AI units.

I had a look at the scripts, found something about "typeof", but couldn't find how to solve that problem...

is there a way that players keep speaking chernarussian?

Share this post


Link to post
Share on other sites

Hey guys I've been having this issue for a while now, I'm making a mission for Invasion 1944 for ARMA2 and as we are currently unreleased I can't really release a version for people to check through just yet.

But anyway I know the revive script DID work in the past, but for some reason recently as my mission has become more complex the revive is bugging more and more.

When a player dies for the 2nd or 3rd time the revive script delays in kicking in, often leaving the player on a black screen, or instantly revived on the spot, other times the respawn at a location button doesn't load.

I've had it working in the past but now I just can't seem to resolve this problem or find an older working version to work from. The only partial solution I've found so far is to change the respawn to Instant to prevent the player respawning at the Respawn_West marker with the default loadout, but I am still stuck with the other problems.

The mission obviously uses custom units so this could be a root cause but as I've said it used to work fine but now seems more unstable than ever.

Any help from people with a similar problem would be greatly appreciated!

Share this post


Link to post
Share on other sites

@fleepee - that's an interesting question and one I've never thought about before. Its most likely a hard coded function of the game rather than a problem in the revive.

You probably need a command like setSide that works for units (unfortunately the current one doesn't). Maybe if you make your revived unit join a group that is side "GUER" it would work.

The only other thing I can think of for the time being (and its not a very practical suggestion) would be to create a replacement config, and hence a pbo, for the US units in which you designate they speak Cherno.

If I can think of anything else I'll let you know.

@PacUK - Very hard to say without seeing the mission mate. One thing though are you using the latest beta patch? If you are maybe try again with the 1.05 release as there is talk that the betas change the way scripts are processed - if this is the case then I might have to make a couple of changes to the revive i.e. replace all the "waitUntil"s with "while" statements.

Share this post


Link to post
Share on other sites

Thanks for your response.

Some more infos:

in the description file, I have the speaker voice set:

class Igor

{

name="Igor";

face="face01";

glasses="None";

speaker="Male01CZ";

pitch=0.95;

};

and a "setidentity" in each init line of my units.

In an hosted game, starting language is chernarussian then turns to the one of the unit's class after death/revive. (english or russian, dependding of the mission I edited)

On a dedicated server, starting language is the one of the unit's class... (english or russian)

I tried different things, like adding "[_name] joinsilent revive_dummy" code in the NORRNCustomExec1, adding a high rank guer unit in the group with a probability of presence of 0, etc...

it didn't work, and I don't want to create a specific addon to solve the "problem" as I want these missions to be addon free.

I just want them to be logical, and that units keep speaking their native language.;)

By the way, I recorded the game chernarussian calls when they have to be revived and replaced the sounds of the revive sound folder, keeping the same file names to not edit the call script.

It wasn't logical that chernarussians call for help in english!

the same could be done with russian voices, and perhaps you could add a switch side condition in the call script and side sound folders?:D

Edited by fleepee

Share this post


Link to post
Share on other sites

@PacUK - Very hard to say without seeing the mission mate. One thing though are you using the latest beta patch? If you are maybe try again with the 1.05 release as there is talk that the betas change the way scripts are processed - if this is the case then I might have to make a couple of changes to the revive i.e. replace all the "waitUntil"s with "while" statements.

Hey norrin.

Could you please direct me to that talk i haven't seen it, i hope that ain't right.

Thanks.

Share this post


Link to post
Share on other sites

@fleepee, mate you've just answered your own question. :) You can use just setIdentity once the player is revived so that it will speak in the language of choice. You can get each playable unit to run a looping script or add a "killed" EH to reset the identity once the unit respawns.

Now the voices with the unconscious call outs is an entirely different problem. I'm not sure whether its changed but you could not call voice bytes from the CA folder via a script - only from within the mission folder. Originally I wanted to have individualised voices for each of the units based on their in mission voice so Dan, Brian etc for each side, however because of this sound limitation if I was to do this the revive script would be several MB in size and its already too big. The only way around this is for you to find the appropriate sound bytes for the cherno forces and swap the samples for the ones already there. Other than that you'd need an addon to be loaded with the revive so these sound bytes could be added for each team or have the revive as an addon (something I've never really wanted to do).

@JW - I read it somewhere I think Xeno, Rommel and Sickboy were posting about it in the beta patch threads - blow can't find it now. If you know any of those guys you might want to track them down as it was an issue with some of the ACE code.

I think the problem is something like any condition linked to the waitUntil command is checked too quickly by the game engine and with the new scripting limitations it causes lag in the other scripts running concurrently especially if it takes several seconds or even longer to fulfill this condition (I may have over simplified or have this completely wrong).

The idea is to use something like

while {condition} do {sleep 0.1};

or even a longer sleep instead as this drastically reduces the speed at which the condition is checked and it frees up resources to process the concurrently running scripts.

Share this post


Link to post
Share on other sites
The only way around this is for you to find the appropriate sound bytes for the cherno forces and swap the samples for the ones already there.

That's what I did for my missions (all in resistance side), but perhaps I wasn't clear enough in my previous post, it works fine!:p

thanks for the EH idea, I didn't think about it...:bounce3:

EDIT:

I added: "this addEventHandler ["killed",{_this setidentity "Igor";}] in the init line of the leader, but it doesn't change anything.

There's allready the setidentity in its init file, and on a dedicated server, he speaks russian at mission start...

Edited by fleepee

Share this post


Link to post
Share on other sites

Try this:

this addEventHandler ["killed",{_this execVm "setIdentity.sqf"}];

Then in the mission directory create a script called setIdentity.sqf and in it put:

_unit = _this select 0;

while {!alive player} do {sleep 0.1};
sleep 1;
player setidentity "Igor";

Note this is untested but it should work for players.

EDIT:

Just had a thought this should work for both players and playable AI

//setIdentity.sqf
_unit = _this select 0;

while {!alive (call compile format["%1",_unit])} do {sleep 0.1};
_name = call compile format["%1",_unit];
_name setidentity "Igor";

Edited by norrin

Share this post


Link to post
Share on other sites

sorry, it doesn't work...:rolleyes:

And as I wish that all ten units of the squads keep their face and voice, i tried this (with your suggestion before you edited it):

_unit = _this select 0;

switch (_unit) do {

case alpha1: {while {!alive _unit} do {sleep 0.1};

sleep 1;

_unit setidentity "Igor";

};

case alpha2: {while {!alive _unit} do {sleep 0.1};

sleep 1;

_unit setidentity "Vilem";

};

};

And so on to alpha10.

With your last suggestion, I had an error message:

'|#|<NULL-OBJECT>'

Error invalid number in expression

But as I said, on a dedicated server, the unit I play speaks DIRECTLY in russian, so finally, I don't think it's due to the revive scripts, perhaps simply the game doesn't allow (in exemple) russian class units to speak another language than russian. It works on a hosted game, and stops after the first death and revive...:confused:

EDIT: Just to be sure, I moved the "setidentity" line to init.sqf and created a radio trigger with "alpha1 setidentity "Igor";" in its activation field

on a dedi: alpha1 speaks chernarussian from the beginning and after death/revive, if I use the radio trigger and its setidentity command...

Conclusion and last edit:

"setidentity" mustn't be in the init line of units;

got it working using

NORRNCustomExec1 ="[_name] execVm 'setIdentity.sqf'";

NORRNCustomExec3 ="[_name] execVm 'setIdentity.sqf'";

and setIdentity.sqf:

_unit = _this select 0;

switch (_unit) do {

case alpha1: {_unit setidentity "Igor";};

case alpha2: {_unit setidentity "Vilem";};

etc...

};

thanks for your time, Norrin!!:pray:

Edited by fleepee
problem solved

Share this post


Link to post
Share on other sites

@JW - I read it somewhere I think Xeno, Rommel and Sickboy were posting about it in the beta patch threads - blow can't find it now. If you know any of those guys you might want to track them down as it was an issue with some of the ACE code.

There was a problem with script lag which has been solved in the newer beta patches(well almost, they are still running slower than in 1.05), maybe thats what your are talking about?

Share this post


Link to post
Share on other sites

I'm currently using ARMA2 version 1.05.62017 as far as I know I'm not using any of the beta patches just the standard update. I'll download the beta and see if I get different results.

Update: tried it with the latest beta patch (70951) and it doesn't appear to have the issue, I'll keep testing but looks like a win, thanks all!

Update 2: Well after a while the issue does come back into effect but only after a good hour or two's play, guess this will do for now though thanks again!

Edited by PacUK

Share this post


Link to post
Share on other sites

@fleepee - glad to hear you got it working :)

@PacUK - check your ArmA report and make sure that the units aren't generating a lot of errors as this can also cause script lag.

Share this post


Link to post
Share on other sites

@Undecieved - Sorry its taken me so long to get back to you about this. I've taken a quick look and what you describe is definitely happening, however I'm not sure if its a limitation of the animations that I'm using and therefore I'm not sure if there's much I can do about it. I'll try to take a closer look but no promises on when that will be.

Thanks, norrin, for your answer!

Yeah, would be cool if there was a workaround, because if not then the script would be quite useless for civilians without rifles.

If the solution with the animations doesn't work, maybe a "dirty" workaround could be to make and give the civilian an invisible rifle, so that he has something in his hands and does the animation, but only the player can't see it. :)

Thanks anyway, mate!

Share this post


Link to post
Share on other sites

Hi Norrin!

I have another question: How can I add a respawn point during the mission?

Share this post


Link to post
Share on other sites

I have a strange problem with this.

if i use this description file

class Header

{

gameType = Coop;

minPlayers = 1;

maxPlayers = 10;

};

// 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"

///////////////////////////////////////////////////////////////////////////////////////////

titleParam1 = "Time";

valuesParam1[] = {-6, 0, 8, 13};

defValueParam1 = 0;

textsParam1[] = {"Morning", "Clear day", "Sundown", "Night"};

///////////////////////////////////////////////////////////////////////////////////////////

titleParam2 = "Number of Revives:";

valuesParam2[] = {2000,1000,20,10,7,5};

defValueParam2 = 7;

textsParam2[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7 - Hard","5 - Extreme"};

///////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////

titleParam1 = "Time";

valuesParam1[] = {-6, 0, 8, 13};

defValueParam1 = 0;

textsParam1[] = {"Morning", "Clear day", "Sundown", "Night"};

///////////////////////////////////////////////////////////////////////////////////////////

titleParam2 = "Number of Revives:";

valuesParam2[] = {2000,1000,20,10,7,5};

defValueParam2 = 7;

textsParam2[] = {"No Revive","Infinite - Cadet","20 - Easy ","10 - Normal","7 - Hard","5 - Extreme"};

When i respawn the enemy does not shoot at me :confused:

Have i misread something?

all enemy using Jw Custom USPS script.

Edited by kdjac

Share this post


Link to post
Share on other sites

Is this compatible with Operation Arrowhead? Could we get an example mission on that?

Share this post


Link to post
Share on other sites
;1664981']Is this compatible with Operation Arrowhead? Could we get an example mission on that?

< Cant wait. Tried to see how the Domination worked with the new ruck thing. Was a bit over my head though

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×