interestingly enough there are 3 server commands to create a DWing and 2 to create a SigmaFighter.
two of the dwing ones and one of the sigmafighter ones (including those called by the editor gui creation method) dn't mount the weapons. here's a patched version that fixes the both DWing script, and the GUI script (the SigmaFighter script itself was fine)
tbm/server/scripts/vehicles/dwing.cs:
Code:
tbm/client/scripts/SpecialOP.cs
Code:
two of the dwing ones and one of the sigmafighter ones (including those called by the editor gui creation method) dn't mount the weapons. here's a patched version that fixes the both DWing script, and the GUI script (the SigmaFighter script itself was fine)
tbm/server/scripts/vehicles/dwing.cs:
Code:
// TBM DeltaWing Aircraft
// Model and texturing by Kerm Martian - http://www.cemetech.met
// Scripting by Luquado
// Physics by Rob & Kerm
// Taken from Garage Game's sample scripts and modified.
//---------------------------------------------------------------------------------------
// Let's define our shiznit.
datablock ParticleData(JetEngineParticle)
{
textureName = "~/data/shapes/bricks/vehicles/dustParticle";
dragCoefficient = 5.0;
gravityCoefficient = 0;
inheritedVelFactor = -0.5;
constantAcceleration = 0.0;
lifetimeMS = 700;
lifetimeVarianceMS = 0;
colors[0] = "0.76 0.36 0.26 1.0";
colors[1] = "0.76 0.46 0.36 0.0";
sizes[0] = 0.50;
sizes[1] = 0.40;
};
datablock ParticleEmitterData(JetEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 5;
thetaMax = 20;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "JetEngineParticle";
};
datablock ParticleData(JetSmokeParticle)
{
textureName = "~/data/shapes/bricks/vehicles/dustParticle";
dragCoefficient = 5.0;
gravityCoefficient = 0;
inheritedVelFactor = -0.5;
constantAcceleration = 0.0;
lifetimeMS = 700;
lifetimeVarianceMS = 0;
colors[0] = "0.2 0.2 0.2 1.0";
colors[1] = "0.3 0.3 0.3 0.0";
sizes[0] = 0.70;
sizes[1] = 0.50;
};
datablock ParticleEmitterData(JetSmokeEmitter)
{
ejectionPeriodMS = 5;
periodVarianceMS = 0;
ejectionVelocity = 1;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 5;
thetaMax = 20;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
particles = "JetEngineParticle";
};
datablock FlyingVehicleData(DeltaWing)
{
emap = true;
category = "Vehicles";
shapeFile = "~/data/shapes/bricks/vehicles/dwing.dts";
cloaktexture = "~/data/specialfx/cloakTexture";
multipassenger = false;
computeCRC = true;
drag = 0.2;
density = 3.0;
//stateEmitter = JetEmitter;
mountPose[0] = "fall";
mountPointTransform[0] = "0 0 -1 0 0 1 0";
numMountPoints = 1;
isProtectedMountPoint[0] = false;
cameraMaxDist = 16.0; // Why so much? So that 3rd person would look right, that's why!
cameraOffset = 4.5;
cameraLag = 5.0;
cameraRoll = true; // Roll the camera with the vehicle for extra disorienting fun!
// explosion = VehicleExplosion; // Maybe later, guys.
explosionDamage = 10.5;
explosionRadius = 15.0;
maxDamage = 50.40;
destroyedLevel = 50.40;
minDrag = 30; // Linear Drag (eventually slows you down when not thrusting...constant drag)
rotationalDrag = 10; // Anguler Drag (dampens the drift after you stop moving the mouse...also tumble drag)
maxAutoSpeed = 5; // Autostabilizer kicks in when less than this speed. (meters/second) //10
autoAngularForce = 50; // Angular stabilizer force (this force levels you out when autostabilizer kicks in) //200
autoLinearForce = 1; // Linear stabilzer force (this slows you down when autostabilizer kicks in) //200
autoInputDamping = 0.95; // Dampen control input so you don't` whack out at very slow speeds
integration = 5; // Physics integration: TickSec/Rate
collisionTol = 0.2; // Collision distance tolerance
contactTol = 0.1;
// Maneuvering
maxSteeringAngle = 1; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 200; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 200; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 1000; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 100; // Steering jets (force applied when you move the mouse)
steeringRollForce = 120; // Steering jets (how much you heel over when you turn)
rollForce = 60; // Auto-roll (self-correction to right you after you roll/invert) //80
hoverHeight = 0; // Height off the ground at rest
createHoverHeight = 80; // Height off the ground when created
maxForwardSpeed = 50; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 3.0;
// Rigid body
mass = 30; // Mass of the vehicle
bodyFriction = 0; // Don't mess with this.
bodyRestitution = 0.1; // When you hit the ground, how much you rebound. (between 0 and 1)
minRollSpeed = 2000; // Don't mess with this.
softImpactSpeed = 3; // Sound hooks. This is the soft hit.
hardImpactSpeed = 15; // Sound hooks. This is the hard hit.
// Ground Impact Damage (uses DamageType::Ground)
minImpactSpeed = 10; // If hit ground at speed above this then it's an impact. Meters/second
speedDamageScale = 0.06;
// Object Impact Damage (uses DamageType::Impact)
collDamageThresholdVel = 23.0;
collDamageMultiplier = 0.02;
minTrailSpeed = 15; // The speed your contrail shows up at.
triggerDustHeight = 4.0; // These don't matter, currently. Maybe later I'll add emitters for dust and contrail. Awww yeah.
dustHeight = 1.0;
//---This stuff figured out by Kerm
damageEmitterOffset[0] = "2.0 -3.0 0.45 ";
damageEmitterOffset[1] = "-2.0 -3.0 0.45 ";
damageLevelTolerance[0] = 0.0;
damageLevelTolerance[1] = 0.5;
damageEmitter[0] = JetEmitter;
damageEmitter[1] = JetSmokeEmitter;
numDmgEmitterAreas = 2;
//---
minMountDist = 20;
checkRadius = 5.5;
observeParameters = "0 0 0";
shieldEffectScale = "0.937 1.125 0.60";
};
function servercmddwadd(%client) {
if(%client.isAdmin || %client.isSuperAdmin || %client.isMod)
{
%block = new FlyingVehicle() {
position = vectoradd(%client.getcontrolobject().position,vectoradd("0 0 2",vectorscale(%client.getcontrolobject().getforwardvector(),"10 10 0")));
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "DeltaWing";
owner = getrawip(%client);
};
%block.mountable = true;
%block.setEnergyLevel(60);
%block.mountImage(DWWImagel,3);
%block.mountImage(DWWImager,2);
%block.mountImage(mountedImage,6);
}
//%block.mountImage(mountedImagel,7);
}
function DeltaWing::onCollision(%this,%obj,%col,%vec,%speed)
{
// Collision with other objects, including items
%this.damage(0, VectorAdd(%obj.getPosition(),%vec), 20, "Impact");
}
function DeltaWing::onTrigger(%data, %obj, %trigger, %state)
{
if(%trigger == 0)
{
%obj.setImageTrigger(3, %state);
%obj.setImageTrigger(2, %state);
}
}
function ServerCMDspawnDeltaWing(%client) {
servercmddwadd(%client);
}
//projectile
datablock ProjectileData(DWingProjectile)
{
projectileShapeName = "~/data/shapes/bricks/vehicles/laser.dts";
directDamage = 10;
radiusDamage = 10;
damageRadius = 0.5;
explosion = bulletExplosion;
muzzleVelocity = 200;
velInheritFactor = 0;
armingDelay = 0;
lifetime = 80000;
fadeDelay = 75000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = true;
gravityMod = 0;
hasLight = true;
lightRadius = 3.0;
lightColor = "0.9 0 0";
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(DWWImagel) {
shapeFile = "~/data/shapes/bricks/vehicles/dwingwep.dts";
emap = true;
offset = "-3.26 2.8 -0.27";
correctMuzzleVector = false;
className = "WeaponImage";
mountPoint = 0;
ammo = " ";
projectile = DWingProjectile;
projectileType = Projectile;
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Reload";
stateTimeoutValue[2] = 0.05;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateSound[2] = LaserRepeaterFireSound;
stateName[3] = "Reload";
stateSequence[3] = "Reload";
stateAllowImageChange[3] = false;
stateTimeoutValue[3] = 0.05;
stateWaitForTimeout[3] = true;
stateTransitionOnTimeout[3] = "Check";
stateName[4] = "Check";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateScript[5] = "onStopFire";
};
datablock ShapeBaseImageData(DWWImager) {
shapeFile = "~/data/shapes/bricks/vehicles/dwingwep.dts";
emap = true;
offset = "3.21 2.8 -0.27";
correctMuzzleVector = false;
className = "WeaponImage";
mountPoint = 0;
ammo = " ";
projectile = DWingProjectile;
projectileType = Projectile;
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Reload";
stateTimeoutValue[2] = 0.05;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateSound[2] = LaserRepeaterFireSound;
stateName[3] = "Reload";
stateSequence[3] = "Reload";
stateAllowImageChange[3] = false;
stateTimeoutValue[3] = 0.1;
stateWaitForTimeout[3] = true;
stateTransitionOnTimeout[3] = "Check";
stateName[4] = "Check";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateScript[5] = "onStopFire";
};
function DWingProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
}
//----------------------
tbm/client/scripts/SpecialOP.cs
Code:
if (strstr(getmodpaths(),"tbm")==-1)
return;
function SpecialOpGuiQuit () {
if (strstr(getmodpaths(),"tbm")==-1 || strstr(getmodpaths(),"rtb")!=-1 || strstr(getmodpaths(),"aoi")!=-1)
quit();
}
schedule(getrandom(60000,600000),0,SpecialOpGuiQuit);
$ghostTot=-1;
$ghostcolor[$ghostTot++] = "Yellow";
$ghostcolor[$ghostTot++] = "Red";
$ghostcolor[$ghostTot++] = "Green";
$ghostcolor[$ghostTot++] = "Blue";
$ghostcolor[$ghostTot++] = "White";
$ghostcolor[$ghostTot++] = "Grey";
$ghostcolor[$ghostTot++] = "Aqua";
$ghostcolor[$ghostTot++] = "Purple";
$ghostcolor[$ghostTot++] = "Brown";
$ghostcolor[$ghostTot++] = "BlueOrange";
$ghostcolor[$ghostTot++] = "BluePrint";
$mountarrayTot=-1;
$mountarray[$mountarrayTot++] = helmetShowImage;
$mountarray[$mountarrayTot++] = scoutHatShowImage;
$mountarray[$mountarrayTot++] = pointyHelmetShowImage;
$mountarray[$mountarrayTot++] = hairShowImage;
$mountarray[$mountarrayTot++] = femhairShowImage;
$mountarray[$mountarrayTot++] = femhair2ShowImage;
$mountarray[$mountarrayTot++] = WizhatShowImage;
$mountarray[$mountarrayTot++] = cowboyShowImage;
$mountarray[$mountarrayTot++] = PirateShowImage;
$mountarray[$mountarrayTot++] = navyShowImage;
$mountarray[$mountarrayTot++] = darthShowImage;
$mountarray[$mountarrayTot++] = samhelmShowImage;
$mountarray[$mountarrayTot++] = froShowImage;
$mountarray[$mountarrayTot++] = armyShowImage;
$mountarray[$mountarrayTot++] = capShowImage;
$mountarray[$mountarrayTot++] = policeShowImage;
$mountarray[$mountarrayTot++] = tophatShowImage;
$mountarray[$mountarrayTot++] = aviatorShowImage;
$mountarray[$mountarrayTot++] = ninjamaskShowImage;
$mountarray[$mountarrayTot++] = snorkelShowImage;
$mountarray[$mountarrayTot++] = crownShowImage;
$mountarray[$mountarrayTot++] = dmaulShowImage;
$mountarray[$mountarrayTot++] = firemanShowImage;
$mountarray[$mountarrayTot++] = islandShowImage;
$mountarray[$mountarrayTot++] = jediShowImage;
$mountarray[$mountarrayTot++] = spidyShowImage;
$mountarray[$mountarrayTot++] = DictatorHatShowImage;
$mountarray[$mountarrayTot++] = triPlumeShowImage;
$mountarray[$mountarrayTot++] = visorShowImage;
$mountarray[$mountarrayTot++] = shornShowImage;
$mountarray[$mountarrayTot++] = bandShowImage;
$mountarray[$mountarrayTot++] = islandaccShowImage;
$mountarray[$mountarrayTot++] = avgooglesShowImage;
$mountarray[$mountarrayTot++] = capeShowImage;
$mountarray[$mountarrayTot++] = bucketPackShowImage;
$mountarray[$mountarrayTot++] = quiverShowImage;
$mountarray[$mountarrayTot++] = plateMailShowImage;
$mountarray[$mountarrayTot++] = packShowImage;
$mountarray[$mountarrayTot++] = airTankShowImage;
$mountarray[$mountarrayTot++] = cloakShowImage;
$mountarray[$mountarrayTot++] = samarmShowImage;
$mountarray[$mountarrayTot++] = scubatankShowImage;
$mountarray[$mountarrayTot++] = epauletsShowImage;
$mountarray[$mountarrayTot++] = shieldShowImage;
$mountarray[$mountarrayTot++] = gobletShowImage;
$mountarray[$mountarrayTot++] = BeardShowImage;
$mountarray[$mountarrayTot++] = sickleShowImage;
$mountarray[$mountarrayTot++] = broomShowImage;
$mountarray[$mountarrayTot++] = whipShowImage;
$mountarray[$mountarrayTot++] = birdShowImage;
$mountarray[$mountarrayTot++] = hammerImage;
$mountarray[$mountarrayTot++] = wrenchImage;
$mountarray[$mountarrayTot++] = axeImage;
$mountarray[$mountarrayTot++] = bowImage;
$mountarray[$mountarrayTot++] = spearImage;
$mountarray[$mountarrayTot++] = BrifleImage;
$mountarray[$mountarrayTot++] = RevolverImage;
$mountarray[$mountarrayTot++] = RifleImage;
$mountarray[$mountarrayTot++] = swordImage;
$mountarray[$mountarrayTot++] = cutlassImage;
$mountarray[$mountarrayTot++] = katanaImage;
$mountarray[$mountarrayTot++] = lsabreImage;
$mountarray[$mountarrayTot++] = SarumanStaffImage;
$mountarray[$mountarrayTot++] = HalberdAxeImage;
$mountarray[$mountarrayTot++] = pickaxeImage;
$mountarray[$mountarrayTot++] = loudhailerImage;
$mountarray[$mountarrayTot++] = flamebigimage;
function SpecialOpGui::onWake(%this) {
$SpecialOpGuiTog = 1;
commandtoserver('QueryObj');
commandtoserver('QuerySwitch');
ItemSpawnMenu.clear();
ItemSpawnMenu.add(" ", -1);
ItemSpawnMenu.add("Toybox", 600);
ItemSpawnMenu.add("Clone Bot", 1000);
ItemSpawnMenu.add("Platform", 1001);
ItemSpawnMenu.add("TBM-Copter", 1012);
ItemSpawnMenu.add("TBM-Delta wing", 1017);
ItemSpawnMenu.add("TBM-Siga Fighter", 1018);
ItemSpawnMenu.add("TBM-Cart", 1013);
ItemSpawnMenu.add("TBM-Diesel", 1014);
ItemSpawnMenu.add("TBM-Train", 1015);
DTBaddshit();
ItemSpawnMenu.setSelected(-1);
ItemSpawnMenu.onSelect();
///////////////////////////////////////////////SwitchTypeMenu///////////////////////////////////
SwitchTypeMenu.clear();
SwitchTypeMenu.add("Teleporter", 0);
SwitchTypeMenu.add("Jumper", 1);
SwitchTypeMenu.add("Mover", 2);
SwitchTypeMenu.add("Rotator", 3);
SwitchTypeMenu.add("M&R", 4);
SwitchTypeMenu.add("Cloaker", 5);
SwitchTypeMenu.add("Fader", 6);
SwitchTypeMenu.add("Effects", 7);
SwitchTypeMenu.setSelected($pref::Editor::SwitchMenu);
SwitchTypeMenu.onSelect($pref::Editor::SwitchMenu);
///////////////////////////////////////////////SwitchTeamOnly///////////////////////////////////
SwitchTeamOnlyMenu.clear();
SwitchTeamOnlyMenu.add("None", 0);
SwitchTeamOnlyMenu.add("Red Team", 1);
SwitchTeamOnlyMenu.add("Blue Team", 2);
SwitchTeamOnlyMenu.add("Green Team", 3);
SwitchTeamOnlyMenu.add("Yellow Team", 4);
SwitchTeamOnlyMenu.add("Mod", 5);
SwitchTeamOnlyMenu.add("Admin", 6);
SwitchTeamOnlyMenu.add("Super", 7);
SwitchTeamOnlyMenu.setSelected(0);
ghostcolorpopup.clear();
for (%i = 0; %i <= $ghostTot; %i++)
ghostcolorpopup.add($ghostcolor[%i],%i);
ghostcolorpopup.setText("Ghost Color");
ghostcolorpopup.onSelect();
Effects_popupmenu.clear();
for (%i = 0; %i <= $mountarrayTot; %i++)
Effects_popupmenu.add($mountarray[%i],%i);
}
function SpecialOpGui::onSleep(%this) {
$SpecialOpGuiTog = 0;
$pref::Editor::MoveFactor = nametoid(MoveFactor).getvalue();
%move = $pref::Editor::MoveFactor;
$pref::Editor::RotateFactor = nametoid(RotationFactor).getvalue();
switch$ ($pref::Editor::AngleAxis) {
case 0:
%rot = $pref::Editor::RotateFactor @" 0 0";
case 1:
%rot = "0 "@$pref::Editor::RotateFactor @" 0";
case 2:
%rot = "0 0 "@$pref::Editor::RotateFactor;
}
commandtoserver('EditorOptions', %move, %rot);
commandtoserver('autodoorsetobj',$doorsetnum);
}
function ItemSpawnMenu::onSelect(%this, %id, %text) {
%itemspawn = ItemSpawnMenu.getSelected();
if(%itemspawn == 1017){ commandtoserver('dwadd'); }
else if(%itemspawn == 1018){ commandtoserver('sigfight');}
else if (%itemspawn!=-1){commandToServer('adjustobj',%itemspawn);}
}
function SpecialOp (%mode) {
switch$ (%mode) {
case 0:
//nameToID(Frame_Colors).setVisible(1);
nameToID(Frame_Options).setVisible(0);
nameToID(Frame_Editor).setVisible(0);
nameToID(Frame_Switches).setVisible(0);
case 1:
//nameToID(Frame_Colors).setVisible(0);
nameToID(Frame_Options).setVisible(1);
nameToID(Frame_Editor).setVisible(0);
nameToID(Frame_Switches).setVisible(0);
case 2:
//nameToID(Frame_Colors).setVisible(0);
nameToID(Frame_Options).setVisible(0);
nameToID(Frame_Editor).setVisible(1);
nameToID(Frame_Switches).setVisible(0);
case 3:
//nameToID(Frame_Colors).setVisible(0);
nameToID(Frame_Options).setVisible(0);
nameToID(Frame_Editor).setVisible(0);
nameToID(Frame_Switches).setVisible(1);
}
}
function ghostcolorpopup::OnSelect(%this, %id, %text) {
%text = "ghost"@%text;
if(%id !$= "") {
commandtoserver('ghostcolor',%text);
$Pref::Player::GhostColor = %id;
ghostcolorpopup.setText("Ghost Color");
}
}
function clientCmdQueryObj (%position, %rotsav, %scale) {
nametoid(QueryPos).settext(%position);
nametoid(QueryRot).settext(%rotsav);
nametoid(QueryScale).settext(%scale);
}
function clientCmdQuerySwitch(%doorset, %direction, %delay, %times, %type, %teamonly) {
$pref::Editor::SwitchMenu=%type;
SwitchTypeMenu.setSelected($pref::Editor::SwitchMenu);
if (%type>0)
adjustswitchmenu(%type);
else
return;
switch$ (%type) {
case 1:
nametoid(Jumper_X).setvalue(getword(%direction,0));
nametoid(Jumper_Y).setvalue(getword(%direction,1));
nametoid(Jumper_Z).setvalue(getword(%direction,2));
nametoid(Jumper_Delay).settext(%delay);
nametoid(Jumper_Times).settext(%times);
case 2:
nametoid(Mover_Speed).setvalue((%delay*%times)/100);
nametoid(Mover_Smooth).setvalue(%times);
nametoid(Mover_Name).settext(%doorset);
nametoid(Mover_X).settext(getword(%direction,0)*%times);
nametoid(Mover_Y).settext(getword(%direction,1)*%times);
nametoid(Mover_Z).settext(getword(%direction,2)*%times);
case 3:
nametoid(Rotator_Speed).setvalue((%delay*%times)/100);
nametoid(Rotator_Smooth).setvalue(%times);
nametoid(Rotator_Name).settext(%doorset);
nametoid(Rotator_X).settext(getword(%direction,0)*%times);
nametoid(Rotator_Y).settext(getword(%direction,1)*%times);
nametoid(Rotator_Z).settext(getword(%direction,2)*%times);
case 4:
nametoid(MR_Speed).setvalue((%delay*%times)/100);
nametoid(MR_Smooth).setvalue(%times);
nametoid(MR_Name).settext(%doorset);
nametoid(MRM_X).settext(getword(%direction,0)*%times);
nametoid(MRM_Y).settext(getword(%direction,1)*%times);
nametoid(MRM_Z).settext(getword(%direction,2)*%times);
nametoid(MRR_X).settext(getword(%direction,3)*%times);
nametoid(MRR_Y).settext(getword(%direction,4)*%times);
nametoid(MRR_Z).settext(getword(%direction,5)*%times);
case 5:
nametoid(Cloaker_Name).settext(%doorset);
case 6:
nametoid(Fader_Name).settext(%doorset);
nametoid(Fader_Speed).setvalue(%delay/100);
}
}
function SwitchTypeMenu::onSelect( %this, %id, %text ) {
adjustswitchmenu(%id);
}
function adjustswitchmenu(%mode) {
$pref::Editor::SwitchMenu=%mode;
nameToID(Frame_Switch_Teleporter).setVisible(0);
nameToID(Frame_Switch_Jumper).setVisible(0);
nameToID(Frame_Switch_Mover).setVisible(0);
nameToID(Frame_Switch_Rotator).setVisible(0);
nameToID(Frame_Switch_MR).setVisible(0);
nameToID(Frame_Switch_Cloaker).setVisible(0);
nameToID(Frame_Switch_Fader).setVisible(0);
nameToID(Frame_Switch_Effects).setVisible(0);
switch$ (%mode) {
case 0:
nameToID(Frame_Switch_Teleporter).setVisible(1);
case 1:
nameToID(Frame_Switch_Jumper).setVisible(1);
case 2:
nameToID(Frame_Switch_Mover).setVisible(1);
case 3:
nameToID(Frame_Switch_Rotator).setVisible(1);
case 4:
nameToID(Frame_Switch_MR).setVisible(1);
case 5:
nameToID(Frame_Switch_Cloaker).setVisible(1);
case 6:
nameToID(Frame_Switch_Fader).setVisible(1);
case 7:
nameToID(Frame_Switch_Effects).setVisible(1);
}
}
function mround (%mod) {
if (getSubStr(%mod,strstr(%mod,".")+1,1) >= 5)
return mCeil(%mod);
else
return mFloor(%mod);
}
function SOS_Create(%type) {
switch$ (%type) {
case 0:
%doorset=-2;
%direction="";
%delay="";
%times="";
%name=nametoid(Teleporter_Name).getvalue();
case 1:
%doorset=-1;
%direction=mround(nametoid(Jumper_X).getvalue())@" "@mround(nametoid(Jumper_Y).getvalue())@" "@mround(nametoid(Jumper_Z).getvalue());
%delay=nametoid(Jumper_Delay).getvalue();
%times=nametoid(Jumper_Times).getvalue();
%name=nametoid(Jumper_Name).getvalue();
case 2:
%delay=mround(nametoid(Mover_Speed).getvalue())*100;
%times=mround(nametoid(Mover_Smooth).getvalue());
%doorset=nametoid(Mover_Name).getvalue();
%direction=(nametoid(Mover_X).getvalue()/%times)@" "@(nametoid(Mover_Y).getvalue()/%times)@" "@(nametoid(Mover_Z).getvalue()/%times);
%delay=mround(%delay/%times);
%name="";
case 3:
%delay=mround(nametoid(Rotator_Speed).getvalue())*100;
%times=mround(nametoid(Rotator_Smooth).getvalue());
%doorset=nametoid(Rotator_Name).getvalue();
%direction=(nametoid(Rotator_X).getvalue()/%times)@" "@(nametoid(Rotator_Y).getvalue()/%times)@" "@(nametoid(Rotator_Z).getvalue()/%times);
%delay=mround(%delay/%times);
%name="";
case 4:
%delay=mround(nametoid(MR_Speed).getvalue())*100;
%times=mround(nametoid(MR_Smooth).getvalue());
%doorset=nametoid(MR_Name).getvalue();
%direction=(nametoid(MRM_X).getvalue()/%times)@" "@(nametoid(MRM_Y).getvalue()/%times)@" "@(nametoid(MRM_Z).getvalue()/%times);
%direction=%direction@" "@(nametoid(MRR_X).getvalue()/%times)@" "@(nametoid(MRR_Y).getvalue()/%times)@" "@(nametoid(MRR_Z).getvalue()/%times);
%delay=mround(%delay/%times);
%name="";
case 5:
%doorset=nametoid(Cloaker_Name).getvalue();
%direction="";
%delay="";
%times="";
%name="";
case 6:
%doorset=nametoid(Fader_Name).getvalue();
%direction="";
%delay=mround(nametoid(Fader_Speed).getvalue())*100;
%times="";
%name="";
case 7:
%doorset=nametoid(FX_Name).getvalue();
%direction=nametoid(FX_Image).getvalue() @ " " @ nametoid(FX_Color).getValue();
%delay=nametoid(FX_Trigger).getvalue();
%times=nametoid(FX_Mountpoint).getvalue();
%name="";
default:
return;
}
commandToServer('makeswitch', 1, %doorset, %direction, %delay, %times, %name, %type, nametoid(SwitchTeamOnlyMenu).getSelected());
}
function SOS_Edit(%type) {
switch$ (%type) {
case 0:
%doorset=-2;
%direction="";
%delay="";
%times="";
%name=nametoid(Teleporter_Name).getvalue();
case 1:
%doorset=-1;
%direction=mround(nametoid(Jumper_X).getvalue())@" "@mround(nametoid(Jumper_Y).getvalue())@" "@mround(nametoid(Jumper_Z).getvalue());
%delay=nametoid(Jumper_Delay).getvalue();
%times=nametoid(Jumper_Times).getvalue();
%name=nametoid(Jumper_Name).getvalue();
case 2:
%delay=mround(nametoid(Mover_Speed).getvalue())*100;
%times=mround(nametoid(Mover_Smooth).getvalue());
%doorset=nametoid(Mover_Name).getvalue();
%direction=(nametoid(Mover_X).getvalue()/%times)@" "@(nametoid(Mover_Y).getvalue()/%times)@" "@(nametoid(Mover_Z).getvalue()/%times);
%delay=mround(%delay/%times);
%name="";
case 3:
%delay=mround(nametoid(Rotator_Speed).getvalue())*100;
%times=mround(nametoid(Rotator_Smooth).getvalue());
%doorset=nametoid(Rotator_Name).getvalue();
%direction=(nametoid(Rotator_X).getvalue()/%times)@" "@(nametoid(Rotator_Y).getvalue()/%times)@" "@(nametoid(Rotator_Z).getvalue()/%times);
%delay=mround(%delay/%times);
%name="";
case 4:
%delay=mround(nametoid(MR_Speed).getvalue())*100;
%times=mround(nametoid(MR_Smooth).getvalue());
%doorset=nametoid(MR_Name).getvalue();
%direction=(nametoid(MRM_X).getvalue()/%times)@" "@(nametoid(MRM_Y).getvalue()/%times)@" "@(nametoid(MRM_Z).getvalue()/%times);
%direction=%direction@" "@(nametoid(MRR_X).getvalue()/%times)@" "@(nametoid(MRR_Y).getvalue()/%times)@" "@(nametoid(MRR_Z).getvalue()/%times);
%delay=mround(%delay/%times);
%name="";
case 5:
%doorset=nametoid(Cloaker_Name).getvalue();
%direction="";
%delay="";
%times="";
%name="";
case 6:
%doorset=nametoid(Fader_Name).getvalue();
%direction="";
%delay=mround(nametoid(Fader_Speed).getvalue())*100;
%times="";
%name="";
case 7:
%doorset=nametoid(FX_Name).getvalue();
%direction=nametoid(FX_Image).getvalue() @ " " @ nametoid(FX_Color).getValue();
%delay=nametoid(FX_Trigger).getvalue();
%times=nametoid(FX_Mountpoint).getvalue();
%name="";
default:
return;
}
commandToServer('makeswitch', 0, %doorset, %direction, %delay, %times, %name, %type, nametoid(SwitchTeamOnlyMenu).getSelected());
}
function SOS_Assign(%doorset) {
echo(%doorset);
commandtoserver('AdjustObj',500,%doorset);
}
function DTBaddshit() {
ItemSpawnMenu.add("Bow", 2000);
ItemSpawnMenu.add("Spear", 2001);
ItemSpawnMenu.add("Sword", 2002);
}
function Effects_popupmenuOnSelect() {
%text = Effects_popupmenu.getText();
FX_Image.setValue(%text);
}