Hello All
I think I just discovered a way to change a player's model and or side in game !
I have been working on a script that automatically creates a new group member whenever a group member dies. Not the simple way, the hard way !
The mission has respawn set to "Group", with each member running a script at start that re-equips them with a standard sidearm and three clips. The idea is that the player will keep coming back as the next guy in the group, but new group members appear at the black ops camp deep in the desert.
Enuff with the background. It's taken ages to implement but the end result is one script called newMan.sqs which does the equipping bit while also adding an EH to run a respawn script called respawnRoutine.sqs any time the unit is hit with fatal damage.
It had to be a "Hit" EH and not a "Dammaged" or "Killed" EH as the player's new "body" is actually selected by the game engine once the player is confirmed dead and not at the time of respawn (as I discovered).
The EH script simply creates a new group member for the player to respawn in to BEFORE he is registered as dead. Kind of neat.
But now the fun begins !
My man was a West black ops Captain and I kept creating West Corporals. But what if created a new East Major instead ? Sure enough - a little sidechat message confirmed that the player was now Side "Enemy". Not perfect, but in my book that qualifies as a change of side !
Now try another trick. Same EH, same scripts but create a new addAction called "Transmute" or whatever. The script should black out the screen, create the new unit (opposite side, different type or both), kill the player, delete his body fadeIn. To be complete you'd also want to take ensure that the payer re-appeared with his old weapons in his new incarnation.
Two caveats - the new unit must have a higher rank than the player (which can be changed back again via script, no ?) and this will cause hell with the players score (again - fixable ?).
Now imagine - you create this script as a "flip flop" - if side player = "West" then goto "convertToEast" and vice versa.
The first scripts are attached, I am still working on the "Transmute" script. To use, create two West units of any rank so long as they are less than "Major" and one object called camp1.
As soon as you appear, turn and shoot your friend. A Russian officer should appear and tell you that you are now side Enemy.
Voila !
I am hoping that this is the solution to many of our problems - feedback and comments gratefully accepted.
Roni
EDIT - I just created a version of the Swap Sides script and haven't been able to replicate the above effect. I went back and tried the original script again and got "Side = Enemy" again then realised that maybe it might be because I keep shooting my own men ! D'Oh !
I haven't given up hope but I'm not sure this way will work. :'(
Rats !