Jump to content
Sign in to follow this  
Chris_Acrobat

Multiplayer: Load dead player to vehicle cargo.

Recommended Posts

When I try to load an old player (dead and respawned), I seems to lose full control over the unit. (Note: -showScriptErrors is enabled)

fnc_loadMedicalTransport = 
{
DEBUG = [];	// Temporarily added for demonstration purposes
_unit = _this;	// Dead player in multiplayer
DEBUG = DEBUG + [_this];

_transport = _unit call fnc_nearestMedicalTransport;
DEBUG = DEBUG + [_transport];

_group = createGroup (side _transport);
DEBUG = DEBUG + [_group];
[_unit] joinSilent _group;
DEBUG = DEBUG + [_group];

DEBUG = DEBUG + [(_transport emptyPositions "Cargo") - 1];
_unit moveInCargo [_transport, (_transport emptyPositions "Cargo") - 1];
DEBUG = DEBUG + [(_transport emptyPositions "Cargo") - 1];
// DEBUG is now: [medic_blue_1,amb,C Alpha 1-1,C Alpha 1-1,15,15]
};

The code works for living and dead AI. But when I use it on a dead player in multiplayer, nothing happens. Not even an error message. DEBUG shows that fnc_loadMedicalTransport still runs perfectly, but moveInCargo seems to be ignored. Is it because the dead player has lost it's soul? Is there a way to add it back as an AI? :)

Share this post


Link to post
Share on other sites

I have tried resetting setPlayable, killing it (again. :P) and a bunch of other function that I don't remember.

Share this post


Link to post
Share on other sites

As I remember, there's really not much you can do with dead players. What is the reason you're looking to put dead players in the vehicle? Knowing your end goal might make it easier to suggest a solution.

Share this post


Link to post
Share on other sites

As a respawn-system. To get respawn-tickets, the dead players has to be transported back to base. And to make logistic simpler I want them to be loadable, otherwise the players has to drag the dead bodies all the way.

Share this post


Link to post
Share on other sites

I think a dead player is a null object and thats why to can reference a handle to him. Some revive script get around this by respawning the dead player in the same position but in a simulated death method.

Share this post


Link to post
Share on other sites

But I can move it around, so it is not completely null. :p

As I said, players has to drag them too, and that is working properly.

Any way, I have already started on a workaround, but it is not yet complete.

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  

×