Author Topic: Emotes and Laser Sights  (Read 2069 times)

Totally unrelated things, amirite?

Anywho, firstly, I was wondering, is there anyway I can make /cmd emotes with sound? If so, how?

I'd also like to know how I can attach a laser sight (See .880 Rifle) to a weapon. A sample code or a good explanation would be fine.

1. Look at Emote_Alarm
2. What code have you actually tried? If you know the 880 rifle has it, try using that.

1. Look at Emote_Alarm
2. What code have you actually tried? If you know the 880 rifle has it, try using that.
1. Did. Tried. Didn't work. I don't even see a cmd function in it, is it built into Blockland or what?
2. I don't know how either. Simply copy-pasting the obvious parts didn't work.

First, 880 would be the only thing you need to look at when making a laser.
Second, I recommend downloading another emote and look at that script.

1. Did. Tried. Didn't work. I don't even see a cmd function in it, is it built into Blockland or what?
/wtf
2. I don't know how either. Simply copy-pasting the obvious parts didn't work.
Spam-spawn a projectile with a red dot emitter at the end of a raycast

/wtf
That's the Confused emote. Which has no sound and actually works differently, from what I can see.

That's the Confused emote. Which has no sound and actually works differently, from what I can see.
Oh right, for alarm it's /alarm, and that does appear to be built in. An emote command works like this:
Code: [Select]
function serverCmdEmote(%client)
{
   if(isObject(%obj = %client.player))
   {
      %obj.emote(Emote);
   }
}
The emote function can use projectiles or images.

So I just stick that into the code? I'll try that out in a bit.
Thanks.

you could try using the projectile from the laser pointer, and set it to stay on,
or be able to bind it to a key, like SHIFT + L or something to toggle the laser.

I'mdumbr0.

Someone fix this up to work with the Alarm emote?

Code: [Select]
function serverCmdMedic(%client)
{
   if(isObject(%obj = %client.player))
   {
      %obj.emote(Medic);
   }
}

What code are you using for the projectile/image data of the emote?

What code are you using for the projectile/image data of the emote?
Bawr.
It's a small script so:
Code: [Select]
function serverCmdMedic(%client)
{
   if(isObject(%obj = %client.player))
   {
      %obj.emote(Medic);
   }
}

datablock AudioProfile(MedicSound)
{
filename = "./Medic.wav";
description = AudioClosest3d;
preload = true;
};

datablock ParticleData(MedicParticle)
{
   dragCoefficient      = 5.0;
   gravityCoefficient   = 0.0;
   inheritedVelFactor   = 0.0;
   windCoefficient      = 0;
   constantAcceleration = 0.0;
   lifetimeMS           = 500;
   lifetimeVarianceMS   = 0;
   useInvAlpha          = false;
   textureName          = "./medic";
   colors[0]     = "1 1 1 1";
   colors[1]     = "1 1 1 1";
   colors[2]     = "1 1 1 1";
   sizes[0]      = 0.9;
   sizes[1]      = 0.9;
   sizes[2]      = 0.9;
   times[0]      = 0.0;
   times[1]      = 0.2;
   times[2]      = 1.0;
};

datablock ParticleEmitterData(MedicEmitter)
{
   ejectionPeriodMS = 35;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   ejectionOffset   = 1.8;
   velocityVariance = 0.0;
   thetaMin         = 0;
   thetaMax         = 0;
   phiReferenceVel  = 0;
   phiVariance      = 0;
   overrideAdvance = false;
   lifeTimeMS = 100;
   particles = "MedicParticle";

   doFalloff = false;

   emitterNode = GenericEmitterNode;
   pointEmitterNode = TenthEmitterNode;

   uiName = "Emote - Medic";
};

datablock ExplosionData(MedicExplosion)
{
   lifeTimeMS = 2000;
   emitter[0] = MedicEmitter;
   soundProfile = MedicSound;
};

datablock ProjectileData(MedicProjectile)
{
   explosion           = MedicExplosion;

   armingDelay         = 0;
   lifetime            = 10;
   explodeOnDeath = true;

   uiName = "Medic Emote";
};

Change %obj.emote(Medic); to %obj.emote(MedicProjectile);.

Although if you're doing the TF2 'medic' emote it won't work so well as it won't be visible unless you're directly facing the person, near them and have the texture downloaded, plus it's hard to type '/medic' in the middle of a firefight.

It's hard to type '/medic' in the middle of a firefight.
Yeah, about that.
Keybinds. hao2?

Anywho it works fine.
So now I can do a whole set, I already have /medic and /spai.
Once I can somehow do keybinds (if), I'll release.
And Space may as well be credited with the script itself, since I know essentially nothing.