Author Topic: Weapon Disguise, excluding local client  (Read 1919 times)

For a project that I am making, I am creating a disguise tool which also disguises your weapon.

The person who disguised should be able to see the weapon normally.
Everybody else should see it as a diffirent weapon, thus meaning "disguised".

Is there anyway that I could do this, if yes, how?


Well, is it possible if the local client sees the disguised weapon then, but when fired, it "uncloaks" and fires as the uncloaked weapon would?



Well, basically like this:

There are 5 players on the server.
Player 1 has a 'Guns Akimbo' weapon in his hands
Player 1 uses the disguise thing with argument 'Bow'
Player 1 including everybody else now see the weapon in his hands as a Bow
Player 1 shoots the weapon
  -> It turns into a Guns Akimbo
  -> It fires (like it would originally do)

Actually I think I found a solution. Would something like this work?
Code: [Select]
function disguise(%playerobj,%image)
{
    %playerobj.disguised_image = player.getMountedImage(0);
    %playerobj.hasImageDisguise = true;
    %playerobj.mountImage(%image,0);
}

package SOMETHING
{
    function Armor::onTrigger(%bacon,%ham,%milk,%cheese,%and,%other,%args)
    {
        if(%val && %slot == 0 && %obj.hasImageDisguise)
            %playerobj.mountImage(%obj.disguised_image,0);
        Parent::onTrigger(%meat,%water,%salad,%and,%spam);
    }
};
activatePackage(SOMETHING);
« Last Edit: October 28, 2010, 05:45:11 AM by Bauklotz »


Well, I'm basically making it for the 'Disguise Kit' item for Spy for Gamemode_BlockBastion2.

What may be possible is something like how the cloaking watches work: You can see it in first person by setting the eyeOffset to something and the normal offset to "0 0 -10000", then make another third-person image that does nothing with the two swapped, mount them both. I don't know how it'd work with firing sequences though and you'd need an invisible copy of every weapon you plan the disguise kit's holder to have.

Nope.
Wepon with 2 different models.
Nay.

Nope.
Wepon with 2 different models.
Nay.
Well my idea is effectively "two weapons, one you can't see and one that actually works but everyone else can't see".

What may be possible is something like how the cloaking watches work: You can see it in first person by setting the eyeOffset to something and the normal offset to "0 0 -10000", then make another third-person image that does nothing with the two swapped, mount them both. I don't know how it'd work with firing sequences though and you'd need an invisible copy of every weapon you plan the disguise kit's holder to have.

I understand this, but how would I kind of mount two weapons to the hand (slot 0)? By the way, I don't need third person because this is for a TF2 remake, and TF2 does not have third person.

The third person one is so that everyone else sees a fake weapon in your hand, otherwise it's easy to target people carrying no item.

You can set the "mountPoint" of the image to be different from the "slot" you attach it to.

So basically, you mean that I do like this:

SLOT 0 (right hand):
Some weapon, for example a Butterfly Knife.
Third person, the high offset makes it invisible.
First person, offset is normal so it is visible.

SLOT 1 (left hand):
Some weapon, for example a Rocket Launcher.
Third person, has a offset which makes it look like it is mounted to right hand.
First person, the high offset makes it invisible.

That?

Correct. In that case you'd give the butterfly a normal attacking sequence and the right hand one just acts as a dummy.

What I'm not sure about is how you'd transition from "first-person only knife" to "visible to all knife" for when you get undisguised by trying to attack, unless you made it only undisguise after the whole stabbing animation. (which'd be very noticable with a Rocket Launcher swinging around but might work for e.g. the Eternal Reward instant disguise)