Announcement

Collapse
No announcement yet.

Error, Call to "Spawn": Type mismatch in parameter 1

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

    #16
    Can you post all of what you've got for SetColor?

    Comment


      #17
      I was intending to use the SetColor you supplied, fully extended for the colors we intend to use.

      However. The problem is back to where we started, how do we call the Weapon.Spawn function with an instance of the XxxXBeamEffect class that has had the set color function called. Inestead of a reference to a class.

      Since I am new to UScript it seems as if the first parameter to Spawn is a class instead of an instance...

      eg...

      SomeFunction(float)

      instead of:

      var float sum
      sum = 4.5
      SomeFunction(sum)

      This is where I'm confused. We need to send the WeaponSpawn something other than the default properties with the class

      something like above or:

      weapon.spawn(XxxXBeamEffect(BE_BLUE),,,start,dir)
      or
      weapon.spawn(class'newbeam',,,start,dir)
      or
      weapon.spawn(class'XxxXBeamEffect'.SetColor(BE_BLU E),,,start,dir)


      I could be way off and maybe their is some coding principle of UScript that I am just not grasping.

      Comment


        #18
        IIRC Spawn returns the created Actor, so you could try to modify the returned object.

        Comment


          #19
          Now I'm just getting plain confused.

          Since I am just starting with UScript and I am more or less modifying code that I have been given, I feel bad for asking all these questions.

          I guess I'm too much of a UScript noob to follow this.. I'm relying on my OOPL background.

          We don't want to have to create a XxxXBeamEffectRed, Green, yellow, purple, etc.. for each color we want. I'm just missing the point on how to pass Weapon.Spawn () an instance of a XxxXBeamEffect object instead of a class definition with defaults.

          Comment


            #20
            What I meant was, try something like:
            Code:
            local Actor temp;
            Weapon.Spawn(class'XxxXBeamEffect',,, start, dir);
            if (temp.IsA('XxxXBeamEffect'))
                temp.SetColor(...)
            I actually have no idea whether that will work or not (never used Spawn before), but apparently spawn does return an actor, so... try it.

            Comment


              #21
              I figured out a potential work around to my original problem.
              Problem is it's shooting blanks...

              This isn't all of the code just the relevent parts.
              Code:
              class XxxXESRFire extends instantfire;
              
              var() class BeamEffectClass;
              var() class<ShockBeamEffect> BeamEffectClass2;
              
              Beam = Weapon.Spawn(BeamEffectClass2,,,Start,Dir);
              
              defaultproperties
              {
                   BeamEffectClass=class'XxxXBeamEffectGreen'
                   BeamEffectClass2=class'XxxXESRv2b.XxxXESRFire'.default.BeamEffectClass
              }
              The gui would then pass in the appropriate BeamEffectClass.

              But it's just shooting blanks like that, no beam at all.

              Mr. Evil - I can't go, var() class<actor> BeamEffectClass; becuase it causes an error where the GUI passes the Beam Color in.

              To get an idea of the importance of this mutator.. my current InstaGib mut is running on about 40 servers. This will blow that one away.

              Comment

              Working...
              X