News:

Welcome! If you're new here, please register to have full access

Main Menu

Freon mutator code

Started by wife, January 20, 2020, 20:11

wife

---
---

Piglet

It's not code I've ever looked at. Hagis might know as he has contributed code to Freon too.

All the code is left on the package so it's there to read & suggest improvements

holyspam

Most of the pickup classes are removed or replaced when tam is initialised, but i can't recall which class this was.
It will probably be in one of the parent classes, like teamgamebase or teamarenamaster

hagis

it's been a (long) while when I looked at this,. in 3spn I think it uses some of the player start nodes or something to pick the places where the pickups will be - or I might be completely wrong,.

I can say fo sure it's in 3psn as I remember looking at the code, the pickups are designed to be random though mostly they aren't as random as they might have been intended,. we had a thought to make the number of pickups configurable - didn't but it is possible

Piglet


function SpawnRandomPickupBases()
{
    local float Score[3];
    local float eval;
    local NavigationPoint Best[3];
    local NavigationPoint N;

    for(N = Level.NavigationPointList; N != None; N = N.NextNavigationPoint)
    {
        if(InventorySpot(N) == None || InventorySpot(N).myPickupBase == None)
            continue;

        eval = FRand() * 5000.0;

        if(Best[0] != None)
            eval += VSize(Best[0].Location - N.Location) * (FRand() * 4.0 - 2.0);
        if(Best[1] != None)
            eval += VSize(Best[1].Location - N.Location) * (FRand() * 3.5 - 1.75);
        if(Best[2] != None)
            eval += VSize(Best[2].Location - N.Location) * (FRand() * 3.0 - 1.5);

        if(Best[0] == N)
            eval = 0;
        if(Best[1] == N)
            eval = 0;
        if(Best[2] == N)
            eval = 0;
           
        if(eval > Score[0])
        {
            Score[2] = Score[1];
            Score[1] = Score[0];
            Score[0] = eval;

            Best[2] = Best[1];
            Best[1] = Best[0];
            Best[0] = N;
        }
        else if(eval > Score[1])
        {
            Score[2] = Score[1];
            Score[1] = eval;

            Best[2] = Best[1];
            Best[1] = N;
        }
        else if(eval > Score[2])
        {
            Score[2] = eval;
            Best[2] = N;
        }
    }

    if(Best[0] != None)
    {
        Bases[0] = Spawn(class'Misc_PickupBase',,, Best[0].Location, Best[0].Rotation);
        Bases[0].MyMarker = InventorySpot(Best[0]);
    }
    if(Best[1] != None)
    {
        Bases[1] = Spawn(class'Misc_PickupBase',,, Best[1].Location, Best[1].Rotation);
        Bases[1].MyMarker = InventorySpot(Best[1]);
    }
    if(Best[2] != None)
    {
        Bases[2] = Spawn(class'Misc_PickupBase',,, Best[2].Location, Best[2].Rotation);
        Bases[2].MyMarker = InventorySpot(Best[2]);
    }
}