Author Topic: Crashing derby - How to raise the 20 vehicle limit?  (Read 1315 times)

Currently I am having issues spawning vehicles, only 4-6 spawn while there is a lot more than can spawn  because I was spawning 12 AIs and only 4-6 vehicles have spawned.

Any ideas?: Or do I need to make a hacky way to make vehicles?

Code: server.cs (31 lines)
    function GameConnection::getSpawnPoint(%client)
    {
        if(isObject(%mini = getMinigameFromObject(%client.minigame)) && DD_Data.memberCount > 0)
        {
            %spawnBrick = DD_Data.assignRandomVehicle(); //Max out needs to be at 32, this cannot repeat
            if(isObject(%spawnBrick))
            {
                %spawnBrick.setVehicle(nameToID(MonsterJeepVehicle), %client); //Prevent others spawning it into something different
                if(!isObject(%spawnBrick.vehicle))
                    %spawnBrick.respawnVehicle();
                else if(isObject(%vehicle = %spawnBrick.spawnBrick))
                    if(isObject(%vehicle.getMountedObject(0)))
                        %spawnBrick.respawnVehicle();

                %point = %spawnBrick.getTransform();
                %spawnPosition = getWords(%point, 0, 2);
                %spawnTransform = getWords(%point, 3, 6);
                %spawnPoint = vectorAdd(%spawnPosition, "0 0 10") SPC %spawnTransform;
                %spawnBrick.isTaken = 1;
                return %spawnPoint;
            }
            else
            {
                %client.chatMessage("\c5Sorry, looks like someone didn't leave enough room for you.");
                return Parent::getSpawnPoint(%client);   
            }
        }
        else if(DD_Data.memberCount <= 0)
            announce("\c0WARNING\c3: No derby spawn has been set!");
        return Parent::getSpawnPoint(%client);   
    }


How do I raise the vehicle limit more than 20?
« Last Edit: June 04, 2015, 11:53:18 PM by Advanced Bot »


How do I do that?

Edit: Nevermind, did something like this in the code
Code: server.cs (13 lines)
%quotaObject = getQuotaObjectFromBrickGroup(getBrickGroupFromObject(%spawnBrick));

if(!isObject(%quotaObject))
    error("Error: GameConnection::getSpawnPoint() - new quota object creation failed!");

setCurrentQuotaObject(%quotaObject);
%spawnBrick.setVehicle(nameToID(MonsterJeepVehicle), %client); //Prevent others spawning it into something different
if(!isObject(%spawnBrick.vehicle))
%spawnBrick.respawnVehicle();
else if(isObject(%vehicle = %spawnBrick.spawnBrick))
if(!isObject(%vehicle.getMountedObject(0)))
    %spawnBrick.respawnVehicle();
clearCurrentQuotaObject();


Problem is, it will still not work.

Nevermind again, appearently it says it has "5 physic vehicles" already, I have this fixed in the code, but seems to put it back.

I forgot to change $Server::Quota::Vehicle, which is 5. aaa
« Last Edit: June 04, 2015, 11:02:10 PM by Advanced Bot »

How do I raise the vehicle limit? I've tried $Server::Quota::Vehicle, it works but it doesn't set max more than 20.

Not recommended.
« Last Edit: June 05, 2015, 10:32:39 AM by Greek2me »

Off topic here, but who decided that syntax highlighting was more important than readability in coding help? If you're gonna do that at least pick colors that I can read against a blue background. Or, easier, just use the code tags like we've been doing for years.

« Last Edit: June 05, 2015, 12:19:48 PM by Advanced Bot »

Off topic here, but who decided that syntax highlighting was more important than readability in coding help? If you're gonna do that at least pick colors that I can read against a blue background. Or, easier, just use the code tags like we've been doing for years.
Yeah I forgot to pick the right color scheme

I'm only going to set it to 32 as max. This is a bad idea.
« Last Edit: June 06, 2015, 09:25:12 PM by Advanced Bot »