No announcement yet.

Vehicle HUDs

  • Filter
  • Time
  • Show
Clear All
new posts

    Vehicle HUDs

    Ok, here's the deal, as many of you know, if the Cicada is used in a gametype other than ONS, it usually generates errors about the HUD

    Well, I'm making a vehicle based off of the Cicada with diff weapons and these are the errors it's generating
    Warning: kCicada VCTF-KS-TorlanK.kCicada (Function KelRV.kCicada.DrawHUD:0069) Accessed None 'Weapons'
    Warning: kCicada VCTF-KS-TorlanK.kCicada (Function KelRV.kCicada.DrawHUD:0011) Accessed None 'Weapons'
    Now, I decided to backtrace vehicle code and got all the way back to ONSVehicle when I finally spotted something useful(the code that supplies alignment reticles I believe)
    simulated function DrawHUD(Canvas Canvas)
        local PlayerController PC;
        local vector CameraLocation;
        local rotator CameraRotation;
        local Actor ViewActor;
    	if (IsLocallyControlled() && ActiveWeapon < Weapons.length && Weapons[ActiveWeapon] != None && Weapons[ActiveWeapon].bShowAimCrosshair && Weapons[ActiveWeapon].bCorrectAim)
    		Canvas.DrawColor = CrosshairColor;
    		Canvas.DrawColor.A = 255;
    		Canvas.Style = ERenderStyle.STY_Alpha;
    		Canvas.SetPos(Canvas.SizeX*0.5-CrosshairX, Canvas.SizeY*0.5-CrosshairY);
    		Canvas.DrawTile(CrosshairTexture, CrosshairX*2.0+1, CrosshairY*2.0+1, 0.0, 0.0, CrosshairTexture.USize, CrosshairTexture.VSize);
        PC = PlayerController(Controller);
    	if (PC != None && !PC.bBehindView && HUDOverlay != None)
            if (!Level.IsSoftwareRendering())
        		CameraRotation = PC.Rotation;
        		SpecialCalcFirstPersonView(PC, ViewActor, CameraLocation, CameraRotation);
        		HUDOverlay.SetLocation(CameraLocation + (HUDOverlayOffset >> CameraRotation));
        		Canvas.DrawActor(HUDOverlay, false, false, FClamp(HUDOverlayFOV * (PC.DesiredFOV / PC.DefaultFOV), 1, 170));
    Now, since the Cicada overrides all this to add in it's own HUD data, could I just add that into my Cicada derivitive to make the alignment reticle appear but remove the HUD errors?

    I'm going to give this a shot and see, so if you find this thread locked/deleted, it worked

    FYI the latest patch fixes that, also a search on the forum yileds already such modified Cicadas


      Yea, but I'm not even using the default Cicada HUD, so I figure get the stuff out anyway.
      The weapons are mostly referenced to tweaked versions of some of the other existing vehicle weapons

      Oh yea, my theory worked.