1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

Perhaps this is simple

Discussion in 'Programming' started by CybrSwami, Jan 17, 2004.

  1. CybrSwami

    CybrSwami New Member

    Joined:
    Jan 17, 2004
    Messages:
    2
    Likes Received:
    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.
     
  2. Sir_Brizz

    Sir_Brizz Administrator Staff Member

    Joined:
    Feb 3, 2000
    Messages:
    25,971
    Likes Received:
    66
    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.
     
  3. CybrSwami

    CybrSwami New Member

    Joined:
    Jan 17, 2004
    Messages:
    2
    Likes Received:
    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?
     
  4. meowcat

    meowcat take a chance

    Joined:
    Jun 7, 2001
    Messages:
    774
    Likes Received:
    1
    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.
     

Share This Page