Results 1 to 6 of 6
  1. #1
    Marrow Fiend
    Join Date
    Nov 2007
    Location
    Lithuania
    Posts
    4,385

    Default Finding certain actors

    I'm somewhat baffled by two issues in a mutator I'm writing, both of which relate to finding certain actors in the game. First of all, I'm trying to find the first Controller in the game's controller list. But it seems that the list gets populated really late in the game, to the point that neither PostBeginPlay() and even ModifyLogin() has nothing defined in the list. So what would be a good place to place the code in? What is the first time after controllers have been spawned that a mutator can access?

    The second issue is about CheckReplacement(). What actors does it iterate over? I'm attempting to find an xBombDelivery and an xBombSpawn, but it seems that they don't go through CheckReplacement()... The former is dynamic, so I want to replace it (apparently they didn't think of not hardcoding the xBombDeliveryHole class, argh), and the latter is static (but at least there they do allow changing the ball's class), and both are NavigationPoint/GameObjective subclasses. I guess that means I should just do a foreach AllActors on PostBeginPlay()?

  2. #2
    Redeemer
    Join Date
    Jan 2004
    Location
    The great Pacific Northwest
    Posts
    1,426

    Default

    1. Use a timer (or periodic tick) in your mutator to periodically check the level.controllerlist and begin action once it is populated. Also note that if your mutator is simulated (and the replication vars are set up to have it exist on clients), the controllerlist is only valid on the server.

    2. Follow the call chain back from CheckReplacement to the PreBeginPlay event in Actor.uc (then take a look here, or in UnGame.cpp). Depending on an actor's properties it may or may not bother calling 'CheckRelevance', but even if it does, if the mutator has not been spawned/loaded yet (which if I recall correctly should be the case for mapper placed level actors) the default mutator won't do anything anyways. I would recommend going with the option you already mentioned, foreach AllActors in PostBeginPlay or maybe BeginPlay (just like the MutInstaGib).
    "What do you mean it doesn't exist clientside?"
    YARM: where player's Lean, Prone, Mantle, Dash, Crouch Jump, 'Parkour' and slide around all with generic realistic weapons!
    My Generic Mods for UT2K4:
    Yet Another Real-life Mod: Realistic weapons, unoriginal gameplay, w/ cheap CODMW knockoff mutator
    TD Vehicles: HUMV, MI4Hound, Motorcycle, IFAV Jeep, UH-60, MH-53 & AH-6 Helicopters, Abrams Tank

  3. #3
    Boomshot

    Join Date
    Feb 2010
    Location
    Portugal
    Posts
    2,162

    Default

    Quote Originally Posted by meowcat View Post
    1. Use a timer (or periodic tick) in your mutator to periodically check the level.controllerlist and begin action once it is populated. Also note that if your mutator is simulated (and the replication vars are set up to have it exist on clients), the controllerlist is only valid on the server.

    2. Follow the call chain back from CheckReplacement to the PreBeginPlay event in Actor.uc (then take a look here, or in UnGame.cpp). Depending on an actor's properties it may or may not bother calling 'CheckRelevance', but even if it does, if the mutator has not been spawned/loaded yet (which if I recall correctly should be the case for mapper placed level actors) the default mutator won't do anything anyways. I would recommend going with the option you already mentioned, foreach AllActors in PostBeginPlay or maybe BeginPlay (just like the MutInstaGib).
    This was the only solution that came to my mind.

  4. #4
    Marrow Fiend
    Join Date
    Nov 2007
    Location
    Lithuania
    Posts
    4,385

    Default

    Hmm,well, right now I have it set to ModifyPlayer(), as it's guaranteed to have a controller at that point. And since it's for an announcement mutator, naturally you can't get it while nobody is spawned, so it works out.

  5. #5
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Germany
    Posts
    120

    Default

    Quote Originally Posted by meowcat View Post
    [...](which if I recall correctly should be the case for mapper placed level actors) the default mutator won't do anything anyways[...]
    That's not true, you can replace or delete Actors such as Pickups with Mutator.CheckReplacement(). Actors with "bStatic=true" or "bNoDelete=true" can neither be deleted nor replaced but values of them can be altered. Actors with "bGameRelevant=true" won't undergo the Mutator.CheckReplacement() function.
    But there are some Actors that overwrite Actor.PreBeginPlay() without an call to the superclass, for instance the class Mutator. The Mutator.CheckReplacement() function won't be called on them either.

  6. #6
    Redeemer
    Join Date
    Jan 2004
    Location
    The great Pacific Northwest
    Posts
    1,426

    Default

    Thanks for the clarification Mutant117! Here is the page I meant to link to in my previous post for the c++ code that initially iterates over all map placed actors (and calls the Pre/Begin/Post script functions.
    "What do you mean it doesn't exist clientside?"
    YARM: where player's Lean, Prone, Mantle, Dash, Crouch Jump, 'Parkour' and slide around all with generic realistic weapons!
    My Generic Mods for UT2K4:
    Yet Another Real-life Mod: Realistic weapons, unoriginal gameplay, w/ cheap CODMW knockoff mutator
    TD Vehicles: HUMV, MI4Hound, Motorcycle, IFAV Jeep, UH-60, MH-53 & AH-6 Helicopters, Abrams Tank


 

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.