1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

RenderOverlays function

Discussion in 'Ask a Coder' started by Wormbo, Aug 21, 2001.

  1. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,912
    Likes Received:
    35
    I'm currently experimenting with the RenderOverlays function of weapons to allow other inventory items or maybe hud mutators to add some effects.
    Now the new UDamage doesn't change the weapon's texture but draws that glow around the weapon.
    Everything is fine until I get double enforcers. The right one does get the cool glow, but the left doesn't.
    That's the code of the basic weapon class I use:
    Code:
    simulated function RenderOverlays(canvas Canvas)
    {
    	local Mutator M;
    	local PickupPlus A;
    	local bool bOverride;
    	
    	for (A = PickupPlus(Affector); !bOverride && A != None; A = PickupPlus(A.NextAffector))
    		if ( A.bRenderOverlays ) {
    			bOverride = A.PreRenderOverlaysFor(Self, Canvas) || bOverride;
    		}
    	
    	if ( !bOverride ) {
    		Super.RenderOverlays(Canvas);
    		
    		for (A = PickupPlus(Affector); A != None; A = PickupPlus(A.NextAffector))
    			if ( A.bRenderOverlays ) {
    				A.PostRenderOverlaysFor(Self, Canvas);
    			}
    	}
    	if ( SlaveWeapon != None )
    		SlaveWeapon.RenderOverlays(Canvas);
    }
    
    The UDamage (one of the affectors) gets a PostRenderOverlaysFor() call with the weapon (Self) as a parameter.
    Now if a second enforcer is picked up it *should* be registered as the SlaveWeapon but why isn't this working?
     
  2. Bytekeeper

    Bytekeeper Last of the Brunnen G

    Joined:
    Jul 15, 2001
    Messages:
    181
    Likes Received:
    0
    :eek: Your second enforcer's renderoverlay is not called...
    You need to call:
    SlaveEnforcer.RenderOverlays()

    Oh just read a bit more ;)
    So it seems that your slaveweapon registration code is buggy.
     
  3. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,912
    Likes Received:
    35
    Damn!
    I renamed SlaveEnforcer to SlaveWeapon and moved it and bIsSlave to the super class (that's where this function resides).
    Oh well, it's gonna be a long night...;)
     

Share This Page