Results 1 to 6 of 6
  1. #1
    Palace Guard
    Join Date
    May 2003
    Posts
    3,461

    Default Replacing random powerups

    I was wondering how to replace randonm powerups, i've seen it done before (chaos ut2's 5 armour powerup) I know you have to use check replacement but i dont know how to do this without creating infinite recursion (or at least having everything turn into my powerup) i'm doing somthing along the lines of..

    [CODE]
    if ( MiniHealthPickup(Other) != None @@ frand()<=0.1)
    ReplaceWith( Other, "PoisonPickup.PoisonPickup");
    else
    return true;

    [CODE]

    oh, and on a different note i'm having trouble using the takeDamage function, mine is like

    Pawn(owner).TakeDamage(3,Pawn(owner),Boost,Boost,c lass'PoisonDamage');

    but i only ever take 1 damage rather than 3

  2. #2
    MSgt. Shooter Person
    Join Date
    Mar 2002
    Posts
    250

    Default

    hehe this may not be the best way, but you could always replace xweaponbases with wildcardbases and set random weapons to spawn there :/

  3. #3
    Palace Guard
    Join Date
    May 2003
    Posts
    3,461

    Default

    yeah but what i'm trying to do is replace about 5-10% of health vials with poison vials, so that might not help.

  4. #4
    Redeemer
    Join Date
    Jul 2002
    Posts
    1,910

    Default

    If 'poisonpickup' is a subclass of the healthvial-pickup you're replacing ... then you simply make sure you're not replacing a poison-pickup ...

    Code:
    if ( (MiniHealthPickup(Other) != None) AND (frand()<=0.1) AND  (PoisonPickup(Other) == None))
    ReplaceWith( Other, "PoisonPickup.PoisonPickup"); 
    else 
    return true;
    Or maybe you need '(Other.Isa("PoisonPickup.PoisonPickup") == False)
    That's for you to decide.
    I have slightly more complicated code in my powerpills-mutator.
    I replace 1 in X adrenaline pills with my powerpills and eliminate the rest ...

  5. #5
    Palace Guard
    Join Date
    May 2003
    Posts
    3,461

    Default

    But wouldnt that loop back over and replace all the vials, i'l try it anyways though, thanks

  6. #6
    Redeemer
    Join Date
    Jul 2002
    Posts
    1,910

    Default

    Perhaps you could make a 'poison-vial' that has two settings.
    One for 'save' / regular vials and one for 'poison'.

    Then you replace all the vials for 'poison-vials' and simply give them a 5% chance of being 'poison'.
    That would be almost the exact code of my powerpills-mutator when set to a 1 in 1 replacement ...
    All you need to do is replace the reference to the 'powerpills' & 'adrenaline' to the healthvials & poison-vials.


 

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.