Jump to content

[Help] This Still Isn't My Easiest Coding Language...


RoundShades
 Share

Recommended Posts

  • Moderator

I have made a STank mutator, that locks "fire muzzle" to fire both missiles from front if using primary fire and both missiles from top if firing secondary fire or any combo of the two in any order. Basically, primary delivers front missile, secondary delivers up missile, and both consume the same missile ammo. For good measure, I also dropped fire rate to 1.3 (it is 1.7 but set to 1.5 so I am assuming .2 is due to the delay between missiles)

I did it with PreBeginPlay event in STankMutator, and changing STank Seat(0)=GunClass(Stank_Weapon_Custom). Everything else I copy-pasted.

However, it errors. Might be real stupid. But I can't seem to figure out what I typed wrong. EDIT: I am no longer getting the same error. It was not my code, but my technique: I didn't put my files into my mod folder and tried compiling them within the RX_Game folder. EDIT2: I also didn't re-edit the UDKDefaultEngine.ini to look for my mod folder to compile it. So that was the second error. But now we are back to the first error, which is still copy-pasted in code below...

The error and the code follows:

\STankMutator.uc(9) : Error, Bad or missing expression for token: Rx_Vehicle_StealthTank, in '='

class STankMutator extends UTMutator;

event PreBeginPlay()
{
local Rx_Vehicle_StealthTank STank;

super.PreBeginPlay(); 

STank = Rx_Vehicle_StealthTank(GetDefaultObject(Class'Rx_Vehicle_StealthTank')); 
STank.Seats(0)={GunClass=class'Rx_Vehicle_StealthTank_Weapon_MOD',
               GunSocket=(TurretFireSocket01,TurretFireSocket02),
               TurretControls=(TurretPitch,TurretRotate),
               GunPivotPoints=(MainTurretYaw,MainTurretPitch),
               CameraTag=CamView3P,
               CameraBaseOffset=(Z=-10),
               CameraOffset=-400,
               SeatIconPos=(X=0.5,Y=0.33),
               MuzzleFlashLightClass=class'Rx_Light_Tank_MuzzleFlash'
               }
}

Link to comment
Share on other sites

Handepsilon:

This looks like a compilation-time (i.e: code) error, not run-time.

BroTranquility:

The issue may be that you're using a function that I don't *think* exists (GetDefaultObject). The only place that I found any mention of GetDefaultObject is this thread on Epic's forums, where the function is also defined below its usage.

For convenience, I've copied the relevant function here (though I don't guarantee that it'll work *at all*, since it's not my code):

final static function object GetDefaultObject(class ObjClass)
{
return FindObject(ObjClass.GetPackageName()$".Default__"$ObjClass, ObjClass);
}

Edit: Also, you may want to look into overriding CheckReplacement() for changing classes, instead.

Link to comment
Share on other sites

  • Moderator

class STankMutator extends UTMutator;

function bool CheckReplacement(Actor Other)
{
if (Other.IsA('Rx_Vehicle_StealthTank'))
{
	Rx_Vehicle_StealthTank(Other).Seats(0)=(GunClass=class'Rx_Vehicle_StealthTank_Weapon');

}
}

And I get similar errors. First, that the perenthesis on line has no effect. Second, when I change Seats(0) to Seats, I get bad expression after = again.

I don't think the compiler likes changing a default in a default. But how would I go about doing that? Simplifying a shortcut for "GunClass"? Would I do that like Local Rx_Vehicle_StealthTank.Seats(0)

Maybe with a series of periods instead of equal signs. So code:

class STankMutator extends UTMutator;

function bool CheckReplacement(Actor Other)
{
if (Other.IsA('Rx_Vehicle_StealthTank'))
{
	Rx_Vehicle_StealthTank(Other).Seats.GunClass=class'Rx_Vehicle_StealthTank_Weapon';
}
}

And now, error:

STankMod\Classes\STankMutator.uc(7) : Error, Invalid property or function call on a dynamic array

Is there a better way to call for a vehicle's weapon when it is embedded into a seat position?

Link to comment
Share on other sites

  • Developer

Why not...

class STankMutator extends UTMutator;

function bool CheckReplacement(Actor Other)
{
  if (Other.IsA('Rx_Vehicle_StealthTank') && !Other.IsA('Rx_Vehicle_StealthTank_MOD'))
  {
     ReplaceWith(Other, "Rx_Vehicle_StealthTank_MOD");
  }
}

ReplaceWith() is a thing btw. Also, the other if is to make sure that the MOD version does not get replaced again, over and over (IsA() also reads children as their parents)

Link to comment
Share on other sites

  • Moderator

Well, I was honestly going to assume, if one cannot replace which weapon a vehicle has mounted on spawn (which I am still convinced is possible in UT but maybe not with how Rx mounts the weapon to the seat), that I would have to break down and make a vehicle swap instead and mount mod weapon to mod vehicle.

But I appreciate your help laying it all out like that. I have less experience with actor replace, I was going to do something similar but not as clean as that. Lord have mercy on my soul with all this junk...

...Also, I am bad with operators in this code compared to Json. I looked them up, but when you present this to me, it makes more sense than what I'd try to do myself. Like goddamn redstone logic up in here, xept with words...

I am testing it now, but in case you happen to read as I do it, could it use a return value at the end or is that implied? EDIT: I think it in fact need return true; added. I am testing now with that. And it works. Well, my actual implementation is now faulty, the following was my weapon, and it still fires out 2 barrels so I have to see why or if I can merely straighten the shot.

   // gun config
   FireTriggerTags(0) = "TurretFireRight"
   FireTriggerTags(1) = "TurretFireRight"
   AltFireTriggerTags(0) = "TurretFireLeft"
   AltFireTriggerTags(1) = "TurretFireLeft"
   VehicleClass=Class'RenX_Game.Rx_Vehicle_StealthTank_MOD'

EDIT: Since this apparently has no effect, nor can I see why when comparing to Mammoth Tank, I am going to humor the idea of adjusting the sockets in socket manager and trying to port those into the game with a mutator.

SO NOW, I have a modified StealthTank mesh .upk, but I can't seem to get the mutator StealthTank_Mod to find and read the StealthTankMod.upk so is there a way to do that or can mutators not touch that?

Link to comment
Share on other sites

I dont think you can put in your own stank upk with a mutator. A mutator is for changing code, not for modifying content.

"I have made a STank mutator, that locks "fire muzzle" to fire both missiles from front if using primary fire and both missiles from top if firing secondary fire or any combo of the two in any order."

Pls take a look at the AddSpread() method in Rx_Vehicle_StealthTank_Weapon. I think modifying this function is all you need to do to get this working. The AddSpread() method defines the rotation the missiles come out of the barrels (or rather it defines how much their rotation should deviate from the barrels rotations). It is responsible for the arch the missiles are taking and it can all be changed easily there. The default implementation of the vehicles AddSpread() adds some random spread to the shots but for the stank the function is overridden to remove the randomness and to create the current steady, put possibly a bit too wide, arch when firing. If you change RandX and RandY you can get different arches or could remove it completly. There also is a CurrentFireMode var already beeing used in that function. It is 0 if primary fire is currently active and 1 for secondary. So you can also change the missiles rotation there easily based on the current firemode.

Then i would also advice you to make your own stank class with this modified weapon class and to use the checkreplacement() function like described above to exchange the stank with your version of it.

Link to comment
Share on other sites

  • Moderator

I already did all that, including the check replacement, and the spread. And...

...wait, did you say it is overridden with the patternistic spread?

...that would explain a lot. In that case, by UDK unit of measurement, I will try something a lot closer to the mammoth's missiles, which if I remember what I just read of it, is around .06 compared to the stanks' 0.30? I tried .20 and .15 but I am suspecting that is why it didn't appear to change anything.

I will let you know if .06 or 0 changes anything, and if not I don't know what the deal is.

It would be BADASS though if it did kind of swirl-arc though each other though, as far as "that is kinda what it did in Ren". But I am not sure how to change or tweak their overriden behavior. I tried changing spread, start speed, acceleration, honing strength, and I don't know the file location that dictates that wide spread.

EDIT: The mammoth's missiles are .15 but they don't have a pattern so I will still try .06 EDIT: Didn't work, not even 0 spread worked. I may also try the goofy idea of having the STank inhereit a variant of the MRLS Missile weapon/projectile. EDIT: That didn't even work. I look at this damn stank fire, and it fires left, then right, if you only fire left and reload, it still fires right next, it's pattern is like etched into the tank itself somehow.

I can release what I currently have, but it would do little more than allow changes to damage and fire rate, which can't be too dramatic or else the damage would be way too high for what it does hit.

Link to comment
Share on other sites

Changing the values in the AddSpread() method will work if done correctly. But im not sure what you could be doing wrong atm. Are you sure your replaced stank is active. Did the replacement really work or maybe is there still something wrong with your replacement code ? You might have to post all your code for us to see.

Link to comment
Share on other sites

  • Moderator
Changing the values in the AddSpread() method will work if done correctly. But im not sure what you could be doing wrong atm. Are you sure your replaced stank is active. Did the replacement really work or maybe is there still something wrong with your replacement code ? You might have to post all your code for us to see.

I would feel real stupid if that were the case. But, here is what you suggested with the spread, which i have tried bulkier code just to try it, but this is the bare minimum of what I had tried originally. 0 compiler errors too.

class STankMutator extends UTMutator;

function bool CheckReplacement(Actor Other)
{
  if (Other.IsA('Rx_Vehicle_StealthTank') && !Other.IsA('Rx_Vehicle_StealthTank_MOD'))
  {
     ReplaceWith(Other, "Rx_Vehicle_StealthTank_MOD");
  }
return true;
}

class Rx_Vehicle_StealthTank_MOD extends Rx_Vehicle_StealthTank;

DefaultProperties
{
Seats(0)={(GunClass=class'Rx_Vehicle_StealthTank_Weapon_MOD',
               GunSocket=(TurretFireSocket01,TurretFireSocket02),
               TurretControls=(TurretPitch,TurretRotate),
               GunPivotPoints=(MainTurretYaw,MainTurretPitch),
               CameraTag=CamView3P,
               CameraBaseOffset=(Z=-10),
               CameraOffset=-400,
               SeatIconPos=(X=0.5,Y=0.33),
               MuzzleFlashLightClass=class'Rx_Light_Tank_MuzzleFlash'
               )}
}

class Rx_Vehicle_StealthTank_Weapon_MOD extends Rx_Vehicle_StealthTank_Weapon;

DefaultProperties
{
   ReloadTime(0) = 1.3
   ReloadTime(1) = 1.3
   VehicleClass=Class'RenX_Game.Rx_Vehicle_StealthTank'

   Spread(0)=0.00
   Spread(1)=0.00
}

Link to comment
Share on other sites

ReplaceWith(Other, "Rx_Vehicle_StealthTank_MOD");

-> You need to give the full path to the vehicle which is the packagename + "." + Classname. So for example it should look like: ReplaceWith(Other, "MyStankMod.Rx_Vehicle_StealthTank_MOD");

VehicleClass=Class'RenX_Game.Rx_Vehicle_StealthTank'

-> This should also point to Class'MyStankMod.Rx_Vehicle_StealthTank_MOD'

Spread(0)=0.00
   Spread(1)=0.00

-> In the stanks case id say you should modify the AddSpread() function directly. Especially the RandX and RandY values. Like this:

class Rx_Vehicle_StealthTank_Weapon_MOD extends Rx_Vehicle_StealthTank_Weapon;

simulated function rotator AddSpread(rotator BaseAim)
{
local vector X, Y, Z;
local float CurrentSpread, RandY, RandZ;

CurrentSpread = Spread[CurrentFireMode];
if (CurrentSpread == 0)
{
	return BaseAim;
}
else
{
        GetAxes(BaseAim, X, Y, Z);

	if(i++ == 0)
		RandY = -0.4; <---- change this. changes arc to the left i think
	else
		RandY = 0.4; <---- change this. changes arc to the right i think 
	if(i > 1)
		i = 0;	
	RandZ = 0.1; <---- change this. changes initial up/down rotation of the rockets
	return rotator(X + RandY * CurrentSpread * Y + RandZ * CurrentSpread * Z);
}
}

DefaultProperties
{
   ReloadTime(0) = 1.3
   ReloadTime(1) = 1.3
   VehicleClass=Class'MyStankMod.Rx_Vehicle_StealthTank_MOD'
}

Since your usage of ReplaceWith() was wrong your changes didnt had any effect. To make sure your functions get executed i can give you the tip of putting a

loginternal("saying something");

in your code lines. It will print output into the log. Then watch the log if the output comes up (or use a debugger like https://code.google.com/p/unreal-debugger/). In general you should watch the log closely for any errors (your replacewith should have caused an error in the log aswell). You can make a live view of the log visible by using the "-log" commandline param. For example you can start your game like this: udk CNC-Canyon?game=RenX_Game.Rx_Game -nomovie -nosteam -log -forcelogflush -windowed

Link to comment
Share on other sites

  • Moderator

Using the above, now I only get this error:

\Rx_Vehicle_StealthTank_Weapon_MOD.uc(17) : Error, Bad or missing expression for token: I, in 'If'

What is "i" supposed to stand for in the spread function? Can I change it to another variable? Is it supposed to be even/odd shots or something?

Link to comment
Share on other sites

It alternates between 0 and 1. 0 is the left rocket pod, 1 is the right rocket pod (or the other way arround, not sure). I think its giving you this error cause your RenX codebase doesent yet contain the variable "i" in the stank base class (i think this change was done after the last source code was distributed).

This should work:

class Rx_Vehicle_StealthTank_Weapon_MOD extends Rx_Vehicle_StealthTank_Weapon;

var int 	 j;

simulated function rotator AddSpread(rotator BaseAim)
{
  local vector X, Y, Z;
  local float CurrentSpread, RandY, RandZ;

  CurrentSpread = Spread[CurrentFireMode];
  if (CurrentSpread == 0)
  {
     return BaseAim;
  }
  else
  {
          GetAxes(BaseAim, X, Y, Z);

     if(j++ == 0)
        RandY = -0.4; <---- change this. changes arc to the left i think
     else
        RandY = 0.4; <---- change this. changes arc to the right i think
     if(j > 1)
        j = 0;   
     RandZ = 0.1; <---- change this. changes initial up/down rotation of the rockets
     return rotator(X + RandY * CurrentSpread * Y + RandZ * CurrentSpread * Z);
  }
}

DefaultProperties
{
   ReloadTime(0) = 1.3
   ReloadTime(1) = 1.3
   VehicleClass=Class'MyStankMod.Rx_Vehicle_StealthTank_MOD'
}

Link to comment
Share on other sites

  • Moderator

No compiler errors. But I am fairly certain the STank isn't getting any of the changes, including ROF which I set to 0.4 just as an obvious test. The code follows. Also, I think at this point it is way too much time for you to spend checking this, but I did appreciate the help.

class STankMutator extends UTMutator;

function bool CheckReplacement(Actor Other)
{
  if (Other.IsA('Rx_Vehicle_StealthTank') && !Other.IsA('Rx_Vehicle_StealthTank_MOD'))
  {
     ReplaceWith(Other, "STankMod.Rx_Vehicle_StealthTank_MOD");
  }
return true;
}

class Rx_Vehicle_StealthTank_MOD extends Rx_Vehicle_StealthTank;

DefaultProperties
{
Seats(0)={(GunClass=class'Rx_Vehicle_StealthTank_Weapon_MOD',
               GunSocket=(TurretFireSocket01,TurretFireSocket02),
               TurretControls=(TurretPitch,TurretRotate),
               GunPivotPoints=(MainTurretYaw,MainTurretPitch),
               CameraTag=CamView3P,
               CameraBaseOffset=(Z=-10),
               CameraOffset=-400,
               SeatIconPos=(X=0.5,Y=0.33),
               MuzzleFlashLightClass=class'Rx_Light_Tank_MuzzleFlash'
               )}
}

class Rx_Vehicle_StealthTank_Weapon_MOD extends Rx_Vehicle_StealthTank_Weapon;

var int     j;

simulated function rotator AddSpread(rotator BaseAim)
{
  local vector X, Y, Z;
  local float CurrentSpread, RandY, RandZ;

  CurrentSpread = Spread[CurrentFireMode];
  if (CurrentSpread == 0)
  {
     return BaseAim;
  }
  else
  {
          GetAxes(BaseAim, X, Y, Z);

     if(j++ == 0)
        RandY = 0.00;
     else
        RandY = 0.00;
     if(j > 1)
        j = 0;   
     RandZ = 0.00;
     return rotator(X + RandY * CurrentSpread * Y + RandZ * CurrentSpread * Z);
  }
}

DefaultProperties
{
   ReloadTime(0) = 0.4
   ReloadTime(1) = 0.4
   VehicleClass=Class'STankMod.Rx_Vehicle_StealthTank_MOD'
}

Link to comment
Share on other sites

pls try a "return false;" directly after the ReplaceWith line. Return false at that place means to not keep the original stank (see checkreplacement description in the mutator class). We will get there, dont worry :D

Link to comment
Share on other sites

  • Moderator
pls try a "return false;" directly after the ReplaceWith line. Return false at that place means to not keep the original stank (see checkreplacement description in the mutator class). We will get there, dont worry :D

Wow, that sounds incredibly stupid of me. It wasn't mentioned at all, and it errored without it, so I went ahead and added it of my own accord, and now I regret everything lol...

EDIT: Infinite Script incursion. It made an infinite. That much I know what it means, it means it constantly calls the script. I thought it was supposed to prevent it if I added a call keeping it if it were the modded variant? Because the inherited kid triggers the replacement of the heir.

I think tomorrow, ill try double if statements with different returns. That should work? EDIT: I did some research, and using 2 if statements is unnecesary, I only need 2 return statements. Return false goes into the brackets after the function, return true goes after the brackets.

Oh well, google wins again. Let's give this a try.

Link to comment
Share on other sites

  • Moderator

Now THAT works! Kudos and good cheer all around! Thanks Agent, Handepileson, and RypeL. I will make the necessary numbers and talk to some servers about considering this tweak. Again, Many Thanks!

Actually, I would like to note, that since changing it, the vehicle replacement from the Airstrip on singleplayer appears to cause the vehicle to hover in it's spawn point midair where the airstrip would drop it off, it is not bound to the player nor does it follow the vehicle rolloff waypoint. Likely bug. May look into some way to replace the weapon instead, I still think it can be done.

Link to comment
Share on other sites

  • Developer
Now THAT works! Kudos and good cheer all around! Thanks Agent, Handepileson, and RypeL. I will make the necessary numbers and talk to some servers about considering this tweak. Again, Many Thanks!

Actually, I would like to note, that since changing it, the vehicle replacement from the Airstrip on singleplayer appears to cause the vehicle to hover in it's spawn point midair where the airstrip would drop it off, it is not bound to the player nor does it follow the vehicle rolloff waypoint. Likely bug. May look into some way to replace the weapon instead, I still think it can be done.

Ah, that means we can't do a mod that replaces MRLS to Hover MRLS then, too bad :(

Also...

Handepileson

It's Handepsilon. If you have trouble spelling it, you can just call me Hande :P

Link to comment
Share on other sites

Now THAT works! Kudos and good cheer all around! Thanks Agent, Handepileson, and RypeL. I will make the necessary numbers and talk to some servers about considering this tweak. Again, Many Thanks!

Actually, I would like to note, that since changing it, the vehicle replacement from the Airstrip on singleplayer appears to cause the vehicle to hover in it's spawn point midair where the airstrip would drop it off, it is not bound to the player nor does it follow the vehicle rolloff waypoint. Likely bug. May look into some way to replace the weapon instead, I still think it can be done.

Ah, that means we can't do a mod that replaces MRLS to Hover MRLS then, too bad :(

Cause initializing code that is done to a vehicle directly after its spawned is not executed when it is replaced with a mutator. This can be circumvented (by doing the initializing code in the mutator) but i have no energy right now to explain/detail it. Ill try to look into it later.

Link to comment
Share on other sites

Huh, interesting.

What you *might* be able to do is extend Rx_PurchaseSystem, and override the vehicle classes. For example, if you wanted a HoverMRLS instead of an MRLS:

class Rx_PurchaseSystem_Mod extends Rx_PurchaseSystem

defaultproperties
{
GDIVehicleClasses[2] = class'RenX_Game.TSR_Vehicle_HoverMRLS'
}

Then you would replace Rx_PurchaseSystem with Rx_PurchaseSystem_Mod in your mutator. If that works as anticipated, you shouldn't have to do anything else (in fact, this could be made shorter if those class arrays weren't marked as 'const' in Rx_PurchaseSystem).

Link to comment
Share on other sites

  • Developer
Huh, interesting.

What you *might* be able to do is extend Rx_PurchaseSystem, and override the vehicle classes. For example, if you wanted a HoverMRLS instead of an MRLS:

class Rx_PurchaseSystem_Mod extends Rx_PurchaseSystem 

defaultproperties
{
GDIVehicleClasses[2] = class'RenX_Game.TSR_Vehicle_HoverMRLS'
}

Then you would replace Rx_PurchaseSystem with Rx_PurchaseSystem_Mod in your mutator. If that works as anticipated, you shouldn't have to do anything else (in fact, this could be made shorter if those class arrays weren't marked as 'const' in Rx_PurchaseSystem).

The classes in Rx_purchase system aren't constant. Also, if you just want to have a custom purchase system that drops whatever you want, I have one of those with all of the nasty little bugs already worked out of it. Well, except that in skirmish, you have to suicide initially to actually spawn, since the purchase system gets replaced right when you're supposed to spawn. It works perfectly on servers though. It's how I circumvented all of the constants in Rx_FamilyInfo

Link to comment
Share on other sites

  • Moderator

Another idea is to just replace the weapon. I just got the checkreplacement to "take off" the weapon from the STank, but the same return true; return false crap just loops then (oddly enough, without crashing the game, just calling it every second you are sitting within a STank in the cmd)

So, which one do you guys want to pitch to me how to do, the replacement purchase code with the bugs worked out, or how to remove and attach weapon to stank?

Link to comment
Share on other sites

The classes in Rx_purchase system aren't constant.

var const array >	GDIInfantryClasses;
var const array >     GDIVehicleClasses;
var const array >      GDIWeaponClasses;
var const array >      GDIItemClasses;
var const array >	NodInfantryClasses;
var const array >     NodVehicleClasses;
var const array >      NodWeaponClasses;
var const array >      NodItemClasses;

Link to comment
Share on other sites

  • Developer
The classes in Rx_purchase system aren't constant.

var const array >	GDIInfantryClasses;
var const array >     GDIVehicleClasses;
var const array >      GDIWeaponClasses;
var const array >      GDIItemClasses;
var const array >	NodInfantryClasses;
var const array >     NodVehicleClasses;
var const array >      NodWeaponClasses;
var const array >      NodItemClasses;

We'll just pretend I never said that. Was thinking something totally different and being frustrated at typing on a phone. Still, a custom purchase system is pretty easy.

Here, have a cookie, Agent.

P.S. THE GetDefaultObject() shenanigans from earlier probably stemmed from Bro referencing RypeL's Prepatch mutator. In it, he uses GetDefaultObject but it is a function written at the very end of the mutator itself, one that may very well have just let me get on my way to making something big.

Link to comment
Share on other sites

  • Developer

The Mutator itself (because I'm too lazy to just upload a folder)

class Rx_PSystemMutator extends UTMutator ;

//Basically just used to get us an 'Other' that points to the Actor I'm looking for (That being the PurchaseSystem in this case.)

function bool CheckReplacement(Actor Other) {

// Stores the current Rx_PurchaseSystem, whether it be the new or old one. This is honestly pointless with the way I have it now. 
local  Rx_PurchaseSystem PSystem ;

if(Other.class == class'Rx_PurchaseSystem') {

PSystem = Rx_Game(WorldInfo.Game).PurchaseSystem ;

//Set the timer to replace the Purchase systems; in reality this may be totally unnecessary and field testing will see. 
//Still the timer needs to be before Rx_GRI looks for the  Purchase System

SetTimer(0.1f, false, 'ChangePurchaseSystem' ) ;

// return false for CheckReplacement means it will be deleting 'Other' in this case. Other being the old Purchase system.
// At least that's how I've come to see it working, and it checks out.

return false;
}

return true ; 
}

//--------

simulated function bool ChangePurchaseSystem() {

//----------------------------------------------
//The Vehicle Manager piggy-backs A LOT off of the Purchase system, so therefore needs to be updated 
//----------------------------------------------

local  Rx_PurchaseSystem PSystem ;

local Rx_VehicleManager VM;

//Set the new purchase system to Rx_Game's Purchase system
Rx_Game(WorldInfo.Game).PurchaseSystem = spawn(class'Rx_PurchaseSystem_MOD',self,'PurchaseSystem',Location,Rotation) ;

//Set the Vehicle Manager back right
VM = Rx_Game(WorldInfo.Game).VehicleManager;


PSystem = Rx_Game(WorldInfo.Game).PurchaseSystem ;


PSystem.SetVehicleManager(VM);
return true;
}

The modified Purchase system... which is only as modified as you want to make it obviously. I just left the classes under default properties as a visual aid.

class Rx_PurchaseSystem_MOD extends Rx_PurchaseSystem ;

//Mainly used as a means to make the purchase system spawn whatever you want. Refer to Rx_PurchaseSystem's default properties for the class arrays.

DefaultProperties 

{
GDIInfantryClasses[1]  = class'Rx_FamilyInfo_GDI_Shotgunner_MOD'
GDIInfantryClasses[13] = class'Rx_FamilyInfo_GDI_Mobius_MOD'

NodInfantryClasses[1]  = class'Rx_FamilyInfo_Nod_Shotgunner_MOD'

NodVehicleClasses[1]   = class'Rx_Vehicle_APC_Nod_MOD'
NodVehicleClasses[4]   = class'Rx_Vehicle_LightTank_MOD'
}

Plain, simple, and to the point, unlike the crap I'm working on now.

Link to comment
Share on other sites

  • Moderator

Have you made any modifications to the Stealth Tank through this yet, should I send the tank's text file to you, or should I borrow a small portion of this code to test the file i have already out through this method? Figured I'd ask since it's your hard work.

This was in fact real good work, this is an important framework for on the fly total rebalance mods touching on every unit.

Link to comment
Share on other sites

  • Developer
Have you made any modifications to the Stealth Tank through this yet, should I send the tank's text file to you, or should I borrow a small portion of this code to test the file i have already out through this method? Figured I'd ask since it's your hard work.

This was in fact real good work, this is an important framework for on the fly total rebalance mods touching on every unit.

We've had that code for awhile. I don't really care if you use it.

Link to comment
Share on other sites

  • Moderator
Have you made any modifications to the Stealth Tank through this yet, should I send the tank's text file to you, or should I borrow a small portion of this code to test the file i have already out through this method? Figured I'd ask since it's your hard work.

This was in fact real good work, this is an important framework for on the fly total rebalance mods touching on every unit.

We've had that code for awhile. I don't really care if you use it.

I am thinking these next two days then, that I will try to take the existing balance mutator, and add my stealth tank adjustment to it, via changing all checkreplacements with a modified purchase system instead. Then next week we can start playing with modified vehicles and sidearms.

Link to comment
Share on other sites

  • Moderator

Okay, so far I have been working on it. So, I added the first block of code directly to the PrePatchBalanceMutator.uc, and I made the second block into it's own file Rx_PurchaseSystem_MOD but I had a question.

EDIT: Also, I am getting an error when I try to compile, but I tried tracking it down myself and... I don't think it's mine. When I strip the balance mutator out of it and use just the 2 code blocks you pasted to the forums, I get:

StankMutator.uc(12) : Warning, 'PSystem' : unused local variable

Line 12 being:

10 if(Other.class == class'Rx_PurchaseSystem') {

11

12 PSystem = Rx_Game(WorldInfo.Game).PurchaseSystem ;

It is not a critical compiling error, the mutator compiles, but launching the game causes a loop upon player spawn that prevents movement at all.

Link to comment
Share on other sites

  • Developer

Psystem really doesn't get used for the top half of that code. You can probably comment it out, since rethe only Psystem variable used is the local one in the ChangePurchaseSystem function.

That also isn't where that error comes from. I think I mentioned earlier that switching out the Purchase system the way I do means you have to suicide every time you run the mutator in single-player. It's unnoticeable in multi-player.

Link to comment
Share on other sites

  • Developer
Other.Class? why not just use Other.IsA()?

Also, the loop seems to be because the child uses the parent that you're replacing, remember that?

I really just write whichever one comes to mind first.

Again, I'm pretty sure I never got a loop, but the lack of initially spawning in single-player is normal

Link to comment
Share on other sites

  • Moderator

That... all makes sense... It is a loop if you look at the code while the game runs, but it does clear up once you get out of "spectator mode", and that includes suicide. So, it is a loop, that the game stops looping once the game starts.

I was told in another thread that buildings are loaded as part of the map-state. I wonder, either by using this to load in the game on the building internals, or by making modified maps (really resaving the maps using modified buildings), if I could accomplish those means...

Okay, so I added it to a copy of the mutator I decompiled from Cache, and this is what I get when trying to compile after adding purchase system modifier to it.

C:\Kyle'sGames\Renegade X\renx sdk\Development\Src\PrePatchBalanceMod\Classes\PrePatchBalanceMutator.uc(149) : Error, BEGIN OBJECT: The component name Sprite is already used (if you want to override the component, don't specify a class):    Begin Object Class=SpriteComponent Name=Sprite Archetype=SpriteComponent'UTGame.Default__UTMutator:Sprite'
C:\Kyle'sGames\Renegade X\renx sdk\Development\Src\PrePatchBalanceMod\Classes\Rx_Controller_Modified.uc(93) : Error, BEGIN OBJECT: The component name CollisionCylinder is already used (if you want to override the component, don't specify a class):    Begin Object Class=CylinderComponent Name=CollisionCylinder Archetype=CylinderComponent'Renx_Game.Default__Rx_Controller:CollisionCylinder'
C:\Kyle'sGames\Renegade X\renx sdk\Development\Src\PrePatchBalanceMod\Classes\Rx_Pawn_Modified.uc(115) : Error, BEGIN OBJECT: The component name ParachuteMeshComponent is already used (if you want to override the component, don't specify a class):    Begin Object Class=SkeletalMeshComponent Name=ParachuteMeshComponent Archetype=SkeletalMeshComponent'Renx_Game.Default__Rx_Pawn:ParachuteMeshComponent'
C:\Kyle'sGames\Renegade X\renx sdk\Development\Src\PrePatchBalanceMod\Classes\Rx_Weapon_SniperRifle_Nod_MOD.uc(6) : Warning, ObjectProperty utgame.UTWeapon:WeaponFireWaveForm: unresolved reference to 'ForceFeedbackWaveform'prepatchbalancemod.Default__Rx_Weapon_SniperRifle_Nod_MOD:ForceFeedbackWaveformShooting1''
C:\Kyle'sGames\Renegade X\renx sdk\Development\Src\PrePatchBalanceMod\Classes\Rx_Weapon_SniperRifle_Nod_MOD.uc(6) : Warning, Invalid property value in defaults:    WeaponFireWaveForm=ForceFeedbackWaveform'prepatchbalancemod.Default__Rx_Weapon_SniperRifle_Nod_MOD:ForceFeedbackWaveformShooting1'
Failure - 14 error(s), 50 warning(s)

But, as an independent mutator, which I was trying to avoid, it does work. I guess I will try to find a server to submit it to for testing.

Link to comment
Share on other sites

  • Moderator

Okay, with the same purchase system mutator for the stealth tank, I replaced the emp nade, and for the first time my first code compiled without error.

However, ingame, emp nade purchase replaces explosives with nothing whatsoever. No errors in cmd. Would I need to cull the explosives purchase manager similar to the vehicle manager in yosh's code earlier?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...