Announcement

Collapse
No announcement yet.

Huge Problem with WeaponTexturePack replacement!

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

    Huge Problem with WeaponTexturePack replacement!

    http://forums.epicgames.com/showthread.php?t=595906

    I did the instruction of the texture pack above. When I try to replace the flak cannon with a red flak cannon. It give me a warning saying
    "UTWeap_RedFlakCannon.uc<6> : Warning, Unresolved reference to Materiel 'RedFlakCannon.Materials.M_WP_RedFlakCannon' "
    and a error saying
    " UTMutator_RedFlakCannon.uc<15> : Error, Bad or missing expression after '&': 'amp' "
    I noticed that the text on the right (with list of stuff in generic browser) is still black instead of grey. I saved the .upk file too. I can't figure out what I am doing wrong. I did everything in the instruction of the weapon texture pack.

    Here is the code: (My Package name is RedFlakCannon):
    UTWeapon_RedFlakCannon:
    Code:
    class UTWeap_RedFlakCannon extends UTWeap_FlakCannon;
    
    simulated function SetSkin(Material NewMaterial)
    {
    	Super.SetSkin(NewMaterial);
    	Mesh.SetMaterial(0, Material'RedFlakCannon.Materials.M_WP_RedFlakCannon');
    }
    
    defaultproperties
    {
    }
    UTMutator_RedFlakCannon:
    Code:
    class UTMutator_RedFlakCannon extends UTMutator;
    
    function InitMutator(string Options, out string ErrorMessage)
    {
    if (UTGame(WorldInfo.Game) != None)
    {
    UTGame(WorldInfo.Game).DefaultInventory[0] = class'RedFlakCannon.UTWeap_RedFlakCannon';
    }
    †
    Super.InitMutator(Options, ErrorMessage);
    }
    
    function bool CheckReplacement(Actor Other)
    {
    if (Other.IsA('UTWeap_FlakCannon') &amp;&amp; !Other.IsA('UTWeap_RedFlakCannon'))
    {
    ReplaceWith(Other, "UTWeap_RedFlakCannon");
    }
    †
    return true;
    }
    
    DefaultProperties
    {
    }
    Attached Files

    #2
    try saving your "RedFlakCannon.upk" to both the ./published/cookedpc/ and the ./unpublished/cookedpc/ and try again.

    Comment


      #3
      Originally posted by NickG View Post
      try saving your "RedFlakCannon.upk" to both the ./published/cookedpc/ and the ./unpublished/cookedpc/ and try again.
      I just tried that and did not work at all. It still the same problem. Help me!

      Comment


        #4
        " UTMutator_RedFlakCannon.uc<15> : Error, Bad or missing expression after '&': 'amp' "

        should just be &&
        like:
        Code:
        if (Other.IsA('UTWeap_FlakCannon') && !Other.IsA('UTWeap_RedFlakCannon'))
        make sure you are working in Unicode and not ANSI.

        To ensure the correct material reference, right-click on your material in the generic browser and select "copy reference", then paste to your script

        Comment


          #5
          Originally posted by NickG View Post
          " UTMutator_RedFlakCannon.uc<15> : Error, Bad or missing expression after '&': 'amp' "

          should just be &&
          like:
          Code:
          if (Other.IsA('UTWeap_FlakCannon') && !Other.IsA('UTWeap_RedFlakCannon'))
          make sure you are working in Unicode and not ANSI.

          To ensure the correct material reference, right-click on your material in the generic browser and select "copy reference", then paste to your script
          Now it works! Thanks, you are the best man! But I now have a new problem. It replaces my Enforcer instead of the flak cannon. When I pick up a flak cannon in a map. It give me a second flak cannon. a yellow flak cannon and a red flak cannon. What do I do? Is it something to do with my weapon replacement code?
          HERE IS MY CODE:

          UTMutator_RedFlakCannon:
          Code:
          class UTMutator_RedFlakCannon extends UTMutator;
          
          function InitMutator(string Options, out string ErrorMessage)
          {
          if (UTGame(WorldInfo.Game) != None)
          {
          UTGame(WorldInfo.Game).DefaultInventory[0] = class'RedFlakCannon.UTWeap_RedFlakCannon';
          }
          
          Super.InitMutator(Options, ErrorMessage);
          }
          
          function bool CheckReplacement(Actor Other)
          {
          if (Other.IsA('UTWeap_FlakCannon') && !Other.IsA('UTWeap_RedFlakCannon'))
          {
          ReplaceWith(Other, "UTWeap_RedFlakCannon");
          }
          return true;
          }
          
          DefaultProperties
          {
          }
          UTWeap_RedFlakCannon:
          Code:
          class UTWeap_RedFlakCannon extends UTWeap_FlakCannon;
          
          simulated function SetSkin(Material NewMaterial)
          {
          	Super.SetSkin(NewMaterial);
          	Mesh.SetMaterial(0, Material'WP_RedFlakCannon.Materials.M_WP_RedFlakCannon');
          }
          
          defaultproperties
          {
          }

          Comment

          Working...
          X