Perhaps this is simple

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

CybrSwami

New Member
Jan 17, 2004
2
0
0
hello all,

this is my first post here on the beyond unreal forums and i am glad to see that the modding community for ut2k3 is alive and well. i have a question that might be overly simple and i apologies if it is in advance.

i have coded a series of melee weapons and the code for each weapon works without problem, i have modified the utclassic mutator code to get the new weapons to replace the weapons in the game in a mutator/arena style.

however, i am finding two problems with this.

Problem 1) if i use the ut classic as the base code for the mutator to get the weapons to work then the assault rifle does not change into my weapon, the sword. so you have the hands replacing teh shield gun but then you have this assault rifle with grenades as your second weapon and then axes adn clubs etc. for the other weapons, this ofcourse is extremely agravating. so the question is is there a simple line of code i am missing or need to add to get this mutator to also replace the assault rfile with the sword?

problem 2) when i cheat and use a second mutator to get work around the above problem i can get the sword in as the second weapon, however, none of the weapons appear in multiplayer, in single player vs bots all is fine all pickup work and all wepons work as they should but a second player can not pick anythign up and no pickup models exist and the second player does nto even ahve a weapon at all. thus i am assuming that the workaround is not working hence why i am here asking for some guidance and hopefully some help

thanks guys hope i have explained the problem if you would like i can paste the code.
 

Sir_Brizz

Administrator
Staff member
Feb 3, 2000
26,020
83
48
you need to replace the weapons in the DefaultInventory. I'm at work just trying to get you started. There is an Inventory array for your Pawn that holds the weapons they are supposed to spawn with. You need to alter this array manually before the players spawn.
 

CybrSwami

New Member
Jan 17, 2004
2
0
0
thanks for the advice jsut a bit of clarification please as i am a bit stupid but is DefaultInventory in the Mutator code or should i put it in as a game rule?
 

meowcat

take a chance
Jun 7, 2001
803
3
18
What sir_brizz was talking about was that in the pawn class (take a a look at the default properties for xPawn in the xGame.u file specifically) there is an array that lists what weapons a pawns will always start. Since i don't have the script in front of me I don't remeber what code is responsible for spawning those weapons and giving them to the pawn, but i think you have two choices (for mutator code that is).
In the modifypawn function of the mutator class, you could search the pawn's inventory for the weapon and try to remove it if they already have it, and also change the entries in the "RequiredEquipment" array (This is important because then you would not have to do the inventory check again if they respawn) to either your weapons or no weapons. Or you could do your check in the checkreplace function and try to change the pawns required equipment there.