• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code HTTP request to website

I might as well throw in another more straightforward question. Is there any way to reference active mutators to get access to their variables? I only know how to access default values for the variables :/

Can't quite follow what you are asking. Do you mean to use mutator A to access variables of mutator B? If yes, then the answer is yes too.

Here a function that will find any mutator for you:
Code:
static function Mutator GetMutator(name MutClass)
{
    local Mutator  mut;

    foreach class'WorldInfo'.static.GetWorldInfo().AllActors(class'Mutator', mut)
    {
        if (mut.IsA(MutClass))
        {
            return mut;
        }
    }

    return None;
}

Then in mutator A you can use it as:
Code:
function BlaBla()
{
    local MutatorB  mutB;

    mutB = MutatorB(static.GetMutator('MutatorB'));

    mutB.AnyVariable = 0;

    mutB.AnyFunction();
}

Disadvantage is that mutator A needs to be compiled against the sources of mutator B. You can overstep this by defining an interface for mutator B. Then mutator B inplements that interface. Next mutator A will look for the interface and not for the mutator. This way both mutator A and B compile against the interface. You can change A without having to rebuild B and you can change B without having to rebuild A.
 
Upvote 0