Home   Help Search Login Register  

Author Topic: Enable High Command Module for players after teamSwitch/respawn  (Read 1959 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Hi everyone.

Does anyone know if it's possible to let the High Command module's "commander function" transfer to another unit after death/teamSwitch/respawn? When the original leader/commander dies, the commanding function doesn't transfer to the new leader of the same group. It only works for the originally synced commander. The effect is that if you want to use the High Command Module, you can't use respawn or teamSwitch because that will basically break the mission. The reason I post in this board is that I can't even make it work in SP, which would be a good start.

The command synchronizeObjectsAdd doesn't work for the High Command Module in a trigger. It doesn't even work if I put it in the init line of the module itself. This is what I have tried:

myHCC is the High Command Module
myHCS is the High Command Subordinate Module
newCommander is the guy I will teamSwitch to
controlledGuy is the leader of the subordinate group

Original High Command Commander Player works of course, synchronized in the editor from mission start. Then two events follow:

-I teamSwitch to the unit called: newCommander
-I activate my Radio Alpha Trigger, on activation: myHCC synchronizeObjectsAdd [newCommander];

The High Command does not show up when I press: Ctrl+Spacebar as it does for the original commanding unit. when I switch back to the original commander the module works fine again.

I have even tried:

myHCC synchronizeObjectsAdd [newCommander];
myHCS synchronizeObjectsAdd [controlledGuy];

Nothing works, even in the editor. Not in a trigger, not in the init line of the module which is read right at mission start. So, no point trying in MP. Does anyone know if there is a workaround? I would really like to solve this.

Thanks!

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
According to the documentation on synchronizedObjectsAdd, the unit name is the object being synchronized to while the array is the list of objects. Try swapping your code around to put the name of your HCM in the array and the unitname before the command.

If that does not work, place a new HCM for the unit being team switched to and when the original commander dies, synch all HCSM's to the new commanders HCM.

Quote
For every new commander, place "High Command - Commander" game logic on map and synchronize it (F5) with the commander.
According to the Biki, every new commander must have his own HCM.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Quote
According to the Biki, every new commander must have his own HCM.

Thanks a lot mate, works very well.

Can't seem to make it work without my own group showing up under HC view.
Doesn't matter really, but might be confusing for some players.
I ran into problems with the HC subordinate, seems like I can't use the old ones or a new one.
The only way I could make it work was to have only a Commander Module (No subordinates).
That way I will automatically control every group on my side.

EDIT:

This seems to work also with subordinates:

Code: [Select]
_newHCcom = HCcomGroupLogic createUnit ["HighCommand",position player,[],0,"NONE"];
_newHCsub = HCsubGroupLogic createUnit ["HighCommandSubordinate",position player,[],0,"NONE"];

_newHCcom synchronizeObjectsAdd [player];
_newHCcom synchronizeObjectsAdd [_newHCsub];

_newHCsub synchronizeObjectsAdd [leader subGroup1];
_newHCsub synchronizeObjectsAdd [leader subGroup2];

The HC module still doesn't work on a dedicated server though  :weeping:

Laggy
« Last Edit: 06 Jan 2011, 01:17:44 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.