What are the fundamental differences between a living playable unit and a dead unit?
I manage to get as far as re-possessing the dead body but not actually able to control it. The following code demonstrates this and also attempts at re-animating the dead body back into a playable unit.
- spawn {
oldUnit = player;
_g = createGroup west;
newUnit = _g createUnit ["B_soldier_AT_F",position player, [], 0 ,"NONE"];
addSwitchableUnit newUnit;
selectPlayer newUnit;
oldUnit setDamage 1;
sleep 3;
oldUnit setDamage 0;
oldUnit enableAI "MOVE";
oldUnit enableAI "ANIM";
oldUnit setUnconscious false;
addSwitchableUnit oldUnit;
selectPlayer oldUnit;
disableUserInput false;
player switchMove "";
player switchCamera "External";
};
Being able to do this will allow us to "revive" a player without convoluted code that memorise the player's exact loadout before death and clones the exact loadout on the newly-respawned unit after death.