Totem Arts Staff NodSaibot Posted April 10, 2015 Totem Arts Staff Share Posted April 10, 2015 The point of this mutator is when people type 'mutate sniper' or 'mutate SNIPER' into the command line, it will award them with a sniper. I know this has no real value, but it's just practice. There is only one problem, it won't compile due to an error in the 6th line. Apparently this has something to do with the code of Rx_InventoryManager and there is nothing I can do about it right now. Waiting for some more info from the devs. Error 9 Bad or missing expression after '&&': 'Rx_InventoryManager' C:\Rx_SDK\Rx_SDK_March_22_2015\Development\Src\CZ_BuySniper\Classes\CZ_BuySniper.uc 6 1 RenXMP class CZ_BuySniper extends UTMutator; function Mutate(string MutateString, PlayerController Sender) { if (Caps(MutateString) == "SNIPER" && Rx_InventoryManager(Sender.Pawn.InvManager) != none) Rx_InventoryManager(Sender.Pawn.InvManager).AddWeaponOfClass(class'Rx_Weapon_SniperRifle_Nod',CLASS_PRIMARY); Super.Mutate(MutateString, Sender); } DefaultProperties { } Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted April 11, 2015 Totem Arts Staff Share Posted April 11, 2015 Did you happen to put the script BEFORE it compiles RenX's own? Quote Link to comment Share on other sites More sharing options...
JeepRubi Posted April 11, 2015 Share Posted April 11, 2015 Okay, I figured out what the issue was. It seems like "Rx_InventoryManager.AddWeaponOfClass" does a check to make sure you're "allowed" to have that weapon before adding it to your inventory. It does that by seeing if the class has the weapon in it's defaults, but because this is an extra weapon, it wont, so the add will fail. Not to worry tho, we can look at the "AddWeaponOfClass" function, and just do the same behaviour, but inside of our mutator, and without the check to see if you're "allowed" to have the weapon. That would look like this: class Rx_Mutator_GiveSniper extends UTMutator; function Mutate(string MutateString, PlayerController Sender) { local Rx_InventoryManager InvManager; local class WeaponClass; WeaponClass = class'Rx_Weapon_SniperRifle_Nod'; InvManager = Rx_InventoryManager(Sender.Pawn.InvManager); if (MutateString ~= "sniper" && InvManager != none) { if (InvManager.PrimaryWeapons.Find(WeaponClass) < 0) // Make sure it isn't in there already. InvManager.PrimaryWeapons.AddItem(WeaponClass); if(InvManager.FindInventoryType(WeaponClass) != None) { InvManager.SetCurrentWeapon(Rx_Weapon(InvManager.FindInventoryType(WeaponClass))); } else { InvManager.SetCurrentWeapon(Rx_Weapon(InvManager.CreateInventory(WeaponClass, false))); } Rx_Pawn(Owner).RefreshBackWeapons(); } Super.Mutate(MutateString, Sender); } Quote Link to comment Share on other sites More sharing options...
JeepRubi Posted April 11, 2015 Share Posted April 11, 2015 And yea, that error looks like it doesn't know what Rx_InventoryManager is, so double check your package is compiling after RenX_Game. Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff NodSaibot Posted April 11, 2015 Author Totem Arts Staff Share Posted April 11, 2015 This is the compiled scripts area. These are all I see Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff NodSaibot Posted April 11, 2015 Author Totem Arts Staff Share Posted April 11, 2015 Apparently it can't find RenX_RCam or RenX_Game in the compiled scripts area, and it's stopping the compilation. Don't know if this is related, but I ran frontend as admin and it worked Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted April 12, 2015 Totem Arts Staff Share Posted April 12, 2015 Apparently it can't find RenX_RCam or RenX_Game in the compiled scripts area, and it's stopping the compilation.Don't know if this is related, but I ran frontend as admin and it worked Check your +EditPackages or +ModEditPackages. If you put your mutator before RenX's that would definitely result compiler error Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.