Jump to content

Recommended Posts

In my Zeus vs Guerilla Zeus game, there are three BLUFOR Curators vs one Independent Curator.

 

The Independent Curator wins when all of the BLUFOR Curators have died. However, the games can last quite a long time, and it can be quite boring for the dead BLUFOR Curators to sit out for the rest of the game. What I have decided is that once a BLUFOR Curator is killed, he respawns and is forced to play just in Curator mode. He is now unable to spawn more units and is only able to command BLUFOR units already on the map or control said units.

 

I have written a short "onPlayerRespawn.sqf" script to do this (however, it is untested because I am currently at work).

Spoiler

if ( side player == west ) then {
    _spawnPos = selectRandom 
    [ 
        [ "Zeus_M_BLUFORSpawn1_1", 340.945 ],
        [ "Zeus_M_BLUFORSpawn1_2", 324.523 ],
        [ "Zeus_M_BLUFORSpawn1_3", 33.747 ],
        [ "Zeus_M_BLUFORSpawn1_4", 230.808 ],
        [ "Zeus_M_BLUFORSpawn1_5", 253.321 ],
        [ "Zeus_M_BLUFORSpawn1_6", 45.909 ],
        [ "Zeus_M_BLUFORSpawn1_7", 177.269 ],
        [ "Zeus_M_BLUFORSpawn1_8", 0 ],
        [ "Zeus_M_BLUFORSpawn1_9", 180 ],
        [ "Zeus_M_BLUFORSpawn2_1", 48.2553 ] 
    ];
    player setPos ( getMarkerPos ( _spawnPos select 0 ) );
    player setDir ( _spawnPos select 1 );

    player enableSimulationGlobal false;
    player hideObjectGlobal true;
    player allowDamage false;
    player enableStamina false;

    [
        ZeusBLUFOR1_1_Curator, 

        [
            "ModuleRemoteControl_F", 0
        ]

    ]    call bis_fnc_curatorObjectRegisteredTable;

    [
        ZeusBLUFOR1_2_Curator, 

        [
            "ModuleRemoteControl_F", 0
        ]

    ]    call bis_fnc_curatorObjectRegisteredTable;

    [
        ZeusBLUFOR1_3_Curator, 

        [
            "ModuleRemoteControl_F", 0
        ]

    ]    call bis_fnc_curatorObjectRegisteredTable;

    [ true, true ] call BIS_fnc_forceCuratorInterface;
    openCuratorInterface;
};

Wondering if anyone has any advice on a better way of doing this! Also, I have a problem now with ending the game due to the BLUFOR Curators respawning. Before, I had it so that the game ended and Independent won when all BLUFOR players were dead, which obviously won't work now!

 

Edit: Ok, so I just got back from work and tested my script. It does work, provided that in my "description.ext" I have specified "respawnOnStart = -1;".
 

What I am wondering is how I would then make Independent win when all BLUFOR Curators have died (now that they can respawn). Before, I had a trigger:

Spoiler


Type: None

Activation: None

Activation Type:

Repeatable: "Uncheck"
Server Only: "Uncheck"

Condition: ( { ( alive _x ) and ( side _x == west ) } count playableUnits ) < 1
On Activation: independent addScoreSide 250; west addScoreSide -( scoreSide west ); "SideScore" call BIS_fnc_endMissionServer;

Obviously, this will no longer work ^^

Edited by rkemsley
Solved

Share this post


Link to post
Share on other sites

So, I had a go at writing a short script to end the game once all BLUFOR Curators have died at least once.

 

The idea is that I create a variable in my "initServer.sqf" that acts as a sort of counter. The game ends when the counter equals the number of BLUFOR playable units on the map.

Spoiler

publicVariable "EndgameBLUFOR";

EndgameBLUFOR = 0;

 

if ( EndgameBLUFOR = ( { ( side _x == west ) } count playableUnits ) ) then {

    independent addScoreSide 250;

    west addScoreSide -( scoreSide west );

    sleep 5;

    "SideScore" call BIS_fnc_endMissionServer;

};

In my "onPlayerKilled.sqf", I have made it so that it adds 1 to the variable every time a BLUFOR Curator dies.

Spoiler

if ( side player == west ) then {

    EndgameBLUFOR = EndgameBLUFOR + 1;

    [ true, true ] call BIS_fnc_forceCuratorInterface;

    openCuratorInterface;

};

Doesn't really work! Wondering if anyone has a better way of doing this.

Share this post


Link to post
Share on other sites

Ok, so I just made it so that when a BLUFOR Curator is killed, his rating is reduced to "-1e6" (basically making him sideEnemy and no longer west).

 

So this is my current "onPlayerRespawn.sqf"

Spoiler

if ( side player == west ) then {
    _spawnPos = selectRandom 
    [ 
        [ "Zeus_M_BLUFORSpawn1_1", 340.945 ],
        [ "Zeus_M_BLUFORSpawn1_2", 324.523 ],
        [ "Zeus_M_BLUFORSpawn1_3", 33.747 ],
        [ "Zeus_M_BLUFORSpawn1_4", 230.808 ],
        [ "Zeus_M_BLUFORSpawn1_5", 253.321 ],
        [ "Zeus_M_BLUFORSpawn1_6", 45.909 ],
        [ "Zeus_M_BLUFORSpawn1_7", 177.269 ],
        [ "Zeus_M_BLUFORSpawn1_8", 0 ],
        [ "Zeus_M_BLUFORSpawn1_9", 180 ],
        [ "Zeus_M_BLUFORSpawn2_1", 48.2553 ] 
    ];
    player setPos ( getMarkerPos ( _spawnPos select 0 ) );
    player setDir ( _spawnPos select 1 );

    player enableSimulationGlobal false;
    [ player, true ] remoteExec [ "hideObjectGlobal", 0, true ];
    player allowDamage false;
    player enableStamina false;

    player addRating -1e6;

    [
        ZeusBLUFOR1_1_Curator, 

        [
            "ModuleRemoteControl_F", 0
        ]

    ]    call bis_fnc_curatorObjectRegisteredTable;

    [
        ZeusBLUFOR1_2_Curator, 

        [
            "ModuleRemoteControl_F", 0
        ]

    ]    call bis_fnc_curatorObjectRegisteredTable;

    [
        ZeusBLUFOR1_3_Curator, 

        [
            "ModuleRemoteControl_F", 0
        ]

    ]    call bis_fnc_curatorObjectRegisteredTable;

    [ true, true ] call BIS_fnc_forceCuratorInterface;
    openCuratorInterface;
};

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×