Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra: Ostfront 41-45 Forums > Red Orchestra Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2006, 08:28 AM
Witzig Witzig is offline
Senior Member
 
Join Date: Jan 2006
Location: Germany
Posts: 2,189
Default Weapon Mutator Problem

Well i just started my first Mutator, and got it working in itself just fine, but now the Mutator has one Problem, when the Mutator is active you can no longer switch Weapons. Even if the changed Weapon is dropped it is not possible.

Code:
class MutWitzigsWeapon extends Mutator;

//=============================================================================

function BeginPlay()
{
     local RORoleInfo RORole;
     local int j;
     super.BeginPlay();

    foreach AllActors(class'RORoleInfo',RORole)
       {
            if(RORole != None)
            {
                 for(j = 0;j < 3; j++)
                {
                        if(RORole.PrimaryWeapons[j].Item == class'ROInventory.PPD40Weapon')
                          RORole.PrimaryWeapons[j].Item = class'MutWitzigsWeapon.PPD40WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.G43Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.G43WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.G43ScopedWeapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.G43WScopedWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.DP28Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.DP28WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.Kar98ScopedWeapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.Kar98WScopedWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.MN9130ScopedWeapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.MN9130WScopedWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.MP40Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.MP40WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.MP41Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.MP41WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.PPS43Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.PPS43WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.PPSH41Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.PPSH41WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.STG44Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.STG44WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.SVT40Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.SVT40WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.SVT40ScopedWeapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.SVT40WScopedWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.MG34Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.MG34WWeapon';

                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.MG42Weapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.MG42WWeapon';
                                                
                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.SatchelCharge10lb10sWeapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.SatchelCharge10lb10sWWeapon';
                        
                        if(RORole.PrimaryWeapons[j].Item==class'ROInventory.PanzerFaustWeapon')
                          RORole.PrimaryWeapons[j].Item=class'MutWitzigsWeapon.PanzerFaustWWeapon';
                }
             
             }   

        }
    }
    
defaultproperties
    {
    GroupName="Weapon Mut"
         FriendlyName="WeaponMut"
         Description="blah blah"
}
All Changes to the Weapon were just some changes to the Fire Modes. Does anyone have a Clue why the Weapons would no longer switch ?

In an earlier Version i made the Error that dropped Version would be the Standard RO Weapons, after the modded Weapon was dropped Weapon switching worked again.

Or if someone could point me to the Class controlling Weapon switching i might find the Error myself.
__________________
Steam-Name: Tank-Boy-Ken
Reply With Quote
  #2  
Old 08-17-2006, 01:14 PM
Sent666 Sent666 is offline
Member
 
Join Date: Jun 2006
Posts: 72
Default

Post some code from one of the weapons you modded then we can see what you are trying to do.
__________________
Reply With Quote
  #3  
Old 08-17-2006, 01:22 PM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,217
Default

tbh. i think its the RoleInfo actor and the way it is replicated. Just an assumption though.
Reply With Quote
  #4  
Old 08-17-2006, 01:29 PM
Witzig Witzig is offline
Senior Member
 
Join Date: Jan 2006
Location: Germany
Posts: 2,189
Default

MG34WWeapon
Code:
class MG34WWeapon extends MG34Weapon;

#exec OBJ LOAD FILE=..\Animations\Axis_Mg34_1st.ukx

defaultproperties
{
    FireModeClass(0)=MG34WAutoFire
    FireModeClass(1)=MG34WSemiAutoFire
    
    //** Inventory/Ammo **//
    PickupClass=class'MG34WPickup'
}
MG34WPickup
Code:
class MG34WPickup extends MG34Pickup
   notplaceable;
   
   defaultproperties
{
    InventoryType=class'MG34WWeapon'
    }
MG34WAutoFire
Code:
defaultproperties
{
    //** Projectile Firing Modded **//
    Spread = 75
    
    //** Recoil **//
    maxVerticalRecoilAngle=650
    maxHorizontalRecoilAngle=450
    
    //** View shake **//
    ShakeOffsetTime=1.0
    ShakeRotTime=0.5
    
    //** Recoil modifiers **//
    RecoilRate=0.04
    PctHipMGPenalty=1.1

}
MG34WSemiAutoFire
Code:
defaultproperties
{
    //** Projectile Firing Modded **//
    Spread = 75
    
    //** Recoil **//
    maxVerticalRecoilAngle=350
      maxHorizontalRecoilAngle=250
    
    //** View shake **//
    ShakeOffsetTime=1.0
    ShakeRotTime=0.5
    
    //** Recoil modifiers **//
    RecoilRate=0.06
    PctHipMGPenalty=1.3

}
I know there is a different Way to replace the Weapons, though i haven't tested this online, worked in Practice Mode.

Its like this:

Code:
function string GetInventoryClassOverride(string InventoryClassName)
{
             
    if(InventoryClassName=="ROInventory.MG34Weapon")
        return "MutWitzigsWeapon.MG34WWeapon";

all other Weapons....
}
__________________
Steam-Name: Tank-Boy-Ken
Reply With Quote
  #5  
Old 08-17-2006, 02:25 PM
Case's Avatar
Case Case is offline
Data Hippo... in the pants
 
Join Date: Nov 2005
Location: Maui, HI
Posts: 344
Default

Worluk is correct. I had this exact same problem.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC