diff --git a/Mod Sources/TSExtension/TSExtension.opensdf b/Mod Sources/TSExtension/TSExtension.opensdf deleted file mode 100644 index 34b05c3..0000000 Binary files a/Mod Sources/TSExtension/TSExtension.opensdf and /dev/null differ diff --git a/Mod Sources/TSExtension/TSExtension.suo b/Mod Sources/TSExtension/TSExtension.suo index 790c35d..dc7b030 100644 Binary files a/Mod Sources/TSExtension/TSExtension.suo and b/Mod Sources/TSExtension/TSExtension.suo differ diff --git a/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp b/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp index d050351..32732f6 100644 --- a/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp @@ -6,7 +6,10 @@ #include #include static float counter=0; -static float mps=0.0; +static float mpsx=0.0; +static float mpsy=0.0; +static float mpsz=0.0; +static bool moveplayerstoo=1; static bool clientupdate=false; static float timecounter=0; #define CMALLOC (char*)malloc @@ -60,7 +63,7 @@ void setClientPosition(unsigned int object,DX::Point3F pos){ sendGhostCommandAll(5,object,pos); } -void moveRecursive(unsigned int simgroup,float xoff){ +void moveRecursive(unsigned int simgroup,float xoff, float yoff, float zoff){ unsigned int mainsim=(unsigned int)simgroup; if (mainsim) { @@ -76,14 +79,22 @@ void moveRecursive(unsigned int simgroup,float xoff){ DX::Point3F test; mat1.getColumn(3,&test); test.x+=xoff; + test.y+=yoff; + test.z+=zoff; mat1.setColumn(3,&test); sobj.setTransform(mat1.m); + if (moveplayerstoo==1) { + char evalstr[512]=""; + + sprintf (evalstr,"onMoveRoutine(%d,\"%g %g %g\",\"%g %g %g\",%g);",sobj.identifier,xoff,yoff,zoff,sobj.worldspherecenter.x,sobj.worldspherecenter.y,sobj.worldspherecenter.z,sobj.worldsphereradius); + Con::eval(evalstr,false,NULL); + } if (clientupdate==true) { - setClientPosition(sobj.base_pointer_value,test); + setClientPosition(sobj.base_pointer_value,test); } } } else { - moveRecursive(sim2.getObject(x),xoff); + moveRecursive(sim2.getObject(x),xoff,yoff,zoff); } } } @@ -130,7 +141,8 @@ void serverProcessReplacement(unsigned int timeDelta) { if (Sim::findObjectc("MoveGroup")) { basex+=counter; DX::SceneObject sobj = DX::SceneObject((unsigned int)Sim::findObjectc("MoveGroup")); - moveRecursive((unsigned int)Sim::findObjectc("MoveGroup"),(mps*((float)((timeDelta)*0.001)))); + moveRecursive((unsigned int)Sim::findObjectc("MoveGroup"),(mpsx*((float)((timeDelta)*0.001))),(mpsy*((float)((timeDelta)*0.001))),(mpsz*((float)((timeDelta)*0.001)))); + Con::eval("MoveRoutineDone();",false,NULL); } if (clientupdate==true) { timecounter=0; @@ -185,7 +197,9 @@ const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[] return test2; } bool conSetMPS(Linker::SimObject *obj, S32 argc, const char *argv[]) { - mps=atof(argv[1]); + mpsx=atof(argv[1]); + mpsy=atof(argv[2]); + mpsz=atof(argv[3]); return false; } const char *conGetAddress(Linker::SimObject *obj, S32 argc, const char *argv[]) diff --git a/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp b/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp index de43af3..ceb78a7 100644 --- a/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp @@ -43,7 +43,7 @@ extern "C" Con::addMethodS("GrenadeProjectile", "getvelocity", &conGrenadeProjectileGetVelocity,"Gets the velocity of the GrenadeProjectile", 2, 2); Con::addMethodB("Projectile", "makeNerf", &conProjectileMakeNerf,"Makes the Projectile deal no damage", 2, 2); Con::addMethodS("SceneObject", "getPositionTest", &conGetPosition,"Gets the Rotation by alternate means as a test", 2, 2); - Con::addMethodB(NULL,"setMPS",&conSetMPS,"sets meters per second for turret", 2, 2); + Con::addMethodB(NULL,"setMPS",&conSetMPS,"sets meters per second for turret in format x,y,z", 4, 4); // TCPObject #ifdef ENABLE_TCPOBJECT Con::addMethodS("TCPObject", "connect", &conTCPObjectConnect, "Connects to a remote server", 3, 3); diff --git a/Patches/server.cs b/Patches/server.cs deleted file mode 100644 index 138bdb4..0000000 --- a/Patches/server.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - - - - - - -memPatch("5BBBDC",getServPAddr()); //Hooks the serverProcess function -$mg = new SimSet(MoveGroup); -MoveGroup.add(Team1); //Adds the Team1 base to the movement group -setMPS(0.5); // Moves the base 0.5 meters per second on the X axis. \ No newline at end of file diff --git a/Patches/servertest.cs b/Patches/servertest.cs new file mode 100644 index 0000000..ffd4e77 --- /dev/null +++ b/Patches/servertest.cs @@ -0,0 +1,37 @@ +// 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. + + + + + +$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; +} + +function moveRoutineDone() { + for (%x=0;%x<(MoveEffectSet.getCount()); %x++) { + %obj=MoveEffectSet.getObject(%x); + %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(-10,0.0,0.0); // Moves the base 0.5 meters per second on the X axis. \ No newline at end of file