Feature #22215

"MPRESPAWN" MPeventhandler should execute on all machines

Added by Mr.Ben about 4 years ago. Updated over 2 years ago.

Status:Duplicate Start date:07/11/2011
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Event Handlers
Target version:-
Affected ArmA II version:1.63 Beta First affected ArmA II version:
Reproduced by another DH user:Yes Single / Multi Player?:
I am using some Mods:No BIForumURL:
I am using:CO (OA+A2) NGUrl:
Reproducible for you:Yes WIKIurl:
Related to content of DLC:

Description

I was using the MP eventhandler MPKILLED. When fired when a unit dies, it runs on all machines. However when i use MPRESPAWN, it only fires on the machine the unit is local to.

Here is the code i was using.

_mpeventhandler = player addMPEventHandler ["MPRESPAWN", {if (isServer) then { [nil, nil, rSPAWN, [], {hint "server ran code";}]call RE;}; }];

So i added this locally to myself when i joined a dedicated server. When i respawned, i recieved no hint. However, if i changed the code to MPKILLED:

_mpeventhandler = player addMPEventHandler ["MPKILLED", {if (isServer) then { [nil, nil, rSPAWN, [], {hint "server ran code";}]call RE;}; }];

For this MPKILLED i recieved a hint. Am I right or wrong in thinking this particular MPEventHandler is supposed to work differently? To me MPRESPAWN, should work the same as MPKILLED, in that you can add the MPEventhandler on any machine, and then it will be ran on all machines when the player respawns.

I am reporting this as a bug, since it doesn't seem to work right. Unless I am doing something wrong?

_mpresp.Desert_E.7z (850 Bytes) Xeno, 07/12/2011 09:40


Related issues

duplicates ARMA2 Community Issue Tracker - Bug #15095: MPRespawn handler only executed where unit is local Assigned 11/13/2010

History

Updated by Fireball about 4 years ago

  • Due date set to 07/25/2011
  • Category set to Event Handlers
  • Status changed from New to Feedback
  • Reproducible for you changed from No to Yes

Updated by Xeno about 4 years ago

He is right. The MPRespawn EH can be added everywhere but it only triggers where the unit is local.
Means the command is useless currently as you could also add a normal (non MP) respawn EH to the unit.

A really simple test mission attached. I've tested it with the latest available beta patch.
It adds the MPRespawn EH only on the server. The diag_log result is only visible in the RPT of the respawned client.

Updated by Fireball about 4 years ago

  • Due date changed from 07/25/2011 to 09/25/2011
  • Status changed from Feedback to Assigned
  • Affected ArmA II version changed from Please select... to 1.60 BETA
  • Reproduced by another DH user changed from No to Yes

Updated by Mr.Ben about 4 years ago

I was just reading the Beta changelog, and it seems:

[73245] New: Multiplayer Event MPRespawn synchronized on all clients but triggered only on the client where respawn happens.

So maybe this is the case that it is supposed to be this way. In that case, this is not a bug, and is infact a request :)

FYI i was not running the latest beta.

Updated by Fireball about 4 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from "MPRESPAWN" MPeventhandler does not execute on all machines to "MPRESPAWN" MPeventhandler should execute on all machines
  • Due date deleted (09/25/2011)
  • Affected ArmA II version deleted (1.60 BETA)
  • Reproduced by another DH user changed from Yes to No
  • Reproducible for you changed from Yes to No

Updated by Xeno about 4 years ago

Well, then there is absolutely no need for a MPRespawn EH. You can also use the normal respawn EH on that client.
The idea behind triggering it on all clients plus server was probably to run some functions/scripts on all clients/server. That's the only reason I can think of for adding it.
But as said, MPRespawn is in its current form is totally useless.

Beside that, I have no idea why the MP EHs transfer all the code added to them over the net.

Updated by Mr.Ben about 4 years ago

The idea behind triggering it on all clients plus server was probably to run some functions/scripts on all clients/server. That's the only reason I can think of for adding it.

Well, i presonnally would like it for making/completing a respawn control system. Currently, i have to either remote execute things all over the network, or I have to use MPkilled, which i dont really like, since i don't get access to the corpse. respawn and MPrespawn EH returns the unit, and corpse, which is really handy and more efficient. I need the server to access this information also, so it can store data. I can then store units, names and other info and use it for spectating and live units etc.
Thes system as it stands works nicely, and is an improved version of an existing idea made by a a member within my community. In essence, you are given X amount of lives to a unit and player. So a player cannot exceed his amount of lives and rejoin and take another slot, and also, a particular slot has a limited amount of lives also, whether used by 1 or more people. In essence, it makes "respawn 4" setting works in the way i would like it (but with respawn 3), in that if someone disconnects, it does not remove the slot, and you cannot bypass death once you have died. The added bonus of these scripts, is that you have the option to select the amount of lives, and respawn time, if required, with the ability to view alive units of your side and the units of your side that have died.

So as you can see, MPrespawn would be awesome if it executed on all machines. At least for me, and perhaps other control systems.

Beside that, I have no idea why the MP EHs transfer all the code added to them over the net.

You don't need to transfer much code at all, if you are calling a function you have already made :D.

Updated by Xeno about 4 years ago

The MP eventhandlers transfer code, even if it is just for calling a function.

It would be better to register the code on all machines needed instead of sending it each time.
This way an unexperienced modder wouldn't run in this trap.

Doesn't change the fact that MPRespawn is pretty useles currenlty and can be easily replaced by the normal respawn EH.

Updated by Mr.Ben about 4 years ago

I thought that is what I said? Create a function/code on all machines, then just call it within the eventhandler. Sorry I am not that good at wording myself.
I think the main thing is really, its nice in many cases to either have the player in control or just the server in many cases, at least from my point of view. TBH the more eventHandlers in the form of MPeventHandlers is nice. I know it doesn't suit everyone, or every circumstance, but it does open up many more doors and possibilities to get round locality issues.

Updated by Anunnaki over 2 years ago

  • Affected ArmA II version set to 1.63 Beta
  • I am using set to CO (OA+A2)

Is this bug in "MPRespawn" eventhandler fixed?

It seems that it is still executed only localy.

It should be executed globaly: http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers .

Updated by Deadfast over 2 years ago

  • Reproduced by another DH user changed from No to Yes

Reproduced in 100296.

Duplicate of: https://dev-heaven.net/issues/15095

Updated by Fireball over 2 years ago

  • Status changed from Assigned to Duplicate
  • Reproducible for you changed from No to Yes

Also available in: Atom PDF