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 06-29-2006, 09:42 AM
Moffia Moffia is offline
Member
 
Join Date: Mar 2006
Posts: 36
Default Not working

Im kinda new to UnrealScript, and trying to make a pistol only mod.
Somehow it doesnt work.

Code:
//=======================================================================
// Pistol Only mod, DUH!
// Author: Moffia
// There are copyrights and sit on here :)
//=======================================================================

class PistolOnly extends Mutator;

function ModifyPlayer(Pawn Other)
{
    Other.GiveWeapon("ROInventory.P08LugerWeapon");
    Other.GiveWeapon("ROInventory.P38Weapon");
    Other.GiveWeapon("ROInventory.TT33Weapon");
}
IF im right it actually should work, the mutator is in the list etc, only i dont have these weapons! If im correct that has to be the new inventory...
Compiler also gives no errors...
__________________
Reply With Quote
  #2  
Old 06-29-2006, 10:09 AM
UncleDrax's Avatar
UncleDrax UncleDrax is offline
Senior Member
 
Join Date: Oct 2005
Location: Florida, USA
Posts: 1,475
Default

Quote:
Originally Posted by Moffia
Im kinda new to UnrealScript, and trying to make a pistol only mod.
Somehow it doesnt work.
...
IF im right it actually should work, the mutator is in the list etc, only i dont have these weapons! If im correct that has to be the new inventory...
Compiler also gives no errors...
The problem might be in how you are giving out weapons..

What you may have to do (and I'm guessing here.. so bear with me.. and I might be wholey off-base)..

Make the mutator modify the weapons loadout for the roles.

/me digs around in his UnCodeX dump from the sdk....

You can probably do this at a few points..

Mutate the RO Role Info's to force only certain weapons to be available

After a player spawns, call ROEngine.ROPlayer.changeWeapons to force all players to only have the weapons loadout you want.

and if you want to do this on a map-for-map basis, you could just open up the map, set the loadouts how you want, and save it under a different name :]



I think there was a weapons mutator for the mod.. might want to try and track that down and see how they did it.
Reply With Quote
  #3  
Old 06-29-2006, 11:35 AM
Moffia Moffia is offline
Member
 
Join Date: Mar 2006
Posts: 36
Default

i think i have a better idea.
make my own 2 roles, for axis and allies and disable the other ones :O

EDIT:

all done, and i wanted to compile, but i get this strange error:

Quote:
Error: C:\Program Files\Steam\SteamApps\common\red orchestra\PistolOnly\Classes\ROGERole.uc(11) : Error, PistolOnly.ROGERole's superclass must be ROEngine.RORoleInfo, not PistolOnly.RORoleInfo
Log: Compile aborted due to errors.
Log: Failure - 1 error(s), 0 warning(s)
__________________

Last edited by Moffia; 06-29-2006 at 11:54 AM.
Reply With Quote
  #4  
Old 06-29-2006, 12:27 PM
UncleDrax's Avatar
UncleDrax UncleDrax is offline
Senior Member
 
Join Date: Oct 2005
Location: Florida, USA
Posts: 1,475
Default

Quote:
Originally Posted by Moffia
i think i have a better idea.
make my own 2 roles, for axis and allies and disable the other ones :O

EDIT:

all done, and i wanted to compile, but i get this strange error:
It's not that strange.. basic OOP. Just ready the error
Reply With Quote
  #5  
Old 06-29-2006, 12:31 PM
Moffia Moffia is offline
Member
 
Join Date: Mar 2006
Posts: 36
Default

well, when i delete the RORoleInfo.uc in the pistolonly folder i get even more errors (4)

Quote:
Log: Analyzing...
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROGEPistolGuy.uc)
Log: Class: ROGEPistolGuy extends ROGE_Standard_Heer
Log: Imported: Class PistolOnly.ROGEPistolGuy
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROGERole.uc)
Log: Class: ROGERole extends RORoleInfo
Log: Imported: Class PistolOnly.ROGERole
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROGE_Heer_Units.uc)
Log: Class: ROGE_Heer_Units extends ROGERole
Log: Imported: Class PistolOnly.ROGE_Heer_Units
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROGE_Standard_Heer.uc)
Log: Class: ROGE_Standard_Heer extends ROGE_Heer_Units
Log: Imported: Class PistolOnly.ROGE_Standard_Heer
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROSUPistolGuy.uc)
Log: Class: ROSUPistolGuy extends ROSU_Standard_RKKF
Log: Imported: Class PistolOnly.ROSUPistolGuy
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROSURole.uc)
Log: Class: ROSURole extends ROEngine.RORoleInfo
Log: Imported: Class PistolOnly.ROSURole
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROSU_RKKF_Units.uc)
Log: Class: ROSU_RKKF_Units extends ROSURole
Log: Imported: Class PistolOnly.ROSU_RKKF_Units
Log: FactoryCreateText: Class with ClassFactoryUC (0 1 ..\PistolOnly\Classes\ROSU_Standard_RKKF.uc)
Log: Class: ROSU_Standard_RKKF extends ROSU_RKKF_Units
Log: Imported: Class PistolOnly.ROSU_Standard_RKKF
Log: Parsing ROGERole
Log: Parsing ROGE_Heer_Units
Log: Parsing ROGE_Standard_Heer
Log: Parsing ROGEPistolGuy
Log: Parsing ROSURole
Log: Parsing ROSU_RKKF_Units
Log: Parsing ROSU_Standard_RKKF
Log: Parsing ROSUPistolGuy
Log: Compiling ROGERole
Log: Compiling ROGE_Heer_Units
Log: Compiling ROGE_Standard_Heer
Log: Compiling ROGEPistolGuy
Log: Compiling ROSURole
Log: Compiling ROSU_RKKF_Units
Log: Compiling ROSU_Standard_RKKF
Log: Compiling ROSUPistolGuy
Log: Importing Defaults for ROGERole
Warning: Failed to load 'NULL': Can't resolve package name
Warning: Failed to load 'Class None.SeveredArmGerTunic': Can't resolve package name
Error: ClassProperty ROEngine.RORoleInfo.DetachedArmClass: unresolved reference to 'class'SeveredArmGerTunic''
Warning: Failed to load 'NULL': Can't resolve package name
Warning: Failed to load 'Class None.SeveredLegGerTunic': Can't resolve package name
Error: ClassProperty ROEngine.RORoleInfo.DetachedLegClass: unresolved reference to 'class'SeveredLegGerTunic''
Log: Importing Defaults for ROGE_Heer_Units
Log: Importing Defaults for ROGE_Standard_Heer
Log: Importing Defaults for ROGEPistolGuy
Log: Importing Defaults for ROSURole
Warning: Failed to load 'NULL': Can't resolve package name
Warning: Failed to load 'Class None.SeveredArmSovTunic': Can't resolve package name
Error: ClassProperty ROEngine.RORoleInfo.DetachedArmClass: unresolved reference to 'class'SeveredArmSovTunic''
Warning: Failed to load 'NULL': Can't resolve package name
Warning: Failed to load 'Class None.SeveredLegSovTunic': Can't resolve package name
Error: ClassProperty ROEngine.RORoleInfo.DetachedLegClass: unresolved reference to 'class'SeveredLegSovTunic''
Log: Importing Defaults for ROSU_RKKF_Units
Log: Importing Defaults for ROSU_Standard_RKKF
Log: Importing Defaults for ROSUPistolGuy
Log: Compile aborted due to errors.
Log: Failure - 4 error(s), 0 warning(s)
__________________
Reply With Quote
  #6  
Old 06-29-2006, 05:08 PM
UncleDrax's Avatar
UncleDrax UncleDrax is offline
Senior Member
 
Join Date: Oct 2005
Location: Florida, USA
Posts: 1,475
Default

Quote:
Originally Posted by Moffia
well, when i delete the RORoleInfo.uc in the pistolonly folder i get even more errors (4)
Err...

No.. the error is simple.. the class you wrote has to Inheirt (extend) a different class..

Deleting a local version of your source RO classes won't help.. and as you saw, it's just making it worse.


In a nutshell, I'd guess you are trying to extend the wrong class... at least according to the compiler.
Reply With Quote
  #7  
Old 06-29-2006, 06:56 PM
Crube Crube is offline
Member
 
Join Date: Mar 2006
Posts: 56
Default

FYI, I don't think you can add or remove the existing RORoleInfo objects in
existing maps because RORoleInfo has bStatic=True.

If someone knows a way around this I would like to see it.

It would be nice if the RO Dev team would change how the role system works
so that mutators can modify the available roles.
Maybe use an array in the ROLevelInfo.
Reply With Quote
  #8  
Old 06-30-2006, 02:29 AM
Moffia Moffia is offline
Member
 
Join Date: Mar 2006
Posts: 36
Default

the thing is i took for both Axis and Allies a sniperguy and edited, ant then only putted the needed .uc files in the golder. (I went looking @ at the extends)

man i can't find the problem, would it help if i put the code here?
__________________

Last edited by Moffia; 06-30-2006 at 02:37 AM.
Reply With Quote
  #9  
Old 06-30-2006, 09:13 PM
Crube Crube is offline
Member
 
Join Date: Mar 2006
Posts: 56
Default

Well, posting code would help find the error, however I think you're going about it wrong anyway.

This is what you need to do to create a pistol only mod.

1. iterate though each of the RORoleInfo objects in the PostBeginPlay() function of you Pistolonly class.
example:

foreach AllActors( class'ROEngine.RORoleInfo', A )

2. In each RORoleInfo, clear out the PrimaryWeapons SecondaryWeapons arrays.

Example:
for( i=0; i < 3; i++)
{
A.SecondaryWeapons[i].Item = none;
A.SecondaryWeapons[i].Amount = 0;
A.SecondaryWeapons[i].AssociatedAttachment = none;


3. Add the Pistol class to the PrimaryWeapons of each

A.PrimaryWeapons[0].Item = class'ROInventory.P38Weapon';
A.PrimaryWeapons[0].Amount = 1;
Reply With Quote
  #10  
Old 07-01-2006, 03:11 AM
Moffia Moffia is offline
Member
 
Join Date: Mar 2006
Posts: 36
Default

well, he says there is a wrong parameter with that code. however, i think it's not possible, becasue when i just try to compile the plain RORoles map there is a generic protection fault...
__________________
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 09:46 PM.


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