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.

Is there a way to create a property of a pawn

Discussion in 'Programming' started by Archimedes 182, Jan 5, 2002.

  1. Archimedes 182

    Archimedes 182 New Member

    Joined:
    Jan 5, 2002
    Messages:
    8
    Likes Received:
    0
    ok this is what im trying to do. I want to have a variable that has a different value for each pawn.

    maybe this'll help

    function MutatorTakeDamage(out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation, out Vector Momentum, name DamageType)

    If (Victim.Health <1)
    If (Victim.Lives >1)
    {
    Victim.Health = 100;
    Victim.Lives -= 1;
    InstigatedBy.Lives += 1;
    }

    etc

    this will basically can only work in LMS and was a response to this request

    This is a suggestion, not a request.

    An LMS mod where you "win" frags from another player.

    i.e. You frag johnsmith... you gain an extra life and johnsmith loses a life. It'd defeat the campers/hiders anyway... It'd be no good for big mass matches because the top two players might have about 25 lives each at the end of the game and be waiting forever for them to finish. Not bad for 2-3 players though?



    anyway is there a way to create the .Lives property ?
    thx for any help
     
  2. Raeled

    Raeled Feuer Frei!

    Joined:
    Jul 1, 2001
    Messages:
    161
    Likes Received:
    0
    LMS uses the score for the lives:

    in the function you posted the score of the victem would be:

    victem.playerreplicationinfo.score
     
  3. eXoR

    eXoR Lead coder

    Joined:
    Oct 22, 2001
    Messages:
    36
    Likes Received:
    0
    Try it like this:

    var PlayerLives[256];

    If (Victim.Health <1)
    If (PlayerLives[Victim.PlayerReplicationInfo.PlayerID] >1)
    {
    Victim.Health = 100;
    PlayerLives[Victim.PlayerReplicationInfo.PlayerID] -= 1;
    PlayerLives[InstigatedBy.PlayerReplicationInfo.PlayerID] += 1;
    }
     

Share This Page