Post by NaCl586 on Dec 25, 2011 0:04:38 GMT
This code was tested before I put the code on MBDK. This code works 100%. Jeff taught me how to do this. I have promised to release this code on MBDK at 25th December. Few lines nearly are the same as elite's code. But both Jeff and Nihahhat already gave permission to this code. Enjoy!
I hope you enjoyed!
P.S Marble Fade effects will be added if Jeff want to code MBAdventure after elite demo is released. If else, just wait until Jeff give the gift...
//-------------------------------------------
// Teleport Trigger by Gerson, for MBDK
// MERRY CHRISTMAS 2011 & HAPPY NEW YEAR 2012!
//-------------------------------------------
datablock triggerData(TeleportTrigger) {
tickPeriodMS = 100;
};
datablock triggerData(LocationTrigger) {
tickPeriodMs = 100;
};
function TeleportTrigger::onEnterTrigger(%this,%trigger,%obj) {
%location = %trigger.location;
%position= nameToId(%location);
if(%trigger.location $= ""){
messageclient(%obj.client, '', '\c0No speciefied location in this trigger!');
return;
}
if(isObject(%position)) {
%x = getWord(%location.getTransform(), 0);
%y = getWord(%location.getTransform(), 1);
%z = getWord(%location.getTransform(), 2);
%a1 = getword(%location.getTransform(), 3);
%a2 = getword(%location.getTransform(), 4);
%a3 = getword(%location.getTransform(), 5);
%a4 = getword(%location.getTransform(), 6);
%rot = %a1 SPC %a2 SPC %a3 SPC %a4;
%destination = %x SPC %y SPC %z SPC %rot;
}
%obj.setTransform(%destination);
}
I hope you enjoyed!
P.S Marble Fade effects will be added if Jeff want to code MBAdventure after elite demo is released. If else, just wait until Jeff give the gift...