http://www.garagegames.com/community/forums/viewthread/34506
Here is my modified version of teleportation trigger data blocks and functions (all scripted inside
http://www.garagegames.com/community/resources/view/7532
$scene0="starter.fps/data/missions/caerleonRomanCity.mis";// loading second mission area romanCity
$scene1="starter.fps/data/missions/caerleonFortress.mis";// loading third mission area fortress
$scene2="starter.fps/data/missions/caerleonHillTop.mis";// loading first mission area hillTop
$scene3="starter.fps/data/missions/caerleonCelticCity.mis";// loading forth mission area celticCity
$currentScene = $scene2;
// creating teleport triggers for romanCity mission
//from celticCity to romanCityS point
datablock TriggerData(toRomanCityS)
{
tickPeriodMS = 100;
};
//from romanCity to fortress West point
datablock TriggerData(toFortressW)
{
tickPeriodMS = 100;
};
//from romanCity to celticCity Norht point
datablock TriggerData(toCelticCityN)
{
tickPeriodMS = 100;
};
datablock TriggerData(toRomanCityN)
{
tickPeriodMS = 100;
};
datablock TriggerData(toRomanCityNW)
{
tickPeriodMS = 100;
};
//from hilltop to fortress entrence
datablock TriggerData(toFortressN)
{
tickPeriodMS = 100;
};
//creating teleport triggers for hillTop mission
//from romanCity to hillTop
datablock TriggerData(toHillTopSouth)
{
tickPeriodMS = 100;
};
datablock TriggerData(toHillTopSouthW)
{
tickPeriodMS = 100;
};
//creating teleport triggers for fortress mission
//from fortress to hillTop
datablock TriggerData(toHillTopSouthE)
{
tickPeriodMS = 100;
};
//from fortress to romancity
datablock TriggerData(toRomanCityE)
{
tickPeriodMS = 100;
};
//function for teleporting from celticCity to romanCitySout Point
function toRomanCityS::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCitySPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from fortress to romanCityWest Point
function toRomanCityE::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCityEastPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from romanCity to fortressWest Point
function toFortressW::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/fortressImage");
LaunchMission($scene1, "fortressSPoint");
$currentScene = $scene1;
pauseCountdown();
}
//function for teleporting from romanCity to celticCityNorth point
function toCelticCityN::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap($scene3);
LaunchMission($scene3, "celticCityNorthPoint");
$currentScene = $scene3;
pauseCountdown();
}
//function for teleporting from romanCity to hillTopSouthWPoint
function toHillTopSouthW::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/hillTopImage");
LaunchMission($scene2, "hillTopSouthWPoint");
$currentScene = $scene2;
pauseCountdown();
}
//function for teleporting from romanCity to hillTopSouthPoint
function toHillTopSouth::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/hillTopImage");
LaunchMission($scene2, "hillTopSouthPoint");
$currentScene = $scene2;
pauseCountdown();
}
//function for teleporting from fortress to hillTopSoutEhPoint
function toHillTopSouthE::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/hillTopImage");
LaunchMission($scene2, "hillTopSouthEPoint");
$currentScene = $scene2;
pauseCountdown();
}
//function for teleporting from hillTop to romanCityNorthW point
function toRomanCityNW::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCityNWPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from hillTop to romanCity North point
function toRomanCityN::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCityNPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from hillTop to Fortress North Point
function toFortressN::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/fortressImage");
LaunchMission($scene1, "fortressNPoint");
$currentScene = $scene1;
pauseCountdown();
}
function LaunchMission(%mission, %spawn, %timeout)
{
fadeScreenOutandIn(0,5000,5000,0);
if (!$Game::LaunchingMission)
{
$Game::NextMission = %mission;
$Game::NextSpawn = %spawn;
$Game::LaunchingMission = true;
schedule(5000, 0, "onLaunchMission");
}
}
function onLaunchMission()
{
$Game::LaunchingMission = false;
loadMission($Game::NextMission);
}
also changed the pickSpawnPoint function scripted in Game.cs folder to following code:$scene1="starter.fps/data/missions/caerleonFortress.mis";// loading third mission area fortress
$scene2="starter.fps/data/missions/caerleonHillTop.mis";// loading first mission area hillTop
$scene3="starter.fps/data/missions/caerleonCelticCity.mis";// loading forth mission area celticCity
$currentScene = $scene2;
// creating teleport triggers for romanCity mission
//from celticCity to romanCityS point
datablock TriggerData(toRomanCityS)
{
tickPeriodMS = 100;
};
//from romanCity to fortress West point
datablock TriggerData(toFortressW)
{
tickPeriodMS = 100;
};
//from romanCity to celticCity Norht point
datablock TriggerData(toCelticCityN)
{
tickPeriodMS = 100;
};
datablock TriggerData(toRomanCityN)
{
tickPeriodMS = 100;
};
datablock TriggerData(toRomanCityNW)
{
tickPeriodMS = 100;
};
//from hilltop to fortress entrence
datablock TriggerData(toFortressN)
{
tickPeriodMS = 100;
};
//creating teleport triggers for hillTop mission
//from romanCity to hillTop
datablock TriggerData(toHillTopSouth)
{
tickPeriodMS = 100;
};
datablock TriggerData(toHillTopSouthW)
{
tickPeriodMS = 100;
};
//creating teleport triggers for fortress mission
//from fortress to hillTop
datablock TriggerData(toHillTopSouthE)
{
tickPeriodMS = 100;
};
//from fortress to romancity
datablock TriggerData(toRomanCityE)
{
tickPeriodMS = 100;
};
//function for teleporting from celticCity to romanCitySout Point
function toRomanCityS::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCitySPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from fortress to romanCityWest Point
function toRomanCityE::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCityEastPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from romanCity to fortressWest Point
function toFortressW::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/fortressImage");
LaunchMission($scene1, "fortressSPoint");
$currentScene = $scene1;
pauseCountdown();
}
//function for teleporting from romanCity to celticCityNorth point
function toCelticCityN::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap($scene3);
LaunchMission($scene3, "celticCityNorthPoint");
$currentScene = $scene3;
pauseCountdown();
}
//function for teleporting from romanCity to hillTopSouthWPoint
function toHillTopSouthW::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/hillTopImage");
LaunchMission($scene2, "hillTopSouthWPoint");
$currentScene = $scene2;
pauseCountdown();
}
//function for teleporting from romanCity to hillTopSouthPoint
function toHillTopSouth::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/hillTopImage");
LaunchMission($scene2, "hillTopSouthPoint");
$currentScene = $scene2;
pauseCountdown();
}
//function for teleporting from fortress to hillTopSoutEhPoint
function toHillTopSouthE::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/hillTopImage");
LaunchMission($scene2, "hillTopSouthEPoint");
$currentScene = $scene2;
pauseCountdown();
}
//function for teleporting from hillTop to romanCityNorthW point
function toRomanCityNW::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCityNWPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from hillTop to romanCity North point
function toRomanCityN::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/cityImage");
LaunchMission($scene0, "romanCityNPoint");
$currentScene = $scene0;
pauseCountdown();
}
//function for teleporting from hillTop to Fortress North Point
function toFortressN::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
LoadingGui.setBitmap("starter.fps/client/ui/fortressImage");
LaunchMission($scene1, "fortressNPoint");
$currentScene = $scene1;
pauseCountdown();
}
function LaunchMission(%mission, %spawn, %timeout)
{
fadeScreenOutandIn(0,5000,5000,0);
if (!$Game::LaunchingMission)
{
$Game::NextMission = %mission;
$Game::NextSpawn = %spawn;
$Game::LaunchingMission = true;
schedule(5000, 0, "onLaunchMission");
}
}
function onLaunchMission()
{
$Game::LaunchingMission = false;
loadMission($Game::NextMission);
}
function pickSpawnPoint()
{
%groupName = "MissionGroup/PlayerDropPoints";
if ( $Game::NextSpawn !$= "" ) {
%spawn = nameToID( %groupName @ "/" @ $Game::NextSpawn );
$Game::NextSpawn = "";
if ( %spawn != -1 )
return %spawn.getTransform();
}
%group = nameToID(%groupName);
if (%group != -1) {
%count = %group.getCount();
if (%count != 0) {
%index = 0; //getRandom(%count-1);
%spawn = %group.getObject(%index);
return %spawn.getTransform();
}
else
error("No spawn points found in " @ %groupName);
}
else
error("Missing spawn points group " @ %groupName);
// Could be no spawn points, in which case we'll stick the
// player at the center of the world.
return "0 0 300 1 0 0 0";
}
No comments:
Post a Comment