Results 1 to 5 of 5
  1. #1
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    566
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default New damage solution

    My game has a couple new qualities to pass along with damage dealt to pawns. All my pawns will have a brief moment of being invincible after they are hurt, which I might at some point set to be alterable so different attacks can induce different periods of invincibility. I further need an ability to add a specific "Knock-Back" effect to the player which will induce specific animations and other effects.

    I was starting to set this up by simply extending the TakeDamage function within my pawn class. It would add a new optional parameter and call the super.TakeDamage with the default parameters. However when I tried to compile this test I discovered that it would not allow me to redefine the function with a different number of parameters.

    So I need a new plan of attack.

    I need a way for attacks to add a new variable I can use in the damage code, possibly two.
    I'm mulling this over but I don't have anything that really seems like a good idea to me, so I am turning to the forum here to ask if anyone has a good idea about how I should handle this.
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/

  2. #2

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    218

    Default

    In addition to subclassing UTDamageType, you can also make a new YourGameTakeDamage() function that will be called by your weapon and other damage dealers. From there, you could call the regular TakeDamage function to get the functionality there as well as have some custom code in addition to that or you can just code your own damage dealing functionality. Hope that gives you a few ideas.

  4. #4

  5. #5
    Iron Guard
    Join Date
    Sep 2008
    Location
    Utah or California
    Posts
    566
    Gamer IDs

    Gamertag: Marscaleb PSN ID: Marscaleb

    Default

    Hmm, but if I created a new damage-type I would need a huge switch list to check all my new damage types, or else drop out any conventional use of damage type.

    I like the idea to create a new take damage function. I could call the super.takeDamage from there, and have a new take damage in my class that calls my custom take damage after assigning default values to my new variables. That way I could cover all my bases.

    Thank you!
    Follow my progress at:
    http://marscaleb.com/
    Read my new webcomic: Mischief in Maytia
    http://maytiacomic.com/


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.