HTTP request to website

  • 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/

Cranston_29thid

FNG / Fresh Meat
Jun 13, 2010
103
0
0
I'm trying to make an HTTP request to a web site when the map loads (ie. GET http://mysite.com/api). In UT2004, this was made pretty easy via El Muerte's LibHTTP. Is there a similar library for Unreal 3 or some native method that does this?
 

Cranston_29thid

FNG / Fresh Meat
Jun 13, 2010
103
0
0
Bump. If a dev could take a look at this that'd be great.

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 :/
 

Ducky

Super Moderator
May 22, 2011
6,358
237
0
Netherlands
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.