Announcement

Collapse
No announcement yet.

UnrealScript Code for Post Process Effects and Chain, Get Effect Names

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UnrealScript Code for Post Process Effects and Chain, Get Effect Names

    Dear Everyone,

    UDN link to kismet and unrealscript postprocesschain code

    Post Process Effects allow for things like Bloom, anti aliasing, motion blur, global screen color alterations, color enhancement, depth of field changes (can be used to make fancy fog or atmospheric effects)

    If you want to use unrealscript to modify Post Process Effects from the Post Process Chain, you have to be able to determine what the name of each Effect is.

    I am providing you with the code here to retrieve the names of the effects in a chain dynamically during game runtime.

    All you need to know is the PostProcessChain's package location.

    ~~~

    PPC Basics
    Steps in the UDK

    1: Create your Post Process Chain in the UDK , rightclick in a package -> post process chain

    2: View-> World properties -> assign your post process chain so it is in use

    3: add nodes to the chain by double-clicking your Post Process Chain and in the editor right-click -> add the various nodes

    make sure to give each node a distinct name as you create them.

    4: save the package containing your PostProcessChain.

    5: right click on the Post Process Chain in the UDK and "copy full name to clipboard"

    ~~~

    UnrealScript Code for Post Process Effects and Chain

    let's say your Post Process Chain filename is called PostProcessChain'JoyPackage.VictoryPostProcessChai n'

    use this code sample in one of your classes to retrieve the names of all the Effects in your Post Process Chain

    Code:
    //global var for saving the names
    var array<Name> PPENames;
    
    function obtainPPEs(){
       local PostProcessChain PPC;
       local int v;
       
       PPC = PostProcessChain(DynamicLoadObject("JoyPackage.VictoryPostProcessChain",  
                       class'PostProcessChain'));
       
    
       for (v = 0; v < PPC.Effects.length; v++ ) {
    	PPENames.addItem(PPC.Effects[v].EffectName);
           
           //when you test this make sure you have -log in your run command
           `log("ppe"$v@PPC.Effects[v].EffectName);
       }
    
    }
    once you have the names of all your Post Process Effects stored, you can use:

    Code:
    PostProcessEffect = PlayerController.PlayerPostProcess.FindPostProcessEffect(PostProcessEffectName);
    to retrieve the actual Post Process Effect itself and then edit its values

    (I will probably write more on this later but it is covered elsewhere on the internet)

    The key issue for which I am providing this code is that there was no easy function to get a list of all possible PostProcessEffectNames, so I'm providing that code to you here



    Rama

    #2
    Help ; Not working for me

    Code:
                 
    
    function obtainPPEs()
    
    {
       local PostProcessChain PPC;
       local int v;
    
       PPC = PostProcessChain(DynamicLoadObject("GOTACinematics.LoadingScreenPPC",
                       class'PostProcessChain'));
    
    
       for (v = 0; v < PPC.Effects.length; v++ )
       {
    	PPENames.addItem(PPC.Effects[v].EffectName);
        `log("ppe"$v@PPC.Effects[v].EffectName);
       }
    
    }
    log = None...

    Thanks in advance

    You can just have one process Chain per map ?

    NVM resolved it works had to name a node.

    Comment


      #3
      Hey EvernewJoy, nice tutorial. I've got a problem though.... this last code snippet isn't working for me...
      Code:
      PostProcessEffect = PlayerController.PlayerPostProcess.FindPostProcessEffect(PostProcessEffectName);
      All I've done is replace the PostProcessEffectName with the effect name I have in code.

      The compile says Bad or Missing Expression for token: PlayerController, in '='

      The previous code works fine, I'm using it in a custom Pawn class.

      Is there some specific way I should use this code? Any advice would be good

      Comment

      Working...
      X