Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2003
    Posts
    16

    Power up weapon?

    I know its possible to make upgradeable weapons where you pick up something and then your weapon can do something new. I was just wondering if any of you knew where i could find information or a tutorial on doing this...?

  2. #2
    Join Date
    Jun 2003
    Posts
    25
    One such way to do it is... After picking up the upgrade, the current selected weapon will be removed from the inventory, and a new upgraded weapon is added. This way, you have a weapon class for each upgraded version of the gun so that dropping it will retain its upgrade status without having to mess with variables and such.

  3. #3
    Join Date
    Jun 2003
    Posts
    16
    Yeah i know! But i have only completed buzz's VTM's and they don't tell you about altering projectiles n stuff. So i was looking for somekind of tutorial that could explain the process of removing the weapon and replacing it with another!

  4. #4
    Join Date
    Jun 2003
    Location
    Germany, Leipzig
    Posts
    78
    But if u want to combine the different upgrades then there would be many weapons of the same type. Wouldn't it be nicer to let the upgrade search through the Inventory for the Weapon needed and change all the things it needs to (eg. FireModes, StaticMesh,...) or let it do a function in the weapon class for each upgrade (eg. ExplosionAmmoUpgrade(), SniperScopeUpgrade()?

    But without the need of combining different upgrades I would do it like shodan.
    There is no life before coffee.

  5. #5
    Join Date
    Mar 2003
    Location
    Southern New Jersey, USA
    Posts
    37
    You could make a mutator, and make a few uc's that will just change the default properties of one of the existing guns. That way, the gun is completely changed, but it's only that way while your in that mutator.
    ~Tom

  6. #6
    Join Date
    Jun 2003
    Posts
    16
    I thought about that yeah! But what im looking for is somekind of tutorial to explain the exact code of "When This is picked up change the properties for this gun"

    Can anyone supply me with a line of code and where to put it? It should be very heavy!

  7. #7
    Join Date
    Jun 2003
    Location
    Germany, Leipzig
    Posts
    78
    OK ... here we go.
    I hope u ever made a weapon yet.

    I'll describe the both methods I would use.

    First subclass your WeaponUpgradePickup from TournamentPickup
    Here u have to adjust the defaultproperties for the staticmesh
    and the variable called InventoryType.

    Your WeaponUpgradeInventory (thats the InventoryType from above) has to be subclassed from (guess) Inventory. Here u change the PickupClass variable to the WeaponUpgradePickup. Override the PickUpFunction(Pawn Other) so it does the stuff it should do when picked up (see third step).

    Does anybody know if this function really is called when picking it up? Sry ... I'm not sure...

    Last but not least ... the PickUpFunction
    This gives us the pawn who is picking up the upgrade.
    If your upgrades cannot be combined u could make a weapon for each upgraded version and then exchange the nonupgrade version with the upgrade one. (Hope my sentences aren't too strange)

    For this, u first have to test if the player already has the weapon which should be upgraded and then delete this and add the new one.

    function PickUpFunction(Pawn Other)
    {
    Super.PickUpFunction(Other);

    if( UnrealPawn(Pawn).IsInLoadout(NonUpgradedWeapon) )
    {
    DeleteInventory(NonUpgradedWeapon);
    AddInventory(UpgradedWeapon);
    //Then u should switch to the new weapon
    //I didn't searched for this function, sry
    }
    else
    DeleteInventory(self);
    //If Pawn doesn' have the weapon which should be upgraded we have
    //to remove this Upgrade from the pawns inventory
    }


    If your upgrades can be combined u should do it as followes:

    function PickUpFunction(Pawn Other)
    {
    Super.PickUpFunction(Other);

    local Inventory DesiredWeapon;

    DesiredWeapon = FindInventoryType(WeaponClassToUpgrade);
    if( DesiredWeapon!=None )
    {
    //Here u can doo all u want with the DesiredWeapon
    //change the staticmesh or firemodes or anything
    }
    else
    DeleteInventory(self);
    }


    So thats enough I think.
    I know its only the basic but I didn't want to be the only one posting here ;-)
    So guys extend this if u want...

    Hope this helps a bit.
    There is no life before coffee.

  8. #8
    Join Date
    Jun 2003
    Posts
    16
    This helps a lot i'll try it out tommorow. Thx... Just what i was looking for!

    Not that if anyone has anything to add about maybe if you have a weapon and you pick all ugrades up then what!

    I think the select new weapon function is called
    function Use( float Value )
    Last edited by setion; 06-16-2003 at 02:54 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •