I use this cog that is based on the "Seifer" cog, and well.. that cog uses an insanly fast pulse to use a thing as a weapon model. Using a fast pulse in a multiplayer game makes lots of lag, but is there a way to make the cog run where none of the data produced by the cog is sent over the network? I set the cog so nothing will be sent over the network(0x200, NOSYNC 0x200 COG results are not broadcast to the other machines, says the JKSpecs), but for some reason or another, something is still sent over the network making massive amounts of lag. SOMETHING is being sent, I know because I set the cog to slow the pulse down when the player is in external view, and when we are in external view, the lag ceases.
Here is the cog:
Any help and a way to stop the pulse from sending and flooding data over the network would be GREATLY appreciated.
------------------
GetThingSignature(Ace1);
Here is the cog:
Code:
# Jedi Knight Cog Script # # WEAPONPOV.COG # # controls first person weapon models. Based on the Seifer cog flags=0x200 symbols model bryarpistol=bryV.3do local keyframe bryarfire=bryvpst1.key local template facetpl=+ghost1 local template povtemp=+gunmodel local template positiontpl=+ghost1 local thing player local thing weapmodelv local int swaydir local int trackID=-1 local int ourweapon local int lastweapon local int modelpostion local int weaponfacing local int povinvisible=0 local int weaponchange=0 local int weapmounted=0 local vector X_AxisVec local vector Y_AxisVec local vector forwardvector local message startup message newplayer message timer message pulse message killed message shutdown message leave message removed end # ======================================================================================== code startup: SetPulse(1); SetPulse(0); SetTimerEx(0.51, 1, 0, 0); Return; # ........................................................................................ newplayer: SetPulse(1); SetPulse(0); SetTimerEx(0.51, 1, 0, 0); Return; # ........................................................................................ timer: player = jkGetLocalPlayer(); if(GetSenderID() == 1) { weapmodelv = CreateThing(povtemp, player); AttachThingToThingEx(weapmodelv, player, 0x8); SetThingFlags(weapmodelv, 0x10); SetThingPos(weapmodelv, GetThingPos(player)); SetActorFlags(weapmodelv, 0x8); SetPulse(0.15); } Return; # ........................................................................................ pulse: player = jkGetLocalPlayer(); ourweapon = GetCurWeapon(player); if(ourweapon == 2) { weaponModel = LoadModel("bryv.3do"); mountAnim = LoadKeyframe("bryvmnt.key"); fireAnim = LoadKeyframe("bryvpst1.key"); } else if(ourweapon == 3) { weaponModel = LoadModel("strv.3do"); mountAnim = LoadKeyframe("strvmnt.key"); fireAnim = LoadKeyframe("strvpst1.key"); } if(ourweapon != lastweapon) { weaponchanged = 1; weapmounted = 0; Print("weaponchanged"); } lastweapon = ourweapon; if(weapmounted != 1) { SetThingModel(weapmodelv, weaponModel); if(trackID != -1) { StopKey(weapmodelv, trackID, 0.0); trackID = -1; } trackID = PlayKey(weapmodelv, mountAnim, 1, 0x14); weapmounted = 1; } if((GetThingHealth(player) < 1) || (GetActorFlags(player) == 0x400000)) { SetPulse(0); if((weapmodelv != -1) && (weapmodelv != player)) { DetachThing(weapmodelv); DestroyThing(weapmodelv); } Return; } if(GetCurrentCamera() == 0) { if((ourweapon == 2) || (ourweapon == 3)) { ClearThingFlags(weapmodelv, 0x10); } else { SetThingFlags(weapmodelv, 0x10); } SetPulse(0.016); } else { SetThingFlags(weapmodelv, 0x10); SetPulse(0.15); } weaponfacing = FireProjectile(player, facetpl, -1, -1, '0.0 0.0 0.0', '0.0 0.0 0.0', 1.0, 0x20, 30, 10); SetThingLook(weapmodelv, GetThingLVec(weaponfacing)); playerthrust = ((VectorY(GetThingThrust(player)) + VectorY(GetThingThrust(player))) * 0.001) * 0.2; if(Y_AxisVec >= 0.007) { swaydir = 0; } if(Y_AxisVec <= -0.004) { swaydir = 1; } if(Y_AxisVec >= 0.0046) { playerthrust = (playerthrust/2.2); } if(Y_AxisVec <= -0.0016) { playerthrust = (playerthrust/2.2); } if(playerthrust <= 0 ) { if(swaydir == 0) { Y_AxisVec = Y_AxisVec + playerthrust; } if(swaydir == 1) { Y_AxisVec = Y_AxisVec - playerthrust; } } else { if(swaydir == 0) { Y_AxisVec = Y_AxisVec - playerthrust; } if(swaydir == 1) { Y_AxisVec = Y_AxisVec + playerthrust; } } if((VectorY(GetThingThrust(player)) == 0)) { if(Y_AxisVec >= 0.0015) { Y_AxisVec = Y_AxisVec - 0.001; } else if(Y_AxisVec <= -0.0015) { Y_AxisVec = Y_AxisVec + 0.001; } else { Y_AxisVec = 0; } } if((VectorX(GetThingThrust(player)) > 0)) { if(X_AxisVec <= 0.004) { X_AxisVec = X_AxisVec + 0.001; } if((X_AxisVec > 0.004) && (X_AxisVec <= 0.0065)) { X_AxisVec = X_AxisVec + 0.0005; } if(X_AxisVec > 0.0065) { X_AxisVec = 0.0065; } } if((VectorX(GetThingThrust(player)) < 0)) { if(X_AxisVec >= -0.004) { X_AxisVec = X_AxisVec - 0.001; } if((X_AxisVec < -0.004) && (X_AxisVec >= -0.0065)) { X_AxisVec = X_AxisVec - 0.0005; } if(X_AxisVec < -0.0065) { X_AxisVec = -0.0065; } } if((VectorX(GetThingThrust(player)) == 0)) { if((X_AxisVec >= 0.0005) || (X_AxisVec <= -0.0005)) { if(X_AxisVec > 0.002) { X_AxisVec = X_AxisVec - 0.001; } if(X_AxisVec < 0.002) { X_AxisVec = X_AxisVec - 0.0005; } if(X_AxisVec < -0.002) { X_AxisVec = X_AxisVec + 0.001; } else if(X_AxisVec > -0.002) { X_AxisVec = X_AxisVec + 0.0005; } } if((X_AxisVec > -0.0005) && (X_AxisVec < 0.0005) && (X_AxisVec != 0)) { X_AxisVec = 0; } } forwardvector = VectorSet(-Y_AxisVec/8+X_AxisVec, Y_AxisVec/4, -Y_AxisVec/8); modelposition = FireProjectile(player, positiontpl, -1, -1, forwardvector, '0 0 0', 0, 0, -1, -1); SetThingPos(weapmodelv, GetThingPos(modelposition)); Return; # ........................................................................................ killed: SetPulse(0); if((weapmodelv != -1) && (weapmodelv != player)) { DetachThing(weapmodelv); DestroyThing(weapmodelv); } Return; # ........................................................................................ shutdown: SetPulse(0); if((weapmodelv != -1) && (weapmodelv != player)) { DetachThing(weapmodelv); DestroyThing(weapmodelv); } Return; # ........................................................................................ leave: SetPulse(0); if((weapmodelv != -1) && (weapmodelv != player)) { DetachThing(weapmodelv); DestroyThing(weapmodelv); } Return; # ........................................................................................ removed: SetPulse(0); if((weapmodelv != -1) && (weapmodelv != player)) { DetachThing(weapmodelv); DestroyThing(weapmodelv); } Return; # ........................................................................................ end
Any help and a way to stop the pulse from sending and flooding data over the network would be GREATLY appreciated.
------------------
GetThingSignature(Ace1);
I am _ Ace_1 _ , and I approve this message.