Couldn't find anything similar on the forum so heres a resource by me.
Its a script for use in an open world splitscreen four swords game.
//2 player combining views script!
//this script requires both a 1st player and 2nd player but can be extended for up to four player splitscreen games.
//place this on a global object, but this script must be running off the 2nd player and also in the step event.
if instance_exists(2ndPlayer)
{
//combining views
if distance_to_object(1stPlayer) > 40
{
view_visible[0] = false;
view_visible[1] = true;
view_visible[2] = true;
}
else
{
view_visible[0] = true;
view_visible[1] = false;
view_visible[2] = false;
}
}
else
{
view_visible[0] = true;
view_visible[1] = false;
view_visible[2] = false;
}
//script curtesy of Ethan Behan.
//credit would be appreciated.
//view example:
//set up views like this:
//view0
//view in room: W:160 , H:144
//port on screen: X:80 , W:160 , H:144
//Object Following: 1stPlayer
//Hbor:500 , Vbor:500
//view1
//view in room: W:160 , H:144
//port on screen: X:161 , W:160 , H:144
//Object Following: 1stPlayer
//Hbor:500 , Vbor:500
//view2
//view in room: W:160 , H:144
//port on screen: X:0 , W:160 , H:144
//Object Following: 2ndPlayer