Amerio.Stephane Posted January 21, 2020 Share Posted January 21, 2020 Hello, I'm trying to have a setup where some slaves display a different camera from the master, with a CIGI host. I can change the camera on the master with Game::get()->setPlayer(player), but this changes the view on all slaves too. Use case: master and all slaves starts with the default cigi camera User press a key on master to go free roaming on master (that part works currently) but *some* other slaves must still have the default cigi camera User press another key on master to toggle the camera on another slave (left shoulder to right shoulder for example) while not modifying the master and the previous slaves Thanks! Link to comment
cash-metall Posted January 22, 2020 Share Posted January 22, 2020 Hello! you can use setSlavePlayer syncker_master->setSlavePlayer(1 << unique_slave_num, slave_player); // for set another camera on specific slave. this turns off the synchronization of the main camera. syncker_master->setSlavePlayer(~(1 << unique_slave_num), Game::getPlayer()); // for set main camera on other camera // ======== syncker_master->setSyncPlayer(1); // for return all slaves on main camera Link to comment
Amerio.Stephane Posted January 22, 2020 Author Share Posted January 22, 2020 That should do the trick! But how can I find the "unique_slave_num" for a specific slave? What if my slaves are not always started in the same order? Can a slave know in any way its slave_num to give it to the master along with its preferred player name? Thank you! Link to comment
cash-metall Posted January 22, 2020 Share Posted January 22, 2020 for (int i = 0; i < syncker_master->getNumSlaves(); i++) { if (strcmp(syncker_master->getSlaveView(i, 0), "left") == 0) //"left" name in Syncker { syncker_manager->setSlavePlayer(1<<i, view->getPlayer()->getPlayer()); Log::message("set view %d to slave %d \n", view->getID(), i); } } smth like this 1 Link to comment
Amerio.Stephane Posted January 22, 2020 Author Share Posted January 22, 2020 Super! Thanks! Link to comment
Recommended Posts