Jump to content

Recommended Posts

2 minutes ago, pierremgi said:

But I can't help without your code. You can PM it.

 

I'm only using your code from the first post.

 

Here I created new mission where your script is and you can download that

Share this post


Link to post
Share on other sites

OK, you're in the case you didn't add any parameter in description.ext and any parameter calling the function. This fails. So, I must rethink the default parameters SP/MP.

You can use the "normal" syntax, like:

 

[30,60,true,0,false,1,west] call MGI_fn_Revive; 

As said before: west or playableUnits + switchableUnits, or even group player (as far as player is defined: add waitUntil {!isnull player}; before this line)

 

I'll issue a workable not at all parameter soon.

Thanks for report.

 

Share this post


Link to post
Share on other sites

@pierremgi I had parameters in description.ext in the other mission (Which I posted) but then I created the new mission (rev.VR) without parameters that I uploaded. (I did set the respawn/revive things in 3den for the new test mission (rev.VR)).

 

Now I put the code you just gave to the init.sqf:

 

waitUntil {!isnull player}; 

[30,60,true,0,false,1,west] call MGI_fn_Revive;

 

But I get this error:

 

20:51:04 Error in expression <elect {(side _x == _side or group _x == hubert) && isnil {_x getVariable "passed>
20:51:04   Error position: <hubert) && isnil {_x getVariable "passed>
20:51:04   Error Undefined variable in expression: hubert

 

Share this post


Link to post
Share on other sites

Your uploaded mission (without any change) fails for another reasons:  there is only one playable unit , then you asked for playableUnits+ switchableUnits as bros >> you are the only bro!

waitUntil {!isnull player};   // not needed if you don't refer to the variable player

[20,120,true,0,false,1,units player,true] call MGI_fn_Revive

 

and Yep, that's my problem. Hubert is defined in all my mission but can't be used in default parameter.

 

 

 

I will not reply till fixing this issue (soon).

 

 

Share this post


Link to post
Share on other sites
6 minutes ago, pierremgi said:

playableUnits+ switchableUnits as bros >> you are the only bro!

 

I was referring to the AIs.

 

But anyway, thanks for looking into it :)

Share this post


Link to post
Share on other sites

Updated. See comments on bros. There are so much cases... So, have a sharp attention for how it works. Thanks.

Share this post


Link to post
Share on other sites

Hi @pierremgi I copied the new code to init.sqf and parameters to description.ext but the medics still won't help me. Did I forget something?

 

Share this post


Link to post
Share on other sites
3 hours ago, gc8 said:

Hi @pierremgi I copied the new code to init.sqf and parameters to description.ext but the medics still won't help me. Did I forget something?

 

Probably. If your medic is not a bro, it's a simple Arma's AI.

So, if i'm right, and I refer to your mission I uploaded, here the medic is not a playable unit and your own parameter refers also to playable units. He can't be bro.

Share this post


Link to post
Share on other sites
13 minutes ago, pierremgi said:

Probably. If your medic is not a bro, it's a simple Arma's AI.

So, if i'm right, and I refer to your mission I uploaded, here the medic is not a playable unit and your own parameter refers also to playable units. He can't be bro.

 

Hmm I made the medics playable and set the parameter "Who are bros?" to WEST

 

And this is the last line I have in init.sqf according to your example:

 

[20,120,true,0,false,1,west,true] call MGI_fn_Revive;

 

Share this post


Link to post
Share on other sites

This line will work in SP.

In MP, all parameters but west will override the params classes in description.ext, if you let the bros class. If bros class is deleted, west will override also the bros (default set to playableUnits). If you don't want to override some parameters and make them useful from lobby, replace them by nil. See all notes in front page.

There is no reason to fail. I can spawn units who becomes bros according to the parameters. So, Try to upload (Vanilla please) your broken scenario.

 

Share this post


Link to post
Share on other sites

For me that works as intended, but I guess you'd like to be healed even if wounded, not unconscious. This is not the aim of this script because Arma's engine does that already... sometimes when the situation is clear.

I tested your scenario:

- in SP, with 2 grenades, it's difficult to reach the unconscious state (that's my bad, you need to place some grenades in a player backpack, or add enemies and make medics invincible for test);

- in MP, your grenades are far more efficient and, on the contrary, you die straight and respawn straight as you set to 0 the respawn time (don't do that).

The unconscious state is, here also, very hard to reach. Add a vest, play with grenades or enemies.

 

To recap:

- healing starts with unconscious state while playing.   (From debug console, setunconscious will lead to repetitive healing actions till respawn. Not a totally accurate test)

- In SP, unconscious state is not Arma's engine. So scripted. Works fine in game.  The Arma's damage/hitPart behaviors for bullets/grenades/explosives is not on my side.

- In MP, I tried to keep the same wound result for players (so the wounds should have the same consequences as for Arma's engine). That's a pain in the b.... I can't manage the EH handleDamage without impacting the way the units fall into unconsciousness or die. But while in game, that's rather good.

 

I guess there is no perfect script (at my level), to make things realistic while "always healing, never dying" situations. You have to accept some "die and respawn", even if you feel some units could help.

Still looking for a full transparent handleDamage for players (no impact at all on result but able to pass a variable for the script). Any help appreciated.

 

 

Share this post


Link to post
Share on other sites

@pierremgi The only way I tested was by executing this in console:  player setDamage 0.9;

That made me incapacitated

And the meds didn't help...

Share this post


Link to post
Share on other sites

That's normal. You need to fire the handleDamage EH for the script. Play normally. As I said, the debug console is not ideal for tests when you need to fire some EH like this one. Applying a simple damage doesn't trigger it.

Share this post


Link to post
Share on other sites
22 minutes ago, pierremgi said:

That's normal. You need to fire the handleDamage EH for the script. Play normally. As I said, the debug console is not ideal for tests when you need to fire some EH like this one. Applying a simple damage doesn't trigger it.

 

So that was my problem all along :)

 

works now...

 

thx!

  • Like 1

Share this post


Link to post
Share on other sites

No problem. Not an easy  code. So, thank you also for your tests. You made it better!

Share this post


Link to post
Share on other sites
On 7/15/2017 at 11:01 PM, pierremgi said:

Code must run on all PCs. So, init.sqf, (trigger, non-repeatable, condition true)...

 

Does the "call MGI_fn_Revive;" line also have to be called on all PCs? And does that mean server also?

Share this post


Link to post
Share on other sites

Have to report a bug. got this error:

 

21:40:09 Error in expression <able 'MGI_AIgrp';
  [_medic] joinSilent _grp;
  if ({isplayer _x} count units _g>
21:40:09   Error position: <_grp;
  if ({isplayer _x} count units _g>
21:40:09   Error Undefined variable in expression: _grp

 

This is my calling line:

 

[15,120,true,0,true,1,playableUnits + switchableUnits,true] call MGI_fn_Revive;

 

Share this post


Link to post
Share on other sites
22 minutes ago, gc8 said:

 

Does the "call MGI_fn_Revive;" line also have to be called on all PCs? And does that mean server also?

Yes. In init.sqf.   Don't care about server or not.  Init.sqf runs everywhere. If you wrote a if (isServer) then { } and the code is inside, that fails.

Share this post


Link to post
Share on other sites

Hi @pierremgi, it's me again. :)

 

I tried getting the script working in multiplayer but for some reason the player only respawns and doesn't get incapacitated. Maybe I did something wrong, but it works well in SP. I tested by starting it from editor in MP mode.

 

Here's the mission files

Share this post


Link to post
Share on other sites

That works for me...  if you just set some revive param in editor (for all players). Not saying you'll never die! As already said, I don't want to change anything for players in MP, just adding some script if unconscious (AIs can heal you). That's all.

 

I can shorten the EH handleDamage applied to player or units, by:

 

  _unit addEventHandler ['handleDamage', {
    params ['_unit','','_dam'];
        if (isNull objectParent _unit && {(count allPlayers == 1 && isPlayer _unit) or MGI_AiRevive}) then {
          if !(_unit getVariable ['uncsious',false]) then {
            _unit setVariable ['uncsious',true,true];
            _unit spawn MGI_fn_unconscious;
          };
        };
        if (!isPlayer _unit or !isMultiplayer) then {_dam min 0.86};
  }];

 

The first condition throws the script waiting for unconscious case.

The second condition treats the case of AI units, and player in SP, to limit their damage to 0.86 (then they don't die). As you can see, there is no figure applied to players in MP.

Imho, but any remark welcome, this EH works as intended, keeping standard damage/hitpart values for MP players, but running the script for their unconsciousness (healing by AIs).

 

Please, "ease" a little bit your scenario. Jumping into a trap with enemies within 10 meters is not fine (even if that can work)!

 

Anyway, if you don't agree with that, and think players should never have to die, you can replace:

if (!isPlayer _unit or !isMultiplayer) then {_dam min 0.86};

by:

_dam min 0.86;

But this will not the "official" front paged script.

  • Thanks 1

Share this post


Link to post
Share on other sites

@pierremgi Ah I thought that might be it but thought there was a bug because I always died. But now testing it again I got incapacitated couple of times. So it works, false alarm :)

Share this post


Link to post
Share on other sites
14 minutes ago, pierremgi said:

Please, "ease" a little bit your scenario. Jumping into a trap with enemies within 10 meters is not fine (even if that can work)!

 

It's just a test mission, trying to get my self killed :)

 

14 minutes ago, pierremgi said:

Anyway, if you don't agree with that, and think players should never have to die, you can replace:

if (!isPlayer _unit or !isMultiplayer) then {_dam min 0.86};

by:

_dam min 0.86;

But this will not the "official" front paged script.

 

Isn't it so with vanilla arma revive that you never die?

 

Here's an idea, how about make that dying/wounding a parameter?

 

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

×