Page 2 of 2

Re: Randomizer Revisited...

Posted: Mon Nov 21, 2022 3:50 pm
by pooty
Ugh. Found a bug in the UltimateONSFactory -- the vehicle is always by default unlocked unless you lock it specifically for one team only. (You might recall the unlocked ion back on Artic this is it). Which means using it as a Random factory is kind of fubar. So I need to rebuild it to change two lines of code lol.

Re: Updated Slated World V4

Posted: Sun Nov 26, 2023 1:49 pm
by captainsnarf
pooty wrote: Sun Nov 26, 2023 1:10 pm I had tried to build a randomizer that let you select for a node group flying or not flying, but I couldn't get the UTScript to recognize the bCanFly variable properly.

Thoughts?
Where is the randomizer vehicle factory code?

I'm assuming it is a list of classes with weights. Higher weight is more likely to be spawned.

You would need to modify that list structure. Include bCanFly for each class in the list. Or create two lists, one flying and one not. Since bCanFly is a property on a Pawn (and not on class), you would have to actually spawn it to check if it can fly or not.

Re: Updated Slated World V4

Posted: Sun Nov 26, 2023 3:49 pm
by pooty
So I got it working.

Added a property to node groups bFlyingOnly
And then this check:
(NodeGroups[index].bFlyingOnly && Vehicles[m].VehicleClass.default.bCanFly )

Only case it wouldn't work if a vehicle changes bCanFly, but AFAIK, there's no vehicle that does that. The above doesn't require the spawning, because of default.

Just need to test it out. Usual Randomizer is in VehicleRandomizerOmni. The two main classes are VehicleRandomizer (base legacy code) and VehicleRandomizerOmni (the one I am changing).
I'm assuming it is a list of classes with weights. Higher weight is more likely to be spawned.
Not quite. Its a list of vehicle classes with point values.
It loops through grabbing a random vehicle from an intermedite list with
(Vehicles[m].bUnique && Vehicles[m].bAlreadyUsed) && !bBanned
&& (NodeGroups[index].bFlyingOnly && Vehicles[m].VehicleClass.default.bCanFly )

Point values are randomly assigned per node group (min/max) say 500 - 1000, so say 700, it will randomly pick a set of vehicles whose cumulative point value is 700 or less. What ever gets assigned to that NodeGroup gets those vehicles, all nodes are paired so each team gets same layout (at least to start).

Now the random vehicle factories in UltimateMappingToolsOmni can create a factory with varying probabilities, but that's only on single factory basis, where as the other one works on Node groups.


Also, its worth pointing out that VehicleRandomizerOmni replaces vehicles on all Stock Factories, so you can randomize a map and not have to replace any factories.
It doesn't do replace on (configurable) ForcedVehicleFactory (part of VehicleRandomizerOmni) and I updated it to also ignore UltimateONSFactory (from UltimateMappingToolsOmni ), which has a few modes like
VST_Random, // Random from list, equal chances for everyone.
VST_Probability, // Use Probability values of the vehicle, so some vehicles are more likely than others.
VST_Sequential, // Always select the next entry from the list when spawning a new vehicle.
VST_OnceRandom, // Random as above, just that the choice will be used for the whole match.
VST_OnceProbability // Use Probablity as above, just that the choice will be used for the whole match.

Probably quite a bit we can do with these if we wanted.

As a side they do depend on ONSPowerNodeSpecial (which allows for varying node health), and we have I think two package versions of those OnslaughtSpecials2 and OnslaughtSpecials2_RNH -- don't know what the diff is..but both are there from the old server.

Re: Randomizer Revisited...

Posted: Sun Nov 26, 2023 5:09 pm
by pooty
I tested it, it needed a few changes in the logic. But it now works. You can control whether a node gets FlyingOnly or any vehicle.

I suppose we could add GroundVehicleOnly or pretty much anything else, but between the VehicleRandomizer and UltimateONSFactories, it can cover mostly every scenario.