Akimbo replication troubles, to the limit

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

A poll? What for?

  • I do not know!

    Votes: 0 0.0%
  • Silly rabbit, poles are for strippers!

    Votes: 2 25.0%
  • Arnold for President!!!

    Votes: 3 37.5%
  • Make a flamethrower!

    Votes: 3 37.5%

  • Total voters
    8

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
Ok so yesterday, if you were attentive, you would have noticed a thread that was up for about an hour and a half. I was having trouble getting the second pistol to show up in network games. I finally fixed that issue about a half hour after i posted asking for help, so i figured i might as well delete the thread. Now im back, with yet more troubles.
You see, i took a peek at the Akimbo mutator's method of making weapons akimbo, and for the most part its great. Had to hack away some of the stuff, but it works online now. The only real problem is that the slaved weapon wont animate unless its master tells it to (in this case that only happens during BringUp and PutDown)
The real issue with that is that you can fire, but the second one wont appear to shoot. I can live with that, but im sure that anyone who might play it would be kinda irked, so i need a fix for it. Ive got a feeling that theres something going horribly wrong, since the second pistol's ModeDoFire and InitEffects pump out AN's like nobody's business, but i have no idea why it would do that. The weapon exists both client and server side, so what would cause the firemodes to not recognise it? I mean, it doesnt draw a muzzleflash nor does it play the firing animation when i tell it to fire. It just sits there like some lazy bastard...
Heres a picture from when i just got the second one working online. I set its bHidden to false just to make sure there wasnt anything real wonky happening before it got postrender called, but that produced a third pistol that sort of chased me around, trying to keep itself in place :)
 

MadNad

New Member
Nov 5, 2002
32
0
0
madnad.com
EvilDrWong said:
Gah, fixed it. Turns out Instigator wasnt being set for some screwed up reason. Fixed all the problems i was having. Thanks for voting in the poll.

If you are using the same weapon for Akimbo, then just switch hands and render the weapon again. Thats what I am doing for Version 2 of excessive.
ExAssault.jpg


If you are trying to get two weapons working its much more a pain....I am close, but i have put it on hold, as I am too busy atm.
ethereal2.jpg
 

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
the only problem with rendering twice is that the weapon doesnt actually fire twice, it just pretends to. Ive gotten it so you can fire them in sequence when you hold the button down (and unlike the enforcer, the timing doesnt get messed up over long periods of firing.) bandaging and reloading both work just fine with dualies as well. Im rather pleased with what ive done (with the help of that funky Akimbo mutator thats floating around... anyone know the author?)
 

MadNad

New Member
Nov 5, 2002
32
0
0
madnad.com
EvilDrWong said:
the only problem with rendering twice is that the weapon doesnt actually fire twice, it just pretends to. Ive gotten it so you can fire them in sequence when you hold the button down (and unlike the enforcer, the timing doesnt get messed up over long periods of firing.) bandaging and reloading both work just fine with dualies as well. Im rather pleased with what ive done (with the help of that funky Akimbo mutator thats floating around... anyone know the author?)


Hehe, the guns don't really fire anyway....you shoot from your center to your opponent. My akimbo assaults shoot grenades from each weapon. The assault/flak combo above does not use that method of course
 

NeoNight

Lurker
Feb 3, 2003
403
0
0
Visit site
EvilDrWong said:
(with the help of that funky Akimbo mutator thats floating around... anyone know the author?)


I forgot who the author was but um..... if you do a search on the beyond unreal fourms for the word akimbo you can probably find the thread he made where he uploaded the file for the mut....
 

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
It doesnt make much sense, but i swear theres a question in here somewhere!

Once again, this problem rears its ugly head! DAMN YOU REPLICATION! DAMN YOU TO THE STINKIEST AND MOST MUSHROOM FILLED PITS OF HELL!!!
You see, i changed the format a little. Last time when i had this problem i didnt have a menu where you could select your stuff, but now... well, the times have changed. Players can opt to spawn with two pistols in leiu of a more fearsome weapon. Sadly though, instigators arent being set for the Slave's firemodes (yes, that sounds weird... because it is) but the slave itself is getting the correct instigator. Obviously, this problem doesnt amount to much on an Instant Action or Listenserver (for the server) but being a client of any sort means that the extra pistol you spawn with is three different kinds of screwed up. But you see, the most perplexing predicament of this precarious proposition would have to be that a player can pick up an extra pistol at any time after theyve been spawned... and it works perfectly fine! No instigator problems, the replication doesnt puke all over the logs, and it even mails me a $5 check every two weekends! Hang on, let me fish up the relevant code bits!
CODE!!!
Code:
class Pistol extends HalfCockedWeapon;

var pistol Master, Slave;
var bool bIsSlave, bSlavingNow;
var pawn RepInstigator;

replication
{
    Reliable if(bNetDirty&&bNetOwner&&Role==ROLE_Authority)
        Slave, Master;
    reliable if(bNetDirty&&Role==ROLE_Authority)
        bIsSlave, RepInstigator;
    reliable if(Role==ROLE_Authority)
        ClientSideSlaveStuff;
}

function GiveTo(Pawn Other, optional Pickup Pickup)
{
local pistol tPistol;

    tPistol=Pistol(Other.FindInventoryType(class));
    if(tPistol!=None&&tPistol.Slave==None&&tPistol.Master==None)
    {
        Instigator=Other;
        tPistol.SpawnDouble(Self);
        Return;
    }

    RepInstigator=Other;

    Super.GiveTo(Other, Pickup);
}

simulated function SpawnDouble(optional Pistol AlreadyFilled)
{
local inventory Copy;

    if(Slave==none)
    {
        if(AlreadyFilled!=None)
            Slave=AlreadyFilled;
        else
        {
            Copy=Spawn(class, Pawn(Owner) );
            Slave=Pistol(Copy);
        }
        if(Slave!=None)
        {
            Slave.SetOwner(Owner);
            Slave.Ammo[0]=Ammo[0];
            Slave.Ammo[1]=Ammo[1];
            Slave.bIsSlave=True;
            Slave.Master=Self;
            Slave.Instigator=RepInstigator;
            slave.FireMode[0].Instigator=RepInstigator;
            slave.FireMode[1].Instigator=RepInstigator;
            MagazineSize=Class.Default.MagazineSize*2;
            ClipCount=min(MagazineSize,ClipCount+class.Default.MagazineSize);
            if(Slave.ThirdPersonActor==None&&Pawn(Owner).Weapon==Self)
            {
                Slave.ThirdPersonActor=Spawn(Slave.AttachmentClass,Owner);
                InventoryAttachment(Slave.ThirdPersonActor).InitFor(Slave);
                Pawn(Owner).AttachToBone(Slave.ThirdPersonActor,'Bip01 L Hand');
                Slave.ThirdPersonActor.SetRelativeRotation(Rot(0,32768,0));
            }
//            Log(Slave@"exists during SpawnDouble on the Server?");
            Slave.ClientSideSlaveStuff(RepInstigator);
//            Sleep(0.3);
            Instigator.Inventory.OwnerEvent('ChangedWeapon');
        }
    }
}

simulated function ClientSideSlaveStuff(pawn NewInst)
{
    Instigator=NewInst;
    Log("Instigator:"@Instigator@"NewInst:"@NewInst);
    FireMode[0].Instigator=NewInst;
    FireMode[1].Instigator=NewInst;
    ClientState=WS_Hidden;
    GotoState('Hidden');
//    bHidden=false;

    Log(Pawn(Owner).Weapon@"weapon,"@Master@"master"@Master.ClientState@"clientstate");

    if(Pawn(Owner).Weapon==Master&&
        (Master.ClientState==WS_ReadyToFire||Master.ClientState==WS_BringUp))
        BringUp();
}
 
Last edited:

EvilDrWong

Every line of code elevates you
Jun 16, 2001
932
0
0
40
Inside the machine
Visit site
oh, no, your fix didnt mess stuff up. All of my semi-fixes did... thankfully though, ive got a backup of the code from a couple weeks ago... and the only changes ive made to the pistol between now and then have been the ones i did yesterday and the day before :)