Announcement

Collapse
No announcement yet.

Setting a default property

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

    Setting a default property

    I am helping someone write a mutator.

    We are extending the SuperShockBeamEffect Class.

    I need to set the mColorRange property

    SuperShockBeamEffect extends ShockBeamEffect
    ShockBeamEffect extends xEmitter

    var(PclVisuals) color mColorRange[2]; is a property of xEmitter and therefore should be a property of SuperShockBeamEffect

    My problem is that I have function to set the color of the beam:
    Code:
    function SetColor(string SelectedColor)
    {
        local Color NewColorRange;
        if (SelectedColor == "Red")
        {
    	NewColorRange.R = 240;
    	NewColorRange.G = 0;
    	NewcolorRange.B = 0;
    	NewColorRange.A = 240;
            mColorRange(0) = NewColorRange;
    
         	
        }
        else if (SelectedColor == "Blue")
        {
          	NewColorRange.R = 0;
    	NewColorRange.G = 0;
    	NewcolorRange.B = 2400;
    	NewColorRange.A = 240;
            mColorRange = NewColorRange;
    	
        }
        else if (SelectedColor == "Green")
        {
          	NewColorRange.R = 0;
    	NewColorRange.G = 240;
    	NewcolorRange.B = 0;
    	NewColorRange.A = 240;
            mColorRange = NewColorRange;
    	
        }
        else
        {
    	NewColorRange.R = 240;
    	NewColorRange.G = 240;
    	NewcolorRange.B = 240;
    	NewColorRange.A = 240;
            mColorRange = NewColorRange; 
    	
        }
       
    }
    When I compile I get:
    C:\UT2004\XxxXESRv2b\Classes\XxxXBeamEffect.uc(20) : Error, '(': Expression has no effect

    line 20 is

    Code:
     mColorRange(0) = NewColorRange;
    What am I doing wrong in setting this property?

    Thanks,
    ~DG

    #2
    Try [ and ]. It's worked for me in the past.

    Comment


      #3
      Tried:

      mColorRange[0] = NewColorRange;

      Getting:

      C:\UT2004\XxxXESRv2b\Classes\XxxXBeamEffect.uc(30) : Error, Array mismatch in '='

      :-(

      Comment


        #4
        Ok, the [ ] worked. What's line 30 in code?

        Comment


          #5
          Oh man! I apparently can't tell the difference between a 2 and a 3!

          Thanks!

          Comment

          Working...
          X