mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-04-26 18:05:04 +00:00
61 lines
No EOL
1.7 KiB
C#
61 lines
No EOL
1.7 KiB
C#
// this is a test for katabatic only with both client and server running their scripts.
|
|
// this should be run after joining the game, or you will fall through the map on spawn where the Team1 base used to be.
|
|
|
|
|
|
|
|
|
|
loadMod("TSExtension");
|
|
$movesim = new SimSet(MoveEffectSet);
|
|
function onMoveRoutine(%obj, %offset, %center, %radius){
|
|
|
|
InitContainerRadiusSearch(%obj.getWorldBoxCenter(),%radius,$TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType);
|
|
%obj2=ContainerSearchNext();
|
|
|
|
while (%obj2) {
|
|
if (!(MoveEffectSet.isMember(%obj2))) {
|
|
MoveEffectSet.add(%obj2);
|
|
}
|
|
|
|
%obj2 = ContainerSearchNext();
|
|
}
|
|
|
|
$moveoffset=%offset;
|
|
}
|
|
$collidegroup = new SimSet(CollideGroup);
|
|
|
|
|
|
|
|
|
|
|
|
function ProjCollisionCallback(%proj1, %proj2) {
|
|
echo(%proj1 SPC "collided with" SPC %proj2);
|
|
if (isObject(%proj1) {
|
|
if (isObject(%proj2) {
|
|
if (%proj1.sourceObject != %proj2.sourceObject) {
|
|
CollideGroup.remove(%proj1);
|
|
CollideGroup.remove(%proj2);
|
|
%proj1.delete();
|
|
%proj2.delete();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function moveRoutineDone() {
|
|
for (%x=0;%x<(MoveEffectSet.getCount()); %x++) {
|
|
%obj=MoveEffectSet.getObject(%x);
|
|
if(%obj.getType() | $TypeMasks::PlayerObjectType) {
|
|
if (%obj.isjetting() || %obj.isjumping() ) {
|
|
echo ("Artificial Gravity Disengaged for" SPC %obj);
|
|
} else {
|
|
%obj.setPosition(VectorAdd(%obj.position,$moveoffset));
|
|
}
|
|
}
|
|
}
|
|
MoveEffectSet.clear();
|
|
|
|
}
|
|
|
|
memPatch("5BBBDC",getServPAddr()); //Hooks the serverProcess function
|
|
$mg = new SimSet(MoveGroup);
|
|
MoveGroup.add(Team1); //Adds the Team1 base to the movement group
|
|
setMPS(0.0,0.0,0.0); // Moves the base 0.5 meters per second on the X axis. |