Freon mutator code  (Read 191 times)

wife

  • Sr. Member
  • *
  • Posts: 121
  • Country: gb
Freon mutator code
« on: January 20, 2020, 20:11 »
1. what governs the placement of the random pickup pads?
from what I can deduce it's anything that extends the Engine.xPickUpBase actor class can be replaced with a pad... but that doesn't guarantee a replacement e.g. UDamage is never(?) replaced and various weapons bases in Corrugation are omitted.
is it random, and what can I do to dictate how actors will be replaced?

2. is there some UScript functionality that allows events to trigger only on, or during, certain game 'rounds'?
when I used to make invasion maps it was possible to trigger specific scripts when a given wave was reached - is there anything similar for Freon?
volite li moje bio poljupce? ^x^

Piglet

  • 1337
  • *
  • Posts: 2322
  • Country: gb
Re: Freon mutator code
« Reply #1 on: January 20, 2020, 20:24 »
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

  • Sr. Member
  • *
  • Posts: 107
  • Country: gr
Re: Freon mutator code
« Reply #2 on: January 20, 2020, 20:30 »
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

  • 1337
  • *
  • Posts: 272
  • Country: gb
Re: Freon mutator code
« Reply #3 on: January 20, 2020, 21:40 »
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

  • 1337
  • *
  • Posts: 2322
  • Country: gb
Re: Freon mutator code
« Reply #4 on: January 20, 2020, 22:25 »
Code: [Select]
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]);
    }
}